question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,208,224
6,210,437
How can I use .xcconfig files in Xcode 4?
I just switched over to Xcode 4 and I'm having trouble working with.xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't figure out how to edit the columns in this view or where to...
Pick File | New, choose Other and "Configuration Settings File", this gets you a new.xcconfig file. Then click on the project on the upper left in the file browser (the same place where you get to build settings), click on the project again in the second-to-left panel, and click on the Info tab at the top of the inner ...
How can I use .xcconfig files in Xcode 4? I just switched over to Xcode 4 and I'm having trouble working with.xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't figure out how to...
TITLE: How can I use .xcconfig files in Xcode 4? QUESTION: I just switched over to Xcode 4 and I'm having trouble working with.xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't...
[ "xcode", "xcode4", "xcconfig" ]
67
111
36,266
3
0
2011-06-01T21:57:37.227000
2011-06-02T04:38:25.083000
6,208,226
6,208,629
List devices by IPs?
How could I list the devices by IP instead of name? I am aware that I can get the device name and description but since I have many devices installed it would be rather easier if I could get it by IP to select one, but I couldnt find any option related so I am wondering if there is an approach to it? foreach (var dev i...
UPDATE, Found a solution: private void GetDevices() { foreach (SharpPcap.LibPcap.LibPcapLiveDevice dev in SharpPcap.LibPcap.LibPcapLiveDeviceList.Instance) { for (int i = 0; i < dev.Addresses.Count; i++) { var ip = dev.Addresses[i].Addr.ipAddress; if (ip == null) continue; iDeviceDropDown.Items.Add(ip.ToString()); } }...
List devices by IPs? How could I list the devices by IP instead of name? I am aware that I can get the device name and description but since I have many devices installed it would be rather easier if I could get it by IP to select one, but I couldnt find any option related so I am wondering if there is an approach to i...
TITLE: List devices by IPs? QUESTION: How could I list the devices by IP instead of name? I am aware that I can get the device name and description but since I have many devices installed it would be rather easier if I could get it by IP to select one, but I couldnt find any option related so I am wondering if there i...
[ "c#", "sharppcap" ]
0
1
1,144
2
0
2011-06-01T21:57:56.927000
2011-06-01T22:49:03.750000
6,208,232
6,208,410
Python: words replacing in huge text
I have a huge text and a list of words ~10K. What is the fastest way in Python to replace all this words in text with some other word? EDIT: Text size >1Gb, text is human written, and "extremely tokenized" (any runs of alphanumeric characters and any other single symbols was splitted into new tokens) a number of words ...
Input format and search / replace pairings info is going to necessary to refine this answer if it comes close to start with, but this would be my initial stab at it (assuming some form of regularity in the input data, space delimited in my example code below). replacements = { 's1': 'r1', 's2': 'r2'... } with open('in...
Python: words replacing in huge text I have a huge text and a list of words ~10K. What is the fastest way in Python to replace all this words in text with some other word? EDIT: Text size >1Gb, text is human written, and "extremely tokenized" (any runs of alphanumeric characters and any other single symbols was splitte...
TITLE: Python: words replacing in huge text QUESTION: I have a huge text and a list of words ~10K. What is the fastest way in Python to replace all this words in text with some other word? EDIT: Text size >1Gb, text is human written, and "extremely tokenized" (any runs of alphanumeric characters and any other single s...
[ "python", "text", "replace" ]
2
3
2,952
4
0
2011-06-01T21:58:06.277000
2011-06-01T22:17:41.410000
6,208,234
6,216,852
javascript draw image into html from buffer (nodejs/socket.io)
(sorry for my english) Hi, i have an appplication created with nodejs to push image data into a webpage. the data from nodejs server is pushed into webpage using socket.io This data is the complete image, i try to write to disc to see the image and is good. The data is put into a buffer to encode in base64 then send to...
In the C++ side (where i create the images and send them to the nodejs server). I need to encode the data in base64. Then in node i get this data put into a buffer with base64 encoding and send it to the webpage.
javascript draw image into html from buffer (nodejs/socket.io) (sorry for my english) Hi, i have an appplication created with nodejs to push image data into a webpage. the data from nodejs server is pushed into webpage using socket.io This data is the complete image, i try to write to disc to see the image and is good....
TITLE: javascript draw image into html from buffer (nodejs/socket.io) QUESTION: (sorry for my english) Hi, i have an appplication created with nodejs to push image data into a webpage. the data from nodejs server is pushed into webpage using socket.io This data is the complete image, i try to write to disc to see the ...
[ "javascript", "node.js", "socket.io" ]
6
2
13,347
3
0
2011-06-01T21:58:35.343000
2011-06-02T15:43:41.607000
6,208,243
6,210,644
Search when NOT in OU
I want to search in the AD with LDAP, with a condition that people are not in a specific OU (see example) Domain.local - [OU] Location A -- [OU] Users -- [OU] Computers - [OU] Location B -- [OU] Users -- [OU] Computers - [OU] Location C -- [OU] Users -- [OU] Computers In my filter I want all users BUT the users from Lo...
ExtensibleMatch explained here allow to build filters on the DN path, but it's not supported in Active Directory. As far as I know you've got the following solution to do what you want: Multiple search, one for each OU except the one you don't want Two search, one global, one for the OU you don't want objects, and you ...
Search when NOT in OU I want to search in the AD with LDAP, with a condition that people are not in a specific OU (see example) Domain.local - [OU] Location A -- [OU] Users -- [OU] Computers - [OU] Location B -- [OU] Users -- [OU] Computers - [OU] Location C -- [OU] Users -- [OU] Computers In my filter I want all users...
TITLE: Search when NOT in OU QUESTION: I want to search in the AD with LDAP, with a condition that people are not in a specific OU (see example) Domain.local - [OU] Location A -- [OU] Users -- [OU] Computers - [OU] Location B -- [OU] Users -- [OU] Computers - [OU] Location C -- [OU] Users -- [OU] Computers In my filte...
[ "active-directory", "ldap" ]
2
4
1,744
1
0
2011-06-01T21:59:28.833000
2011-06-02T05:06:20.370000
6,208,249
6,208,329
Is there a way to check internal method variables with rspec?
i'm using Rspec for testing. I'm currently creating a combat system and i would need to test it as extensively as needed. Till now, using rspec, i mostly check the outcome of a method on whether it should return a certain value, create certain records and so on. But how can i actually(if possible) check a variable insi...
you can not do that. In your case, I would suggest, you separate the call into multiple methods so you can test their outcome one by one. In general, if you tend to ask yourself what your methods are actually doing, it's a good sign that you should separate the code into multiple methods.
Is there a way to check internal method variables with rspec? i'm using Rspec for testing. I'm currently creating a combat system and i would need to test it as extensively as needed. Till now, using rspec, i mostly check the outcome of a method on whether it should return a certain value, create certain records and so...
TITLE: Is there a way to check internal method variables with rspec? QUESTION: i'm using Rspec for testing. I'm currently creating a combat system and i would need to test it as extensively as needed. Till now, using rspec, i mostly check the outcome of a method on whether it should return a certain value, create cert...
[ "ruby-on-rails", "rspec" ]
3
5
1,903
1
0
2011-06-01T21:59:55.343000
2011-06-01T22:09:05.040000
6,208,254
6,208,275
Filtering QuerySets by OR instead of AND
If I do: People.filter(name = 'Oscar', lastName = 'Mederos) it will be translated to something like: SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos Does Django allow to do the same but using OR instead of AND?
Q objects. People.objects.filter(Q(name='Oscar') | Q(lastName='Mederos'))
Filtering QuerySets by OR instead of AND If I do: People.filter(name = 'Oscar', lastName = 'Mederos) it will be translated to something like: SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos Does Django allow to do the same but using OR instead of AND?
TITLE: Filtering QuerySets by OR instead of AND QUESTION: If I do: People.filter(name = 'Oscar', lastName = 'Mederos) it will be translated to something like: SELECT ______ WHERE Name = 'Oscar' AND LastName = 'Mederos Does Django allow to do the same but using OR instead of AND? ANSWER: Q objects. People.objects.filt...
[ "django", "django-models" ]
0
6
83
1
0
2011-06-01T22:00:15.230000
2011-06-01T22:02:45.963000
6,208,274
6,208,294
Where do scheduled python programs "print"?
If I schedule print "Hello World!"; to run every hour with crontab, where will Hello World! be printed? Is there a log file? If I do it with Java or C instead of Python, will it make any difference? Thanks!
They will be sent to the email address defined at the top of the crontab, or to the crontab's owner by default. See the crontab(5) man page for more details.
Where do scheduled python programs "print"? If I schedule print "Hello World!"; to run every hour with crontab, where will Hello World! be printed? Is there a log file? If I do it with Java or C instead of Python, will it make any difference? Thanks!
TITLE: Where do scheduled python programs "print"? QUESTION: If I schedule print "Hello World!"; to run every hour with crontab, where will Hello World! be printed? Is there a log file? If I do it with Java or C instead of Python, will it make any difference? Thanks! ANSWER: They will be sent to the email address def...
[ "python", "cron" ]
0
2
114
1
0
2011-06-01T22:02:40.533000
2011-06-01T22:04:38.160000
6,208,282
6,208,300
count elements after DOM change
so currently using ajax with JQuery.post to return a form populate with some values. What I am trying to do is basically identify if the content contains checkboxes using: var count = $('#form').find('checkbox').length; alert(count); however even when it does contain checkboxes the output is 0. So do I have the syntax ...
There is no tag checkbox, you will need to use the:checkbox docs selector $('#form').find(':checkbox').length; or the more verbose $('#form').find('input[type="checkbox"]').length;
count elements after DOM change so currently using ajax with JQuery.post to return a form populate with some values. What I am trying to do is basically identify if the content contains checkboxes using: var count = $('#form').find('checkbox').length; alert(count); however even when it does contain checkboxes the outpu...
TITLE: count elements after DOM change QUESTION: so currently using ajax with JQuery.post to return a form populate with some values. What I am trying to do is basically identify if the content contains checkboxes using: var count = $('#form').find('checkbox').length; alert(count); however even when it does contain ch...
[ "php", "jquery", "ajax" ]
1
5
139
1
0
2011-06-01T22:03:13.813000
2011-06-01T22:05:11.657000
6,208,286
6,208,312
Re-use variable outside of function?
How can I use return the $row array in the below example, so that I can re-use the variable outside of this function? I manage to echo the information inside the function using $row['columnName'], but various combinations of global and $GLOBALS, return $xyz and getting variable scope to work for me has me a bit out of ...
Just return it from your function: $results = array(); while ($row = mysql_fetch_assoc($result)) { $results[] = $row; // or do something more with the row } return $results; and call your function like: $query_results = getInfo();
Re-use variable outside of function? How can I use return the $row array in the below example, so that I can re-use the variable outside of this function? I manage to echo the information inside the function using $row['columnName'], but various combinations of global and $GLOBALS, return $xyz and getting variable scop...
TITLE: Re-use variable outside of function? QUESTION: How can I use return the $row array in the below example, so that I can re-use the variable outside of this function? I manage to echo the information inside the function using $row['columnName'], but various combinations of global and $GLOBALS, return $xyz and get...
[ "php", "mysql", "variables", "global-variables", "scope" ]
1
4
1,170
3
0
2011-06-01T22:03:18.630000
2011-06-01T22:07:38.227000
6,208,287
6,216,603
.click event doesn't seem to fire
I've got the following code inside of a
Turned out to be a timing issue. My jQuery code was running before the element was loaded on the page, due to where I placed them in relation to one another - hence the jQuery was trying to bind to an ID that didn't yet exist.
.click event doesn't seem to fire I've got the following code inside of a
TITLE: .click event doesn't seem to fire QUESTION: I've got the following code inside of a ANSWER: Turned out to be a timing issue. My jQuery code was running before the element was loaded on the page, due to where I placed them in relation to one another - hence the jQuery was trying to bind to an ID that didn't yet...
[ "jquery", "jquery-click-event" ]
0
0
587
4
0
2011-06-01T22:03:47.287000
2011-06-02T15:22:41.343000
6,208,301
6,208,387
simplest way to do a recurring text file upload to sql server
i have a TAB DELIMITTED log file where new data in this log file needs to be dumped into a sql server 2008 database. i am wondering what is the best way to automate this? is there a service i can use inside the management studio that will help me?
If you have SQL Server Integration Services (SSIS) installed, you could use that to load the Tab delimited file into SQL Server table. In this link (SQL Integration Services to load tab delimited file), I have explained it step-by-step on how to load a tab delimited file into SQL Server table using SSIS. If you would a...
simplest way to do a recurring text file upload to sql server i have a TAB DELIMITTED log file where new data in this log file needs to be dumped into a sql server 2008 database. i am wondering what is the best way to automate this? is there a service i can use inside the management studio that will help me?
TITLE: simplest way to do a recurring text file upload to sql server QUESTION: i have a TAB DELIMITTED log file where new data in this log file needs to be dumped into a sql server 2008 database. i am wondering what is the best way to automate this? is there a service i can use inside the management studio that will h...
[ "sql", "sql-server", "sql-server-2008" ]
1
2
6,762
3
0
2011-06-01T22:05:13.933000
2011-06-01T22:15:08.307000
6,208,307
6,208,923
Process.Start(url) in a loop not launching every instance
I have a need to launch multiple browser instances / tabs in succession but using Process.Start(url) I am finding that not every URL is launched. for (int i = 0; i < n; i++) { var p = Process.Start("http://localhost/#" + i.ToString()); } For any value n > 1 I find that only the last URL is opened in the browser (I'm te...
Ended up with the following, still not ideal (launches multiple browser windows), incorporating the command-line arg parsing solution Split string containing command-line parameters into string[] in C# const int n = 3; static void Main(string[] args) { for (int i = 0; i < n; i++) { var start = GetDefaultBrowserStartInf...
Process.Start(url) in a loop not launching every instance I have a need to launch multiple browser instances / tabs in succession but using Process.Start(url) I am finding that not every URL is launched. for (int i = 0; i < n; i++) { var p = Process.Start("http://localhost/#" + i.ToString()); } For any value n > 1 I fi...
TITLE: Process.Start(url) in a loop not launching every instance QUESTION: I have a need to launch multiple browser instances / tabs in succession but using Process.Start(url) I am finding that not every URL is launched. for (int i = 0; i < n; i++) { var p = Process.Start("http://localhost/#" + i.ToString()); } For an...
[ "c#" ]
2
0
2,460
4
0
2011-06-01T22:06:39.573000
2011-06-01T23:34:33.400000
6,208,308
6,208,441
UML help C# Design Principles
I have a problem understanding an UML below: Specifically, what is the relationship between PersistentSet and ThirdPartyPersistentSet? What is the relationship between PersistentObject and ThirdPartyPersistentSet? Please note that the UML is from Agile Principles, Patterns, and Practices in C# By Martin C. Robert, Mart...
The relationship between PersistentSet and ThirdPartyPersistentSet is an Aggregation, which means the PersistentSet contains one or more ThridPartyPersistenSet instances. This is a "weak" relationship, meaning the instances of ThirdPartyPersistentSet can exist outside of the PersistentSet. The relationship between Pers...
UML help C# Design Principles I have a problem understanding an UML below: Specifically, what is the relationship between PersistentSet and ThirdPartyPersistentSet? What is the relationship between PersistentObject and ThirdPartyPersistentSet? Please note that the UML is from Agile Principles, Patterns, and Practices i...
TITLE: UML help C# Design Principles QUESTION: I have a problem understanding an UML below: Specifically, what is the relationship between PersistentSet and ThirdPartyPersistentSet? What is the relationship between PersistentObject and ThirdPartyPersistentSet? Please note that the UML is from Agile Principles, Pattern...
[ "c#", "oop", "uml", "design-principles" ]
2
1
1,212
5
0
2011-06-01T22:06:46.743000
2011-06-01T22:22:02.827000
6,208,317
6,209,271
Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft
Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft. Greetings I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do an fft of a signal, but when I try and combine the fft data (frequency, amplitude, and phase) back to see if I get a simila...
The IFFT is an efficient implementation of the following transformation: N-1 x[n] = SUM X[k] exp(j*2*pi*n*k/N) k=0 where X[k] are your FFT results ( complex amplitudes), and x[n] are your time-domain samples. For real-only inputs, this can be rewritten in terms of cos and sin (or in terms of cos with a phase term), but...
Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft. Greetings I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do an fft of a signal, but when ...
TITLE: Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft QUESTION: Rebuilding original signal from frequencies, amplitude, and phase obtained after doing an fft. Greetings I'm trying to rebuild a signal from the frequency, amplitude, and phase obtained after I do an fft of a...
[ "matlab", "fft", "equation-solving" ]
1
3
3,536
2
0
2011-06-01T22:08:15.603000
2011-06-02T00:38:40.190000
6,208,335
6,208,757
Is there an example XML document that uses every feature of XML for testing?
Does anyone know where I can get a canonical XML document that uses every feature of the XML 1.0 specification that aren't mutually exclusive? Not including various encoding flavors. If I can get a single document encoded in UTF-8 that would be fine.
It is not possible for one single document to use every feature: for example if a document uses UTF-16 encoding then it cannot also use UTF-8 encoding. The W3C XML 1.0 Conformance Test Suite can be downloaded from http://www.w3.org/XML/Test/
Is there an example XML document that uses every feature of XML for testing? Does anyone know where I can get a canonical XML document that uses every feature of the XML 1.0 specification that aren't mutually exclusive? Not including various encoding flavors. If I can get a single document encoded in UTF-8 that would b...
TITLE: Is there an example XML document that uses every feature of XML for testing? QUESTION: Does anyone know where I can get a canonical XML document that uses every feature of the XML 1.0 specification that aren't mutually exclusive? Not including various encoding flavors. If I can get a single document encoded in ...
[ "xml" ]
3
4
235
1
0
2011-06-01T22:09:17.660000
2011-06-01T23:07:23.023000
6,208,339
6,208,641
Qt: Correct way to post events to a QThread?
In my Qt application, I have a main thread and a worker thread. The worker thread subclasses QThread and processes events via customEvent. Is this the correct way for the main thread to send events to be processed by the worker thread? QThread* myWorkerThread = //... QApplication::instance()->postEvent (myWorkerThread...
Your understanding is correct and is indeed very unintuitive:) A lot of the trouble comes from the documentation for QThread that suggests subclassing QThread. Although Qthread has its own event loop, only events and signals for QObjects created in the run() method (created in that thread) will be processed in the QThr...
Qt: Correct way to post events to a QThread? In my Qt application, I have a main thread and a worker thread. The worker thread subclasses QThread and processes events via customEvent. Is this the correct way for the main thread to send events to be processed by the worker thread? QThread* myWorkerThread = //... QAppli...
TITLE: Qt: Correct way to post events to a QThread? QUESTION: In my Qt application, I have a main thread and a worker thread. The worker thread subclasses QThread and processes events via customEvent. Is this the correct way for the main thread to send events to be processed by the worker thread? QThread* myWorkerThre...
[ "c++", "multithreading", "qt", "events", "qthread" ]
15
16
12,231
2
0
2011-06-01T22:09:51.600000
2011-06-01T22:51:04.310000
6,208,342
6,208,795
Using server side html+js in phonegap (multiplatform mobile dev)
Phonegap uses html source located in www folder. I was testing what happens if index.html is still in www, but it links to other html that are located in at the server side. It will open the server side html in the web browser instead of handle it as part of the app. Is there any way to make phonegap work with server s...
Phonegap is designed to deploy a client, a web app inside a native web view. You can write a server side API for returning any information your app may need and you can modify the DOM using JS. There are great templating solutions out there such as mustache.js. The idea is to write the app fully in JS and retrieve info...
Using server side html+js in phonegap (multiplatform mobile dev) Phonegap uses html source located in www folder. I was testing what happens if index.html is still in www, but it links to other html that are located in at the server side. It will open the server side html in the web browser instead of handle it as part...
TITLE: Using server side html+js in phonegap (multiplatform mobile dev) QUESTION: Phonegap uses html source located in www folder. I was testing what happens if index.html is still in www, but it links to other html that are located in at the server side. It will open the server side html in the web browser instead of...
[ "javascript", "html", "cordova", "server-side" ]
5
3
3,678
2
0
2011-06-01T22:10:06.560000
2011-06-01T23:13:16.163000
6,208,348
6,208,357
How do I compare values of BigInteger to be used as a condition in a loop?
I am trying to compare if the value of one BigInteger(base) is > (greater than) the value of another BigInteger(prime) and if the value of 'a' is not equal to one. If value of a is not 1, it should break out of the loop. How should I compare them? Random ran = new Random(); BigInteger prime = new BigInteger(16,ran); Bi...
You can compare them using BigInteger.compareTo(BigInteger). In your case, this would be while (base.compareTo(prime) > 0) {...}. Also, your termination condition should be changed from if (a!= one) to if (!a.equals(one)) since two BigInteger variables with the same integer value are not necessarily referencing the sam...
How do I compare values of BigInteger to be used as a condition in a loop? I am trying to compare if the value of one BigInteger(base) is > (greater than) the value of another BigInteger(prime) and if the value of 'a' is not equal to one. If value of a is not 1, it should break out of the loop. How should I compare the...
TITLE: How do I compare values of BigInteger to be used as a condition in a loop? QUESTION: I am trying to compare if the value of one BigInteger(base) is > (greater than) the value of another BigInteger(prime) and if the value of 'a' is not equal to one. If value of a is not 1, it should break out of the loop. How sh...
[ "java", "biginteger" ]
23
37
68,211
3
0
2011-06-01T22:10:48.410000
2011-06-01T22:12:30.223000
6,208,361
6,208,399
UIView needs to push a UIViewController (delegation)
I'm having a hard time getting my head around custom delegation - I would be most grateful if someone could help me: I have a UIViewController with a tab bar controller, and each of these contains a subclassed UIView. In one of the views, I have a UIButton in which I want to load a UIDocumentInteractionController. I al...
I recently posted a detailed answer on how to use custom delegation. You can check it out here: dismissModalViewController AND pass data back What you want to do here is implement the protocol in your UIView and set the UIViewController to be it's delegate. To help you understand the linked answer better, in the answer...
UIView needs to push a UIViewController (delegation) I'm having a hard time getting my head around custom delegation - I would be most grateful if someone could help me: I have a UIViewController with a tab bar controller, and each of these contains a subclassed UIView. In one of the views, I have a UIButton in which I...
TITLE: UIView needs to push a UIViewController (delegation) QUESTION: I'm having a hard time getting my head around custom delegation - I would be most grateful if someone could help me: I have a UIViewController with a tab bar controller, and each of these contains a subclassed UIView. In one of the views, I have a U...
[ "iphone", "objective-c", "uiview", "delegates", "uiviewcontroller" ]
1
2
1,741
1
0
2011-06-01T22:12:43.903000
2011-06-01T22:15:55.697000
6,208,363
6,208,612
Sharing a URL with a query string on Twitter
I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button. For example, sharing a link to Google: Tweet URLs with query strings confuse Twitter's URL shortening service, t.co. I've tried URL encoding this in various ways...
This can be solved by using https://twitter.com/intent/tweet instead of http://www.twitter.com/share. Using the intent/tweet function, you simply URL encode your entire URL and it works like a charm. https://dev.twitter.com/web/intents
Sharing a URL with a query string on Twitter I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button. For example, sharing a link to Google: Tweet URLs with query strings confuse Twitter's URL shortening service, t.co....
TITLE: Sharing a URL with a query string on Twitter QUESTION: I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button. For example, sharing a link to Google: Tweet URLs with query strings confuse Twitter's URL shorten...
[ "twitter", "query-string", "share", "url-encoding" ]
167
137
336,886
13
0
2011-06-01T22:13:13.810000
2011-06-01T22:46:49.623000
6,208,367
6,208,415
RegEx to match stuff between parentheses
I'm having a tough time getting this to work. I have a string like: something/([0-9])/([a-z]) And I need regex or a method of getting each match between the parentheses and return an array of matches like: [ [0-9], [a-z] ] The regex I'm using is /\((.+)\)/ which does seem to match the right thing if there is only one s...
You need to make your regex pattern 'non-greedy' by adding a? after the.+ By default, * and + are greedy in that they will match as long a string of chars as possible, ignoring any matches that might occur within the string. Non-greedy makes the pattern only match the shortest possible match. See Watch Out for The Gree...
RegEx to match stuff between parentheses I'm having a tough time getting this to work. I have a string like: something/([0-9])/([a-z]) And I need regex or a method of getting each match between the parentheses and return an array of matches like: [ [0-9], [a-z] ] The regex I'm using is /\((.+)\)/ which does seem to mat...
TITLE: RegEx to match stuff between parentheses QUESTION: I'm having a tough time getting this to work. I have a string like: something/([0-9])/([a-z]) And I need regex or a method of getting each match between the parentheses and return an array of matches like: [ [0-9], [a-z] ] The regex I'm using is /\((.+)\)/ whic...
[ "javascript", "regex", "arrays", "url", "url-routing" ]
73
157
202,328
4
0
2011-06-01T22:13:41.360000
2011-06-01T22:18:35.087000
6,208,369
6,208,405
Import Python module with PyImport_ImportModuleEx for a gedit plugin
I'm learning Python and I try to use Python Markdown in a gedit plugin. Here's how my files are organized: ~/.gnome2/gedit/plugins/mytest.gedit-plugin ~/.gnome2/gedit/plugins/mytest/ ~/.gnome2/gedit/plugins/mytest/__init__.py ~/.gnome2/gedit/plugins/mytest/markdown/ ~/.gnome2/gedit/plugins/mytest/markdown/__init__.py ~...
If you want to use markdown without modifying it then you're going to have to put it somewhere where the Python library expects it, such as in site-packages/. Otherwise, you will have to modify it to use relative imports instead of absolute imports.
Import Python module with PyImport_ImportModuleEx for a gedit plugin I'm learning Python and I try to use Python Markdown in a gedit plugin. Here's how my files are organized: ~/.gnome2/gedit/plugins/mytest.gedit-plugin ~/.gnome2/gedit/plugins/mytest/ ~/.gnome2/gedit/plugins/mytest/__init__.py ~/.gnome2/gedit/plugins/m...
TITLE: Import Python module with PyImport_ImportModuleEx for a gedit plugin QUESTION: I'm learning Python and I try to use Python Markdown in a gedit plugin. Here's how my files are organized: ~/.gnome2/gedit/plugins/mytest.gedit-plugin ~/.gnome2/gedit/plugins/mytest/ ~/.gnome2/gedit/plugins/mytest/__init__.py ~/.gnom...
[ "python", "import", "gedit" ]
2
2
1,522
1
0
2011-06-01T22:13:43.513000
2011-06-01T22:16:51.667000
6,208,372
6,208,421
NSNumber Formatting (Round to 1000's place)
I currently have a series of NSNumber objects with values between 0 and 500,000. They are randomly generated values with many decimal places. How can I print these values, but round them to the nearest 1000? For example 32143.8472 would round to 32000. For simplicity, lets assume I want them in a NSLog... eg. NSLog(@"T...
NSNumber objects are suitable for storing values, for numeric operations you should use plain numeric types (e.g. int) Try the following code: int rounded = 1000*(([number intValue]+500)/1000); What happens there: [number intValue] That gets integer part of our number add 500 and divide by 1000 - get the nearest number...
NSNumber Formatting (Round to 1000's place) I currently have a series of NSNumber objects with values between 0 and 500,000. They are randomly generated values with many decimal places. How can I print these values, but round them to the nearest 1000? For example 32143.8472 would round to 32000. For simplicity, lets as...
TITLE: NSNumber Formatting (Round to 1000's place) QUESTION: I currently have a series of NSNumber objects with values between 0 and 500,000. They are randomly generated values with many decimal places. How can I print these values, but round them to the nearest 1000? For example 32143.8472 would round to 32000. For s...
[ "objective-c" ]
2
11
1,972
1
0
2011-06-01T22:13:56.150000
2011-06-01T22:19:27.803000
6,208,385
6,208,551
How can I automate antivirus/WSUS patch testing of my Windows driver and binary?
My (rather small) company develops a popular Windows application, but one thing we've always struggled with is testing - it frequently is only tested by the developers on a system similar to the one they developed it on, and when an update is pushed out to customers, there is a segment of our base that experiences issu...
Interesting problem. One thing to avoid is using the antivirus APIs to check to see if your application triggers them. You want a real live deployment of your application, on the expected operating system, with a real live AV install monitoring it. That way you'll trigger the heuristics monitoring as well as the simple...
How can I automate antivirus/WSUS patch testing of my Windows driver and binary? My (rather small) company develops a popular Windows application, but one thing we've always struggled with is testing - it frequently is only tested by the developers on a system similar to the one they developed it on, and when an update...
TITLE: How can I automate antivirus/WSUS patch testing of my Windows driver and binary? QUESTION: My (rather small) company develops a popular Windows application, but one thing we've always struggled with is testing - it frequently is only tested by the developers on a system similar to the one they developed it on, ...
[ "python", "testing", "automation", "functional-testing", "cots" ]
5
1
1,445
1
0
2011-06-01T22:14:58.253000
2011-06-01T22:37:48.443000
6,208,394
6,282,792
WrkTaskIP.aspx Task Page Change Redirect URL
I have a workflow with customised task forms so clicking on a workflow task opens up the task page WrkTaskIP.aspx with an InfoPath form hosted within it. The task form has a submit button which submits to the hosting environment to complete the task and the page by default will then redirect to the WrkStat.aspx page to...
I got around this problem by having a task form change view to a "Task Completed" screen on submit which then includes a link to the place they should be redirected to. Since I already have found a way to get hyperlinks to open in the same window, it nearly has the same effect as what I was originally after. The custom...
WrkTaskIP.aspx Task Page Change Redirect URL I have a workflow with customised task forms so clicking on a workflow task opens up the task page WrkTaskIP.aspx with an InfoPath form hosted within it. The task form has a submit button which submits to the hosting environment to complete the task and the page by default w...
TITLE: WrkTaskIP.aspx Task Page Change Redirect URL QUESTION: I have a workflow with customised task forms so clicking on a workflow task opens up the task page WrkTaskIP.aspx with an InfoPath form hosted within it. The task form has a submit button which submits to the hosting environment to complete the task and the...
[ "sharepoint", "sharepoint-2007" ]
0
0
1,965
1
0
2011-06-01T22:15:24.213000
2011-06-08T17:29:03.350000
6,208,400
6,208,620
Modal Popup Extender animation in ASP.net
I am currently developing an ASP.net c# application. I have a grid view which has bound link buttons inside. When the link button is pressed I want to display the modal popup using a fade in animation and a fade out animation when a button inside the modal popup is clicked. I have added the animation extender into the ...
The TargetControlID (as far as I am aware) should be a control in the popup panel itself, not in the grid control. When I use the ModalPopupExtender I usually use an asp:Button with 'display:none' as the TargetControlID. Eg, In the code-behind you have to control the showing and hiding of the control base on an event, ...
Modal Popup Extender animation in ASP.net I am currently developing an ASP.net c# application. I have a grid view which has bound link buttons inside. When the link button is pressed I want to display the modal popup using a fade in animation and a fade out animation when a button inside the modal popup is clicked. I h...
TITLE: Modal Popup Extender animation in ASP.net QUESTION: I am currently developing an ASP.net c# application. I have a grid view which has bound link buttons inside. When the link button is pressed I want to display the modal popup using a fade in animation and a fade out animation when a button inside the modal pop...
[ "c#", "asp.net", "modalpopupextender", "animationextender" ]
1
1
10,767
3
0
2011-06-01T22:16:10.317000
2011-06-01T22:47:26.287000
6,208,401
6,208,428
ListView disable Insert and Edit buttons based on role
I've a requirement to disable edit/create buttons in ListView.Could anyone please show me how to enable or disable Edit/Create buttons in ListView from code behind, please. Not sure if this is possible.
Use RolePrincipal.IsInRole. The code should be similiar to the following: void listView_ItemDataBound(...) { Button targetButton = (Button) e.Item.FindControl("TargetButtonName"); targetButton.Enabled = User.IsInRole("Administrators"); } Refer to how to enable and disable button based on user role?
ListView disable Insert and Edit buttons based on role I've a requirement to disable edit/create buttons in ListView.Could anyone please show me how to enable or disable Edit/Create buttons in ListView from code behind, please. Not sure if this is possible.
TITLE: ListView disable Insert and Edit buttons based on role QUESTION: I've a requirement to disable edit/create buttons in ListView.Could anyone please show me how to enable or disable Edit/Create buttons in ListView from code behind, please. Not sure if this is possible. ANSWER: Use RolePrincipal.IsInRole. The cod...
[ "asp.net" ]
4
4
4,284
1
0
2011-06-01T22:16:21.550000
2011-06-01T22:20:37.900000
6,208,412
6,208,447
Getting others to use my apps with Visual C++
I am learning how to build games in Visual C++ and when I upload them so friends can check them out, they all end up with messages saying it can not run. I did some research and found that it is because I am compiling against a Dynamic library instead of a static library. Correct me if I am wrong anywhere please. Upon ...
If you link to any DLLs, you also need to ship those along. If you produce a single.exe in your output, you probably need your friends to install the MS Visual Studio redistributable package for your version of visual studio. This is an example link for the VS 2010 one, but the one you give your friends should match yo...
Getting others to use my apps with Visual C++ I am learning how to build games in Visual C++ and when I upload them so friends can check them out, they all end up with messages saying it can not run. I did some research and found that it is because I am compiling against a Dynamic library instead of a static library. C...
TITLE: Getting others to use my apps with Visual C++ QUESTION: I am learning how to build games in Visual C++ and when I upload them so friends can check them out, they all end up with messages saying it can not run. I did some research and found that it is because I am compiling against a Dynamic library instead of a...
[ "visual-c++" ]
1
3
50
2
0
2011-06-01T22:17:49.583000
2011-06-01T22:22:30.300000
6,208,414
6,208,432
Can I append a img to a img
So I tried out if I can append using jquery a image to an image and it works, but the image seems to be gone or visibility is hidden and display none or so it seems. So my question is can this be done and can I use this image. Its for a project I am working on. thats what my code looks like after I use the append. and ...
According to the specification the element cannot have content: The IMG element has no content; it is usually replaced inline by the image designated by the src attribute, the exception being for left or right-aligned images that are "floated" out of line. So trying to nest tags would result into undefined behavior.
Can I append a img to a img So I tried out if I can append using jquery a image to an image and it works, but the image seems to be gone or visibility is hidden and display none or so it seems. So my question is can this be done and can I use this image. Its for a project I am working on. thats what my code looks like ...
TITLE: Can I append a img to a img QUESTION: So I tried out if I can append using jquery a image to an image and it works, but the image seems to be gone or visibility is hidden and display none or so it seems. So my question is can this be done and can I use this image. Its for a project I am working on. thats what m...
[ "jquery", "tags", "append", "image" ]
1
2
251
4
0
2011-06-01T22:18:29.377000
2011-06-01T22:21:00.453000
6,208,418
6,208,506
Python requiring an attribute be converted to a string
from sys import exit from random import randint class Map(object): def death(): print quips[randint (0, len(quips)-1)] exit(1) def princess_lives_here(): print "You see a beautiful Princess with a shiny crown." print "She offers you some cake." eat_it = raw_input(">") if eat_it == "eat it": print "You explode like...
Maybe you want something like this? class Map(object): def __init__(self): self.quips = [ "You died. You suck at this.", "Your mom would be proud, if she were smarter", "Such a luser.", "I have a small puppy that's better at this." ] def death(self): print self.quips[randint (0, len(self.quips)-1)] exit(1) def prin...
Python requiring an attribute be converted to a string from sys import exit from random import randint class Map(object): def death(): print quips[randint (0, len(quips)-1)] exit(1) def princess_lives_here(): print "You see a beautiful Princess with a shiny crown." print "She offers you some cake." eat_it = raw_inp...
TITLE: Python requiring an attribute be converted to a string QUESTION: from sys import exit from random import randint class Map(object): def death(): print quips[randint (0, len(quips)-1)] exit(1) def princess_lives_here(): print "You see a beautiful Princess with a shiny crown." print "She offers you some cake."...
[ "python", "string", "class", "attributes" ]
1
1
2,326
5
0
2011-06-01T22:18:44.400000
2011-06-01T22:32:04.027000
6,208,443
6,208,971
What happens to an Android thread after the Activity that created it is destroyed?
In my Android app, the main Activity will sometimes start a Thread to load data from a server. This thread modifies the app's database and edits some important files. AFAIK, it would appear that this thread continues to execute. What will happen to this thread if the Android gets into a low memory situation and decides...
AFAIK, it would appear that this thread continues to execute. This is true but you have no guarantee of how long the thread will stay alive. What will happen to this thread if the Android gets into a low memory situation and decides to kill the entire Application? This is actually a fairly rare case in my experience bu...
What happens to an Android thread after the Activity that created it is destroyed? In my Android app, the main Activity will sometimes start a Thread to load data from a server. This thread modifies the app's database and edits some important files. AFAIK, it would appear that this thread continues to execute. What wil...
TITLE: What happens to an Android thread after the Activity that created it is destroyed? QUESTION: In my Android app, the main Activity will sometimes start a Thread to load data from a server. This thread modifies the app's database and edits some important files. AFAIK, it would appear that this thread continues to...
[ "java", "android", "multithreading", "android-activity" ]
20
18
7,345
4
0
2011-06-01T22:22:10.100000
2011-06-01T23:41:49.890000
6,208,462
6,208,483
read with SAxParser
hi everyone I try to read the information of this direction http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr SAXParserFactory factory= SAXParserFactory.newInstance(); try { SAXParser parser= factory.newSAXParser(); RssHandler handler= new RssHandler(); parser.parse(this.getInputStream(), handler)...
The first URL contains something like this: "XOM","Exxon Mobil Corpo","6/1/2011",82.03,2.14,11.89 "BBD-B.TO","BOMBARDIER INC., ","6/1/2011",6.95,1.11,16.07 "JNJ","Johnson & Johnson","6/1/2011",66.48,3.25,15.26 "MSFT","Microsoft Corpora","6/1/2011",24.43,2.44,9.94 which is CSV (comma-separated values) formatted data. CS...
read with SAxParser hi everyone I try to read the information of this direction http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr SAXParserFactory factory= SAXParserFactory.newInstance(); try { SAXParser parser= factory.newSAXParser(); RssHandler handler= new RssHandler(); parser.parse(this.getInp...
TITLE: read with SAxParser QUESTION: hi everyone I try to read the information of this direction http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr SAXParserFactory factory= SAXParserFactory.newInstance(); try { SAXParser parser= factory.newSAXParser(); RssHandler handler= new RssHandler(); parser...
[ "android" ]
0
1
188
1
0
2011-06-01T22:24:46.760000
2011-06-01T22:28:17.970000
6,208,474
6,218,124
Symfony2 custom validator
i am trying to build an custom validator with symfony2 but something strange happens: i have created both Password and PasswordValidate by following the steps in symfony2 cookbook but first time when i load the page i get this error: AnnotationException: [Semantical Error] The annotation "@Symfony\Component\Validator\C...
Assuming your custom validator constraint is not in the Symfony\Component\Validator\Constraints namespace, but your own namespace: NMSP\MyBundle\Validator. You should add the following use statement: use NMSP\MyBundle\Validator as NMSPAssert; Then use the following annotation on the $username property: @NMSPAssert\Pass...
Symfony2 custom validator i am trying to build an custom validator with symfony2 but something strange happens: i have created both Password and PasswordValidate by following the steps in symfony2 cookbook but first time when i load the page i get this error: AnnotationException: [Semantical Error] The annotation "@Sym...
TITLE: Symfony2 custom validator QUESTION: i am trying to build an custom validator with symfony2 but something strange happens: i have created both Password and PasswordValidate by following the steps in symfony2 cookbook but first time when i load the page i get this error: AnnotationException: [Semantical Error] Th...
[ "validation", "symfony" ]
0
6
3,130
1
0
2011-06-01T22:27:15.027000
2011-06-02T17:40:33.560000
6,208,484
6,208,542
Converting separate month, day and year values into a timestamp
I have a month value (1-12), day value (1-31), and a year value (2010,2011,2012). I also have a hour value and a minute value. How can I give this to strtotime() in a way it can convert it to a timestamp?
Given the variables $year $month $day $hour $minute you can do: strtotime("$year-$month-$day $hour:$minute"); Be careful to enclose the variables with ", never in this case with '. UPDATE (thanks to comments of @Clockwork and @Tadeck): In case there is a variable $timeofday that represents the time of day (i.e. AM or P...
Converting separate month, day and year values into a timestamp I have a month value (1-12), day value (1-31), and a year value (2010,2011,2012). I also have a hour value and a minute value. How can I give this to strtotime() in a way it can convert it to a timestamp?
TITLE: Converting separate month, day and year values into a timestamp QUESTION: I have a month value (1-12), day value (1-31), and a year value (2010,2011,2012). I also have a hour value and a minute value. How can I give this to strtotime() in a way it can convert it to a timestamp? ANSWER: Given the variables $yea...
[ "php", "date", "time", "timestamp" ]
25
21
35,115
7
0
2011-06-01T22:28:44.077000
2011-06-01T22:36:20.580000
6,208,488
6,209,040
Implementation of ceil() and floor()
Just curious how are these implemented. I can't see where I would start. Do they work directly on the float 's/ double 's bits? Also where can I find the source code of functions from math.h? All I find are either headers with prototypes or files with functions that call other functions from somewhere else. EDIT: Part ...
If you're interested in seeing source code for algorithms for this kind of thing, then fdlibm - the "Freely Distributable libm ", originally from Sun, and the reference implementation for Java's math libraries - might be a good place to start. (For casual browsing, it's certainly a better place to start than GNU libc, ...
Implementation of ceil() and floor() Just curious how are these implemented. I can't see where I would start. Do they work directly on the float 's/ double 's bits? Also where can I find the source code of functions from math.h? All I find are either headers with prototypes or files with functions that call other funct...
TITLE: Implementation of ceil() and floor() QUESTION: Just curious how are these implemented. I can't see where I would start. Do they work directly on the float 's/ double 's bits? Also where can I find the source code of functions from math.h? All I find are either headers with prototypes or files with functions tha...
[ "c", "math" ]
18
21
18,821
6
0
2011-06-01T22:29:01.863000
2011-06-01T23:55:18.233000
6,208,492
6,241,346
Devise - Redirected to page if account isn't confirmed
I'm trying to redirect the user if their account hasn't been confirmed. So this involves two parts of the code: Redirect the user after they first create the account Redirect them if they try to sign in before confirming the account I need help with the second. The first I was able to do by putting in after_inactive_si...
You may have to create a custom warden strategy and check if the account needs confirmation. Something of this sorts: # config/initializers/my_strategy.rb Warden::Strategies.add(:my_strategy) do def valid? true end def authenticate! u = User.find_for_authentication(:email => params[:email]) if u.nil? ||!u.valid_passwo...
Devise - Redirected to page if account isn't confirmed I'm trying to redirect the user if their account hasn't been confirmed. So this involves two parts of the code: Redirect the user after they first create the account Redirect them if they try to sign in before confirming the account I need help with the second. The...
TITLE: Devise - Redirected to page if account isn't confirmed QUESTION: I'm trying to redirect the user if their account hasn't been confirmed. So this involves two parts of the code: Redirect the user after they first create the account Redirect them if they try to sign in before confirming the account I need help wi...
[ "ruby-on-rails-3", "devise" ]
3
7
3,047
1
0
2011-06-01T22:29:50.003000
2011-06-05T06:21:05.900000
6,208,503
6,208,538
mysql changing column to row heading
I have a table that holds data like key val Product Oranges Customer Alan Sherry Product Apples Area Isles Customer John C etc and I want to change it to more like Product customer Area Oranges Alan Sherry Isles Appleas John C how would I do that thanks
This could be hard to do using purely sql. You could use a cursor and look for product, customer, area (in a specific order, maybe?) and set variables for those 3 items until you come to product each time, then you flush the variables you've set into one row in the new table you've created using and insert statement an...
mysql changing column to row heading I have a table that holds data like key val Product Oranges Customer Alan Sherry Product Apples Area Isles Customer John C etc and I want to change it to more like Product customer Area Oranges Alan Sherry Isles Appleas John C how would I do that thanks
TITLE: mysql changing column to row heading QUESTION: I have a table that holds data like key val Product Oranges Customer Alan Sherry Product Apples Area Isles Customer John C etc and I want to change it to more like Product customer Area Oranges Alan Sherry Isles Appleas John C how would I do that thanks ANSWER: Th...
[ "mysql", "sql" ]
0
1
128
1
0
2011-06-01T22:31:57.117000
2011-06-01T22:35:38.127000
6,208,522
6,208,573
Python: joining 2 lists of the same size
Let's say I have 2 following lists: list1 = [1,1,1,1] list2 = [3,3,3,3] I want the result of join to be: list3 [4,4,4,4] What's would be the best way to do it?
Extremely similar to Ignacio's answer, but for a tiny bit more brevity: list3 = [sum(i) for i in zip(list1, list2)] or list3 = map(sum, zip(list1, list2)) I prefer the map version myself. Edit: As JBernardo rightly points out, if using Python 2.x you should replace zip with its iterator counterpart in itertools.izip fo...
Python: joining 2 lists of the same size Let's say I have 2 following lists: list1 = [1,1,1,1] list2 = [3,3,3,3] I want the result of join to be: list3 [4,4,4,4] What's would be the best way to do it?
TITLE: Python: joining 2 lists of the same size QUESTION: Let's say I have 2 following lists: list1 = [1,1,1,1] list2 = [3,3,3,3] I want the result of join to be: list3 [4,4,4,4] What's would be the best way to do it? ANSWER: Extremely similar to Ignacio's answer, but for a tiny bit more brevity: list3 = [sum(i) for ...
[ "python", "list", "sum" ]
3
10
221
2
0
2011-06-01T22:34:06.690000
2011-06-01T22:40:40.080000
6,208,524
6,218,579
ASP.NET add multiple series to chart via treeview selection
My page has a chart that is set up to display data that is coming from a SqlDataSource. There is a TreeView which contains a list of datapoints that I want to be able to add to the chart as different series. The user selects which item they wish to add by clicking a checkbox in the treeview for that node and then click...
To get this to work correctly all of the datapoints that will be added to the chart need to be included in the select statement for the sqlDataSource: sqlDataSource.SelectCommand = "SELECT (Date + CONVERT(datetime,Time)) As TimeStamp, X1, X2, X3 FROM AAA ORDER BY TimeStamp";
ASP.NET add multiple series to chart via treeview selection My page has a chart that is set up to display data that is coming from a SqlDataSource. There is a TreeView which contains a list of datapoints that I want to be able to add to the chart as different series. The user selects which item they wish to add by clic...
TITLE: ASP.NET add multiple series to chart via treeview selection QUESTION: My page has a chart that is set up to display data that is coming from a SqlDataSource. There is a TreeView which contains a list of datapoints that I want to be able to add to the chart as different series. The user selects which item they w...
[ "asp.net", "sql", "treeview", "charts" ]
0
0
1,290
1
0
2011-06-01T22:34:13.137000
2011-06-02T18:18:19.533000
6,208,525
6,208,626
How to have a cornerradius on Flex 4 TextInput component
How do I get corner radius on my TextInput component in Flex 4.
Create a custom skin (possibly by copying spark TextInputSkin) and add a border graphic with rounded corners, like this: If you want more special rounded corners you can also use these attributes: topLeftRadiusX="4" topLeftRadiusY="8" bottomLeftRadiusX="2" bottomRightRadiusY="10" The default TextInputSkin does not allo...
How to have a cornerradius on Flex 4 TextInput component How do I get corner radius on my TextInput component in Flex 4.
TITLE: How to have a cornerradius on Flex 4 TextInput component QUESTION: How do I get corner radius on my TextInput component in Flex 4. ANSWER: Create a custom skin (possibly by copying spark TextInputSkin) and add a border graphic with rounded corners, like this: If you want more special rounded corners you can al...
[ "apache-flex", "flex4" ]
2
10
6,185
2
0
2011-06-01T22:34:29.047000
2011-06-01T22:48:28.880000
6,208,526
6,209,930
MATLAB Concatenate matrices with unequal dimensions
Is there any easy way to concatenate matrices with unequal dimensions using zero padding? short = [1 2 3]'; long = [4 5 6 7]'; desiredResult = horzcat(short, long); I would like something like: desiredResult = 1 4 2 5 3 6 0 7
Matrices in MATLAB are automatically grown and padded with zeroes when you assign to indices outside the current bounds of the matrix. For example: >> short = [1 2 3]'; >> long = [4 5 6 7]'; >> desiredResult(1:numel(short),1) = short; %# Add short to column 1 >> desiredResult(1:numel(long),2) = long; %# Add long to col...
MATLAB Concatenate matrices with unequal dimensions Is there any easy way to concatenate matrices with unequal dimensions using zero padding? short = [1 2 3]'; long = [4 5 6 7]'; desiredResult = horzcat(short, long); I would like something like: desiredResult = 1 4 2 5 3 6 0 7
TITLE: MATLAB Concatenate matrices with unequal dimensions QUESTION: Is there any easy way to concatenate matrices with unequal dimensions using zero padding? short = [1 2 3]'; long = [4 5 6 7]'; desiredResult = horzcat(short, long); I would like something like: desiredResult = 1 4 2 5 3 6 0 7 ANSWER: Matrices in MAT...
[ "matlab", "matrix", "concatenation" ]
3
5
19,165
3
0
2011-06-01T22:34:42.057000
2011-06-02T02:57:59.653000
6,208,528
6,208,607
If StartMenuInternet is not set, where else can I look for the default browser?
key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false); if (key == null) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); } On a very few machines this is coming up blank. When regedit is probed, the key is found to be (value not found). What are my op...
I needed if (key == null || key.ValueCount == 0) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); }
If StartMenuInternet is not set, where else can I look for the default browser? key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false); if (key == null) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); } On a very few machines this is coming up blank. ...
TITLE: If StartMenuInternet is not set, where else can I look for the default browser? QUESTION: key = Registry.CurrentUser.OpenSubKey(@"Software\Clients\StartMenuInternet", false); if (key == null) { key = Registry.LocalMachine.OpenSubKey(@"Software\Clients\StartMenuInternet", false); } On a very few machines this is...
[ "c#", "windows", "regedit" ]
1
0
262
2
0
2011-06-01T22:34:48.783000
2011-06-01T22:46:02.190000
6,208,529
6,209,059
Two Database tables related in two different ways...?
Im sort of scratching my head on this one. Here's the scenario. Im using Doctrine and YAML schema files: I have a table User and a table Event User looks like this: User: columns: id: type: integer(7) email: type: string(100) display_name: type: string(255) fb_id: type: string(100) relations: Event: type: many refClass...
I think you just need one many-to-many relationship between the two tables. UserEvent will tell you what users have what events (and vice versa)... and joining through UserEvent and adding WHERE user.id = event.initiator_id will give you access to a user's initiated events, assuming they also belong to those events.
Two Database tables related in two different ways...? Im sort of scratching my head on this one. Here's the scenario. Im using Doctrine and YAML schema files: I have a table User and a table Event User looks like this: User: columns: id: type: integer(7) email: type: string(100) display_name: type: string(255) fb_id: t...
TITLE: Two Database tables related in two different ways...? QUESTION: Im sort of scratching my head on this one. Here's the scenario. Im using Doctrine and YAML schema files: I have a table User and a table Event User looks like this: User: columns: id: type: integer(7) email: type: string(100) display_name: type: st...
[ "mysql", "doctrine", "rdbms", "yaml" ]
0
1
86
2
0
2011-06-01T22:34:56.570000
2011-06-01T23:58:50.430000
6,208,548
6,208,569
Is it possible to change the height on a jquery ui progressbar
I have a progress bar in a html table cell. It seems to expand to the width of the table cell but i want to explicitly specify the height of the progress bar. Is it possible to specify the height of a jQuery progress bar? $(this).progressbar({ value: parseInt($(this).attr("rel")) });
Of course it is. There's even a resizable progress bar demo. Too fancy for you? Just use.height(): $('#progressbar').height(400); Demo: http://jsfiddle.net/mattball/N5AVv/
Is it possible to change the height on a jquery ui progressbar I have a progress bar in a html table cell. It seems to expand to the width of the table cell but i want to explicitly specify the height of the progress bar. Is it possible to specify the height of a jQuery progress bar? $(this).progressbar({ value: parseI...
TITLE: Is it possible to change the height on a jquery ui progressbar QUESTION: I have a progress bar in a html table cell. It seems to expand to the width of the table cell but i want to explicitly specify the height of the progress bar. Is it possible to specify the height of a jQuery progress bar? $(this).progressb...
[ "jquery", "jquery-ui", "progress-bar", "jquery-ui-progressbar" ]
6
12
8,183
3
0
2011-06-01T22:37:23.793000
2011-06-01T22:40:17.310000
6,208,561
6,208,860
Accessing an ActionScript function via Javascript
I'm trying to call a function in an action script using the ExternalInterface.addCallback API, but I can't seem to get it to work. Here's what I have: ActionScript: //MyClass.as package { import flash.display.Sprite; import flash.external.ExternalInterface; public class MyClass extends Sprite { public function MyClas...
I figured it out. The key way to signal the javascipt through ExternalInterface.call so we know for sure that the swf is loaded. The most "Universal" way to do this is as follows: MyClass.as //MyClass.as package { import flash.display.Sprite; import flash.external.ExternalInterface; public class MyClass extends Sprit...
Accessing an ActionScript function via Javascript I'm trying to call a function in an action script using the ExternalInterface.addCallback API, but I can't seem to get it to work. Here's what I have: ActionScript: //MyClass.as package { import flash.display.Sprite; import flash.external.ExternalInterface; public cla...
TITLE: Accessing an ActionScript function via Javascript QUESTION: I'm trying to call a function in an action script using the ExternalInterface.addCallback API, but I can't seem to get it to work. Here's what I have: ActionScript: //MyClass.as package { import flash.display.Sprite; import flash.external.ExternalInte...
[ "javascript", "actionscript", "externalinterface", "nomethoderror" ]
6
5
6,111
2
0
2011-06-01T22:39:13.697000
2011-06-01T23:24:06.627000
6,208,562
6,208,746
Simple Framework Mechanics
I'm building a simple framework and hoping it will help me better understand OOP. Well, I've come across my first hurdle. I'm naturally using MVC pattern and I have a user model. I then have a 'table' which manages the collection of user objects. I have an abstract model and table. Similar to Zend Framework layout. Any...
doctrine or not? If your intention is to learn how to write SQL Queries and to create something for your own, use mysqli or PDO. If you would like to learn how to use a real object oriented database layer, use doctrine. With 3 pages tutorial, you can do the most general things. However some very special cases are bette...
Simple Framework Mechanics I'm building a simple framework and hoping it will help me better understand OOP. Well, I've come across my first hurdle. I'm naturally using MVC pattern and I have a user model. I then have a 'table' which manages the collection of user objects. I have an abstract model and table. Similar to...
TITLE: Simple Framework Mechanics QUESTION: I'm building a simple framework and hoping it will help me better understand OOP. Well, I've come across my first hurdle. I'm naturally using MVC pattern and I have a user model. I then have a 'table' which manages the collection of user objects. I have an abstract model and...
[ "oop", "php" ]
1
2
216
2
0
2011-06-01T22:39:16.727000
2011-06-01T23:06:14.957000
6,208,563
6,218,304
Extract all the elements that meet the condition from an XELEMENT var + LINQ to XML
I have two XELEMENTS XR and XTemp. MY XR Contains: Subject Subject Vehicle...... My XTemp contains: Subject Subject Vehicle Vehicle...... Trying to extract all the elements from XTemp based on a certain condtion and add them to XR. The condition is: get all the elements whose id begins with "V". Below code was the best...
Your problem is in this bit of code:.Where(x => x.Element(xmlns + "unit").Attribute("id")... At that point in the query you're already querying over unit elements. A unit doesn't contain a nested unit, which is why you get a NullReferenceException. Change it to:.Where(x => x.Attribute("id")... Personally, I find your q...
Extract all the elements that meet the condition from an XELEMENT var + LINQ to XML I have two XELEMENTS XR and XTemp. MY XR Contains: Subject Subject Vehicle...... My XTemp contains: Subject Subject Vehicle Vehicle...... Trying to extract all the elements from XTemp based on a certain condtion and add them to XR. The ...
TITLE: Extract all the elements that meet the condition from an XELEMENT var + LINQ to XML QUESTION: I have two XELEMENTS XR and XTemp. MY XR Contains: Subject Subject Vehicle...... My XTemp contains: Subject Subject Vehicle Vehicle...... Trying to extract all the elements from XTemp based on a certain condtion and ad...
[ "lambda", "linq-to-xml" ]
1
2
1,481
1
0
2011-06-01T22:39:21.810000
2011-06-02T17:56:33.850000
6,208,564
6,208,579
how to access json via jquery
i have this json in my request $.get("/shop_possystems/index.php?route=module/cart/ajax_get_individual_prices&current_id=" + current_id + "&standard_id=" + standard + "&professional_id=" + professional + "&premium_id=" + premium + "&quantity=" + quantity, function(data) { var standard_price = data.standard_price; var p...
You need to parse the JSON. Put this as the first line of the callback: data = $.parseJSON(data); Alternatively, use $.getJSON instead of $.get or pass "json" as another parameter to $.get.
how to access json via jquery i have this json in my request $.get("/shop_possystems/index.php?route=module/cart/ajax_get_individual_prices&current_id=" + current_id + "&standard_id=" + standard + "&professional_id=" + professional + "&premium_id=" + premium + "&quantity=" + quantity, function(data) { var standard_pric...
TITLE: how to access json via jquery QUESTION: i have this json in my request $.get("/shop_possystems/index.php?route=module/cart/ajax_get_individual_prices&current_id=" + current_id + "&standard_id=" + standard + "&professional_id=" + professional + "&premium_id=" + premium + "&quantity=" + quantity, function(data) {...
[ "jquery" ]
0
5
2,970
4
0
2011-06-01T22:39:26.630000
2011-06-01T22:41:29.643000
6,208,565
6,208,624
const char* vs char* (C++)
For the following program: int DivZero(int, int, int); int main() { try { cout << DivZero(1,0,2) << endl; } catch(char* e) { cout << "Exception is thrown!" << endl; cout << e << endl; return 1; } return 0; } int DivZero(int a, int b, int c) { if( a <= 0 || b <= 0 || c <= 0) throw "All parameters must be greater than ...
Why are you throwing and catching strings anyway? You should throw and catch exceptions, e.g. std::runtime_error The answer to your question is that whenever you insert a string in quotes in the code it returns a null terminated const char* The reason your code doesn't work as above is because it's the wrong type, so t...
const char* vs char* (C++) For the following program: int DivZero(int, int, int); int main() { try { cout << DivZero(1,0,2) << endl; } catch(char* e) { cout << "Exception is thrown!" << endl; cout << e << endl; return 1; } return 0; } int DivZero(int a, int b, int c) { if( a <= 0 || b <= 0 || c <= 0) throw "All param...
TITLE: const char* vs char* (C++) QUESTION: For the following program: int DivZero(int, int, int); int main() { try { cout << DivZero(1,0,2) << endl; } catch(char* e) { cout << "Exception is thrown!" << endl; cout << e << endl; return 1; } return 0; } int DivZero(int a, int b, int c) { if( a <= 0 || b <= 0 || c <= 0...
[ "c++" ]
15
18
26,602
2
0
2011-06-01T22:39:36.973000
2011-06-01T22:48:12.930000
6,208,572
6,208,600
C++, 'coupling' of member pointers in multiple objects copied from the same original object
#include #include #include #include struct s_A { bool bin; s_A(): bin(0) {} }; class c_A { public: s_A * p_struct; c_A(): p_struct(NULL) {p_struct = new s_A [16];} void Reset() { delete [] p_struct; p_struct = new s_A [16]; } }; int main () { srand(1); int x = 30; std::vector objects; objects.assign(x, c_A()); std:...
The particular source of your problem are these lines here: objects_copy.push_back(objects[ rand() % x ]); objects_copy[q].Reset(); The issue is that when you try pushing copies of the objects into objects_copy, you end up making a shallow copy of the objects in the objects vector. This means that the objects in the tw...
C++, 'coupling' of member pointers in multiple objects copied from the same original object #include #include #include #include struct s_A { bool bin; s_A(): bin(0) {} }; class c_A { public: s_A * p_struct; c_A(): p_struct(NULL) {p_struct = new s_A [16];} void Reset() { delete [] p_struct; p_struct = new s_A [16]; }...
TITLE: C++, 'coupling' of member pointers in multiple objects copied from the same original object QUESTION: #include #include #include #include struct s_A { bool bin; s_A(): bin(0) {} }; class c_A { public: s_A * p_struct; c_A(): p_struct(NULL) {p_struct = new s_A [16];} void Reset() { delete [] p_struct; p_struct...
[ "c++", "pointers", "object", "dynamic-memory-allocation", "copying" ]
4
5
463
1
0
2011-06-01T22:40:25.423000
2011-06-01T22:45:02.357000
6,208,574
6,208,953
convert opengl Window to std::size_t and back again works in Linux, but not OS X
I have successfully converted an OpenGL Window to an std::size_t variable and then converted it back to an OpenGL Window in Linux. However, when I try to do the same thing in Mac OS X it isn't working. Here's what I'm doing: /* our window instance(This is an X Window System Window!) */ Window window_;.... std::size_t O...
void* would be a fine option if you can't provide GL type information to getInputMgr. I assume you are trying to hide OpenGL definitions from the rest of your code?
convert opengl Window to std::size_t and back again works in Linux, but not OS X I have successfully converted an OpenGL Window to an std::size_t variable and then converted it back to an OpenGL Window in Linux. However, when I try to do the same thing in Mac OS X it isn't working. Here's what I'm doing: /* our window ...
TITLE: convert opengl Window to std::size_t and back again works in Linux, but not OS X QUESTION: I have successfully converted an OpenGL Window to an std::size_t variable and then converted it back to an OpenGL Window in Linux. However, when I try to do the same thing in Mac OS X it isn't working. Here's what I'm doi...
[ "c++", "linux", "macos", "opengl", "x11" ]
0
1
418
2
0
2011-06-01T22:40:48.940000
2011-06-01T23:39:03.550000
6,208,578
6,208,619
Django - validating and saving ModelForm with editable=false fields
I do apologise for all the questions I'm posting today, but I'm at my wits end on this one. I'm trying to make a Q&A thing for a video site, and I'm trying to get the question to submit via AJAX. Question model: class Question(models.Model): user = models.ForeignKey(User, editable=False) video = models.ForeignKey(Video...
You aren't passing in video in the view: forms.py def __init__(self, video, *args, **kwargs): views.py q=QuestionForm(request.POST) as video is a positional argument, I'd imagine it is interpreting request.POST as the video? You could change video to a keyword argument: def __init__(self, video=None, *args, **kwargs): ...
Django - validating and saving ModelForm with editable=false fields I do apologise for all the questions I'm posting today, but I'm at my wits end on this one. I'm trying to make a Q&A thing for a video site, and I'm trying to get the question to submit via AJAX. Question model: class Question(models.Model): user = mod...
TITLE: Django - validating and saving ModelForm with editable=false fields QUESTION: I do apologise for all the questions I'm posting today, but I'm at my wits end on this one. I'm trying to make a Q&A thing for a video site, and I'm trying to get the question to submit via AJAX. Question model: class Question(models....
[ "django", "django-models", "django-forms" ]
0
2
1,163
2
0
2011-06-01T22:41:26.940000
2011-06-01T22:47:25.917000
6,208,582
6,208,598
jquery find select options attributes
I know how to get the attributes of an element, using jquery. But I'm not sure how to do it with the actual options in a select field. first option second option third option To get the referenceID I would just do this: $("#test").attr("referenceID"); And when I want to get the value: $("#test").val(); But I want to ge...
Presuming you want to find the title attribute of the selected option... $('#test option:selected').attr('title'); That is, find the descendant element of #test that is (a) an option element and (b) is selected. If you already have a selection containing #test, you can do this with find: $('#test').find('option:selecte...
jquery find select options attributes I know how to get the attributes of an element, using jquery. But I'm not sure how to do it with the actual options in a select field. first option second option third option To get the referenceID I would just do this: $("#test").attr("referenceID"); And when I want to get the val...
TITLE: jquery find select options attributes QUESTION: I know how to get the attributes of an element, using jquery. But I'm not sure how to do it with the actual options in a select field. first option second option third option To get the referenceID I would just do this: $("#test").attr("referenceID"); And when I w...
[ "jquery", "jquery-selectors" ]
9
16
37,442
3
0
2011-06-01T22:42:07.690000
2011-06-01T22:44:57.773000
6,208,615
6,208,687
Read through an unstructured xls file
I have an.xls file which contains one column with 2,000 rows. I want to iterate through the file and print out the data points which start with "cheap". However, the following code doesn't work. Help! import xlrd wb = xlrd.open_workbook("file.xls") wb.sheet_names() sh = wb.sheet_by_index(0) lst = [sh] for item in ls...
it should look like: import xlrd wb = xlrd.open_workbook("file.xls") wb.sheet_names() sh = wb.sheet_by_index(0) for item in sh.col(0): value = unicode(item.value) if value.startswith("cheap"): print value
Read through an unstructured xls file I have an.xls file which contains one column with 2,000 rows. I want to iterate through the file and print out the data points which start with "cheap". However, the following code doesn't work. Help! import xlrd wb = xlrd.open_workbook("file.xls") wb.sheet_names() sh = wb.sheet_...
TITLE: Read through an unstructured xls file QUESTION: I have an.xls file which contains one column with 2,000 rows. I want to iterate through the file and print out the data points which start with "cheap". However, the following code doesn't work. Help! import xlrd wb = xlrd.open_workbook("file.xls") wb.sheet_names...
[ "python", "file", "xls" ]
1
2
841
1
0
2011-06-01T22:46:57.127000
2011-06-01T22:58:00.823000
6,208,617
6,280,355
Controlling Selenium using Python - unable to use 'waits'
We maintain a library used by test scripts which do system level testing. Part of the system under test is a website, and to navigate and interact with the website we use JPype to control Selenium 2.0's webdriver. Selenium 2.0 has a Java and C# interface, and for the time being we can't rewrite out test library using e...
ImplicitlyWait through JPype and the Java bindings works, and can fulfill the required need here.
Controlling Selenium using Python - unable to use 'waits' We maintain a library used by test scripts which do system level testing. Part of the system under test is a website, and to navigate and interact with the website we use JPype to control Selenium 2.0's webdriver. Selenium 2.0 has a Java and C# interface, and fo...
TITLE: Controlling Selenium using Python - unable to use 'waits' QUESTION: We maintain a library used by test scripts which do system level testing. Part of the system under test is a website, and to navigate and interact with the website we use JPype to control Selenium 2.0's webdriver. Selenium 2.0 has a Java and C#...
[ "python", "selenium" ]
4
0
1,598
2
0
2011-06-01T22:47:02.730000
2011-06-08T14:26:54.417000
6,208,622
6,213,106
what is parse error: naked expression at top level?
I was trying to get the length of each element, given a nested list; and I also I want to get rid of the repeated length. For example, a nested list [[1],[1,2],[4..5]] should give me [1,2]. I can do it in the interactive by nub (map length [[1],[1,2],[4..5]]). But if I write a file with the following code: Import Data....
In the parser, Import Data.List looks like an application of the data constructor Import with the data constructor Data.List as its argument. Since this error occurred during parsing, the compiler has not yet figured out that neither of the data constructors Import or Data.List actually exist, but it does know that an ...
what is parse error: naked expression at top level? I was trying to get the length of each element, given a nested list; and I also I want to get rid of the repeated length. For example, a nested list [[1],[1,2],[4..5]] should give me [1,2]. I can do it in the interactive by nub (map length [[1],[1,2],[4..5]]). But if ...
TITLE: what is parse error: naked expression at top level? QUESTION: I was trying to get the length of each element, given a nested list; and I also I want to get rid of the repeated length. For example, a nested list [[1],[1,2],[4..5]] should give me [1,2]. I can do it in the interactive by nub (map length [[1],[1,2]...
[ "haskell", "syntax" ]
2
2
5,811
2
0
2011-06-01T22:47:37.860000
2011-06-02T10:09:16.933000
6,208,627
6,208,711
Correctly Release cell from UITAbleView
I would like to know how to correctly release a cell and fix a memory leak I have. and also ask if a memory leak can cause crashing on scrolling if the numbers cell numbers get high? Here is my cell where the leak is coming from any suggestions? NSString *identifier = @"cell"; UITableViewCell *cell = [tableView dequeue...
cell object needs to be autoreleased here – cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"]; and this line needs to be inside if ( cell == nil ) { //here }. You alloc-init tableImage but do not release it. selectedCell is not released either. You are autorelease ing a...
Correctly Release cell from UITAbleView I would like to know how to correctly release a cell and fix a memory leak I have. and also ask if a memory leak can cause crashing on scrolling if the numbers cell numbers get high? Here is my cell where the leak is coming from any suggestions? NSString *identifier = @"cell"; UI...
TITLE: Correctly Release cell from UITAbleView QUESTION: I would like to know how to correctly release a cell and fix a memory leak I have. and also ask if a memory leak can cause crashing on scrolling if the numbers cell numbers get high? Here is my cell where the leak is coming from any suggestions? NSString *identi...
[ "uitableview" ]
2
0
3,125
2
0
2011-06-01T22:48:32.360000
2011-06-01T23:01:58
6,208,633
6,211,012
How to search inside a specific block of code in IntelliJ IDEA?
How I can search within a specific block of code or selection in IntelliJ IDEA? I got used to using this feature in Eclipse. In Eclipse you can just double click on the beginning of a curly bracket, and it'll highlight the entire block of code. After which you could do Command + f ( Ctrl + f on Windows) to search ONLY ...
Go to Settings | Keymap, search for the Find... action in the Other group. This action should have the following description: Find a string in active editor, shows modal dialog Assign a keyboard shortcut to this action (you need to make a copy of default keymap to modify it), for example Ctrl + Alt + Shift + F. When in...
How to search inside a specific block of code in IntelliJ IDEA? How I can search within a specific block of code or selection in IntelliJ IDEA? I got used to using this feature in Eclipse. In Eclipse you can just double click on the beginning of a curly bracket, and it'll highlight the entire block of code. After which...
TITLE: How to search inside a specific block of code in IntelliJ IDEA? QUESTION: How I can search within a specific block of code or selection in IntelliJ IDEA? I got used to using this feature in Eclipse. In Eclipse you can just double click on the beginning of a curly bracket, and it'll highlight the entire block of...
[ "search", "intellij-idea", "highlighting" ]
9
5
3,403
5
0
2011-06-01T22:50:00.527000
2011-06-02T06:01:21.410000
6,208,634
6,208,703
php implode breaks on spaces
I have an array of strings, and these strings have spaces in them. For example: $arr = array('bob', 'john smith', 'grease monkey', 'etc'); Why is it when I try to $str = implode('|', $arr);, it stops at the first space it finds?? I'm left with a string like: $str = "bob|john"; If I try: $arr = array('bob', 'john', 'gre...
Edit: I'm actually trying to set it to the value of a hidden field: /> You need to quote the value attribute: Without doing that, the rendered HTML looks like: Which the browser will handle as this:
php implode breaks on spaces I have an array of strings, and these strings have spaces in them. For example: $arr = array('bob', 'john smith', 'grease monkey', 'etc'); Why is it when I try to $str = implode('|', $arr);, it stops at the first space it finds?? I'm left with a string like: $str = "bob|john"; If I try: $ar...
TITLE: php implode breaks on spaces QUESTION: I have an array of strings, and these strings have spaces in them. For example: $arr = array('bob', 'john smith', 'grease monkey', 'etc'); Why is it when I try to $str = implode('|', $arr);, it stops at the first space it finds?? I'm left with a string like: $str = "bob|jo...
[ "php", "implode" ]
1
3
6,474
4
0
2011-06-01T22:50:04.727000
2011-06-01T23:00:15.240000
6,208,636
6,208,654
Django not create database table
Hey, I've a database already created. Now I've updated UserProfile with: class UserProfile(models.Model): user = models.ForeignKey(User, unique = True, related_name = 'user') follows = models.ManyToManyField("self", related_name = 'follows') <-- NEW LINE so python manage.py sqlall myapp returns me: [...] CREATE TABLE "...
manage.py syncdb will not modify existing tables to add or remove fields. You will need to either manually modify your database, or use a tool like South to create automated database migrations (which is what I highly recommend)
Django not create database table Hey, I've a database already created. Now I've updated UserProfile with: class UserProfile(models.Model): user = models.ForeignKey(User, unique = True, related_name = 'user') follows = models.ManyToManyField("self", related_name = 'follows') <-- NEW LINE so python manage.py sqlall myapp...
TITLE: Django not create database table QUESTION: Hey, I've a database already created. Now I've updated UserProfile with: class UserProfile(models.Model): user = models.ForeignKey(User, unique = True, related_name = 'user') follows = models.ManyToManyField("self", related_name = 'follows') <-- NEW LINE so python mana...
[ "python", "django" ]
5
6
8,401
2
0
2011-06-01T22:50:33.233000
2011-06-01T22:52:33.697000
6,208,652
6,232,774
InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project
InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project. I have ReportViewer 2010 selected as a requirement but it's not adding the files I need. Its also not adding the SQL CE 3.5 run-time either. I can get the "Visual Studio Installer" to add both but I understand MS is going to be removing thi...
OK found the answer. The walk-thru they give doesn't give the option to specify whether or not prerequisites should be installed. Rather, in the Solution Explorer under the name of the setup project is a section called "2 Specify Application Data" and under it, is a section called "redistributables". This was the secti...
InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project. I have ReportViewer 2010 selected as a requirement but it's not adding the files I need. Its also not adding the SQL CE 3.5 run-time either. I can get the "Visua...
TITLE: InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project QUESTION: InstallShield LE isn't installing ReportViewer 2010 from my VS 2010 C# Project. I have ReportViewer 2010 selected as a requirement but it's not adding the files I need. Its also not adding the SQL CE 3.5 run-time either. I ...
[ "visual-studio-2010", "installshield-le" ]
2
2
1,333
1
0
2011-06-01T22:52:16.760000
2011-06-03T21:16:40.650000
6,208,660
6,208,694
Difference between these two requests
Request One (Not working) { "AddNewRequest":{ "Patient":{ "PrimaryPhoneNumber":" ", "DateOfBirth":" ", "CellPhoneNumber1":" ", "ResidentialAddress":{ "AddressLine1":" ", "State":" ", "City":" ", "PostalCode":" " }, "PhoneNumber1":" ", "SSN":" ", "FullName":"John", "Religion":" ", "Gender":" ", "Race":" ", "Firstname":"...
In JSON the order doesn't matter but the name does. In the Request One you have "AddNewRequest" while in Request Two you have "PatientAddNewRequest". Also on the server side, the serializer/de-serializer may need specific ordering. JSON An object is an unordered collection of zero or more name/value pairs, where a name...
Difference between these two requests Request One (Not working) { "AddNewRequest":{ "Patient":{ "PrimaryPhoneNumber":" ", "DateOfBirth":" ", "CellPhoneNumber1":" ", "ResidentialAddress":{ "AddressLine1":" ", "State":" ", "City":" ", "PostalCode":" " }, "PhoneNumber1":" ", "SSN":" ", "FullName":"John", "Religion":" ", "...
TITLE: Difference between these two requests QUESTION: Request One (Not working) { "AddNewRequest":{ "Patient":{ "PrimaryPhoneNumber":" ", "DateOfBirth":" ", "CellPhoneNumber1":" ", "ResidentialAddress":{ "AddressLine1":" ", "State":" ", "City":" ", "PostalCode":" " }, "PhoneNumber1":" ", "SSN":" ", "FullName":"John",...
[ "javascript", "json" ]
1
6
433
3
0
2011-06-01T22:53:54.430000
2011-06-01T22:58:59.177000
6,208,663
6,208,774
Can managed code perform computations as fast as unmamanged?
I've been interested in different chess engines lately. There are many open and closed sources project in this field. They are all (most of them anyway) written in C/C++. This is kind of an obvious thing - you have a computationally intensive task, you use C/C++ so you get both portability and speed. This seems like a ...
"Can" it? Yes, of course. Even without unsafe/unverifiable code, well-optimized.NET code can outperform native code. Case in point, Dr. Jon Harrop's answer on this thread: F# performance in scientific computing Will it? Usually, no, unless you go way out of your way to avoid allocations.
Can managed code perform computations as fast as unmamanged? I've been interested in different chess engines lately. There are many open and closed sources project in this field. They are all (most of them anyway) written in C/C++. This is kind of an obvious thing - you have a computationally intensive task, you use C/...
TITLE: Can managed code perform computations as fast as unmamanged? QUESTION: I've been interested in different chess engines lately. There are many open and closed sources project in this field. They are all (most of them anyway) written in C/C++. This is kind of an obvious thing - you have a computationally intensiv...
[ "c#", "c++", "performance", "unmanaged", "managed" ]
2
6
1,264
6
0
2011-06-01T22:54:36.113000
2011-06-01T23:09:51.917000
6,208,664
6,208,862
In need of a python script to upload a file with IP address every few minutes
I'm using windows server 2008, and one of the things I need to do in order to pair to a domain name is send a file with the computers current IP address (it's not static) to a server via sftp every few minutes. The problem is that I'm not sure how to do this.
I would send it via XMPP. You can set up a listener service for the server. Send an xmpp message using a python library Here are some ideas on XMPP servers to run on your IIS server (listening to recieve the incoming messages from clients http://metajack.im/2008/08/26/choosing-an-xmpp-server/ Pretzel looks nice this py...
In need of a python script to upload a file with IP address every few minutes I'm using windows server 2008, and one of the things I need to do in order to pair to a domain name is send a file with the computers current IP address (it's not static) to a server via sftp every few minutes. The problem is that I'm not sur...
TITLE: In need of a python script to upload a file with IP address every few minutes QUESTION: I'm using windows server 2008, and one of the things I need to do in order to pair to a domain name is send a file with the computers current IP address (it's not static) to a server via sftp every few minutes. The problem i...
[ "python", "ip-address", "autorun" ]
0
0
909
1
0
2011-06-01T22:54:40.097000
2011-06-01T23:24:42.337000
6,208,666
6,208,705
PHP timezone not set
First of all, i don't have access to the php.ini in the webserver. In my local server I put date.timezone = "Europe/Lisbon" in my php.ini. Is it possible to change this in.htaccess? or, what is the alternative? At the moment I get this error in web server for phpmailer(): Strict Standards: date(): It is not safe to rel...
On second thought, ini_set may not be the best way to go. Apparently E_STRICT standards say that you should use date_default_timezone_set instead. Try something like: date_default_timezone_set('Europe/Lisbon'); $tz = date_default_timezone_get(); More info can be found here about the issue: http://answers.google.com/an...
PHP timezone not set First of all, i don't have access to the php.ini in the webserver. In my local server I put date.timezone = "Europe/Lisbon" in my php.ini. Is it possible to change this in.htaccess? or, what is the alternative? At the moment I get this error in web server for phpmailer(): Strict Standards: date(): ...
TITLE: PHP timezone not set QUESTION: First of all, i don't have access to the php.ini in the webserver. In my local server I put date.timezone = "Europe/Lisbon" in my php.ini. Is it possible to change this in.htaccess? or, what is the alternative? At the moment I get this error in web server for phpmailer(): Strict S...
[ "timezone", "php" ]
8
12
18,816
3
0
2011-06-01T22:54:53.680000
2011-06-01T23:00:29.107000
6,208,674
6,209,191
Why is Interop.WMPLib unable to load assembly in Release mode, but works in Debug mode?
I have added the Windows Media Player com control into my toolbox and then used the control successfully on a Form in Debug mode. However, when I try running the application in Release mode it errors with... Could not load file or assembly 'Interop.WMPLib,... or one of its dependecies. An attempt was made to load a pro...
You changed the Platform target setting in the Debug configuration. Possibly weeks ago, maybe even in a previous version of Visual Studio. But didn't change it in the Release configuration. It is one of the settings that is configuration specific.
Why is Interop.WMPLib unable to load assembly in Release mode, but works in Debug mode? I have added the Windows Media Player com control into my toolbox and then used the control successfully on a Form in Debug mode. However, when I try running the application in Release mode it errors with... Could not load file or a...
TITLE: Why is Interop.WMPLib unable to load assembly in Release mode, but works in Debug mode? QUESTION: I have added the Windows Media Player com control into my toolbox and then used the control successfully on a Form in Debug mode. However, when I try running the application in Release mode it errors with... Could ...
[ "visual-studio-2010", "controls", "winforms-interop" ]
1
1
5,061
2
0
2011-06-01T22:55:53.430000
2011-06-02T00:22:41.060000
6,208,676
6,208,723
C# DateTime to UTC Time without changing the time
How would I convert a preexisting datetime to UTC time without changing the actual time. Example: DateTime dateTime = GetSomeDateTime(); // dateTime here is 3pm dateTime.ToUtcDateTime() // datetime should still be 3pm
6/1/2011 4:08:40 PM Local 6/1/2011 4:08:40 PM Utc from DateTime dt = DateTime.Now; Console.WriteLine("{0} {1}", dt, dt.Kind); DateTime ut = DateTime.SpecifyKind(dt, DateTimeKind.Utc); Console.WriteLine("{0} {1}", ut, ut.Kind);
C# DateTime to UTC Time without changing the time How would I convert a preexisting datetime to UTC time without changing the actual time. Example: DateTime dateTime = GetSomeDateTime(); // dateTime here is 3pm dateTime.ToUtcDateTime() // datetime should still be 3pm
TITLE: C# DateTime to UTC Time without changing the time QUESTION: How would I convert a preexisting datetime to UTC time without changing the actual time. Example: DateTime dateTime = GetSomeDateTime(); // dateTime here is 3pm dateTime.ToUtcDateTime() // datetime should still be 3pm ANSWER: 6/1/2011 4:08:40 PM Local...
[ "c#", "datetime", "utc" ]
168
273
197,823
5
0
2011-06-01T22:56:13.293000
2011-06-01T23:03:20.713000
6,208,678
6,238,701
Storing, Loading, and Updating a Trie in ASP.NET MVC 3
I have a trie-based word detection algorithm for a custom dictionary. Note that regular expressions are too brittle with this dictionary as entries may contain spaces, periods, etc. I've implemented the algorithm in a local C# app that reads in the dictionary from file and stores the trie in memory (it's compact, so no...
I'm not sure if you are looking for specific implementation details, or more conceptual ideas about how to handle but I'll throw some ideas out there for now. Actual Trie Classes - Here is a good C# example of classes for setting up a Trie. It sounds like you already have this part figured out. Storing: I would persist...
Storing, Loading, and Updating a Trie in ASP.NET MVC 3 I have a trie-based word detection algorithm for a custom dictionary. Note that regular expressions are too brittle with this dictionary as entries may contain spaces, periods, etc. I've implemented the algorithm in a local C# app that reads in the dictionary from ...
TITLE: Storing, Loading, and Updating a Trie in ASP.NET MVC 3 QUESTION: I have a trie-based word detection algorithm for a custom dictionary. Note that regular expressions are too brittle with this dictionary as entries may contain spaces, periods, etc. I've implemented the algorithm in a local C# app that reads in th...
[ "asp.net-mvc-3", "architecture", "concurrency", "trie" ]
2
1
391
4
0
2011-06-01T22:56:22.107000
2011-06-04T18:49:00.490000
6,208,679
6,208,796
Cancan Undefined Method 'user' Problems
I'm running into problems defining user permissions in my cancan controller: class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user if user.role?:admin can:manage,:all else can:read,:all can:update, User do |user| user.try(:user) == user end end end end This results in a NoMethodErr...
The problem is that user.try(:user) == user is basically trying to execute user.user == user Looks like you're trying to only let users update the User model attributes if the User instance in question is the logged-in user. Try this instead: can:update, User,:id => user.id Which is saying "Can update the User model wh...
Cancan Undefined Method 'user' Problems I'm running into problems defining user permissions in my cancan controller: class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user if user.role?:admin can:manage,:all else can:read,:all can:update, User do |user| user.try(:user) == user end e...
TITLE: Cancan Undefined Method 'user' Problems QUESTION: I'm running into problems defining user permissions in my cancan controller: class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user if user.role?:admin can:manage,:all else can:read,:all can:update, User do |user| user.try(:u...
[ "ruby-on-rails", "cancan" ]
1
6
1,607
1
0
2011-06-01T22:56:23.363000
2011-06-01T23:13:26.850000
6,208,685
6,208,780
Testing "HTML fixtures" with RSpec and rails
I have a web scraper built to parse html from a website and I'm trying to write tests for it. The class I'm trying to test receives a Nokogiri HTML object and extracts the required data from it. Now as usual the html can vary, sometimes elements will be missing or whatnot. I need to test these different situations. So ...
Have a look at the Artifice, fakeweb or webmock gems, which override net/http in order to supply testable results.
Testing "HTML fixtures" with RSpec and rails I have a web scraper built to parse html from a website and I'm trying to write tests for it. The class I'm trying to test receives a Nokogiri HTML object and extracts the required data from it. Now as usual the html can vary, sometimes elements will be missing or whatnot. I...
TITLE: Testing "HTML fixtures" with RSpec and rails QUESTION: I have a web scraper built to parse html from a website and I'm trying to write tests for it. The class I'm trying to test receives a Nokogiri HTML object and extracts the required data from it. Now as usual the html can vary, sometimes elements will be mis...
[ "ruby-on-rails", "unit-testing", "rspec", "rspec2" ]
3
3
738
1
0
2011-06-01T22:57:57.553000
2011-06-01T23:10:12.757000
6,208,690
6,208,730
Delphi TTable.Exists fails on Paradox table even if database tables exist
When I create a table object (Table1) from scratch and assign the TableName property to an existing table on disk, the Table1.Exist function fails. I'm using Delphi2010 and it is a Paradox 7 table. filename:= ZipMaster1.DirEntry[i].FileName; if Pos('.DB', UpperCase(filename)) > 0 then begin Table1:= TTable.Create(FormA...
You need to separately set the DatabaseName and FileName. Table1:= TTable.Create(whatever); Table1.DatabaseName:= ExtractDir; Table1.TableName:= ExtractFileName(filename); (You should really get away from the BDE and Paradox files (as well as TTable). The BDE has been deprecated for more than a decade now, and may not ...
Delphi TTable.Exists fails on Paradox table even if database tables exist When I create a table object (Table1) from scratch and assign the TableName property to an existing table on disk, the Table1.Exist function fails. I'm using Delphi2010 and it is a Paradox 7 table. filename:= ZipMaster1.DirEntry[i].FileName; if P...
TITLE: Delphi TTable.Exists fails on Paradox table even if database tables exist QUESTION: When I create a table object (Table1) from scratch and assign the TableName property to an existing table on disk, the Table1.Exist function fails. I'm using Delphi2010 and it is a Paradox 7 table. filename:= ZipMaster1.DirEntry...
[ "delphi", "delphi-2010", "paradox" ]
2
4
2,840
1
0
2011-06-01T22:58:18.613000
2011-06-01T23:04:20.370000
6,208,700
6,208,810
Why doesn't "case" with "when > 2" work?
Why is this not working? case ARGV.length when 0 abort "Error 1" when > 2 abort "Error 2" end
An if statement would probably be more fitting for your code, since you don't have a definitive range/value, but rather just a greater-than: if ARGV.length == 0 abort "Error 1" elsif ARGV.length > 2 abort "Error 2" end
Why doesn't "case" with "when > 2" work? Why is this not working? case ARGV.length when 0 abort "Error 1" when > 2 abort "Error 2" end
TITLE: Why doesn't "case" with "when > 2" work? QUESTION: Why is this not working? case ARGV.length when 0 abort "Error 1" when > 2 abort "Error 2" end ANSWER: An if statement would probably be more fitting for your code, since you don't have a definitive range/value, but rather just a greater-than: if ARGV.length ==...
[ "ruby" ]
35
9
23,257
5
0
2011-06-01T23:00:02.457000
2011-06-01T23:15:54.117000
6,208,712
6,208,742
iOS XML parsing on main or background thread
When parsing XML in Objective-C on an iOS app, when can the main thread be used and when should the parsing happen on a background thread? Can the main thread handle SAX parsing on small documents, or should all XML parsing happen in the background?
I normally do all of my data processing on a background thread. This ensures that the UI thread isn't blocked at any point in time by whatever I'm doing.
iOS XML parsing on main or background thread When parsing XML in Objective-C on an iOS app, when can the main thread be used and when should the parsing happen on a background thread? Can the main thread handle SAX parsing on small documents, or should all XML parsing happen in the background?
TITLE: iOS XML parsing on main or background thread QUESTION: When parsing XML in Objective-C on an iOS app, when can the main thread be used and when should the parsing happen on a background thread? Can the main thread handle SAX parsing on small documents, or should all XML parsing happen in the background? ANSWER...
[ "objective-c", "multithreading", "ios", "sax", "xml-parsing" ]
1
4
1,133
2
0
2011-06-01T23:01:59.030000
2011-06-01T23:05:55.523000
6,208,714
6,208,842
Refresh multiple div-[unique_ID]'s with jQuery and .load()?
I am working on modifying a plugin to allow users to vote on posts. My page looks something like this (though this is simplified of course): //voting buttons //voting buttons //voting buttons //voting buttons As you can see, each voting div has a unique class associated with it, vote[id]. My trouble is that after submi...
If I understood well: you can do an 'offline' trick. Just increment the vote number with jQuery, something like in this Ex: var voted = 0; $('.vote').attr('value', function() { voted++; return voted; }); The change will happen in the browser. Than always on page refresh you'll get back the real state from the DB.
Refresh multiple div-[unique_ID]'s with jQuery and .load()? I am working on modifying a plugin to allow users to vote on posts. My page looks something like this (though this is simplified of course): //voting buttons //voting buttons //voting buttons //voting buttons As you can see, each voting div has a unique class ...
TITLE: Refresh multiple div-[unique_ID]'s with jQuery and .load()? QUESTION: I am working on modifying a plugin to allow users to vote on posts. My page looks something like this (though this is simplified of course): //voting buttons //voting buttons //voting buttons //voting buttons As you can see, each voting div h...
[ "jquery", "ajax", "load" ]
2
1
2,176
3
0
2011-06-01T23:02:29.937000
2011-06-01T23:20:49.047000
6,208,715
6,208,767
Pragma no cache and javascript
Does the pragma no-cache mean the browser will not cache javascript scripts? e.g. Will the pragma no cache tag stop the browser from caching the jquery script?
Actually, that depends on the browser used. For modern browsers you need to add Cache-Control and Expires headers as well. response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", 0); See also: How to control web page caching, ...
Pragma no cache and javascript Does the pragma no-cache mean the browser will not cache javascript scripts? e.g. Will the pragma no cache tag stop the browser from caching the jquery script?
TITLE: Pragma no cache and javascript QUESTION: Does the pragma no-cache mean the browser will not cache javascript scripts? e.g. Will the pragma no cache tag stop the browser from caching the jquery script? ANSWER: Actually, that depends on the browser used. For modern browsers you need to add Cache-Control and Exp...
[ "javascript", "html", "jsf", "http-headers" ]
2
3
12,804
1
0
2011-06-01T23:02:30.450000
2011-06-01T23:09:09.980000
6,208,717
6,208,960
.ajax load remote page content to javascript var
I want to get a short string hosted on a server where I do not have access to the data as XML, JSON, etc. I am trying to use either.load or.ajax to do this. I want to be able to parse the data into a javascipt array. The entire contents of the remote page is text and I am happy to take all of it and remove what I do no...
The answer would be to long to post here (really). But look those up: Same Origin Policy Padded JSON If you have no control over the remote site, you have lost - you will not get any data from it by Ajax (which is actually a feature, not a limitation of the technology). One way of circumventing the protection would be ...
.ajax load remote page content to javascript var I want to get a short string hosted on a server where I do not have access to the data as XML, JSON, etc. I am trying to use either.load or.ajax to do this. I want to be able to parse the data into a javascipt array. The entire contents of the remote page is text and I a...
TITLE: .ajax load remote page content to javascript var QUESTION: I want to get a short string hosted on a server where I do not have access to the data as XML, JSON, etc. I am trying to use either.load or.ajax to do this. I want to be able to parse the data into a javascipt array. The entire contents of the remote pa...
[ "javascript", "ajax", "jquery" ]
0
2
1,389
1
0
2011-06-01T23:02:46.363000
2011-06-01T23:40:04.223000
6,208,720
6,208,857
How to properly declare a self-referencing template type?
How do I declare a templated type that refers to itself? template class Animal { public: T getChild (); } With this, I get a compiler error concerning a missing type specifier. I tried to forward-declare Animal, without success. I am trying to impose a type constraint. A Lion can only have a Lion as a child, a Bear has...
The usual way to do something like a linked list is: template class Linked { private: Linked * m_prev; Linked * m_next; } Does this work for you, and if not, what are you trying to accomplish that can't be done this way?
How to properly declare a self-referencing template type? How do I declare a templated type that refers to itself? template class Animal { public: T getChild (); } With this, I get a compiler error concerning a missing type specifier. I tried to forward-declare Animal, without success. I am trying to impose a type cons...
TITLE: How to properly declare a self-referencing template type? QUESTION: How do I declare a templated type that refers to itself? template class Animal { public: T getChild (); } With this, I get a compiler error concerning a missing type specifier. I tried to forward-declare Animal, without success. I am trying to ...
[ "c++", "templates" ]
6
2
7,609
4
0
2011-06-01T23:03:00.607000
2011-06-01T23:23:54.147000
6,208,727
6,213,346
How can I make sure TCL doesn't mess up the order of array elements?
The problem is that the order in which I "insert" elements in an array changes throughout the execution of the script. Here is a quick reproduction of the problem: #!/bin/bash #: \ exec /home/binops/afse/eer/eer_SPI-7.3.1/tclsh "$0" "$@" proc myProc { theArray } { upvar $theArray theArrayInside parray theArrayInside p...
Tcl is flexible enough that one can devise many schemes to handle what you want. Here's an idea that stores the order of your keys within the array itself, assuming the empty string is not a valid key in your data: proc array_add {ary_name key value} { upvar 1 $ary_name ary set ary($key) $value lappend ary() $key } pr...
How can I make sure TCL doesn't mess up the order of array elements? The problem is that the order in which I "insert" elements in an array changes throughout the execution of the script. Here is a quick reproduction of the problem: #!/bin/bash #: \ exec /home/binops/afse/eer/eer_SPI-7.3.1/tclsh "$0" "$@" proc myProc ...
TITLE: How can I make sure TCL doesn't mess up the order of array elements? QUESTION: The problem is that the order in which I "insert" elements in an array changes throughout the execution of the script. Here is a quick reproduction of the problem: #!/bin/bash #: \ exec /home/binops/afse/eer/eer_SPI-7.3.1/tclsh "$0" ...
[ "arrays", "tcl" ]
4
0
2,004
2
0
2011-06-01T23:04:12.920000
2011-06-02T10:31:31.587000
6,208,729
6,208,828
AJAX upload triggered from a specific select option
I'm looking to add an option to my layout page to allow people to upload new logos on the fly. Currently users can select the image they'd like via a drop-down select element. I'd like to add an option at the end which allows them to upload a new image. I'd then refresh the image select elements with the new addition. ...
The only way to uplaod an image in a AJAX way is via an iframe. If i had to advise a way i would have it so that. The user selects Add new images. An onselect function detects this and displays a form in a html box underneath. You have that form's "target" set to the ID of the iframe. Also have a onSubmit command on th...
AJAX upload triggered from a specific select option I'm looking to add an option to my layout page to allow people to upload new logos on the fly. Currently users can select the image they'd like via a drop-down select element. I'd like to add an option at the end which allows them to upload a new image. I'd then refre...
TITLE: AJAX upload triggered from a specific select option QUESTION: I'm looking to add an option to my layout page to allow people to upload new logos on the fly. Currently users can select the image they'd like via a drop-down select element. I'd like to add an option at the end which allows them to upload a new ima...
[ "javascript", "jquery", "ajax", "upload", "ajax-upload" ]
0
1
234
1
0
2011-06-01T23:04:19.217000
2011-06-01T23:18:09.907000
6,208,732
6,208,793
LINQ to JSON in .net 4.0 Client Profile
How would I go about about using LINQ to JSON in the.net 4 Client Profile in C#. I'd like to query certain json responses as shown in msdn blog post without having to write out a contract (datacontract, servicecontract, etc). I really only need to query(read) the response, I don't need to modify the json response. (Als...
JSON.net is quite popular and seems to be what you're after.
LINQ to JSON in .net 4.0 Client Profile How would I go about about using LINQ to JSON in the.net 4 Client Profile in C#. I'd like to query certain json responses as shown in msdn blog post without having to write out a contract (datacontract, servicecontract, etc). I really only need to query(read) the response, I don'...
TITLE: LINQ to JSON in .net 4.0 Client Profile QUESTION: How would I go about about using LINQ to JSON in the.net 4 Client Profile in C#. I'd like to query certain json responses as shown in msdn blog post without having to write out a contract (datacontract, servicecontract, etc). I really only need to query(read) th...
[ "c#", "json", ".net-client-profile" ]
4
3
1,036
2
0
2011-06-01T23:04:47.220000
2011-06-01T23:13:09.737000
6,208,738
6,208,777
AdapterContextMenuInfo.id
I have looked online about this. So my understanding is that AdapterContextMenuInfo.position is the index of the item in the listview. Is AdapterContextMenuInfo.id the index of the item in the Cursor or the primary key id of the item in the database? I have used it as the primary key id of the item in the database. Are...
Is AdapterContextMenuInfo.id the index of the item in the Cursor or the primary key id of the item in the database? It is the value of the _id column that is inside your Cursor, when you are using a CursorAdapter. Are cursors indexed by primary key? Cursors are not indexed, period. However, to use CursorAdapter, you mu...
AdapterContextMenuInfo.id I have looked online about this. So my understanding is that AdapterContextMenuInfo.position is the index of the item in the listview. Is AdapterContextMenuInfo.id the index of the item in the Cursor or the primary key id of the item in the database? I have used it as the primary key id of the...
TITLE: AdapterContextMenuInfo.id QUESTION: I have looked online about this. So my understanding is that AdapterContextMenuInfo.position is the index of the item in the listview. Is AdapterContextMenuInfo.id the index of the item in the Cursor or the primary key id of the item in the database? I have used it as the pri...
[ "android" ]
2
1
1,463
1
0
2011-06-01T23:05:35.247000
2011-06-01T23:10:00.310000
6,208,740
6,224,297
symfony sfDoctrineRoute model question
I couldn't understand completely how does the sfDoctrineRoute class works for example, i have the following route: Comment: class: sfDoctrineRouteCollection options: prefix_path::username/comment module: comment model: Comment now, in executeNew() method of commentActions class, this code: $this->getRoute()->getObject(...
In the case of executeNew, there is little/no benefit to using a doctrine route. Consider instead the executeEdit method (update, delete and show are the same too). A url could be like: /comment/5/edit (or in your case, /myusername/comment/5/edit) $this->getRoute()->getObject() will then return comment 5 from the datab...
symfony sfDoctrineRoute model question I couldn't understand completely how does the sfDoctrineRoute class works for example, i have the following route: Comment: class: sfDoctrineRouteCollection options: prefix_path::username/comment module: comment model: Comment now, in executeNew() method of commentActions class, t...
TITLE: symfony sfDoctrineRoute model question QUESTION: I couldn't understand completely how does the sfDoctrineRoute class works for example, i have the following route: Comment: class: sfDoctrineRouteCollection options: prefix_path::username/comment module: comment model: Comment now, in executeNew() method of comme...
[ "php", "symfony1" ]
0
0
381
1
0
2011-06-01T23:05:40.857000
2011-06-03T07:37:50.147000
6,208,752
6,208,849
Java, moving from desktop app to web app
I'm going to write my first Java based web app, and I'm sort of lost how to begin. Firstly, I would like a web app and a desktop app that do pretty much the same thing, without the hackish idea of embedding a web browser into the desktop app because that doesn't allow to easily make changes to the desktop without affec...
You should definitely use a framework as otherwise sooner or later you'll end up writing your own. If you use maven then simply typing mvn archetype:generate will give you a huge list of frameworks to choose from and it'll set up all of the scaffolding for you so you can just play with a few frameworks until you find t...
Java, moving from desktop app to web app I'm going to write my first Java based web app, and I'm sort of lost how to begin. Firstly, I would like a web app and a desktop app that do pretty much the same thing, without the hackish idea of embedding a web browser into the desktop app because that doesn't allow to easily ...
TITLE: Java, moving from desktop app to web app QUESTION: I'm going to write my first Java based web app, and I'm sort of lost how to begin. Firstly, I would like a web app and a desktop app that do pretty much the same thing, without the hackish idea of embedding a web browser into the desktop app because that doesn'...
[ "java", "desktop-application" ]
3
2
2,683
4
0
2011-06-01T23:07:02.840000
2011-06-01T23:22:16.020000
6,208,756
6,208,882
moving UIScrollView on rotate on the ipad
I have a multiview application and i have built a custom panelview controller to display panels with limited information about a product, the problem is that there should be 3 panels in portrait aspect and 4 in landscape. Due to the depth of view controllers (about 5) the didRotateFromInterfaceOrientation: event will n...
What you're looking for is UIView 's animateWithDuration: methods. You'll get the appropriate duration from willRotateToInterfaceOrientation:duration: in the view controller.
moving UIScrollView on rotate on the ipad I have a multiview application and i have built a custom panelview controller to display panels with limited information about a product, the problem is that there should be 3 panels in portrait aspect and 4 in landscape. Due to the depth of view controllers (about 5) the didRo...
TITLE: moving UIScrollView on rotate on the ipad QUESTION: I have a multiview application and i have built a custom panelview controller to display panels with limited information about a product, the problem is that there should be 3 panels in portrait aspect and 4 in landscape. Due to the depth of view controllers (...
[ "iphone", "ipad", "animation", "uiview", "xcode4" ]
0
1
258
1
0
2011-06-01T23:07:10.687000
2011-06-01T23:27:19.530000
6,208,758
6,208,773
how compilers detect overflow in numbers while compiling?
Compiler deal with source code as strings so in C++ for example when it encourage statement like unsigned char x = 150; it knows from type limits that unsigned char must be in range between 0 and 255. My question is while the number 150 remain string what algorithm compiler use to compare digit sequence - 150 in this c...
Compilers handle it pretty much the easiest possible way: they convert the number to an integer or float as appropriate. There's no law that says the compiler can't convert from strings to some other representation as appropriate. But now, consider your original problem; what about if you took the digits and just built...
how compilers detect overflow in numbers while compiling? Compiler deal with source code as strings so in C++ for example when it encourage statement like unsigned char x = 150; it knows from type limits that unsigned char must be in range between 0 and 255. My question is while the number 150 remain string what algori...
TITLE: how compilers detect overflow in numbers while compiling? QUESTION: Compiler deal with source code as strings so in C++ for example when it encourage statement like unsigned char x = 150; it knows from type limits that unsigned char must be in range between 0 and 255. My question is while the number 150 remain ...
[ "c++", "compiler-theory" ]
3
6
514
5
0
2011-06-01T23:07:30.130000
2011-06-01T23:09:50.500000
6,208,764
6,208,803
How do I troubleshoot "simplexml_load_file() parser error: Entity 'nbsp' not defined"?
I use PHP to generate XML files. I have use some code below to avoid error. $str = str_ireplace(array('<','>','&','\'','"'),array('<','>','&',''','"'),$str); but still cause fault. simplexml_load_file() [function.simplexml-load-file] *[file name]* parser error: Entity 'nbsp' not defined in *[file name] [line]* The erro...
is a HTML entity, but doesn't exist in XML. Either get rid of it (you're not saying where it comes from, so it's hard to give any more specific advice), or wrap your HTML data in CDATA blocks so the parser ignores them.
How do I troubleshoot "simplexml_load_file() parser error: Entity 'nbsp' not defined"? I use PHP to generate XML files. I have use some code below to avoid error. $str = str_ireplace(array('<','>','&','\'','"'),array('<','>','&',''','"'),$str); but still cause fault. simplexml_load_file() [function.simplexml-load-file]...
TITLE: How do I troubleshoot "simplexml_load_file() parser error: Entity 'nbsp' not defined"? QUESTION: I use PHP to generate XML files. I have use some code below to avoid error. $str = str_ireplace(array('<','>','&','\'','"'),array('<','>','&',''','"'),$str); but still cause fault. simplexml_load_file() [function.si...
[ "php", "xml", "symbols" ]
1
4
17,213
4
0
2011-06-01T23:08:13.323000
2011-06-01T23:14:33.180000
6,208,766
6,208,839
How do I make the html source formatting
How do I make the html source formatting in php Sample: 2. 4. 4. 2. 2. "; echo format_mixed_output($mixed_output);?> i want to be this: 2. 4. 4. 2. 2. i can't find source in net, please help me...
You can use " Tidy ". Example: http://www.php.net/manual/en/tidy.examples.basic.php Your example would be something like this: 2. 4. 4. 2. 2. "; $config = array( 'indent' => true, 'output-xml' => true, 'input-xml' => true, 'wrap' => '1000'); $tidy = new tidy(); $tidy->parseString($mixed_output, $config, 'utf8'); $tid...
How do I make the html source formatting How do I make the html source formatting in php Sample: 2. 4. 4. 2. 2. "; echo format_mixed_output($mixed_output);?> i want to be this: 2. 4. 4. 2. 2. i can't find source in net, please help me...
TITLE: How do I make the html source formatting QUESTION: How do I make the html source formatting in php Sample: 2. 4. 4. 2. 2. "; echo format_mixed_output($mixed_output);?> i want to be this: 2. 4. 4. 2. 2. i can't find source in net, please help me... ANSWER: You can use " Tidy ". Example: http://www.php.net/manu...
[ "php", "html", "formatting" ]
1
4
526
1
0
2011-06-01T23:09:00.140000
2011-06-01T23:20:28.663000
6,208,787
6,208,933
webmatrix c# and razor
I wanted to give a try to razor but there are not many tutorials on web; I've already tried this one, so better ask here. Can anyone please tell me how razor works? I mean are there any code behind pages or controls? and what is done in code behind pages if they exist? Also, how can I reference code behind pages? Gener...
I can't speak a whole lot to WebMatrix. But...are you familiar with ASP.NET MVC? Given what you're asking, it sounds like maybe you aren't. I would start with learning the basics of MVC first. I learned on the NerdDinner example http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx To a...
webmatrix c# and razor I wanted to give a try to razor but there are not many tutorials on web; I've already tried this one, so better ask here. Can anyone please tell me how razor works? I mean are there any code behind pages or controls? and what is done in code behind pages if they exist? Also, how can I reference c...
TITLE: webmatrix c# and razor QUESTION: I wanted to give a try to razor but there are not many tutorials on web; I've already tried this one, so better ask here. Can anyone please tell me how razor works? I mean are there any code behind pages or controls? and what is done in code behind pages if they exist? Also, how...
[ "c#", "asp.net", "razor", "webmatrix" ]
2
2
2,416
3
0
2011-06-01T23:11:42.043000
2011-06-01T23:36:28.720000
6,208,791
6,208,829
ProjectLocker and TortoiseGit
I am trying to setup ProjectLocker with TortoiseGit. I have followed all the steps needed but keep getting the following error when I try to push to the remote server Pushing to git-davidmz@pl3.projectlocker.com:gemscope.git ERROR:gitosis.serve.main:Arguments to command look dangerous fatal: The remote end hung up unex...
I would recommend connecting from the bash command line to troubleshoot. TortoiseGit relies on msysgit to be installed underneath. Further, use gitolite instead of gitosis as gitosis is no longer actively developed. Your issue is probably with what key you are presenting and how you set up your admin repository. Hope t...
ProjectLocker and TortoiseGit I am trying to setup ProjectLocker with TortoiseGit. I have followed all the steps needed but keep getting the following error when I try to push to the remote server Pushing to git-davidmz@pl3.projectlocker.com:gemscope.git ERROR:gitosis.serve.main:Arguments to command look dangerous fata...
TITLE: ProjectLocker and TortoiseGit QUESTION: I am trying to setup ProjectLocker with TortoiseGit. I have followed all the steps needed but keep getting the following error when I try to push to the remote server Pushing to git-davidmz@pl3.projectlocker.com:gemscope.git ERROR:gitosis.serve.main:Arguments to command l...
[ "git", "tortoisegit", "projectlocker" ]
1
0
1,040
1
0
2011-06-01T23:12:51.620000
2011-06-01T23:18:36.250000
6,208,792
6,208,811
Select users who have not signed up for an interview
I have two tables, interviews and users. inteviews looks like this: users looks like this: The id column in the user table will match the user column in the interviews table. How can I select all users that have not signed up for an interview? (E.g. something along the lines of "select * from interviews left join users...
You'd want all the users that does not have an entry in the interviews table: SELECT users.* FROM users LEFT JOIN interviews ON users.id = interviews.id WHERE interviews.id IS NULL (from the looks of the tables, it sounds like it's users.id that should be joined on interviews.user though)
Select users who have not signed up for an interview I have two tables, interviews and users. inteviews looks like this: users looks like this: The id column in the user table will match the user column in the interviews table. How can I select all users that have not signed up for an interview? (E.g. something along t...
TITLE: Select users who have not signed up for an interview QUESTION: I have two tables, interviews and users. inteviews looks like this: users looks like this: The id column in the user table will match the user column in the interviews table. How can I select all users that have not signed up for an interview? (E.g....
[ "mysql", "select", "join" ]
0
4
88
2
0
2011-06-01T23:13:07.920000
2011-06-01T23:15:56.003000
6,208,797
6,287,225
How to fix java OutOfMemoryError: Java heap space from DataImportHandler?
I am trying to import a large dataset (41million records) into a new Solr index. I have setup the core, it works, I inserted some test docs, they work. I have setup the data-config.xml as below and then I start the full-import. After about 12 hours! the import fails. The document size can get quite large, could the err...
Caused by: java.lang.OutOfMemoryError: Java heap space at java.lang.StringCoding$StringDecoder.decode(Unknown Source) at java.lang.StringCoding.decode(Unknown Source) at java.lang.String. (Unknown Source) at java.lang.String. (Unknown Source) at com.microsoft.sqlserver.jdbc.DDC.convertStreamToObject(DDC.java:419) makes...
How to fix java OutOfMemoryError: Java heap space from DataImportHandler? I am trying to import a large dataset (41million records) into a new Solr index. I have setup the core, it works, I inserted some test docs, they work. I have setup the data-config.xml as below and then I start the full-import. After about 12 hou...
TITLE: How to fix java OutOfMemoryError: Java heap space from DataImportHandler? QUESTION: I am trying to import a large dataset (41million records) into a new Solr index. I have setup the core, it works, I inserted some test docs, they work. I have setup the data-config.xml as below and then I start the full-import. ...
[ "java", "solr", "tomcat7" ]
15
8
9,168
5
0
2011-06-01T23:13:52.587000
2011-06-09T01:47:41.440000
6,208,808
6,208,976
Associations of Hierarchical Objects, belongs_to, has_many of Own Class
I'm trying to make objects belong to other objects of the same class by adding a parent_id attribute to the object so active record can associate them with each other in a hierarchical manner. I know I can just write an instance method to do a find and get them, but I want to know if there is a more rails appropriate w...
It seems that this gem may be of help: https://github.com/skyeagle/nested_set or acts_as_tree: https://github.com/rails/acts_as_tree
Associations of Hierarchical Objects, belongs_to, has_many of Own Class I'm trying to make objects belong to other objects of the same class by adding a parent_id attribute to the object so active record can associate them with each other in a hierarchical manner. I know I can just write an instance method to do a find...
TITLE: Associations of Hierarchical Objects, belongs_to, has_many of Own Class QUESTION: I'm trying to make objects belong to other objects of the same class by adding a parent_id attribute to the object so active record can associate them with each other in a hierarchical manner. I know I can just write an instance m...
[ "ruby-on-rails", "activerecord" ]
0
0
374
2
0
2011-06-01T23:15:31.400000
2011-06-01T23:42:49.213000
6,208,825
6,208,867
Hadamard pattern question
I am writing a program that displays Hadamard pattern using recursion. A 1-by-1 Hadamard pattern is a single black square. In general a 2N-by-2N Hadamard pattern is obtained by aligning 4 copies of the N-by-N pattern in the form of a 2-by-2 grid, and then inverting the colors of all the squares in the lower right N-by-...
Your code is not inverting the lower-right quadrant, it's simply forcing it to be white. I would say that the best solution is to add an extra parameter to your recursive method (let's call it b ), whose value can be true or false. You can then recurse as: hadamard(g, n-1, x, y, width/2, height/2, b); hadamard(g, n-1, ...
Hadamard pattern question I am writing a program that displays Hadamard pattern using recursion. A 1-by-1 Hadamard pattern is a single black square. In general a 2N-by-2N Hadamard pattern is obtained by aligning 4 copies of the N-by-N pattern in the form of a 2-by-2 grid, and then inverting the colors of all the square...
TITLE: Hadamard pattern question QUESTION: I am writing a program that displays Hadamard pattern using recursion. A 1-by-1 Hadamard pattern is a single black square. In general a 2N-by-2N Hadamard pattern is obtained by aligning 4 copies of the N-by-N pattern in the form of a 2-by-2 grid, and then inverting the colors...
[ "java", "recursion" ]
1
3
694
1
0
2011-06-01T23:17:52.130000
2011-06-01T23:25:15.347000
6,208,826
6,208,973
SimpleXML - How do I use an attribute as a selector?
Given this XML: Node 1 text Node 2 text XML;?> I would like to list the content of all of the of the fields. This is what I have. It fails with an error "member function xpath() on a non-object". // load xml file include 'xml/portfolio_xml.php'; $portfolio = simplexml_load_string($xml); foreach ($portfolio->xpath('//p...
You need to check that simple_xml_load_string succeeded. Its failing right now because $portfolio isnt an object. This is partially why i prefer using the real constructor instead of the function. I prefer to catch exceptions and handle errors that way: try { $portfolio = new SimpleXmlElement($xml); foreach ($portfoli...
SimpleXML - How do I use an attribute as a selector? Given this XML: Node 1 text Node 2 text XML;?> I would like to list the content of all of the of the fields. This is what I have. It fails with an error "member function xpath() on a non-object". // load xml file include 'xml/portfolio_xml.php'; $portfolio = simplexm...
TITLE: SimpleXML - How do I use an attribute as a selector? QUESTION: Given this XML: Node 1 text Node 2 text XML;?> I would like to list the content of all of the of the fields. This is what I have. It fails with an error "member function xpath() on a non-object". // load xml file include 'xml/portfolio_xml.php'; $po...
[ "php", "simplexml" ]
0
3
968
1
0
2011-06-01T23:17:56.720000
2011-06-01T23:42:13.823000
6,208,846
6,237,656
Transform or replace the jquery.ajax promise
I am hoping to transform the data returned by an ajax call and pass this to another plugin's constructor. I thought that if the plugin's options accepted an object for its data or a function that returned the data this would allow me to use a deferred object being jQuery.ajax. The rub is that I need to transform the da...
success returns the original Deferred object, not the new one. If you want to transform the data, you need deferred.pipe function shapeResults( rawData ) { return rawData.toUpperCase(); } function useTransformedData(data) { alert(data); } $.get( '/' ).pipe( shapeResults ).then( useTransformedData ); See jsFiddle. The...
Transform or replace the jquery.ajax promise I am hoping to transform the data returned by an ajax call and pass this to another plugin's constructor. I thought that if the plugin's options accepted an object for its data or a function that returned the data this would allow me to use a deferred object being jQuery.aja...
TITLE: Transform or replace the jquery.ajax promise QUESTION: I am hoping to transform the data returned by an ajax call and pass this to another plugin's constructor. I thought that if the plugin's options accepted an object for its data or a function that returned the data this would allow me to use a deferred objec...
[ "jquery", "ajax", "jquery-deferred" ]
4
3
840
1
0
2011-06-01T23:22:06.813000
2011-06-04T15:36:03.473000
6,208,847
6,208,912
Parsing date in JavaScript
When i enter the date and submit, the format of my date is \/06\/12\/1967 and i need in the below format to send my JSON. The Format Needed With the Slashes to be sent. /Date(1306348200000)/
Your date is pre 1970, so you should be able to take advantage of the negative number to represent dates before that. var str = '\/06\/12\/1967', date = new Date(str); str = '/Date(' + +date + ')/'; jsFiddle. If you need it in seconds as opposed to milliseconds, divide by 1000. If your date is in the European format ...
Parsing date in JavaScript When i enter the date and submit, the format of my date is \/06\/12\/1967 and i need in the below format to send my JSON. The Format Needed With the Slashes to be sent. /Date(1306348200000)/
TITLE: Parsing date in JavaScript QUESTION: When i enter the date and submit, the format of my date is \/06\/12\/1967 and i need in the below format to send my JSON. The Format Needed With the Slashes to be sent. /Date(1306348200000)/ ANSWER: Your date is pre 1970, so you should be able to take advantage of the negat...
[ "javascript" ]
1
2
210
1
0
2011-06-01T23:22:11.697000
2011-06-01T23:33:31.420000
6,208,850
6,215,474
Creating new entities while enabling injection
I have a method on a stateless session bean which creates a new instance of an entity and persists it. You might normally use new MyEntity() to create the object but I would like injection to populate some of the properties of the entity for me. I got partial success using @Inject @New private MyEntity myNewEntity; in ...
First of all - I have serious doubts that it's a good idea to use CDI to control the lifecycle of a Entity. See this quote from the documentation ( here ): According to this definition, JPA entities are technically managed beans. However, entities have their own special lifecycle, state and identity model and are usual...
Creating new entities while enabling injection I have a method on a stateless session bean which creates a new instance of an entity and persists it. You might normally use new MyEntity() to create the object but I would like injection to populate some of the properties of the entity for me. I got partial success using...
TITLE: Creating new entities while enabling injection QUESTION: I have a method on a stateless session bean which creates a new instance of an entity and persists it. You might normally use new MyEntity() to create the object but I would like injection to populate some of the properties of the entity for me. I got par...
[ "jpa", "ejb", "java-ee-6", "cdi" ]
1
2
1,153
2
0
2011-06-01T23:22:46.783000
2011-06-02T13:52:59.860000
6,208,859
6,209,307
IRC function dilemma
[EDIT] Sorry about the title being off. I was thinking of a different problem I was having, and accidentally crossed the two. Hi everyone, I'm writing my IRC bot skeleton in Python currently. To explain a couple things before I ask my question, I am writing a IRC bot complete with a plug-in system that will receive sig...
It sounds like you need to decide between or read up more on Publish/subscribe and Chain of Responsibility. Unfortunately I don't have much experience in this area. Just happened to read a related article recently.
IRC function dilemma [EDIT] Sorry about the title being off. I was thinking of a different problem I was having, and accidentally crossed the two. Hi everyone, I'm writing my IRC bot skeleton in Python currently. To explain a couple things before I ask my question, I am writing a IRC bot complete with a plug-in system ...
TITLE: IRC function dilemma QUESTION: [EDIT] Sorry about the title being off. I was thinking of a different problem I was having, and accidentally crossed the two. Hi everyone, I'm writing my IRC bot skeleton in Python currently. To explain a couple things before I ask my question, I am writing a IRC bot complete with...
[ "python", "recursion", "irc" ]
0
1
132
1
0
2011-06-01T23:24:03.303000
2011-06-02T00:45:32.293000
6,208,863
6,208,921
Get last clicked and stop function
I have a grid that when some cell is clicked, it blinks (thanks to cyclicFade jQuery plugin). I need to stop blink the cell when I click in another one. You can see the complete markup here. $(".color").click(function () { $("#colorPicker").show(); var number = $(this).attr('id').substr(1); var selected = $(this).attr(...
In your click handler add: $('.lastClicked').cyclicFade(stop); $('.lastClicked').removeClass('lastClicked'); $(this).addClass('lastClicked'); It should be enough. K
Get last clicked and stop function I have a grid that when some cell is clicked, it blinks (thanks to cyclicFade jQuery plugin). I need to stop blink the cell when I click in another one. You can see the complete markup here. $(".color").click(function () { $("#colorPicker").show(); var number = $(this).attr('id').subs...
TITLE: Get last clicked and stop function QUESTION: I have a grid that when some cell is clicked, it blinks (thanks to cyclicFade jQuery plugin). I need to stop blink the cell when I click in another one. You can see the complete markup here. $(".color").click(function () { $("#colorPicker").show(); var number = $(thi...
[ "jquery", "callback" ]
0
0
494
1
0
2011-06-01T23:24:52.193000
2011-06-01T23:34:17.090000