FAQ Database Discussion Community


How to define point cuts for a sequence of method(s)?

aop,aspectj,spring-aop
For example if I have 3 classes, class A { public void doA() { /* do something */ } } class B { public void doB() { A a = new A(); a.doA(); } } class MyClass { public static void main(String args[]) { B b = new B(); b.doB();...

OData v4.0 via ASP.NET WebAPI - Can Excel consume a service?

asp.net-web-api,odata,wcf-data-services
I have built a few WebAPIs since it was born, including one supporting OData URL filters when that was new. I see now that OData over WebAPI has matured, I see it can serve service metadata. Is it complete enough for Excel or other OData client tooling to plug and...

jQuery on TAB pressure simulate on(mousedown) event

javascript,jquery,dom,keydown
In my webpage i have to trap TAB key pressure and then simulate mousedown event for the object involved. I tried so: $('*').keydown(function(e) { var keyCode = e.keyCode || e.which; if (keyCode == 9) { var elementClicked = e.target.nodeName; elementClicked.mousedown(); } }); but error Uncaught TypeError: undefined is not a...

jQuery - select on change event causes select-box to instantly close again in IE10 and FF

javascript,jquery,html,firefox,internet-explorer-10
i am having a very strange and annoying problem with binding jquery "on change" events to <select> - boxes in IE10 and (various) firefox-version. this problem does not occur in Chrome or IE11. the dropdown-menu which is opening after clicking a select-box is instantly closed again, but only if there...

Insert data in Sql Server datable from Datagridview c#

c#,datagridview,insert
I have a problem in inserting data in datatable from datagridview this is my code: SqlConnection con1 = new SqlConnection(); con1.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\GestStock.mdf;Integrated Security=True;User Instance=True"; con1.Open(); string insertcmd = "INSERT INTO [Article] (CodeArticle,LibelleFr,LibelleAr,IdCategorie,InfomationsDetaille,Quantite,StockActuel,StockMinimum,PrixAchat,DateAchat,NumeroFacture)" + "VALUES(@CodeArticle1,@LibelleFr1,@LibelleAr1,@IdCategorie1...

WCF OData Service stored procedure call generates “Operation could destabilize the runtime” error with $select option

select,entity-framework-5,odata,entity-framework-6,wcf-data-services
I've been trying to call a stored procedure through Entity Framework and WCF Data Services (OData). It returns an entity not a complex type. Following walkthroughs found all over the web (like this one), I came up with this code inside my service: [WebGet] public IQueryable<Entity> GetEntitiesByParameterId(int parameterId) { return...

Binding the title of a LayoutDocument from a collection in AvalonDock 2.0

c#,wpf,mvvm,avalondock
I'm binding an ObservableCollection to AvalonDock 2.0, where every item in the collection is an AvalonDock Document. This is how I do the binding: <ad:DockingManager DocumentsSource="{Binding Path=OpenProjects, Mode=TwoWay}" ActiveContent="{Binding Path=CurrentProject, Mode=TwoWay}" LayoutItemTemplateSelector="{StaticResource ProjectTemplateSelector}"> ... </ad:DockingManager> The problem is I want to show the Name of each item (which is specified...

'Undefined' when returning object from JS module

javascript,jquery,global-variables,revealing-module-pattern
I have defined a global variable and then set it equal to a method made available through one of my modules which renders a chart. The module should return a chart, thus assigning the variable 'alChart' a chart object. It is also worth mentioning that the chart renders perfectly fine...

Laravel / Intervention Image Class - class not found

php,class,laravel,image-resizing
I just installed Intervention Image Class following instructions from here: http://image.intervention.io/getting_started/installation I also added these 2 lines into config/app.php file: 'Intervention\Image\ImageServiceProvider' 'Image' => 'Intervention\Image\Facades\Image' When I open my website, i get this error: Class 'Intervention\Image\ImageServiceProvider' not found Why is that and what should I do now?...

Search files with same part of content in linux

linux,bash,file,grep,comparison
Here is the problem. I have a huge number of files(10000 or more) in one folder. Every file contains it's own ID on position from 26th to 36th symbol. I need to find all files with the same IDs. E.g. there can be files with IDs 1, 1, 2, 3,...

SAML WebSSO profile implementation

single-sign-on,saml
I am going to implement ServiceProvider part using SAML 2.0 WebSSO profile. According to the SAML specification, the two supported flows are SP initiated and IDP initiated. I want to implement only IDP initiated flow because of time constraints. Will it work? or is it required to implement both the...

jQuery toggleSlide: show/hide block

jquery
I have the following code. I want to make my content slide, when I click on a certain button. Everything works perfect. The only problem is that if I have moltiple html contents like this they are all opening at the same time. Trying to do many different method and...

Recursive call and assignment of reference pointers

c++,binary-search-tree,void-pointers
I am feeling confused by the pointers in c++, where I am trying to implement BST. Instead of (method 1)having a type of node, I want to use reference pointer (method 2). How could I rewrite if statement, so it would work in a method where pointers been used? How...

passing javascript parameter to asp.net

javascript,asp.net
I have a Javascript function and i want to pass a parameter from javascript to asp.net. my sample code like below: function ConfirmMessage(message) { var msg = "<%= Efe.UI.WebApplication.AppCode.HelperClass.GetScreenMessage(message); %>" alert.confirm(msg); } But I am getting error at "message" parameter. The error is: The "name" does not exist in the...

Is it necessary to encode spaces in urls in html?

html,url,encoding,uri
According to RFC3986: reserved = gen-delims / sub-delims gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" So no space-encoding required...

File downloading from SQL server using C# [closed]

c#,sql-server,download
I have modified a project of file upload & downlod to & from SQL server using C# as per my requirement by adding three more text boxes. Im able to upload files on SQL sever and can view the files using following page <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>...

How to get error description once error occured during sql statement execution

sql-server,sql-server-2008
I am using SQL Server 2008 and writing a stored procedure which inserts and updates records in a table. This procedure will be scheduled for some time. Whenever there is a error I am logging that error in another table. But I need actual error message but unable to get...

The nature of pandas DataFrame

python,pandas
As a followup to my question on mixed types in a column: Can I think of a DataFrame as a list of columns or is it a list of rows? In the former case, it means that (optimally) each column has to be homogeneous (type-wise) and different columns can be...

Java+Eclipse: Strange output when printing long arrays

java,arrays,eclipse,system.out,blank-space
I'm programming Java using Eclipse and I discovered a weird behavior of System.out.print when printing long arrays. Using the following code prints a long line of blanks before the actual output: double[] values = new double[1000]; for (int i=0; i<1000; i++) values[i] = Math.random(); for (int i=0; i<1000; i++) System.out.print(values[i]...

Dynamic array allocated, but cannot use it

c,arrays,dynamic
I would love to use this code as a dynamic array. Unfortunately, I cannot figure out why the program does not use the allocated memory. Is there something wrong with the parameters of the AddToArray function, maybe? It is possible to copy and paste this code directly into the IDE...

check remote wmi and remote registry

powershell
I am using the below code snippet in my script to check if Remote WMI and Remote Registry is working. Could you please help me if this is the right way to do it and if there is a better way of checking if remote WMI and Remote Registry is...

Jquery Validation validate form-array with index [duplicate]

javascript,jquery,validation
This question already has an answer here: Validating array inputs using jquery validation plugin 4 answers I need to validate the floor fields that mention below. <form id="test_form" > <input name="floor[abc]" type="text" class="input_txt_l " value="" /> <input name="floor[cde]" type="text" class="input_txt_l " value="" /> </form> I tried with jquery validator...

Error while running a .sh script via QProcess

qt,shell,qt4,qprocess
I have written a QT GUI program where pressing a button will execute a .sh script. The contents of the script is- echo -e 'attach database 'testdatabase.db' as 'aj';\n.separator ","\n.import ora_exported.csv qt_ora_exported' | sqlite3 testdatabase.db basically the script will import a .csv to an sqlite database. And when the script...

Grouping the consecutive elements in XSLT

xslt,grouping
I am new to XSLT and XML. I have the following XML. I wanted to group the consecutive child elements. <Root> <Child No="1" Month="0" Date="13/08/2014" Payment="100"> <Totals/> </Child> <Child No="2" Month="1" Date="13/09/2014" Payment="100"> <Totals/> </Child> <Child No="3" Month="2" Date="13/10/2014" Payment="200"> <Totals/> </Child> <Child No="4" Month="3" Date="13/11/2014" Payment="300"> <Totals/> </Child> <Child...

Vanilla js fadeIn animation doesn't work

javascript
I want to animate a fade in effect with vanilla js, but the animated element isn't keeping opacity 1. It shows very short but dissapears right after. var carousel = document.getElementById('myCarousel'); window.onload = function() { carousel.style.opacity = 0; (function fadeIn() { console.log('timer working'); (carousel.style.opacity += .1) > 1 ? carousel.style.opacity...

Parse specific links in html using HTMLParser in python?

python,html,parsing
I am trying to parse a particular set of links from a html file, but since I am using HTMLParser I cannot access information of the html in a Hierarchy Tree and hence I cannot extract the information. My HTML is as follows : <p class="mediatitle"> <a class="bullet medialink" href="link/to/a/file">Some...

Why is my form selection box not toggling items?

javascript,jquery,html
I have a form selection box, the code has worked before but it does not seem to work now, please can someone help me find where the error is Basically I have a form with the #main and a selection box called #chart-type. what I need the #chart-type select box...

How to perform logging with gsutil rsync

google-cloud-storage,gsutil
What's the proper way to log any errors or warnings when performing a quiet rsync? This is what I currently run from my crontab: gsutil -m -q rsync -r -C /mount1/share/folder gs://my-bucket-1/folder/ > /mount2/share/folder/gsutil.log Since the log file is always completely empty and I'm uploading terabytes of data I'm starting...

Twig : Entity was not found

symfony2,twig,sonata-admin
I create a new application with existant datas. I use sonatadminbundle to list a datagrid of objects "Formule" In my object "Formule" i have a relation to object "Contact". In my list in need to display this relation. But i know there is some Contact has deleted in the past....

how to convert amount to text in openerp 7 in Accounting and Finance module?

openerp
cr.execute("""select sum(debit-credit) from account_move_line where id={0}',(account.id)""") amount = cr.fetchall() help me in problem: NameError: global name 'cr' is not defined...

AES Decryption with C#

c#,c++,encryption,aes
I use Crypto++ in C++ to encrypt a string. Now I want to decrypt this ciphertext with C# but it doesn't work. My C++ Code to encrypted the string is as follow: string encrypt(string data) { // Key and IV setup std::string key = "0123456789abcdef"; std::string iv = "aaaaaaaaaaaaaaaa"; std::string...

My cdh5.2 cluster get FileNotFoundException when running hbase MR jobs

java,hadoop,mapreduce,hbase,cloudera-cdh
My cdh5.2 cluster has a problem to run hbase MR jobs. For example, I added the hbase classpath into the hadoop classpath: vi /etc/hadoop/conf/hadoop-env.sh add the line: export HADOOP_CLASSPATH="/usr/lib/hbase/bin/hbase classpath:$HADOOP_CLASSPATH" And when I am running: hadoop jar /usr/lib/hbase/hbase-server-0.98.6-cdh5.2.1.jar rowcounter "mytable" I get the following exception: 14/12/09 03:44:02 WARN security.UserGroupInformation: PriviledgedActionException...

what does it mean “public $helpers = array('Html', 'Form');” in CakePHP [closed]

forms,cakephp
I am new to the subject. I can't realize what does it public $helpers = array('Html','Form'); //var helpers mean. please anyone help me....

Mysql variable not working through php

php,mysql,sql
Here is my query woking absolutely fine when entered directly: SET @new_sno=0; SELECT(@new_sno:[email protected]_sno+1) AS sno_new,Products,Price, case sno WHEN 1 THEN 1 WHEN 2 THEN 2 WHEN 3 THEN 3 WHEN 4 THEN 4 WHEN 12 THEN 5 ELSE 6 END AS orderpriority FROM rates ORDER BY orderpriority,sno; but when I...

What is the best approach to integrate marketo forms with Kentico

kentico,marketo
I'm new to kentico and I'm trying to integrate marketo Forms 2.0 (contact us page) to a kentico page, Was unable to find any integration samples,

Update profile function

laravel,laravel-4
I have a function that check updates the users profile info. Currently, if I put |unique:users in the validator every time I try to update the profile info on the form it will not let me because a user (which is me) has my email. So I figured out the...

image slider in a row of table

jquery,html5,css3
I have multiple images in a row I want to slide these image without button click once page loaded images start sliding in a linear manner. I don't mind using HTML5,css3 or jquery. but I can't find a way to do so. This is my HTML page: <table style="margin-top:90px;"> <tr>...

How to use a variable with type

c#,arrays,predicate
I am quite new to the syntax of c#. I was declaring an array of Process: Process[] myProc, and I am trying to use the Count<> member. I tried to use it like this: if(myProc.Count() > 0) but it doesn't seem to work. What should the correct syntax be? Thanks....

What is the easiest way to print a variadic parameter pack using std::ostream? [duplicate]

c++,templates,c++11,variadic-templates
This question already has an answer here: How to call a function on all variadic template args? 1 answer What is the easiest way to print a parameter pack, separated by commas, using std::ostream? Example: template<typename... Args> void doPrint(std::ostream& out, Args... args){ out << args...; // WRONG! What to...

htaccess - 301 redirect url to another url adding more to domain

regex,apache,.htaccess,mod-rewrite,redirect
I would have an example of what I have done to attempt this already but with all my searching in Google I can't even find an example to start with. I need to 301 redirect the following url from http://www.example.com/words-that-end-with/letter/acy to http://www.example.com/word-lists/words-that-end-with/letter/acy I would some assistance with this...

How is the end of an object denoted in java in memory(or somewhere else)?

java,object,memory,reference
For example, you create two objects Circle circle1 = new Circle(); Circle circle2 = new Circle(); I learned that circle1 (as well as circle2) points to the starting place of the object in memory on the heap. But now the question comes up, how does it know when it ends?...

Select rows with show flag but based on another table

mysql,sql,select,join
Can someone help me about this problem. I have 2 tables: TASKS:(id,once) SAVED_tasks (id, task_id) table where i save tasks.. I need to show all tasks but NOT if the task have value is 1 and if is already inserted in SAVED_tasks table.. EXAMPLE: tasks: id, name, once 1, task1,...

how to disable external button in angular when form is invalid

javascript,angularjs
I have a multiform like this : <form id="signup-form" name="frm" ng-submit="processForm()" novalidate> <!-- our nested state views will be injected here --> <div id="form-views" ui-view></div> </form> <pre> {{ formData }} <input type="button" value="ذخیره" class="btn btn-primary" ng-click="$broadcast('Save')" /> how can i disable and enable button if form is invali or vali...

Return value from jar file created from Matlab

java,matlab,jar,matlab-deployment,matlab-compiler
I have got a Matlab code which at last calculates a vector of indexes. I used library compiler in order to compile matlab code to a java package .jar file. I exported the jar file in order to run it for my main Java project. The name of the package...

How to spliit this string and get the number seperately in ios regular expression

ios,regex,nsstring,nsregularexpression
I have a NSStringlike this "media_w940996738_476.mp3"I want to get this "476" number sepertely. How can I get it from this NSString using a regular expression. Thank you...

Tabular layout tricks

android,android-layout,tablelayout,android-tablelayout
I want to create a layout like this picture: I tried to create something like this: <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:stretchColumns="*" > <TableRow android:id="@+id/sth" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:text="hello" /> <TextView android:text="hello2" />...

Spring Transactional Rollback does not work

java,spring
I have following Thread and transactional method, I have get thrown an exception to test rollback of insertion of DB but notthing is changed. What am I missing? public class CleaningThread extends Thread { public void run() { try { doJob(); } catch (Exception e) { e.printStackTrace(); } } @Transactional(rollbackFor=Exception.class)...

Value will blink only once at the html text box

javascript,html
while loop in javascript function calc(){ var one = document.getElementById("fv").value; var two = document.getElementById("sv").value; var one1 = parseInt(one); var two1 = parseInt(two); var total = 0; if(one1<=two1){ while (one1 <= two1){ total = total+one1; one1++; total=total; } document.getElementById("tv").value = total; }} calc() //call function </script> <form> There are some confusion...

StackPanel not scrolling in Windows Phone 8.1

xaml,microsoft-metro,winrt-xaml,windows-phone-8.1
I am building a Custom Control for Windows Phone 8.1. But the stackpanel is not scrolling down. StackPanel contains one ListView which shouws a TextBlock & another StackPanel which houses a Toggle Button. <StackPanel Orientation="Vertical" > <ListView Grid.Row="0" Background="RoyalBlue"> <ListView.ItemTemplate> <DataTemplate> <Grid> <TextBlock Text="Some Text" Foreground="Black" FontSize="20" TextAlignment="Center" ></TextBlock> </Grid>...

meaning of “memory ordering obeys causality”?

x86,memory-model
I'm very new to multiprocessor programming. In article about x86 memory model. In a multiprocessor system, memory ordering obeys causality (memory ordering respects transitive visibility). Please, help...

Reflecting superclass's value type arguments in Scala, without TypeTag

scala,generics,reflection
In Java, while type arguments are erased in runtime, it is possible to find the actual type arguments passed to a superclass: class Derived extends Base<String> { // ... } ParameterizedType type = (ParameterizedType)Derived.class.getGenericSuperclass(); Type[] args = type.getActualTypeArguments(); // gives {String.class} While I can use the same Java reflection to...

How do I calculate the UILabel height dynamically

ios,objective-c,iphone,ios8,uilabel
I have the following code: label.numberOfLines = 0; // allows label to have as many lines as needed label.text = @"some long text"; [label sizeToFit]; How do I get the height of label in points?...

Counter-intuitive behavior of min_member/2

prolog,order,min,swi-prolog,sicstus-prolog
min_member(-Min, +List) True when Min is the smallest member in the standard order of terms. Fails if List is empty. ?- min_member(3, [1,2,X]). X = 3. The explanation is of course that variables come before all other terms in the standard order of terms, and unification is used. However, the...

FB Graph API likes/user_likes not returning anything

java,facebook,facebook-graph-api
I am trying to read the user's feed and parse it. I am having trouble with trying to see if a user has liked a post or not. In FQL I can do this: SELECT likes FROM stream WHERE post_id = '59685491632_10152603637976633' That works fine, but to my knowledge FQL...

VBox Dragging flickers

java,javafx,draggable,stage,vbox
I create a new Stage in the Code and it's needed, that the Stage is undecorated! In this case the new created Stage loses the Drag-Function. I created the following code, now i can drag the Stage. But the Stage is flickery, so it stays not at one place, it...

Determine if called from with statement

python
I would have a function that can either be called directly or via a with statement, and it should behave differently depending on how it is called, returning a context manager if called via a with statement, otherwise doing what the context manager would do directly. e.g. class Context(object): def...

Inheritance between managed and unmanaged classes

c#,c++,pointers,inheritance,c++-cli
Hello I have a question regarding inheritance in a project mixing C++ and C#. So i have a C++/CLI layer doing the stuff inbetween. In C++ I have 2 structures : public Class A : { public : A(){*a = new int(); *a = 0;} void f1(){*a = 10}; int...

Prime factorization with Actionscript 3

actionscript-3,flash,primes,factorization,factors
I am currently trying to make a program which is able to prime factorize any given number, but I am having some problems. I have already coded a program which generates the first x primes, and I thought I could use this program to solve my former task. The problem...

Kerberos term definitions

windows,security,kerberos
I am new to kerberos. I found some link but still can't understand it terms fully and how it should be. Can anybody please make me understand the following terms? Realm Kdc Principal I want to know how to mention realm name, kdc name should be in krb5.ini? I setup...

Returning Dynamic List or Dictionary in c#

c#
I have a function which can return me multiple key,value objects. I am not sure how to do that. public static List <String> organizationType(User user) { List<String> data = new List<String>(); foreach (UserRoles ur in user.GetUserRoles()) { OrganizationType ot = OrganizationType.Get(ur.organizationTypeId, "1"); data.Add(ot.Name); // I would need a key here...

Uploading Video in php not working

php,mysql,file-upload
I want to upload video in php this is my code <?php if(isset($_POST['submit'])) { $allowedExts = array("jpg", "jpeg", "gif", "png", "mp3", "mp4", "wma"); $extension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); if ((($_FILES["file"]["type"] == "video/mp4") || ($_FILES["file"]["type"] == "audio/mp3") || ($_FILES["file"]["type"] == "audio/wma") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] ==...

Define a Select via a control table, SQL Server 2008

sql,sql-server,tsql
This is a bit of a weird question, but that's what the customer wants :) They want to control what is selected via a control table. Reason for that is, that they don't know how the columns will be called in the end. So when someone wants to run the...

Asp.net UserControl - How to Data-Bind objects from a list?

c#,asp.net,data-binding,user-controls,bindable
I am using asp.net 4.5 c#. I have created a user control with the following member inside: [Bindable(true)] public Product item { get{ return _product; } set { _product = value; } } I then use my control, while DataBinding a "Product" into the member above: <script runat="server"> Product item=new...

Swift - programmatically navigate to another view controller/scene

ios,swift,xcode6
I got an error message during navigating from first view controller to second view controller. My coding is like this one let vc = LoginViewController(nibName: "LoginViewController", bundle: nil) self.navigationController?.pushViewController(vc, animated: true) The problem is I always got this kind of error message 2014-12-09 16:51:08.219 XXXXX[1351:60b] *** Terminating app due to...

How to find a reference key in SQL Server 2012?

sql-server,sql-server-2012,foreign-key-relationship
I am working with SQL Server 2012. I have a table. I am looking for tables which are referring to this table. e.g. TestTable. Now there are two tables: ChildTable1 ChildTable2 How to find that these two tables have relationship with TestTable? Thanks in advance....

How to add a non-Amber library with bower? (for example processing js)

smalltalk,amber-smalltalk
I have started a project with amber init and then bower install processing --save to get processing.js added. I do the initialisation with firstProcessingInstance <return Processing.instances[0]> This method is called by the instance method initializeand it worked a pre-Amber v0.13 version. How do I initialize Processing.js in Amber 0.13 and...

MVC .NET | Check Another Field In The Login Process

asp.net-mvc,asp.net-mvc-5,asp.net-identity,identity
I have a MVC 5 project (.NET) and I added another field to my User object(and also to the DB in 'AspNetUsers' table) in identity (using this article http://www.itorian.com/2013/11/customize-users-profile-in-aspnet.html). The field called "Active" and its purpose is to allow admins to freeze accounts (temporarily). Whats lead me to my question:...

How to align first row of table with a line of text

html,css
I want to align the first row of a table with a line of text. For example, I want to achieve ** some text ** |first row of table      |                        |second row of table|                        ... When I use the <table> element it always puts the table on a new line,...

Does HTML5 has a built-in fixed header table?

html5
Does HTML 5 has a built-in fixed header table (tbody is scrollable, but thead and tfoot are fixed)?

finding number of occurences of any word in Rows

c#,linq
I have retrieved records from database which have a string field "Route".like No1) 2101-5340-5860-4923-3948-3459 No2) 4923-6574-9090-2000-3948-3400 No3) 2101-3400-4567-4444-5434-4923 I want to have this result at last: No_of_iteration -------------------------- 2101 2 5340 1 4923 3 5860 1 ... ... and the rest I was thinking of the solutions. one way is...

What exactly is a cancellation point?

c++,cancellation
I am trying to get my head around what exactly a cancellation point is in c++. I have read: man page and What are pthread cancellation points used for But I am still a little confused on certain points. For example, I am using the file write() function. Apparently this...

Accessing session data in ring middleware

clojure,ring,compojure
I'm trying to access basic session data in a ring middleware to, in my case, copy user data into the request for easier access. (def app (-> (handler/site app-routes) (wrap-user-auth) ; <--- my middleware (session/wrap-session {:store (cookie-store {:key "something super secret"})}))) Middleware: (defn wrap-user-auth [handler] (fn [request] (println request )...

Refreshing canvas in Python3 / tkinter similar to MATLABs “hold on”

python-3.x,matplotlib,tkinter,tkinter-canvas
I'm trying to create a program which plots an arbitrary number of dots on a canvas based on two sliders (a minimum and a maximum value) where the values are read from a list of data. The problem I'm having is in refreshing the canvas with new dots each time...

Closing a pdf file via a batch script (.bat)

windows,batch-file,pdf
I use a windows batch file .bat for running latex command to create a pdf. To open the final pdf file, I wrote pdflatex %2 START "" %2.pdf Where %2 is the filename I passed it as argument. Problem is, whenever, I run the script, I have to manually close...

Missing Automation from namespace 'System.Management'. Missing assembly reference

c#,.net,powershell
System: Windows 7 Professional 64 bit, PowerShell v 2.0, no Visual Studio (can't be installed and others too) Trying to run PowerShell from C#. This is the code snippet: using System; using System.Management.Automation; class Hello { static void Main(string[] args) { PowerShell ps = PowerShell.Create(); ps.AddCommand("Get-Process"); Console.WriteLine("Process Id"); Console.WriteLine("----------------------------"); foreach...

Determine in a VSTO addin if a user is currently “using” Excel 2007

c#,vb.net,excel,vsto
I am currently writing a VSTO addin for Excel 2007 on a Windows 7 machine. I have implemented a Windows.Forms.NativeWindow and Window HotKey in order to know when a user hits a certain key combination. This all works fine, whenever the key combination is pressed it is detected in the...

Convert dd/MM/yyyy hh:mm tt string date to C# date [duplicate]

c#,datetime
This question already has an answer here: Converting a String to DateTime 8 answers I have a string variable that contains the following date time string. It's format is dd/MM/yyyy HH:mm tt string temp = "31/12/2014 12:15 AM"; I want to assign this date time to a C# datetime...

Taking multiple coordinates from a PostgreSQL DB and display a polygon

java,android,sql,postgresql,polygon
I have some trouble understanding ResultSets so I'm asking you. I will be brief in explaining my concern. I have a table that looks like this id(serial) | border(geometry) 1 latlnggeom1 2 latlnggeom2 3 latlnggeom3 And I want to take the coordinates from that table and display them in a...

Format Datetime Object of type Datetime

c#,.net,datetime
I want to convert a DateTime instance (DataTime.Now) in YYYY-MM-DD HH:MM:SS. The output should remain a DateTime, not a string. How to do this?...

How to get Class Instance of class from Type or string form of Class name

c#,.net,generics,type-conversion
C# .net 4.0 I have a function public static void CreateXMLOfCollection(ClassCollection ArraylstObject) { //Convert array list into List<> Then pass it for XML Creation: Type classType = AlstObject[0].GetType(); // here is the problem.. List<classType > lst = ConvertArrayListToList <classType> (AlstObject); } public static List<T> ConvertArrayListToList<T>(BusinessObjectCollection collection) { //Code for conversion.....

Group By Multiple columns and count it

vb.net
I have a list (sourceList), for example: id price1 price2 Data --------------------------------- 12 88 222 1 12 88 222 4 12 66 234 4 I need to group it by all the three columns: id, price1, price2. There is no meaning for the column Data. I need to get this...

Plot two figures on the same figure using subplot [duplicate]

matlab,signal-processing
This question already has an answer here: How does subplot work and what is the difference between subplot(121) and subplot(1,2,1) in MATLAB? 1 answer I am trying to plot the following using subplot how can I do that? Thank you [n,wc]= buttord(Wp,Ws,Rp,Rs); [z,p,k]=butter(n,wc); sos = zp2sos(z,p,k); freqz(sos) ; grpdelay(sos)...

Android Studio 1.0 and error “Library projects cannot set applicationId”

android,android-studio,android-gradle,android-library
After updating Android Studio to 1.0, I see this error: Error: Library projects cannot set applicationId. applicationId is set to 'com.super.app' in default config. I updated the Gradle plugin as suggested but I did not understand how to fix this....

How to show an UIActivityindicator in UICollectionview customcell untill the image downloads at server side?

objective-c,ios7,uiactivityindicatorview
Can Any one help me how to show the activity indicator until the image for UICollection cell downloads at back end. In my code the activity indicator is show only for last cell..Don't know where I m making the mistake Here is my code: - (collectionCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{...

Understanding the attoparsec implementation (part 2)

haskell,attoparsec
I am currently trying to study and understand the source code of the attoparsec library, but there are some details I can't figure out myself. For example, the definition of the Parser type: newtype Parser i a = Parser { runParser :: forall r. State i -> Pos -> More...

How to add buttons along side a grid in TKinter

python,button,python-3.x,tkinter,grid
I am creating a grid for a game in TKinter and I want to have buttons below or along side the grid of blue tiles. I have already tried this: from tkinter import * class BattleScreen(Frame): def __init__(self, root): Frame.__init__(self, root) self.grid() for row in range(20): for col in range(20):...

I get a type '{}' where I should be getting a type number (TypeScript)

typescript
In the following TypeScript code, which is a subset of a more complete class, I have some functions such as map and foldr. When I run code such as: var s = new ArrayList<number>(); s.append(5, 6, 7, 8); var i : number = s.foldr(max, 0); I end up with an...

How do I delegate a call to [0..

arrays,swift,range,sequence
Background For convenience, I used this alias: typealias Deck = [Int] My needs are expanding so I have now converted my code to: class Deck { var deck : [Int] // ... other members } I am able to delegate most of my calls through to self.deck, but after googling...

in vfork child are created repeatedly

c,child-process,vfork
Anyone can explain the following code: #include<stdio.h> #include<stdlib.h> main() { int a=1; int pid; if((pid = vfork()) == 0) { printf("This is child . %d\n", getpid() ); a=2; } else { printf("%d\t%d\n",getpid(),a); sleep(1); } } In the above code, child processes are created repeatedly. Can anyone please help me understand...

How to install zend framework 1.12.9 in xampp?

zend-framework
Hy i am new in zend framework and want to install it please tell me how to install in window 7 with xampp server step by step?

MYSQLi Multiple Records Outputs Duplicates

php,html,mysql,mysqli
Issue: I've continuously looked over my code and cannot find why the array is duplicating the data. A single entry into the database has a correct output, however if there is more than one it will duplicate those before it as well as the next one. My Code: global $connection;...

T-sql script to replace first 2 numbers in a string [closed]

sql,sql-server-2008,tsql
Table contains rows with the string starting with 99 e.g: 99064960 I would like to script a change to replace 99 with 88 on all rows. Expected result: 88064960 Using the following statement the issue was resolved but question was posted to amalgamate these functions into a single statement. UPDATE...

Which is better, autoincrement on database or through code?

database,auto-increment
Which is better, autoincrement on database or through code? My instructor just told me that leaving the database as "stupid" as possible is better, and let the program do all the work. Isn't it the other way around?

How to compare Color object and get closest Color in an Color[]?

c#,windows-runtime,windows-universal
Let's say I have an array with colors (with the whole color spectrum, from red to red.). A shorter version would look like this: public Color[] ColorArray = new Color[360] { Color.FromArgb(255, 245, 244, 242), Color.FromArgb(255, 245, 244, 240), Color.FromArgb(255, 245, 244, 238) } Now if I have a seperate...

jquery change image path on div hover and make its class active?

javascript,jquery,html,css
I have a div structure like this :- <div class="row margin-bottom-20"> <div class="col-md-3 service-box-v1" id="div1"> <div><a href="#"><img src="path" id="img1" /></a></div> <h2>abc</h2> </div> <div class="col-md-3 service-box-v1" id="div2"> <div><a href="#"><img src="path" id="img2" /></a></div> <h2>def</h2> </div> <div class="col-md-3 service-box-v1" id="div3"> <div><a href="#"><img src="path"...

Select the first column name where a value is null by Id

mysql,sql,sql-server-2008,select
I would like to get the first null-valued column name when selecting by Id: I tried: SELECT Snap1,Snap2,Snap3,Snap4 where NULL FROM tbtProgressSnap where Id=3 Id | Snap1 | Snap2 | Snap3 | Snap4| ----------------------------------- 1 | | |/a.png |/b.png| ----------------------------------- 2 | d.png | m.png | | | ----------------------------------- 3...

How to select all non-distinct rows from a DB?

sql,postgresql,select,group-by,having
This will give me all unique entries: select distinct (origin, destination) from mytable but how can I select all routes that are non-unique instead? So I get the rows that are dublicate regarding these 2 fields?...

Catch all exceptions in ASP.NET C# rather than each method in a `try{} catch{}` block

c#,asp.net,windows,try-catch
Is there a better way to catch all exceptions in one place without writing try{} catch{} for each method?

SOAP Server in JAVA <-> SOAP Client in C#

java,c#,.net,soap,wsdl
I have a problem with a SOAP Server written in JAVA, the project is running as a windows service and not as a webserver (e.g. GLASSFISH). So the problem is, everytime I make a request from a C# .NET client, the JAVA SOAP server is not able to parse the...

Create tables with Many-to-One relation in Postgresql

sql,postgresql
I am a newbie with Postgresql and database . I have the following table Shop Create table Shop( id integer , Name varchar(50), Adress varchar(50) ) And I have a second table Product Create table Product( id integer , Name varchar(50), Price float) How to create a relation One-To-One between...