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,194,343
6,194,692
excel - rounding time to the nearest 15 minutes
I have a formula that computes the difference of several TIMES and multiplies it by 24 to get a decimal value for the total: D10=(C9-D9)*24 I would like to do special rounding like this: if D9 is 1pm and C9 is 2:08 pm, i would like D10 to be 1.25 another words 1:53 until 2:07 would be counted as 2 2:08 until 2:22 would...
Here is the formula that will partition out the difference as you wanted: =(TRUNC((D9+VALUE("00:07"))*96)-TRUNC((C9+VALUE("00:07"))*96))*VALUE("00:15")*24
excel - rounding time to the nearest 15 minutes I have a formula that computes the difference of several TIMES and multiplies it by 24 to get a decimal value for the total: D10=(C9-D9)*24 I would like to do special rounding like this: if D9 is 1pm and C9 is 2:08 pm, i would like D10 to be 1.25 another words 1:53 until ...
TITLE: excel - rounding time to the nearest 15 minutes QUESTION: I have a formula that computes the difference of several TIMES and multiplies it by 24 to get a decimal value for the total: D10=(C9-D9)*24 I would like to do special rounding like this: if D9 is 1pm and C9 is 2:08 pm, i would like D10 to be 1.25 another...
[ "excel", "vba", "worksheet-function" ]
4
4
10,007
4
0
2011-05-31T22:35:57.403000
2011-05-31T23:26:49.843000
6,194,346
6,194,369
Simplest way to provide "In progress"..."Done" notification?
I am not new to programming, but kind of rusty in Javascript/web development. I am building an application with Rails, and we have several time-consuming operations during which we want to provide feedback to the user. Basically, I want to do something like this using AJAX: [User clicks 'ok' or 'proceed'] [Optional con...
$(window).ajaxStart(function() { $("#loader").show(); }).ajaxStop(function() { $("#loader").hide(); }); Just globally bind to start and stop. This example shows and hides a loader div. Generally you have a div with a spinner in it letting the user know that it is loading. The disappearance of the spinner should be enou...
Simplest way to provide "In progress"..."Done" notification? I am not new to programming, but kind of rusty in Javascript/web development. I am building an application with Rails, and we have several time-consuming operations during which we want to provide feedback to the user. Basically, I want to do something like t...
TITLE: Simplest way to provide "In progress"..."Done" notification? QUESTION: I am not new to programming, but kind of rusty in Javascript/web development. I am building an application with Rails, and we have several time-consuming operations during which we want to provide feedback to the user. Basically, I want to d...
[ "javascript", "jquery", "ruby-on-rails", "ajax" ]
2
5
273
3
0
2011-05-31T22:36:33.637000
2011-05-31T22:39:55.273000
6,194,351
6,195,441
Do the CRM 4.0 Web Services force update of all entity fields even if they haven't changed
I have an application that i run daily to send contract updates to CRM from an external source. The process that I use is: Download all existing entities from CRM via a SQL query. Create an appropriate CRM entity object with all of the values populated Find the appropriate entry in the external source and update the ch...
Behind the scenes, I believe Microsoft CRM is using a SQL update for all of the attributes from the property bag that are not null. You can also turn on options to overwrite nulls. This sounds like a typical delta process. I will give advice on what I believe are the two best ways to go about it that I've seen with Mic...
Do the CRM 4.0 Web Services force update of all entity fields even if they haven't changed I have an application that i run daily to send contract updates to CRM from an external source. The process that I use is: Download all existing entities from CRM via a SQL query. Create an appropriate CRM entity object with all ...
TITLE: Do the CRM 4.0 Web Services force update of all entity fields even if they haven't changed QUESTION: I have an application that i run daily to send contract updates to CRM from an external source. The process that I use is: Download all existing entities from CRM via a SQL query. Create an appropriate CRM entit...
[ "dynamics-crm", "crm" ]
1
2
729
1
0
2011-05-31T22:37:26.100000
2011-06-01T01:50:25.630000
6,194,364
6,194,377
search certain characters in an if statement
.what i want to do is search for certain Initials inside a retrieved record from a database. for example i have a record like this.. "SGA, MNFA, JGA" how do I code an If statement that will search if SGA is present inside the record. If it is found then proceed, if not, then an else statement will be performed. sample:...
if (strpos($fieldFromDatabase,'SGA')!==false) { } else { } If you need case insenstive you can use stripos php>5.0
search certain characters in an if statement .what i want to do is search for certain Initials inside a retrieved record from a database. for example i have a record like this.. "SGA, MNFA, JGA" how do I code an If statement that will search if SGA is present inside the record. If it is found then proceed, if not, then...
TITLE: search certain characters in an if statement QUESTION: .what i want to do is search for certain Initials inside a retrieved record from a database. for example i have a record like this.. "SGA, MNFA, JGA" how do I code an If statement that will search if SGA is present inside the record. If it is found then pro...
[ "php" ]
0
1
90
1
0
2011-05-31T22:39:22.683000
2011-05-31T22:41:13.067000
6,194,371
6,194,673
Wordpress Multisite Rewrite Rules
I am running Wordpress 3.1 with multisite enabled. I have multiple websites all sharing the same.htaccess file in the web root directory. I am using RewriteCond to target specific websites and apply RewriteRules to each site. Unfortunately it is not working as expected. Here is what I have in my.htaccess file: RewriteE...
From Apache page The order of rules in the ruleset is important because the rewrite engine processes them in a particular (not always obvious) order, as follows: The rewrite engine loops through the rulesets (each ruleset being made up of RewriteRule directives, with or without RewriteConds), rule by rule. When a parti...
Wordpress Multisite Rewrite Rules I am running Wordpress 3.1 with multisite enabled. I have multiple websites all sharing the same.htaccess file in the web root directory. I am using RewriteCond to target specific websites and apply RewriteRules to each site. Unfortunately it is not working as expected. Here is what I ...
TITLE: Wordpress Multisite Rewrite Rules QUESTION: I am running Wordpress 3.1 with multisite enabled. I have multiple websites all sharing the same.htaccess file in the web root directory. I am using RewriteCond to target specific websites and apply RewriteRules to each site. Unfortunately it is not working as expecte...
[ "wordpress", "mod-rewrite" ]
1
2
2,614
1
0
2011-05-31T22:39:58.113000
2011-05-31T23:24:09.760000
6,194,386
6,194,411
Search through git revisions for method call
We have a function in our code which isn't being called, but should be. We know it was being called in a version of our software released about 2 years ago. So at some point in the past few thousand revisions of our code (in a git repository), this function call was removed, and we need to know when this was. Is there ...
You can use the Git "pickaxe": git log -SYourFunctionName This will show revisions where text containing YourFunctionName was either added or removed.
Search through git revisions for method call We have a function in our code which isn't being called, but should be. We know it was being called in a version of our software released about 2 years ago. So at some point in the past few thousand revisions of our code (in a git repository), this function call was removed,...
TITLE: Search through git revisions for method call QUESTION: We have a function in our code which isn't being called, but should be. We know it was being called in a version of our software released about 2 years ago. So at some point in the past few thousand revisions of our code (in a git repository), this function...
[ "git", "source-control-explorer" ]
4
7
272
1
0
2011-05-31T22:42:50.897000
2011-05-31T22:46:47.270000
6,194,395
6,194,732
How do you initialize a NSCollectionViewItem?
I am trying to setup an NSCollectionView that has custom drawing in the individual NSCollectionViewItem views. I have an image that I need to draw in each view, but I cannot link the view back to the NSCollectionViewItem subclass in Interface Builder. Is there an init method I can use with my NSCollectionViewItem in or...
I found this documentation - NSCollectionViewItem class What I found there shows setting a reference like so: Setting the Represented Object – representedObject Available in Mac OS X v10.5 through Mac OS X v10.5 – setRepresentedObject: Available in Mac OS X v10.5 through Mac OS X v10.5 Your sample: -(void)setSelected:...
How do you initialize a NSCollectionViewItem? I am trying to setup an NSCollectionView that has custom drawing in the individual NSCollectionViewItem views. I have an image that I need to draw in each view, but I cannot link the view back to the NSCollectionViewItem subclass in Interface Builder. Is there an init metho...
TITLE: How do you initialize a NSCollectionViewItem? QUESTION: I am trying to setup an NSCollectionView that has custom drawing in the individual NSCollectionViewItem views. I have an image that I need to draw in each view, but I cannot link the view back to the NSCollectionViewItem subclass in Interface Builder. Is t...
[ "cocoa", "nsview", "nscollectionview", "nscollectionviewitem" ]
2
1
2,769
2
0
2011-05-31T22:44:37.017000
2011-05-31T23:32:26.090000
6,194,397
6,194,540
Route works in application, fails in Cucumber test
I have a route that works (recognized, can follow it) in a Rails 3 application, but fails in the Cucumber test: routes.rb: resources:tests do member do post 'start' end end Working link in application: =button_to 'Start', start_test_path(@test) Gherkin step: And I am on the test start page for "Sample Test" Failing in ...
The reason is that 'start' is a post action, not a get action. When you use the I am on the... cucumber step you are generating a get request, not a post request. To fix this, simply press the button in Cucumber, instead of visiting the direct path. This can be done with the press cucumber step, like this: When I press...
Route works in application, fails in Cucumber test I have a route that works (recognized, can follow it) in a Rails 3 application, but fails in the Cucumber test: routes.rb: resources:tests do member do post 'start' end end Working link in application: =button_to 'Start', start_test_path(@test) Gherkin step: And I am o...
TITLE: Route works in application, fails in Cucumber test QUESTION: I have a route that works (recognized, can follow it) in a Rails 3 application, but fails in the Cucumber test: routes.rb: resources:tests do member do post 'start' end end Working link in application: =button_to 'Start', start_test_path(@test) Gherki...
[ "ruby-on-rails", "routes", "cucumber" ]
1
2
708
2
0
2011-05-31T22:45:15.150000
2011-05-31T23:03:20.153000
6,194,398
6,197,271
Mathematica large table periodic interpolation
I have a very large table in Mathematica ((dimcub-1)^3 elements) coming from an inverse FFT. I need to use periodic interpolation on this table. Since periodic interpolation requires that the first elements and last elements are equal, I create a new table of dim^3 elements manually and use that in my interpolation. It...
Thanks for all the answers. I tried the suggestion by leonid but when I print my oldtable, it was still (dimcub -1)^3 dimensional. New elements were defined and I can see them individually but they do not show up as part of the oldtable when I print the whole table. So I ended up with something similar which is doing e...
Mathematica large table periodic interpolation I have a very large table in Mathematica ((dimcub-1)^3 elements) coming from an inverse FFT. I need to use periodic interpolation on this table. Since periodic interpolation requires that the first elements and last elements are equal, I create a new table of dim^3 element...
TITLE: Mathematica large table periodic interpolation QUESTION: I have a very large table in Mathematica ((dimcub-1)^3 elements) coming from an inverse FFT. I need to use periodic interpolation on this table. Since periodic interpolation requires that the first elements and last elements are equal, I create a new tabl...
[ "wolfram-mathematica", "interpolation" ]
8
4
666
4
0
2011-05-31T22:45:23.370000
2011-06-01T06:45:47.960000
6,194,403
6,194,529
LINQ to Entities does not support the method...System.Object CompareObjectEqual
When I execute the code below I receive the error message: LINQ to Entities does not recognize the method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this method cannot be translated into a store expression. It seems to be occurring on the line For Each row2 in PCstudent. Prote...
First of all you're doing things the most difficult way possible (row by row update in code) instead of single update to the database; that said, nothing looks incorrect on the surface of things. You might check the definition of 'dbPC.Residencies' to make sure it's defined correctly, and you may need to put an "if (PC...
LINQ to Entities does not support the method...System.Object CompareObjectEqual When I execute the code below I receive the error message: LINQ to Entities does not recognize the method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this method cannot be translated into a store ex...
TITLE: LINQ to Entities does not support the method...System.Object CompareObjectEqual QUESTION: When I execute the code below I receive the error message: LINQ to Entities does not recognize the method 'System.Object CompareObjectEqual(System.Object, System.Object, Boolean)' method, and this method cannot be translat...
[ "asp.net", "vb.net", "entity-framework", "entity-framework-4", "linq-to-entities" ]
0
1
2,386
1
0
2011-05-31T22:45:47.567000
2011-05-31T23:01:43.810000
6,194,404
6,194,428
Post request using CURL
Possible Duplicate: Post data and retrieve the response using PHP Curl? I want to make a number of POST requests (about 1000) to read data from a webpage which accepts post requests.I am aware about the implementing CURL through GET, but not through POST. So, please help me in this. Thanks in advance...:)
Did you look at the documentation? Basically, just do a curl_setopt() $ch = curl_init(); curl_setopt($ch, CURLOPT_POST);
Post request using CURL Possible Duplicate: Post data and retrieve the response using PHP Curl? I want to make a number of POST requests (about 1000) to read data from a webpage which accepts post requests.I am aware about the implementing CURL through GET, but not through POST. So, please help me in this. Thanks in ad...
TITLE: Post request using CURL QUESTION: Possible Duplicate: Post data and retrieve the response using PHP Curl? I want to make a number of POST requests (about 1000) to read data from a webpage which accepts post requests.I am aware about the implementing CURL through GET, but not through POST. So, please help me in ...
[ "php", "ajax", "post", "curl" ]
0
5
1,435
3
0
2011-05-31T22:45:53.260000
2011-05-31T22:49:18.220000
6,194,407
6,194,474
Can I databind to an asp.net Image control?
I have a listview that is setup like so: " Visible="false" /> -<%# Eval("ID") %>" title="<%# Eval("HelpText") %>"><%# Eval("Title") %> When I have the " Visible="false" /> portion in there it errors out with: The server tag is not well formed. If I change it to: It renders fine. What would cause this to happen?
In ASP.NET controls the Eval statement go in between single quotes no double quotes:
Can I databind to an asp.net Image control? I have a listview that is setup like so: " Visible="false" /> -<%# Eval("ID") %>" title="<%# Eval("HelpText") %>"><%# Eval("Title") %> When I have the " Visible="false" /> portion in there it errors out with: The server tag is not well formed. If I change it to: It renders fi...
TITLE: Can I databind to an asp.net Image control? QUESTION: I have a listview that is setup like so: " Visible="false" /> -<%# Eval("ID") %>" title="<%# Eval("HelpText") %>"><%# Eval("Title") %> When I have the " Visible="false" /> portion in there it errors out with: The server tag is not well formed. If I change it...
[ "asp.net", "image", "data-binding" ]
1
3
3,162
1
0
2011-05-31T22:46:19.590000
2011-05-31T22:54:47.863000
6,194,408
6,258,553
NHibernate / MVC lazy loading failing with "session closed or no session"
I'm using NHibernate behind my ASP.NET MVC application and I've come across a frustrating problem when trying to save an object via an AJAX call. I am getting the usual: Failed to lazily initialize a collection of role: [type] no session or session was closed The problem is, as far as I can tell the session is not clos...
I finally discovered the reason for this error, but only by dumb luck. I'll post the resolution in case it helps someone, but I can't really offer any explanation why and will probably post a new question to see if someone can clear the air. You'll note in my code I was calling my service like this: var user = svc.Find...
NHibernate / MVC lazy loading failing with "session closed or no session" I'm using NHibernate behind my ASP.NET MVC application and I've come across a frustrating problem when trying to save an object via an AJAX call. I am getting the usual: Failed to lazily initialize a collection of role: [type] no session or sessi...
TITLE: NHibernate / MVC lazy loading failing with "session closed or no session" QUESTION: I'm using NHibernate behind my ASP.NET MVC application and I've come across a frustrating problem when trying to save an object via an AJAX call. I am getting the usual: Failed to lazily initialize a collection of role: [type] n...
[ "asp.net-mvc", "nhibernate" ]
3
1
2,394
3
0
2011-05-31T22:46:20.907000
2011-06-06T22:03:20.947000
6,194,410
6,194,551
Pl/SQL - oracle 9i
We have a table customer and table car. customer table is defined as: cust#, transaction# car table is defined as: transaction#, car model# car model# can be either nissan, toyota or honda. what we need to find out is how many distinct customer have bought a honda but not a nissan. there can be multiple records for car...
Try this: SELECT COUNT(DISTINCT cust#) FROM customer a, car b WHERE a.transaction# = b.transaction# AND b.model# = 'HONDA' AND NOT EXISTS ( SELECT 1 FROM customer c, car d WHERE c.transaction# = d.transaction# AND d.model# = 'NISSAN' AND c.cust# = a.cust# )
Pl/SQL - oracle 9i We have a table customer and table car. customer table is defined as: cust#, transaction# car table is defined as: transaction#, car model# car model# can be either nissan, toyota or honda. what we need to find out is how many distinct customer have bought a honda but not a nissan. there can be multi...
TITLE: Pl/SQL - oracle 9i QUESTION: We have a table customer and table car. customer table is defined as: cust#, transaction# car table is defined as: transaction#, car model# car model# can be either nissan, toyota or honda. what we need to find out is how many distinct customer have bought a honda but not a nissan. ...
[ "sql", "plsql", "oracle9i" ]
1
1
99
2
0
2011-05-31T22:46:38.953000
2011-05-31T23:04:56.353000
6,194,412
6,194,443
php checking cookie to set another cookie
i'm setting a cookie using this code: setcookie("Blah","user",time()+86400); i'm then checking that cookie on another page and setting another cookie, then redirecting to another page if (isset($_COOKIE["Blah"])) { setcookie("Demo","user",time()+86400); } $url="cd/bar/home.php" header ("Location: $URL"); however, when ...
From the manual page for setcookie: The default value [of the $path argument] is the current directory that the cookie is being set in. So the cookie is only being set with the /fu/ path. If you want to set it to the global path, say so explicitly: setcookie("Demo","user",time()+86400, '/');
php checking cookie to set another cookie i'm setting a cookie using this code: setcookie("Blah","user",time()+86400); i'm then checking that cookie on another page and setting another cookie, then redirecting to another page if (isset($_COOKIE["Blah"])) { setcookie("Demo","user",time()+86400); } $url="cd/bar/home.php"...
TITLE: php checking cookie to set another cookie QUESTION: i'm setting a cookie using this code: setcookie("Blah","user",time()+86400); i'm then checking that cookie on another page and setting another cookie, then redirecting to another page if (isset($_COOKIE["Blah"])) { setcookie("Demo","user",time()+86400); } $url...
[ "php", "redirect", "cookies" ]
2
2
253
1
0
2011-05-31T22:46:49.230000
2011-05-31T22:51:56.867000
6,194,416
6,224,754
How to add javascript to joomla module?
Hi I have problem with adding javascript into a joomla module..I've found some solution, but it's not working.. $document = &JFactory::getDocument(); $document->addScript("/career.js"); These two lines I have in my module, but the script isn't in rendered site.. The file is in root of my web (for test purposes only). T...
Ouch..The main problem is, that I am loading the page containing custom module with javascript is loaded via ajax..And all the plugins seems to be adding the js code into head and I only replace some elements into body of my page. exist some solution to this problem?I know I can have all the js logic into one file, but...
How to add javascript to joomla module? Hi I have problem with adding javascript into a joomla module..I've found some solution, but it's not working.. $document = &JFactory::getDocument(); $document->addScript("/career.js"); These two lines I have in my module, but the script isn't in rendered site.. The file is in ro...
TITLE: How to add javascript to joomla module? QUESTION: Hi I have problem with adding javascript into a joomla module..I've found some solution, but it's not working.. $document = &JFactory::getDocument(); $document->addScript("/career.js"); These two lines I have in my module, but the script isn't in rendered site.....
[ "javascript", "joomla", "joomla-extensions" ]
3
0
20,777
8
0
2011-05-31T22:47:04.430000
2011-06-03T08:31:46.657000
6,194,419
6,194,717
Extract link of background, jsoup
I have a problem with extract link from HTML of the following nature, using jsoup.
This is how I'd do it. import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class JSoup { public static void main(String[] args) { String html = " "; Document doc = Jsoup.parse( html ); Elements elements = doc.getElementsByClass("post_video"...
Extract link of background, jsoup I have a problem with extract link from HTML of the following nature, using jsoup.
TITLE: Extract link of background, jsoup QUESTION: I have a problem with extract link from HTML of the following nature, using jsoup. ANSWER: This is how I'd do it. import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; public class JSoup { public s...
[ "java", "background-image", "jsoup" ]
3
6
2,717
1
0
2011-05-31T22:47:15.870000
2011-05-31T23:30:49.630000
6,194,424
6,194,481
copying part of the char array to a string in c
I have read many suggested questions, but still cannot find out the answer. I know the content in buffer is a NULL terminated char array, and I want to copy it into a dynamic allocated char array. However, I kept getting segmentation fault from the strcpy function. Thanks for any help. void myFunction() { char buffer[2...
Your invocation of strcpy(3) is incorrect. Change it to the following: buffer[199] = '\0'; strcpy(message, &buffer[1]); strcpy(3) has the following signature: char * stpcpy(char *s1, const char *s2); You passed in: char *stpcpy(char *s1, const char s2); /* won't work */ I would suggest using memcpy(3) instead of strcpy...
copying part of the char array to a string in c I have read many suggested questions, but still cannot find out the answer. I know the content in buffer is a NULL terminated char array, and I want to copy it into a dynamic allocated char array. However, I kept getting segmentation fault from the strcpy function. Thanks...
TITLE: copying part of the char array to a string in c QUESTION: I have read many suggested questions, but still cannot find out the answer. I know the content in buffer is a NULL terminated char array, and I want to copy it into a dynamic allocated char array. However, I kept getting segmentation fault from the strcp...
[ "c", "string", "segmentation-fault", "arrays" ]
2
1
5,550
2
0
2011-05-31T22:48:46.537000
2011-05-31T22:55:35.053000
6,194,425
6,194,441
How to add the checked="checked" attribute to the output of .html() method
There must be something special about the checked attribute of a checkbox either at the jQuery level or the DOM level. With this HTML: And this JavaScript: $(function() { $("#cb").attr("checked","checked"); alert("Expecting this HTML fragment to have a 'checked' attribute:\n\n" + $("body").html()); }); I'm not gettin...
Update to jQuery 1.6. There have been some significant changes to attr in 1.6/1.6.1.
How to add the checked="checked" attribute to the output of .html() method There must be something special about the checked attribute of a checkbox either at the jQuery level or the DOM level. With this HTML: And this JavaScript: $(function() { $("#cb").attr("checked","checked"); alert("Expecting this HTML fragment t...
TITLE: How to add the checked="checked" attribute to the output of .html() method QUESTION: There must be something special about the checked attribute of a checkbox either at the jQuery level or the DOM level. With this HTML: And this JavaScript: $(function() { $("#cb").attr("checked","checked"); alert("Expecting th...
[ "jquery", "html", "checkbox", "attr" ]
3
4
285
1
0
2011-05-31T22:48:48.177000
2011-05-31T22:51:52.950000
6,194,449
6,194,555
Converting bitmap from ARGB1555 to RGB8888
Having a bit of a brain fart right now, but I'm needing help converting an image from ARGB1555 to RGB8888. I already have the loop that goes through each of the pixels (reads u16s from a file essentially), and I would like to store them as a u32 instead. I'd suppose I would just use some binary operator to get the 2-6,...
You didnt state what language you are writing it in but here is a C++ function for it: It takes the 16 bit integer in ARGB1555 and returns a 32 bit integer in ARGB8888 unsigned int ARGB1555toARGB8888(unsigned short c) { const unsigned int a = c&0x8000, r = c&0x7C00, g = c&0x03E0, b = c&0x1F; const unsigned int rgb = (r...
Converting bitmap from ARGB1555 to RGB8888 Having a bit of a brain fart right now, but I'm needing help converting an image from ARGB1555 to RGB8888. I already have the loop that goes through each of the pixels (reads u16s from a file essentially), and I would like to store them as a u32 instead. I'd suppose I would ju...
TITLE: Converting bitmap from ARGB1555 to RGB8888 QUESTION: Having a bit of a brain fart right now, but I'm needing help converting an image from ARGB1555 to RGB8888. I already have the loop that goes through each of the pixels (reads u16s from a file essentially), and I would like to store them as a u32 instead. I'd ...
[ "image-processing", "bitmap" ]
1
2
3,289
1
0
2011-05-31T22:52:30.420000
2011-05-31T23:05:15.463000
6,194,451
6,204,923
lua - table maintenance (particle system related)
The update() function below gets called on every frame of a game. If the Drop particle has y value greater than 160 I want to remove it from the table. The problem is that I get "attempt to compare number with nil" errors, on the line notated below: local particles = {}; function update() local num = math.random(1,10)...
Thanks for the answers, they were all helpful. Here is what ended up working for me. The table.remove call is necessary to keep the loop running properly. for i = #particles, 1, -1 do if particles[i].y > 160 then local child = table.remove(particles, i) if child ~= nil then display.remove(child) child = nil end end end
lua - table maintenance (particle system related) The update() function below gets called on every frame of a game. If the Drop particle has y value greater than 160 I want to remove it from the table. The problem is that I get "attempt to compare number with nil" errors, on the line notated below: local particles = {}...
TITLE: lua - table maintenance (particle system related) QUESTION: The update() function below gets called on every frame of a game. If the Drop particle has y value greater than 160 I want to remove it from the table. The problem is that I get "attempt to compare number with nil" errors, on the line notated below: lo...
[ "lua", "coronasdk", "lua-table", "particles" ]
2
3
1,058
4
0
2011-05-31T22:52:38.190000
2011-06-01T16:59:42.293000
6,194,454
6,194,493
How come I am getting different responses on browser than the server
Here is an example website http://us.blizzard.com/store/browse.xml?f=c:5,c:33 When I inspect the response in Firefox it is application/xhtml When I make a request to the same url server side with the following headers var request = (HttpWebRequest)WebRequest.Create(url); var cookieContainer = new CookieContainer(); re...
Try including Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 to your request. request.Accept = @"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; EDIT: Try to replicate the request from Firefox. I tried this (I used chrome + chrome dev tools to get the headers) request.CookieCon...
How come I am getting different responses on browser than the server Here is an example website http://us.blizzard.com/store/browse.xml?f=c:5,c:33 When I inspect the response in Firefox it is application/xhtml When I make a request to the same url server side with the following headers var request = (HttpWebRequest)Web...
TITLE: How come I am getting different responses on browser than the server QUESTION: Here is an example website http://us.blizzard.com/store/browse.xml?f=c:5,c:33 When I inspect the response in Firefox it is application/xhtml When I make a request to the same url server side with the following headers var request = (...
[ "c#", "asp.net" ]
2
4
101
1
0
2011-05-31T22:52:58.253000
2011-05-31T22:56:27.537000
6,194,462
6,194,677
How to specify a typeclass instance?
I have a (fairly) legitimate case where there are two type instance implementations, and I want to specify a default one. After noting that doing modular arithmetic with Int types resulted in lots of hash collisions, I want to try GHC's Int64. I have the following code: class Hashable64 a where hash64:: a -> Int64 ins...
This sort of situation is handled by GHC's OverlappingInstances extension. Roughly speaking, this extension allows instances to coexist despite the existence of some type(s) to which both could apply. For such types, GHC will select the "most specific" instance, which is a little fuzzy in some cases but usually does wh...
How to specify a typeclass instance? I have a (fairly) legitimate case where there are two type instance implementations, and I want to specify a default one. After noting that doing modular arithmetic with Int types resulted in lots of hash collisions, I want to try GHC's Int64. I have the following code: class Hashab...
TITLE: How to specify a typeclass instance? QUESTION: I have a (fairly) legitimate case where there are two type instance implementations, and I want to specify a default one. After noting that doing modular arithmetic with Int types resulted in lots of hash collisions, I want to try GHC's Int64. I have the following ...
[ "haskell", "instance", "typeclass" ]
5
6
1,760
1
0
2011-05-31T22:53:33.883000
2011-05-31T23:24:54.377000
6,194,466
6,195,408
Large substrings ~9000x faster in Firefox than Chrome: why?
The Benchmark: http://jsperf.com/substringing So, I'm starting up my very first HTML5 browser-based client-side project. It's going to have to parse very, very large text files into, essentially, an array or arrays of objects. I know how I'm going to go about coding it; my primary concern right now is getting the parse...
In the case of Spidermonkey (the JS engine in Firefox), a substring() call just creates a new "dependent string": a string object that stores a pointer to the thing it's a substring off and the start and end offsets. This is precisely to make substring() fast, and is an obvious optimization given immutable strings. As ...
Large substrings ~9000x faster in Firefox than Chrome: why? The Benchmark: http://jsperf.com/substringing So, I'm starting up my very first HTML5 browser-based client-side project. It's going to have to parse very, very large text files into, essentially, an array or arrays of objects. I know how I'm going to go about ...
TITLE: Large substrings ~9000x faster in Firefox than Chrome: why? QUESTION: The Benchmark: http://jsperf.com/substringing So, I'm starting up my very first HTML5 browser-based client-side project. It's going to have to parse very, very large text files into, essentially, an array or arrays of objects. I know how I'm ...
[ "javascript", "performance", "google-chrome", "firefox", "jsperf" ]
20
17
1,089
2
0
2011-05-31T22:53:45.227000
2011-06-01T01:43:45.130000
6,194,469
6,197,744
Extracting multi-valued attribute from LDAP groupOfUniqueNames
I'm trying to read all members who belong to group defined in LDAP as groupOfUniqueNames. String url = "ldap://blah.blah.address:389/dc=foo,dc=bar"; Hashtable env = new Hashtable (); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, url); DirContext ctx = new I...
I managed to solve this issue using JLDAP LDAPConnection conn = new LDAPConnection(); conn.connect("blah.blah.address", 389); String[] attrIDs = {"uniqueMember"}; LDAPSearchResults search = conn.search("dc=foo,dc=bar", LDAPConnection.SCOPE_ONE, "cn=testgroup", attrIDs, false); while(search.hasMore()) { LDAPEntry entr...
Extracting multi-valued attribute from LDAP groupOfUniqueNames I'm trying to read all members who belong to group defined in LDAP as groupOfUniqueNames. String url = "ldap://blah.blah.address:389/dc=foo,dc=bar"; Hashtable env = new Hashtable (); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory...
TITLE: Extracting multi-valued attribute from LDAP groupOfUniqueNames QUESTION: I'm trying to read all members who belong to group defined in LDAP as groupOfUniqueNames. String url = "ldap://blah.blah.address:389/dc=foo,dc=bar"; Hashtable env = new Hashtable (); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.l...
[ "java", "ldap" ]
1
4
10,256
1
0
2011-05-31T22:53:58.267000
2011-06-01T07:34:50.420000
6,194,470
6,194,996
Replacing the output of one method into the output of another method
So I have this method that should read a file and detect if the character after the symbol is a number or a word. If it is a number, I want to delete the symbol in front of it, translate the number into binary and replace it in the file. If it is a word, I want to set the characters to number 16 at first, but then, if ...
I don't quite understand the logic. If you are simply trying to replace all the @ symbols in order, why not read all the numbers into a List in order, until you see an @ symbol. Then you can start replacing them in order from that List (or Queue since you want first in first out). Does that satisfy your requirements? I...
Replacing the output of one method into the output of another method So I have this method that should read a file and detect if the character after the symbol is a number or a word. If it is a number, I want to delete the symbol in front of it, translate the number into binary and replace it in the file. If it is a wo...
TITLE: Replacing the output of one method into the output of another method QUESTION: So I have this method that should read a file and detect if the character after the symbol is a number or a word. If it is a number, I want to delete the symbol in front of it, translate the number into binary and replace it in the f...
[ "java", "file", "replace" ]
0
1
105
1
0
2011-05-31T22:54:04.897000
2011-06-01T00:23:45.767000
6,194,472
6,211,738
Scramble a floating point number?
I need a repeatable pseudo-random function from floats in [0,1] to floats in [0,1]. I.e. given a 32-bit IEEE float, return a "different" one (as random as possible, given the 24 bits of mantissa). It has to be repeatable, so keeping tons of internal state is out. And unfortunately it has to work with only 32-bit int an...
Best I understand the requirements, a hash accomplishes the desired functionality. Re-interprete the float input as an integer, apply the hash function to produce an integer approximately uniformly distributed in [0,2^32), then multiply this integer by 2^-32 to convert the resulting integer back to a float roughly unif...
Scramble a floating point number? I need a repeatable pseudo-random function from floats in [0,1] to floats in [0,1]. I.e. given a 32-bit IEEE float, return a "different" one (as random as possible, given the 24 bits of mantissa). It has to be repeatable, so keeping tons of internal state is out. And unfortunately it h...
TITLE: Scramble a floating point number? QUESTION: I need a repeatable pseudo-random function from floats in [0,1] to floats in [0,1]. I.e. given a 32-bit IEEE float, return a "different" one (as random as possible, given the 24 bits of mantissa). It has to be repeatable, so keeping tons of internal state is out. And ...
[ "c", "random", "cuda", "scramble" ]
4
3
663
3
0
2011-05-31T22:54:16.193000
2011-06-02T07:34:17.117000
6,194,477
6,194,572
How can I migrate a temp table using LINQ to SQL?
I have two tables: contacts and contact_temps. The contact_temps table mirrors the contacts table. What I'm trying to do is simply pull records from the temp table and insert them into contacts. Afterwards I will remove those records from the contact_temps table. The code below only migrates one record and doesn't dele...
I wonder if your "Insert All on Submit" is causing the entities to become associated with db.contacts. Try this. // migrate temp profile(s)... var tempProfiles = from ct in db.contact_temps where ct.SessionKey == contact.Profile.SessionId select ct; foreach (var c in tempProfiles) { Contact newC = new Contact(); newC....
How can I migrate a temp table using LINQ to SQL? I have two tables: contacts and contact_temps. The contact_temps table mirrors the contacts table. What I'm trying to do is simply pull records from the temp table and insert them into contacts. Afterwards I will remove those records from the contact_temps table. The co...
TITLE: How can I migrate a temp table using LINQ to SQL? QUESTION: I have two tables: contacts and contact_temps. The contact_temps table mirrors the contacts table. What I'm trying to do is simply pull records from the temp table and insert them into contacts. Afterwards I will remove those records from the contact_t...
[ "c#", "linq", "linq-to-sql" ]
0
0
682
2
0
2011-05-31T22:54:55.350000
2011-05-31T23:08:04.283000
6,194,479
6,195,004
Regex for matching "non-javadoc" comment in Eclipse
I'm trying to write a regular expression that matches the (non-javadoc) comments in the format /* * (non-javadoc) * * some other comment here * */ So far I have (?s)/\*\R.*?non-Javadoc.*?\*/, but that is actually matching too much. I have a header at the top of my file that is something like /* * header text */ public ...
This should do it: (?s)/\*[^*](?:(?!\*/).)*\(non-javadoc\)(?:(?!\*/).)*\*/ /\*[^*] matches the beginning of a C-style comment ( /* */ ) but not a JavaDoc comment ( /** */ ) (?!\*/). matches any single character unless it's the beginning of a */ sequence. Searching for (?:(?!\*/).)* instead of.*? makes it impossible for...
Regex for matching "non-javadoc" comment in Eclipse I'm trying to write a regular expression that matches the (non-javadoc) comments in the format /* * (non-javadoc) * * some other comment here * */ So far I have (?s)/\*\R.*?non-Javadoc.*?\*/, but that is actually matching too much. I have a header at the top of my fil...
TITLE: Regex for matching "non-javadoc" comment in Eclipse QUESTION: I'm trying to write a regular expression that matches the (non-javadoc) comments in the format /* * (non-javadoc) * * some other comment here * */ So far I have (?s)/\*\R.*?non-Javadoc.*?\*/, but that is actually matching too much. I have a header at...
[ "regex", "eclipse", "javadoc", "replace", "multiline" ]
10
11
2,060
2
0
2011-05-31T22:55:17.673000
2011-06-01T00:24:59.960000
6,194,482
6,194,510
How can I put subclasses from the same baseclass into a list?
How can I put subclasses from the same baseclass into a list? I´m working with ASP.NET MVC3 and have created a basemodel-class with properties like name, age and so on. Now i have created submodels (subclasses) with more details. To easily handle the subclasses i want a list with the objects in it but how? I have read ...
Just create the list so it's of the base class: List myList = new List (); then add your subclass objects as normal: myList.Add(new SubClass1()); myList.Add(new SubClass2()); etc. where: public class SubClass1: BaseClass {} public class SubClass2: BaseClass {} Then when you get them out you can use the is and as operat...
How can I put subclasses from the same baseclass into a list? How can I put subclasses from the same baseclass into a list? I´m working with ASP.NET MVC3 and have created a basemodel-class with properties like name, age and so on. Now i have created submodels (subclasses) with more details. To easily handle the subclas...
TITLE: How can I put subclasses from the same baseclass into a list? QUESTION: How can I put subclasses from the same baseclass into a list? I´m working with ASP.NET MVC3 and have created a basemodel-class with properties like name, age and so on. Now i have created submodels (subclasses) with more details. To easily ...
[ "c#", "asp.net-mvc-3", "subclass" ]
4
3
3,309
2
0
2011-05-31T22:55:46.273000
2011-05-31T22:58:49.473000
6,194,484
6,194,564
Getting popup inside of fixed-width container to auto-size properly
I have a bunch of "help" links that have content in them that appears on mouseover. The links are all 15x15px and I want the nested popup to auto-size itself, but am having issues getting it to work. It's easy to make this work if I pull the popups outside of their container, but then they're just restricted to the wid...
See: http://jsfiddle.net/NsGaN/4/ You need to decide why you want to constrict the links to 20px (15x15) when you also don't want text to wrap, these two points are kinda self-exclusive
Getting popup inside of fixed-width container to auto-size properly I have a bunch of "help" links that have content in them that appears on mouseover. The links are all 15x15px and I want the nested popup to auto-size itself, but am having issues getting it to work. It's easy to make this work if I pull the popups out...
TITLE: Getting popup inside of fixed-width container to auto-size properly QUESTION: I have a bunch of "help" links that have content in them that appears on mouseover. The links are all 15x15px and I want the nested popup to auto-size itself, but am having issues getting it to work. It's easy to make this work if I p...
[ "css" ]
0
0
872
2
0
2011-05-31T22:55:55.350000
2011-05-31T23:06:51.620000
6,194,490
6,194,515
Memory leak in using a list of lists
I had some code thrown at me to 'productionize.' I ran a memory leak checker and it calls out the following line within the 'for' loop below as a memory leak. someStruct->arrayMap = new std::list *[someStruct->mapSizeX]; for(int i=0; i mapSizeX; i++){ someStruct->arrayMap[i] = new std::list [someStruct->mapSizeY]; } He...
Deallocate the objects in the reverse order that you allocated them. Allocation: someStruct->arrayMap = new std::list *[someStruct->mapSizeX]; for(int i=0; i mapSizeX; i++){ someStruct->arrayMap[i] = new std::list [someStruct->mapSizeY]; } Deallocation: for (int i=0; i mapSizeX; i++){ delete[] someStruct->arrayMap[i]; ...
Memory leak in using a list of lists I had some code thrown at me to 'productionize.' I ran a memory leak checker and it calls out the following line within the 'for' loop below as a memory leak. someStruct->arrayMap = new std::list *[someStruct->mapSizeX]; for(int i=0; i mapSizeX; i++){ someStruct->arrayMap[i] = new s...
TITLE: Memory leak in using a list of lists QUESTION: I had some code thrown at me to 'productionize.' I ran a memory leak checker and it calls out the following line within the 'for' loop below as a memory leak. someStruct->arrayMap = new std::list *[someStruct->mapSizeX]; for(int i=0; i mapSizeX; i++){ someStruct->a...
[ "c++", "memory-leaks", "stdlist" ]
0
3
467
2
0
2011-05-31T22:56:12.327000
2011-05-31T22:59:36.037000
6,194,495
6,194,592
How do I create a namespace in JavaScript?
I want to access variables by using MyNamespace.variable1 that are globally accessible. I believe Drupal does something similar, no?
What Drupal does is using the following code: var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} }; Drupal.attachBehaviors = function (context, settings) { context = context || document; settings = settings || Drupal.settings; // Execute all of them. $.each(Drupal.behaviors, function () { if ($.isF...
How do I create a namespace in JavaScript? I want to access variables by using MyNamespace.variable1 that are globally accessible. I believe Drupal does something similar, no?
TITLE: How do I create a namespace in JavaScript? QUESTION: I want to access variables by using MyNamespace.variable1 that are globally accessible. I believe Drupal does something similar, no? ANSWER: What Drupal does is using the following code: var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'locale': {} ...
[ "javascript", "namespaces" ]
1
3
606
4
0
2011-05-31T22:56:39.140000
2011-05-31T23:11:09.540000
6,194,499
6,194,512
pushd through os.system
I'm using a crontab to run a maintenance script for my minecraft server. Most of the time it works fine, unless the crontab tries to use the restart script. If I run the restart script manually, there aren't any issues. Because I believe it's got to do with path names, I'm trying to make sure it's always doing any mine...
Each shell command runs in a separate process. It spawns a shell, executes the pushd command, and then the shell exits. Just write the commands in the same shell script: os.system("cd /directory/path/here; run the commands") A nicer (perhaps) way is with the subprocess module: from subprocess import Popen Popen("run th...
pushd through os.system I'm using a crontab to run a maintenance script for my minecraft server. Most of the time it works fine, unless the crontab tries to use the restart script. If I run the restart script manually, there aren't any issues. Because I believe it's got to do with path names, I'm trying to make sure it...
TITLE: pushd through os.system QUESTION: I'm using a crontab to run a maintenance script for my minecraft server. Most of the time it works fine, unless the crontab tries to use the restart script. If I run the restart script manually, there aren't any issues. Because I believe it's got to do with path names, I'm tryi...
[ "python", "cron", "centos" ]
26
17
33,307
7
0
2011-05-31T22:57:14.010000
2011-05-31T22:58:52.727000
6,194,505
6,195,344
Canvas Image trouble
I am having issues with JavaScript and Canvas particularly in Firefox. I am trying to create an canvas image viewer that will run when canvas is enabled in a browser in place of standard img tag. Javascript changes the image from an array of src paths when an arrow is clicked. For some reason Firefox is always one img ...
You're setting the src of the image and then immediately painting it into the canvas. But image loads are async. So you're painting it before the new src you set has loaded; since you keep reusing the same image it's still showing the previous image at that point. You want to run update() off an onload listener on imag...
Canvas Image trouble I am having issues with JavaScript and Canvas particularly in Firefox. I am trying to create an canvas image viewer that will run when canvas is enabled in a browser in place of standard img tag. Javascript changes the image from an array of src paths when an arrow is clicked. For some reason Firef...
TITLE: Canvas Image trouble QUESTION: I am having issues with JavaScript and Canvas particularly in Firefox. I am trying to create an canvas image viewer that will run when canvas is enabled in a browser in place of standard img tag. Javascript changes the image from an array of src paths when an arrow is clicked. For...
[ "javascript", "firefox", "html", "canvas" ]
3
3
466
1
0
2011-05-31T22:58:24.793000
2011-06-01T01:30:22.463000
6,194,517
6,204,490
Array from form - Wordpress Metadata
I got a custom post type, with a form for storing some data (name, url) to display in a template. What I want to know is how can I store those values in an array? An example of my code: ID); $name = $custom["name"][0]; $url = $custom["url"][0]; echo ' ';?> Name: Url: To this I want to add something like... $url = $cus...
A passed array will be serialized into a string: http://codex.wordpress.org/Function_Reference/update_post_meta update_post_meta( $post_id, 'files_metadata', array( 'name1' => $_POST['name1'], 'url1' => $_POST['url1'] 'name2' => $_POST['name2'], 'url2' => $_POST['url2'] ) );
Array from form - Wordpress Metadata I got a custom post type, with a form for storing some data (name, url) to display in a template. What I want to know is how can I store those values in an array? An example of my code: ID); $name = $custom["name"][0]; $url = $custom["url"][0]; echo ' ';?> Name: Url: To this I want...
TITLE: Array from form - Wordpress Metadata QUESTION: I got a custom post type, with a form for storing some data (name, url) to display in a template. What I want to know is how can I store those values in an array? An example of my code: ID); $name = $custom["name"][0]; $url = $custom["url"][0]; echo ' ';?> Name: U...
[ "php", "arrays", "forms", "wordpress", "metadata" ]
0
2
1,064
1
0
2011-05-31T22:59:56.130000
2011-06-01T16:23:56.750000
6,194,525
6,197,214
How to restrict access to symbols in shared object?
I have a plug-in in the form of a shared library (bar.so) that links into a larger program (foo). Both foo and bar.so depend on the same third party library (baz) but they need to keep their implementations of baz completely separate. So when I link foo (using the supplied object files and archives) I need it to ignore...
Use dlopen to load your plugin with RTLD_DEEPBIND flag. (edit) Please note that RTLD_DEEPBIND is Linux-specific and need glibc 2.3.4 or newer.
How to restrict access to symbols in shared object? I have a plug-in in the form of a shared library (bar.so) that links into a larger program (foo). Both foo and bar.so depend on the same third party library (baz) but they need to keep their implementations of baz completely separate. So when I link foo (using the sup...
TITLE: How to restrict access to symbols in shared object? QUESTION: I have a plug-in in the form of a shared library (bar.so) that links into a larger program (foo). Both foo and bar.so depend on the same third party library (baz) but they need to keep their implementations of baz completely separate. So when I link ...
[ "linux", "linker", "shared-libraries", "symbols" ]
8
5
1,211
1
0
2011-05-31T23:01:15.693000
2011-06-01T06:39:05.070000
6,194,528
6,198,597
Dynamic Programming Scheduler in Prolog
I'm trying to create a simple scheduler in Prolog that takes a bunch of courses along with the semesters they're offered and a user's ranking of the courses. These inputs get turned into facts like course('CS 4812','Quantum Information Processing',1.0882353,s2012). course('Math 6110','Real Analysis I',0.5441176,f2011)....
There are a couple of reasons for bad performance: First of all, assert/3 is not very fast so you spend a lot of time there if there are a lot of asserts. Then, prolog uses a hash table based on the first argument to match clauses. In your case, yhe first argument is the Result which is uninstantiated when it's called ...
Dynamic Programming Scheduler in Prolog I'm trying to create a simple scheduler in Prolog that takes a bunch of courses along with the semesters they're offered and a user's ranking of the courses. These inputs get turned into facts like course('CS 4812','Quantum Information Processing',1.0882353,s2012). course('Math 6...
TITLE: Dynamic Programming Scheduler in Prolog QUESTION: I'm trying to create a simple scheduler in Prolog that takes a bunch of courses along with the semesters they're offered and a user's ranking of the courses. These inputs get turned into facts like course('CS 4812','Quantum Information Processing',1.0882353,s201...
[ "prolog", "dynamic-programming" ]
3
2
1,759
1
0
2011-05-31T23:01:40.157000
2011-06-01T08:56:18.440000
6,194,534
6,206,665
ListView footer not center
Any idea why the footer of my list view is always on the left? Here's my xml layout. Footer just added and removed as more data needs loaded. I want theTextView and ProgressBar to be center
Okay, so the problem was NOT with the footer view shown in the OP; it indeed works just fine. The problem was my ListView had the layout_width attribute set to wrap_content. This works just fine for all the list renderers, but not for the footer. Changing the ListView to fill_parent fixed it thanks gang [SOLVED]
ListView footer not center Any idea why the footer of my list view is always on the left? Here's my xml layout. Footer just added and removed as more data needs loaded. I want theTextView and ProgressBar to be center
TITLE: ListView footer not center QUESTION: Any idea why the footer of my list view is always on the left? Here's my xml layout. Footer just added and removed as more data needs loaded. I want theTextView and ProgressBar to be center ANSWER: Okay, so the problem was NOT with the footer view shown in the OP; it indeed...
[ "android", "listview", "android-layout" ]
1
7
1,164
3
0
2011-05-31T23:02:18.023000
2011-06-01T19:37:41.533000
6,194,541
6,194,586
How to implement a CheckBox's onTouchEvent
How do you implement this onTouchEvent? It should fire when the user checks or unchecks the CheckBox widget. CheckBox checkBox = new CheckBox(activity); checkBox.setText("Don't present me information again."); checkBox.onTouchEvent(.....);
The CheckBox widget (and any other widget that extends CompoundButton ) has a method setOnCheckedChangeListener, which is the bit you're lacking (you probably don't want to use onTouchEvent in this case). This example should replace the final line of code in your snippet: checkBox.setOnCheckedChangeListener( new OnChec...
How to implement a CheckBox's onTouchEvent How do you implement this onTouchEvent? It should fire when the user checks or unchecks the CheckBox widget. CheckBox checkBox = new CheckBox(activity); checkBox.setText("Don't present me information again."); checkBox.onTouchEvent(.....);
TITLE: How to implement a CheckBox's onTouchEvent QUESTION: How do you implement this onTouchEvent? It should fire when the user checks or unchecks the CheckBox widget. CheckBox checkBox = new CheckBox(activity); checkBox.setText("Don't present me information again."); checkBox.onTouchEvent(.....); ANSWER: The CheckB...
[ "android", "android-widget" ]
0
2
685
2
0
2011-05-31T23:03:31.730000
2011-05-31T23:10:21.853000
6,194,543
6,194,973
Table rendering issue: firefox 4, gecko
In webkit browsers this page renders fine: http://www.ryanhaywood.com/s/film.html But in the updated firefox it is spaced horribly. I have messed around in firebug for days, I have no idea how to even fix this in firefox. I apologize for the archaic solution (tables) deployed in aforementioned page Can anyone spot the ...
You had indicated creating layouts with tables is dated, I'd definitely agree. Here's a solution using 's that should work in all browsers example here: http://jsfiddle.net/pxfunc/hjgQm/ I've classed the films in a left-orientation and right-orientation alternating pattern of div's like so: Director's Reel Nobody's Off...
Table rendering issue: firefox 4, gecko In webkit browsers this page renders fine: http://www.ryanhaywood.com/s/film.html But in the updated firefox it is spaced horribly. I have messed around in firebug for days, I have no idea how to even fix this in firefox. I apologize for the archaic solution (tables) deployed in ...
TITLE: Table rendering issue: firefox 4, gecko QUESTION: In webkit browsers this page renders fine: http://www.ryanhaywood.com/s/film.html But in the updated firefox it is spaced horribly. I have messed around in firebug for days, I have no idea how to even fix this in firefox. I apologize for the archaic solution (ta...
[ "html", "webkit", "cross-browser", "firefox4", "gecko" ]
0
0
100
1
0
2011-05-31T23:03:59.670000
2011-06-01T00:19:09.320000
6,194,550
6,199,592
CSRF with jquery and $.post in django 1.3
In django 1.3 you now have to use csrf even with ajax. I use jquery and I now want to add the csrf token to the $.post. How can i do this? I am not very skilled in jquery so it would be nice with a good description. It is a rating app and the post is send when a star is clicked. I have seen the django docs but do not u...
Place this code before your function. It will take care of CSRF. $('html').ajaxSend(function(event, xhr, settings) { function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie!= '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery....
CSRF with jquery and $.post in django 1.3 In django 1.3 you now have to use csrf even with ajax. I use jquery and I now want to add the csrf token to the $.post. How can i do this? I am not very skilled in jquery so it would be nice with a good description. It is a rating app and the post is send when a star is clicked...
TITLE: CSRF with jquery and $.post in django 1.3 QUESTION: In django 1.3 you now have to use csrf even with ajax. I use jquery and I now want to add the csrf token to the $.post. How can i do this? I am not very skilled in jquery so it would be nice with a good description. It is a rating app and the post is send when...
[ "jquery", "django", "django-csrf" ]
6
7
7,424
3
0
2011-05-31T23:04:51.513000
2011-06-01T10:16:34.890000
6,194,560
6,194,635
Alert something on enter key if no forms active in the html site
I'd like to make a two-in-one solution for keypress event. If I hit enter, and no form elements are active in my site I'd like to alert AAA. Else submit the active form. How can i do this? $(document).bind('keypress', function(e) { if(e.keyCode==13){ e.preventDefault(); alert("AAA"); } }); // the enter key hitted and a...
Use focus and focusout to keep track of whether your form has focus and display the appropriate alert. There is also document.activeElement but I am not too sure if all browsers support it
Alert something on enter key if no forms active in the html site I'd like to make a two-in-one solution for keypress event. If I hit enter, and no form elements are active in my site I'd like to alert AAA. Else submit the active form. How can i do this? $(document).bind('keypress', function(e) { if(e.keyCode==13){ e.pr...
TITLE: Alert something on enter key if no forms active in the html site QUESTION: I'd like to make a two-in-one solution for keypress event. If I hit enter, and no form elements are active in my site I'd like to alert AAA. Else submit the active form. How can i do this? $(document).bind('keypress', function(e) { if(e....
[ "javascript", "jquery", "html", "events", "keyboard-shortcuts" ]
0
2
169
1
0
2011-05-31T23:06:26.693000
2011-05-31T23:18:21.787000
6,194,562
6,195,423
IE8 scrolls down on ajax onload event
I have trouble with this page for example: http://www.last.cz/exotika.html. If you open it in FF or chrome, you start at the top of page. But when you try in IE8, it loads scrolled past the header. Compatibility mode does not help. I think the filter details that get filled by onload function cause it. Does anyone who ...
This will be executed onload(placed in core.js): $('#item0').focus() That's what happens, the element #item0 gets the focus and the page scrolls down to fully show the element(it will scroll until the bottom-border of the first "hotel-box"--thats what #item0 actually is-- occurs inside the viewport). Other browsers may...
IE8 scrolls down on ajax onload event I have trouble with this page for example: http://www.last.cz/exotika.html. If you open it in FF or chrome, you start at the top of page. But when you try in IE8, it loads scrolled past the header. Compatibility mode does not help. I think the filter details that get filled by onlo...
TITLE: IE8 scrolls down on ajax onload event QUESTION: I have trouble with this page for example: http://www.last.cz/exotika.html. If you open it in FF or chrome, you start at the top of page. But when you try in IE8, it loads scrolled past the header. Compatibility mode does not help. I think the filter details that ...
[ "javascript", "css", "ajax", "internet-explorer-8" ]
0
1
262
1
0
2011-05-31T23:06:37.660000
2011-06-01T01:46:28.613000
6,194,566
6,194,695
OpenNETCF.Telephony detect incoming calls in WIndows Mobile 6
I develop an application related to managing calls under Windows Mobile 6. For the calls I use OpenNETCF.Telephony around TAPI. I manage to detect and answer the first incoming call, but then, if I have another incoming call (when I already have an incoming call answered), this call is not detected. So, only the first ...
Seems that I found the answer easy. My settings for cellular line were tapi.CellularLine(MediaMode.InteractiveVoice, CallPrivilege.Owner) and I changed them to tapi.CellularLine(MediaMode.InteractiveVoice, CallPrivilege.Monitor | CallPrivilege.Owner)
OpenNETCF.Telephony detect incoming calls in WIndows Mobile 6 I develop an application related to managing calls under Windows Mobile 6. For the calls I use OpenNETCF.Telephony around TAPI. I manage to detect and answer the first incoming call, but then, if I have another incoming call (when I already have an incoming ...
TITLE: OpenNETCF.Telephony detect incoming calls in WIndows Mobile 6 QUESTION: I develop an application related to managing calls under Windows Mobile 6. For the calls I use OpenNETCF.Telephony around TAPI. I manage to detect and answer the first incoming call, but then, if I have another incoming call (when I already...
[ "c#", "telephony", "windows-mobile-6", "opennetcf" ]
0
0
702
1
0
2011-05-31T23:07:28.017000
2011-05-31T23:27:37.860000
6,194,568
6,194,694
Convert between System.Data.SqlDbType and Microsoft.SqlServer.Management.Smo.SqlDataType
Given an instance of System.Data.SqlDbType how can I convert it to an instance of Microsoft.SqlServer.Management.Smo.SqlDataType and vice-versa? The enums don't match up.
Something like this if the names match, maybe? System.Data.SqlDbType otherEnumTypeValue = System.Data.SqlDbType.Xml; Microsoft.SqlServer.Management.Smo.SqlDataTypeconverted = (Microsoft.SqlServer.Management.Smo.SqlDataType)Enum.Parse(typeof(Microsoft.SqlServer.Management.Smo.SqlDataType), otherEnumTypeValue.ToString())...
Convert between System.Data.SqlDbType and Microsoft.SqlServer.Management.Smo.SqlDataType Given an instance of System.Data.SqlDbType how can I convert it to an instance of Microsoft.SqlServer.Management.Smo.SqlDataType and vice-versa? The enums don't match up.
TITLE: Convert between System.Data.SqlDbType and Microsoft.SqlServer.Management.Smo.SqlDataType QUESTION: Given an instance of System.Data.SqlDbType how can I convert it to an instance of Microsoft.SqlServer.Management.Smo.SqlDataType and vice-versa? The enums don't match up. ANSWER: Something like this if the names ...
[ "c#", "sql-server", "enums" ]
1
4
3,962
2
0
2011-05-31T23:07:42.023000
2011-05-31T23:27:37.547000
6,194,569
6,194,631
For Selenium, do I need to start the java server?
$pip install selenium $sudo apt-get install firefox xvfb from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys browser = webdriver.Firefox() browser.get("http://www.yahoo.com") This is what I have so far, for Selenium. It seems to ...
First let me define for you client mode and server mode: Client mode: where the language bindings connect to the remote instance. This is the way that the FirefoxDriver and the RemoteWebDriver client normally work. Server mode: where the language bindings are responsible for setting up the server, which the driver runn...
For Selenium, do I need to start the java server? $pip install selenium $sudo apt-get install firefox xvfb from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys browser = webdriver.Firefox() browser.get("http://www.yahoo.com") This...
TITLE: For Selenium, do I need to start the java server? QUESTION: $pip install selenium $sudo apt-get install firefox xvfb from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys browser = webdriver.Firefox() browser.get("http://ww...
[ "java", "python", "selenium", "jar" ]
1
0
565
2
0
2011-05-31T23:07:52.777000
2011-05-31T23:17:36.597000
6,194,576
6,194,596
How can I convert an Excel file on a Linux server to a delimited text file?
I am running a Linux server and one of our suppliers only knows how to send me an Excel file which I need to import into our system daily. Does anyone know of a good way to export the Excel file to a delimited file? Preferably with php or perl. Thanks! Chris Edwards
Java library POI does this quite well, with very simple API. http://poi.apache.org/
How can I convert an Excel file on a Linux server to a delimited text file? I am running a Linux server and one of our suppliers only knows how to send me an Excel file which I need to import into our system daily. Does anyone know of a good way to export the Excel file to a delimited file? Preferably with php or perl....
TITLE: How can I convert an Excel file on a Linux server to a delimited text file? QUESTION: I am running a Linux server and one of our suppliers only knows how to send me an Excel file which I need to import into our system daily. Does anyone know of a good way to export the Excel file to a delimited file? Preferably...
[ "linux", "excel", "csv", "export" ]
2
1
1,670
2
0
2011-05-31T23:09:21.007000
2011-05-31T23:11:37.313000
6,194,589
6,194,938
Django create template filter for nice time
I know there's timesince filter. But I want something that returns this: just few seconds ago X minutes ago X hours ago on $day_name X weeks ago X months ago Examples: just few seconds ago 37 minutes ago 2 hours ago yesterday on Thursday 1 week ago 7 months ago How can I implement something like this?
Not sure if it ticks all your boxes, but there's a tag naturaltime in the django.contrib.humanize template tags that should do this: https://docs.djangoproject.com/en/dev/ref/contrib/humanize/#naturaltime settings.py INSTALLED_APPS = {... 'django.contrib.humanize', } template.html {% load humanize %} {{ model.timefield...
Django create template filter for nice time I know there's timesince filter. But I want something that returns this: just few seconds ago X minutes ago X hours ago on $day_name X weeks ago X months ago Examples: just few seconds ago 37 minutes ago 2 hours ago yesterday on Thursday 1 week ago 7 months ago How can I impl...
TITLE: Django create template filter for nice time QUESTION: I know there's timesince filter. But I want something that returns this: just few seconds ago X minutes ago X hours ago on $day_name X weeks ago X months ago Examples: just few seconds ago 37 minutes ago 2 hours ago yesterday on Thursday 1 week ago 7 months ...
[ "python", "django", "django-template-filters" ]
7
16
3,786
2
0
2011-05-31T23:10:52.823000
2011-06-01T00:13:08.653000
6,194,602
6,194,620
echo array ISO-8859-1 values correctly
I'm having troubles while printing the array values, they are originally encoded with ISO-8859-1 and when echoed they appear with "?". That's so annoying! I have the charset defined to ISO-8859-15 $lang = array(); $lang['HOMEPAGE'] = 'âéíó'; echo $lang['HOMEPAGE']; result:???? Any hints? It used to work, using the u...
There are two encodings at work here: The encoding of your text, in this case the source code. The encoding of the webpage. Make sure it's set to ISO-8859-1 as well. Put this meta tag in the header of your HTML file to enforce an encoding:
echo array ISO-8859-1 values correctly I'm having troubles while printing the array values, they are originally encoded with ISO-8859-1 and when echoed they appear with "?". That's so annoying! I have the charset defined to ISO-8859-15 $lang = array(); $lang['HOMEPAGE'] = 'âéíó'; echo $lang['HOMEPAGE']; result:???? ...
TITLE: echo array ISO-8859-1 values correctly QUESTION: I'm having troubles while printing the array values, they are originally encoded with ISO-8859-1 and when echoed they appear with "?". That's so annoying! I have the charset defined to ISO-8859-15 $lang = array(); $lang['HOMEPAGE'] = 'âéíó'; echo $lang['HOMEPAG...
[ "php" ]
1
1
1,177
2
0
2011-05-31T23:12:58.703000
2011-05-31T23:16:09.577000
6,194,614
6,194,760
Touch issue on ListBox
I have this ListBox in my xaml. FIRST.XAML The problem is that when I click first time on a list item, all ok, it calls SECOND.XAML correctly, but, when I go back to FIRST.XAML from SECOND.XAML, I'm unable to re-click at the same ListBox item! But why? Here C# code: private void openNewsViewer(object sender, SelectionC...
The problem is that your event fires when page is reloaded ( when your listbox is created the selectedItem is changed). You can use ManipulationStarted event.
Touch issue on ListBox I have this ListBox in my xaml. FIRST.XAML The problem is that when I click first time on a list item, all ok, it calls SECOND.XAML correctly, but, when I go back to FIRST.XAML from SECOND.XAML, I'm unable to re-click at the same ListBox item! But why? Here C# code: private void openNewsViewer(ob...
TITLE: Touch issue on ListBox QUESTION: I have this ListBox in my xaml. FIRST.XAML The problem is that when I click first time on a list item, all ok, it calls SECOND.XAML correctly, but, when I go back to FIRST.XAML from SECOND.XAML, I'm unable to re-click at the same ListBox item! But why? Here C# code: private void...
[ "c#", "xaml", "windows-phone-7", "listbox", "selectionchanged" ]
1
0
499
1
0
2011-05-31T23:15:49.717000
2011-05-31T23:39:54.690000
6,194,618
6,194,653
Develop in python on Linux, test on Windows
I'm trying to develop a cross-platform library and want to be able to develop code and then quickly test it on both Windows and Linux. I'm not sure if it's even an option or worthwhile testing under Wine (it uses the multiprocessing module, and COM on Windows) but I do have a VM I've been running it under. It's just be...
Using a DVCS to push the local changes to the server will take you far. You will need a SSH server on the Windows machine, but there are several of those around. You can also use a makefile to direct the pushing and testing, possibly even running the tests remotely depending on what they consist of.
Develop in python on Linux, test on Windows I'm trying to develop a cross-platform library and want to be able to develop code and then quickly test it on both Windows and Linux. I'm not sure if it's even an option or worthwhile testing under Wine (it uses the multiprocessing module, and COM on Windows) but I do have a...
TITLE: Develop in python on Linux, test on Windows QUESTION: I'm trying to develop a cross-platform library and want to be able to develop code and then quickly test it on both Windows and Linux. I'm not sure if it's even an option or worthwhile testing under Wine (it uses the multiprocessing module, and COM on Window...
[ "python", "windows", "testing", "virtualization" ]
0
2
529
3
0
2011-05-31T23:15:57.237000
2011-05-31T23:20:53.373000
6,194,621
6,196,161
Execute maven task first thing
I have a multi-module maven project and would like to execute an ant task before maven starts building the reactor. The only solution I've come up is to create a module that will execute this ant task, and have that module be the first in the list of, but I feel that is not the maven way (or is it?) Is there a way to a...
Your approach seems to be correct. I have seen similar build scripts in some client projects. The first module contains only one build plugin: maven-antrun-plugin. Rest of modules are normal Maven pom files that see the environment settings updated by Ant.
Execute maven task first thing I have a multi-module maven project and would like to execute an ant task before maven starts building the reactor. The only solution I've come up is to create a module that will execute this ant task, and have that module be the first in the list of, but I feel that is not the maven way ...
TITLE: Execute maven task first thing QUESTION: I have a multi-module maven project and would like to execute an ant task before maven starts building the reactor. The only solution I've come up is to create a module that will execute this ant task, and have that module be the first in the list of, but I feel that is ...
[ "maven", "module", "maven-antrun-plugin" ]
0
0
341
1
0
2011-05-31T23:16:15.440000
2011-06-01T04:09:29.393000
6,194,624
6,194,666
ASP.Net MVC3 routing reserved words?
I have an ASP.Net MVC application with the standard routes defined. The app edits meta data for our database. The url scheme is: http://localhost/tables/Edit/[Name of Table Here] This calls the edit function on the tables controller and passes in the name of the table as the parameter id. All of the tables work fine ex...
Yes, con is a reserved word and thus cannot be put in a MVC route. Here is a blog post describing a work-around: http://haacked.com/archive/2010/04/29/allowing-reserved-filenames-in-URLs.aspx And another post detailing the reasons behind the reserved words: http://bitquabit.com/post/zombie-operating-systems-and-aspnet-...
ASP.Net MVC3 routing reserved words? I have an ASP.Net MVC application with the standard routes defined. The app edits meta data for our database. The url scheme is: http://localhost/tables/Edit/[Name of Table Here] This calls the edit function on the tables controller and passes in the name of the table as the paramet...
TITLE: ASP.Net MVC3 routing reserved words? QUESTION: I have an ASP.Net MVC application with the standard routes defined. The app edits meta data for our database. The url scheme is: http://localhost/tables/Edit/[Name of Table Here] This calls the edit function on the tables controller and passes in the name of the ta...
[ "asp.net-mvc-3", "asp.net-mvc-routing", "reserved-words" ]
9
13
2,849
2
0
2011-05-31T23:16:36.113000
2011-05-31T23:22:48.937000
6,194,632
6,194,645
Valid JSON Array logs Undefined to the console no matter what I do
I'm using Jquery to call a php script which then generates an array. I'm using echo json_encode (array ( "key"=>$value, "key"=>$value, "key"=>$value )); As the last line of the PHP document which is generating a valid JSON array. I checked via Firebug. Unfortunately when I try to access one of the values with dot-notat...
Are you sure data is being json decoded on the Javascript side and isn't just a String?
Valid JSON Array logs Undefined to the console no matter what I do I'm using Jquery to call a php script which then generates an array. I'm using echo json_encode (array ( "key"=>$value, "key"=>$value, "key"=>$value )); As the last line of the PHP document which is generating a valid JSON array. I checked via Firebug. ...
TITLE: Valid JSON Array logs Undefined to the console no matter what I do QUESTION: I'm using Jquery to call a php script which then generates an array. I'm using echo json_encode (array ( "key"=>$value, "key"=>$value, "key"=>$value )); As the last line of the PHP document which is generating a valid JSON array. I che...
[ "php", "jquery", "ajax", "json" ]
0
3
256
1
0
2011-05-31T23:18:04.317000
2011-05-31T23:19:43.177000
6,194,639
6,194,926
EntitySet - is there a sane reason that IList.Add doesn't set assigned?
There are 3 ways of adding items to most lists... via a direct public API method, typically Add(SomeType) via the generic IList.Add(T) interface via the non-generic IList.Add(object) interface method and you normally expect them to behave more or less the same. However, LINQ's EntitySet is... peculiar on both 3.5 and 4...
Interestingly, this has been identified for several versions now (you stated that a 3.5 issue was fixed in 4.0). Here is a post from 2007. The rest of the IList methods in 4.0 are correctly tied to the IList methods. I think that there are 2 likely explanations (of the bug/feature variety): This is an actual bug that M...
EntitySet - is there a sane reason that IList.Add doesn't set assigned? There are 3 ways of adding items to most lists... via a direct public API method, typically Add(SomeType) via the generic IList.Add(T) interface via the non-generic IList.Add(object) interface method and you normally expect them to behave more or l...
TITLE: EntitySet - is there a sane reason that IList.Add doesn't set assigned? QUESTION: There are 3 ways of adding items to most lists... via a direct public API method, typically Add(SomeType) via the generic IList.Add(T) interface via the non-generic IList.Add(object) interface method and you normally expect them t...
[ "c#", ".net", "linq", "linq-to-sql", "entityset" ]
40
20
3,307
3
0
2011-05-31T23:18:43.213000
2011-06-01T00:10:30.353000
6,194,649
6,195,786
Handling target/action weak reference with NSOperation
I'm using a NSOperation to handle background processing in an iOS app, and I'm trying to understand the target/action pattern. In the delegate pattern, the delegate is held as a weak reference, and the delegate object is responsible for setting the other object's delegate field to nil before it dealloc s. In the target...
As explained in The Target, it's up to you to make sure that the target is available if a control might send an action. In practice, this isn't a problem because the target is usually a controller that's created before and deallocated after the controls. If you're sending action messages from an operation, you'll need ...
Handling target/action weak reference with NSOperation I'm using a NSOperation to handle background processing in an iOS app, and I'm trying to understand the target/action pattern. In the delegate pattern, the delegate is held as a weak reference, and the delegate object is responsible for setting the other object's d...
TITLE: Handling target/action weak reference with NSOperation QUESTION: I'm using a NSOperation to handle background processing in an iOS app, and I'm trying to understand the target/action pattern. In the delegate pattern, the delegate is held as a weak reference, and the delegate object is responsible for setting th...
[ "objective-c", "ios", "memory-management", "nsoperation", "target-action" ]
1
2
1,316
2
0
2011-05-31T23:20:06.830000
2011-06-01T02:57:55.700000
6,194,651
6,194,680
Midpoint sums Prob. 22" - I don't get the right answer because I don't understand what means "xxxxx.x" I think
I am trying to solve this exercise Problem 22 just for reinforcing my solving skills. I've already coded the answer. The task asks for "what is the sum of ALL the resulting y coordinates values? (Enter the number as a decimal in the form xxxxx.x ( I dont understand what this means )). My answers is 50616.0, but it is w...
They want the result in the form "xxxxx.x", meaning 5 digits before the dot and one after. Your answer is incorrect because it is an integer, while they want a floating point number.
Midpoint sums Prob. 22" - I don't get the right answer because I don't understand what means "xxxxx.x" I think I am trying to solve this exercise Problem 22 just for reinforcing my solving skills. I've already coded the answer. The task asks for "what is the sum of ALL the resulting y coordinates values? (Enter the num...
TITLE: Midpoint sums Prob. 22" - I don't get the right answer because I don't understand what means "xxxxx.x" I think QUESTION: I am trying to solve this exercise Problem 22 just for reinforcing my solving skills. I've already coded the answer. The task asks for "what is the sum of ALL the resulting y coordinates valu...
[ "java", "math" ]
0
1
123
2
0
2011-05-31T23:20:28.997000
2011-05-31T23:25:19.110000
6,194,659
6,195,104
Configuring a custom scrollbar in PyQt
I am building a GUI for image processing in PyQt. One task that I need to be able to do is use a scrollbar to move through a directory of image files. Specifically, if there are 1000 images, say, in /my/dir, then I would like the distance scrolled along a scrollbar to correspond to the image number (between 1 and 1000)...
The simplest way would be to use a QListWidget and populate it with your images as the icons of a QListWidgetItem. An example would be something like this self.list_widget = QListWidget() files = glob.glob('YourDirectory/*.jpg') #Get all jpegs in your directory for i in files: self.list_widget.addItem(QListWidgetItem(Q...
Configuring a custom scrollbar in PyQt I am building a GUI for image processing in PyQt. One task that I need to be able to do is use a scrollbar to move through a directory of image files. Specifically, if there are 1000 images, say, in /my/dir, then I would like the distance scrolled along a scrollbar to correspond t...
TITLE: Configuring a custom scrollbar in PyQt QUESTION: I am building a GUI for image processing in PyQt. One task that I need to be able to do is use a scrollbar to move through a directory of image files. Specifically, if there are 1000 images, say, in /my/dir, then I would like the distance scrolled along a scrollb...
[ "python", "image-processing", "pyqt", "scrollbar" ]
0
1
2,324
1
0
2011-05-31T23:21:49.723000
2011-06-01T00:43:23.090000
6,194,662
6,194,676
Boolean Operators in MySQL
I have list of items (separated by comma) that I need to look up in a database. Initially I was looking up each item code individually, but there must be an easier way of doing it. I was playing around in phpMyAdmin trying to select items with no luck. SELECT * FROM `items` WHERE `code` = ( 20298622 OR 83843296 OR 4654...
You could use... SELECT * FROM `items` WHERE `code` IN (20298622, 83843296, 46549947)
Boolean Operators in MySQL I have list of items (separated by comma) that I need to look up in a database. Initially I was looking up each item code individually, but there must be an easier way of doing it. I was playing around in phpMyAdmin trying to select items with no luck. SELECT * FROM `items` WHERE `code` = ( 2...
TITLE: Boolean Operators in MySQL QUESTION: I have list of items (separated by comma) that I need to look up in a database. Initially I was looking up each item code individually, but there must be an easier way of doing it. I was playing around in phpMyAdmin trying to select items with no luck. SELECT * FROM `items` ...
[ "mysql", "select", "conditional-statements" ]
2
4
249
3
0
2011-05-31T23:22:14.470000
2011-05-31T23:24:36.967000
6,194,667
6,194,685
iPhone App Splash Screen Crashes when trying to load
I am writing an app that allows the user to snap a photo with the camera or choose a photo from library and once a picture is selected, the user is taken to another view where he can see a "rating" of his photo and share it to Facebook/Twitter etc. However, before showing the rating of the picture, I want to show a loa...
In the first line of showSplash change UIView to UIViewController.
iPhone App Splash Screen Crashes when trying to load I am writing an app that allows the user to snap a photo with the camera or choose a photo from library and once a picture is selected, the user is taken to another view where he can see a "rating" of his photo and share it to Facebook/Twitter etc. However, before sh...
TITLE: iPhone App Splash Screen Crashes when trying to load QUESTION: I am writing an app that allows the user to snap a photo with the camera or choose a photo from library and once a picture is selected, the user is taken to another view where he can see a "rating" of his photo and share it to Facebook/Twitter etc. ...
[ "iphone", "objective-c", "xcode", "ios", "ios4" ]
0
0
366
3
0
2011-05-31T23:22:50.183000
2011-05-31T23:26:02.850000
6,194,674
6,196,450
rails - capistrano deployment of a subdirectory
I have a directory structure in git/github which looks like: demoapp - mockups - some_files - app (rails app) the github url for the app looks like git@github/user/demoapp.git Currently when I use capistrano to deploy, it looks for rake file in the directory demoapp and fails to find it. How do I specify in capistrano ...
After looking through Deploying a Git subdirectory in Capistrano I ended up creating a separate repositories for my rails app and for other stuff. The rails repository has all the artifacts like rake required by the capistrano script.
rails - capistrano deployment of a subdirectory I have a directory structure in git/github which looks like: demoapp - mockups - some_files - app (rails app) the github url for the app looks like git@github/user/demoapp.git Currently when I use capistrano to deploy, it looks for rake file in the directory demoapp and f...
TITLE: rails - capistrano deployment of a subdirectory QUESTION: I have a directory structure in git/github which looks like: demoapp - mockups - some_files - app (rails app) the github url for the app looks like git@github/user/demoapp.git Currently when I use capistrano to deploy, it looks for rake file in the direc...
[ "ruby-on-rails", "capistrano" ]
1
1
2,403
2
0
2011-05-31T23:24:29.413000
2011-06-01T04:56:16.107000
6,194,693
6,195,173
Zend form: errors don't show up
Zend talk.I build a custom Zend_form in my web app.The problem is that I can't get the errors to show up (when I submit the form without any text).Am I missing something obvious? class Commentform extends Zend_Form { public function init() { $this->setMethod('post'); $this->setAction(''); $text=new Zend_Form_Element_T...
The correct decorator to use on your form is FormErrors, eg $this->setDecorators(array( 'FormElements', 'FormErrors', 'Form',array('Description',array('tag'=>'h2','placement'=>'prepend')), array('HtmlTag', array('tag' => 'div','class'=>'write_comment')), )); The Errors decorator is for elements.
Zend form: errors don't show up Zend talk.I build a custom Zend_form in my web app.The problem is that I can't get the errors to show up (when I submit the form without any text).Am I missing something obvious? class Commentform extends Zend_Form { public function init() { $this->setMethod('post'); $this->setAction(''...
TITLE: Zend form: errors don't show up QUESTION: Zend talk.I build a custom Zend_form in my web app.The problem is that I can't get the errors to show up (when I submit the form without any text).Am I missing something obvious? class Commentform extends Zend_Form { public function init() { $this->setMethod('post'); $...
[ "php", "zend-framework", "zend-form" ]
0
2
1,676
2
0
2011-05-31T23:27:18.903000
2011-06-01T00:57:51.283000
6,194,701
6,259,516
creating certificate programmatically using cert authority
One of my company servers running Windows 2000 is hosting a Certificate Authority (microsoft based). When I open a web browser and type in http://server_name/certsrv, I get a page (titled Microsoft Certificate services) which allows me create a certificate request to this CA and get back a certificate which I then inst...
As you have already discovered, judging by your more recent questions, you can use System.Security.Cryptography and System.Security.Cryptography.X509Certificates namespaces from standard.NET framework and also open source Bouncy Castle library. These are the API's you are looking for. Alternatively, you can use OpenSSL...
creating certificate programmatically using cert authority One of my company servers running Windows 2000 is hosting a Certificate Authority (microsoft based). When I open a web browser and type in http://server_name/certsrv, I get a page (titled Microsoft Certificate services) which allows me create a certificate requ...
TITLE: creating certificate programmatically using cert authority QUESTION: One of my company servers running Windows 2000 is hosting a Certificate Authority (microsoft based). When I open a web browser and type in http://server_name/certsrv, I get a page (titled Microsoft Certificate services) which allows me create ...
[ "x509certificate" ]
0
0
1,080
2
0
2011-05-31T23:28:19.777000
2011-06-07T00:26:00.877000
6,194,705
6,194,774
Need help making rectangles function like buttons (Android)
So I'm quite a noob using the Android SDK (I find it very confusing compared to straight java). This is my second day using it, teaching myself the whole way. With that mentioned, I would like to know how to make a Rect act as a button. Basically the user will tap on a certain Rectangle (that has been drawn on the scre...
So I'm going to assume you're using a SurfaceView to draw on. What you want should be pretty simple. First, override the touch event in the surface view and store off the coordinates of the last touch: @Override public void onTouchEvent(MotionEvent event) { x = event.getX(); y = event.getY(); } Then, check if your rect...
Need help making rectangles function like buttons (Android) So I'm quite a noob using the Android SDK (I find it very confusing compared to straight java). This is my second day using it, teaching myself the whole way. With that mentioned, I would like to know how to make a Rect act as a button. Basically the user will...
TITLE: Need help making rectangles function like buttons (Android) QUESTION: So I'm quite a noob using the Android SDK (I find it very confusing compared to straight java). This is my second day using it, teaching myself the whole way. With that mentioned, I would like to know how to make a Rect act as a button. Basic...
[ "android", "graphics", "button" ]
0
2
1,063
1
0
2011-05-31T23:28:47.807000
2011-05-31T23:42:12.947000
6,194,711
6,194,786
CheckBox.setText do not work (Android)
CheckBox checkBox = new CheckBox(activity); CheckBox.setText("Hello"); I tried to set the text after a check box as above. But it didnt show me anything. Any suggestions?
First: you try to set the Text using the name of the class CheckBox??? it should be the instance checkBox, like this: CheckBox checkBox = new CheckBox(activity); checkBox.setText("Hello"); Second: did you try to add your checkBox to your Activity Content like this?? this.setContentView(checkBox); EDIT:: refer this, may...
CheckBox.setText do not work (Android) CheckBox checkBox = new CheckBox(activity); CheckBox.setText("Hello"); I tried to set the text after a check box as above. But it didnt show me anything. Any suggestions?
TITLE: CheckBox.setText do not work (Android) QUESTION: CheckBox checkBox = new CheckBox(activity); CheckBox.setText("Hello"); I tried to set the text after a check box as above. But it didnt show me anything. Any suggestions? ANSWER: First: you try to set the Text using the name of the class CheckBox??? it should be...
[ "android" ]
3
6
6,797
1
0
2011-05-31T23:29:58.467000
2011-05-31T23:44:37.717000
6,194,718
6,197,831
Load app:/ images into HTMLLoader in Adobe Air Flex4.5?
I'm building an app with Adobe AIR that contains a browsing component with mx:HTML. This browser will be used to load external content (publicly-accessible URLs like http://google.com, for example) and after the external content loads, I'm injecting CSS and JS into the HTMLLoader to provide other UI components for my a...
Why don't encode img in base 64 at runtime? package { import flash.display.Sprite; import flash.events.Event; import flash.html.HTMLLoader; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; // Base64Encoder from as3corelib (https://github.com/mikechambers/as3corelib) import...
Load app:/ images into HTMLLoader in Adobe Air Flex4.5? I'm building an app with Adobe AIR that contains a browsing component with mx:HTML. This browser will be used to load external content (publicly-accessible URLs like http://google.com, for example) and after the external content loads, I'm injecting CSS and JS int...
TITLE: Load app:/ images into HTMLLoader in Adobe Air Flex4.5? QUESTION: I'm building an app with Adobe AIR that contains a browsing component with mx:HTML. This browser will be used to load external content (publicly-accessible URLs like http://google.com, for example) and after the external content loads, I'm inject...
[ "actionscript-3", "apache-flex", "air", "flex4" ]
1
4
4,536
2
0
2011-05-31T23:30:55.893000
2011-06-01T07:45:16.333000
6,194,728
6,194,762
How can I hide $Aborted message?
I know that I'm aborting the evaluation and can see it when the black bar on the side goes away. So there is no need for this message. How do I turn it off?
If you are not using $Post for something else, or if you can combine functions, you could use: $Post = # /. $Aborted -> Null &; Be warned that you may break things, as programs may use $Aborted in their control flow. More robustly, addressing the problem Alexey demonstrates: $Post = Function[Null, Unevaluated@# /. $Abo...
How can I hide $Aborted message? I know that I'm aborting the evaluation and can see it when the black bar on the side goes away. So there is no need for this message. How do I turn it off?
TITLE: How can I hide $Aborted message? QUESTION: I know that I'm aborting the evaluation and can see it when the black bar on the side goes away. So there is no need for this message. How do I turn it off? ANSWER: If you are not using $Post for something else, or if you can combine functions, you could use: $Post = ...
[ "wolfram-mathematica" ]
2
5
228
3
0
2011-05-31T23:31:39.747000
2011-05-31T23:40:01.157000
6,194,734
6,207,934
NHibernate ThenFetchMany is retrieving duplicate children
I have a parent object with a child collection containing one element, the child collection contains a "grandchild" collection containing 3 elements. I am loading the parent object from the database using NHibernate as follows Parent parentObject = session.Query ().FetchMany(x => x.Children).ThenFetchMany(x => x.GrandC...
I was able to use the answer here using QueryOver, it correctly loads the objects while generating efficient SQL (selects per table instead of one huge join).
NHibernate ThenFetchMany is retrieving duplicate children I have a parent object with a child collection containing one element, the child collection contains a "grandchild" collection containing 3 elements. I am loading the parent object from the database using NHibernate as follows Parent parentObject = session.Query...
TITLE: NHibernate ThenFetchMany is retrieving duplicate children QUESTION: I have a parent object with a child collection containing one element, the child collection contains a "grandchild" collection containing 3 elements. I am loading the parent object from the database using NHibernate as follows Parent parentObje...
[ "nhibernate", "fetch", "eager-loading" ]
5
2
5,441
4
0
2011-05-31T23:32:39.200000
2011-06-01T21:27:58.883000
6,194,736
6,194,751
How do I translate this to Python?
s1 = Selenium::WebDriver::Remote.new:url => "http://localhost:4444/wb/pub" This is Ruby. What's the equivalent in Python?
This S/O answer should demonstrate the Syntax you need: How do you connect remotely using Python + Webdriver
How do I translate this to Python? s1 = Selenium::WebDriver::Remote.new:url => "http://localhost:4444/wb/pub" This is Ruby. What's the equivalent in Python?
TITLE: How do I translate this to Python? QUESTION: s1 = Selenium::WebDriver::Remote.new:url => "http://localhost:4444/wb/pub" This is Ruby. What's the equivalent in Python? ANSWER: This S/O answer should demonstrate the Syntax you need: How do you connect remotely using Python + Webdriver
[ "python", "ruby", "selenium" ]
0
1
103
1
0
2011-05-31T23:32:45.943000
2011-05-31T23:37:59.970000
6,194,739
6,194,957
Overriding onTouchEvent competing with ScrollView
From a simplistic overview I have a custom View that contains some bitmaps the user can drag around and resize. The way I do this is fairly standard as in I override onTouchEvent in my CustomView and check if the user is touching within an image, etc. My problem comes when I want to place this CustomView in a ScrollVie...
Normally Android uses a long press to begin a drag in cases like these since it helps disambiguate when the user intends to drag an item vs. scroll the item's container. But if you have an unambiguous signal when the user begins dragging an item, try getParent().requestDisallowInterceptTouchEvent(true) from the custom ...
Overriding onTouchEvent competing with ScrollView From a simplistic overview I have a custom View that contains some bitmaps the user can drag around and resize. The way I do this is fairly standard as in I override onTouchEvent in my CustomView and check if the user is touching within an image, etc. My problem comes w...
TITLE: Overriding onTouchEvent competing with ScrollView QUESTION: From a simplistic overview I have a custom View that contains some bitmaps the user can drag around and resize. The way I do this is fairly standard as in I override onTouchEvent in my CustomView and check if the user is touching within an image, etc. ...
[ "android", "user-interface", "drag-and-drop", "scrollview" ]
17
42
19,684
3
0
2011-05-31T23:33:42.647000
2011-06-01T00:15:49.260000
6,194,747
6,195,133
Rails help getting javascript loading faster from bottom
I am have that problem, that I got some javascript that shows a flexibg image. It only works if it on the bottom of the page. just before The problem is that the javascript gets loaded as the last. And I can see the flexi bg image just streching wish is not nice. My code: <%= javascript_include_tag 'flexibg.js' %> What...
Ok, to understand your problem you need a basic understanding of how a page loads. The short (not 100% accurate, but good enough) explanation is that the browser goes line by line, starting with the top line of the page. As it hits each script tag, it loads it (and does NOT move on to the rest of the lines until it is ...
Rails help getting javascript loading faster from bottom I am have that problem, that I got some javascript that shows a flexibg image. It only works if it on the bottom of the page. just before The problem is that the javascript gets loaded as the last. And I can see the flexi bg image just streching wish is not nice....
TITLE: Rails help getting javascript loading faster from bottom QUESTION: I am have that problem, that I got some javascript that shows a flexibg image. It only works if it on the bottom of the page. just before The problem is that the javascript gets loaded as the last. And I can see the flexi bg image just streching...
[ "javascript", "ruby-on-rails", "ruby", "ruby-on-rails-3" ]
0
2
498
1
0
2011-05-31T23:36:41.423000
2011-06-01T00:50:10.860000
6,194,755
6,201,923
File download results in "IE was not able to open this internet site"
I'm at a loss for this one. I've looked all over and there seem to be a lot of solutions, but they aren't working for me. I've got a CGI::Application app generating a MS Excel spreadsheet with Spreadsheet::WriteExcel. This worked fine for quite some time until our live server had a hardware failure a couple weeks ago. ...
According to http://support.microsoft.com/kb/316431 IE can't deal with some situations where a file isn't cached but it's then opened by some external process. It's not the exact same case, but as EricLaw mentioned in a comment, it might have something to do with the Vary heading and the fact that the download doesn't ...
File download results in "IE was not able to open this internet site" I'm at a loss for this one. I've looked all over and there seem to be a lot of solutions, but they aren't working for me. I've got a CGI::Application app generating a MS Excel spreadsheet with Spreadsheet::WriteExcel. This worked fine for quite some ...
TITLE: File download results in "IE was not able to open this internet site" QUESTION: I'm at a loss for this one. I've looked all over and there seem to be a lot of solutions, but they aren't working for me. I've got a CGI::Application app generating a MS Excel spreadsheet with Spreadsheet::WriteExcel. This worked fi...
[ "perl", "apache", "internet-explorer", "mod-perl" ]
12
8
7,414
3
0
2011-05-31T23:39:05.143000
2011-06-01T13:28:19.710000
6,194,756
6,201,869
Hibernate Could Not Load an Entity Error
I just started using Hibernate on a new project, and with my first entity, I got an error, that I can't seem to figure out. My schema right now is just two tables, continents and countries, where country has a continentid foreign key. When I try to run code that calls the continents entity, I get a blank page. All proc...
The issue was that I was using the wrong attribute to specify the table name to be mapped in the objects. The attribute should be table='' so my hibernate objects should look like this: Continent.cfc component table='continents' persistent=true output=false{ } Country.cfc component table='countries' persistent=true out...
Hibernate Could Not Load an Entity Error I just started using Hibernate on a new project, and with my first entity, I got an error, that I can't seem to figure out. My schema right now is just two tables, continents and countries, where country has a continentid foreign key. When I try to run code that calls the contin...
TITLE: Hibernate Could Not Load an Entity Error QUESTION: I just started using Hibernate on a new project, and with my first entity, I got an error, that I can't seem to figure out. My schema right now is just two tables, continents and countries, where country has a continentid foreign key. When I try to run code tha...
[ "hibernate", "coldfusion", "railo" ]
0
5
24,981
5
0
2011-05-31T23:39:16.453000
2011-06-01T13:23:41.813000
6,194,758
6,194,785
Does all source code need to be PCI compliant?
We have never transmitted, processed or stored credit card information in the past as we did everything via PayPal so we never needed to be PCI compliant. However, we are launching a new online store and by having a seamless checkout where credit card information in processed without redirected to PayPal, we need PCI c...
The basic answer is that it depends. In general, only the source code that deals (or can deal) with the sensitive and protected data of PCI needs to be PCI compliant. However, this means that if other areas of your code have access into the secure areas, you need security there as well. If another area of your applicat...
Does all source code need to be PCI compliant? We have never transmitted, processed or stored credit card information in the past as we did everything via PayPal so we never needed to be PCI compliant. However, we are launching a new online store and by having a seamless checkout where credit card information in proces...
TITLE: Does all source code need to be PCI compliant? QUESTION: We have never transmitted, processed or stored credit card information in the past as we did everything via PayPal so we never needed to be PCI compliant. However, we are launching a new online store and by having a seamless checkout where credit card inf...
[ "pci-compliance" ]
5
4
2,121
2
0
2011-05-31T23:39:51.933000
2011-05-31T23:44:20.717000
6,194,767
6,194,808
How to reference an image inside another tag with 'this'?
I know this is pretty basic, I'm trying to get the 'src' attribute of some images and put them in the same number of #image fields: count = 0; $('.selected').each(function() { count++; // the idea is to get the value from each ".selected img" $('#image' + count).val( this + img ).attr("src"); }); How to reference the i...
Is this the sort of thing you mean? $(function() { var count = 0; $('.selected').each(function() { count++; var source = $('img', this).attr('src'); $('input#image' + count).val(source); }); });
How to reference an image inside another tag with 'this'? I know this is pretty basic, I'm trying to get the 'src' attribute of some images and put them in the same number of #image fields: count = 0; $('.selected').each(function() { count++; // the idea is to get the value from each ".selected img" $('#image' + count)...
TITLE: How to reference an image inside another tag with 'this'? QUESTION: I know this is pretty basic, I'm trying to get the 'src' attribute of some images and put them in the same number of #image fields: count = 0; $('.selected').each(function() { count++; // the idea is to get the value from each ".selected img" $...
[ "javascript", "jquery" ]
1
1
194
4
0
2011-05-31T23:40:42.120000
2011-05-31T23:48:54.313000
6,194,797
6,194,817
What is a C++ container with a "contains" operation?
I want to use a structure in which I insert integers, and then can ask if (container.contains(3)) { /**/ } There has to be something like this.
You can use std::vector. std::vector myVec; myVec.push_back(3); if (std::find(myVec.begin(), myVec.end(), 3)!= myVec.end()) { // do your stuff } You can even make a little helper function: template bool contains(const std::vector &vec, const T &value) { return std::find(vec.begin(), vec.end(), value)!= vec.end(); } Her...
What is a C++ container with a "contains" operation? I want to use a structure in which I insert integers, and then can ask if (container.contains(3)) { /**/ } There has to be something like this.
TITLE: What is a C++ container with a "contains" operation? QUESTION: I want to use a structure in which I insert integers, and then can ask if (container.contains(3)) { /**/ } There has to be something like this. ANSWER: You can use std::vector. std::vector myVec; myVec.push_back(3); if (std::find(myVec.begin(), myV...
[ "c++", "insert", "integer", "containers", "contains" ]
14
18
13,436
5
0
2011-05-31T23:47:08.343000
2011-05-31T23:50:24.287000
6,194,801
6,195,095
Bubbling scroll/mousewheel event
I've setup my app/website such that I have an absolute-positioned canvas element on top of a scrollpanel, when the scrollpanel scrolls I apply on offset to the canvas to make it look like the image is scrolling (this allows me to have huge canvas without the overhead of a huge canvas element). The problem is, when my m...
Mousewheel event does bubble, to differentiate between up/down scrolling use the event.wheelDelta and event.detail attributes. MSDN: onmousewheel Event (IE, WebKit) event.wheelDelta indicates the distance that the wheel button has rotated, expressed in multiples of 120. A positive value indicates that the wheel button ...
Bubbling scroll/mousewheel event I've setup my app/website such that I have an absolute-positioned canvas element on top of a scrollpanel, when the scrollpanel scrolls I apply on offset to the canvas to make it look like the image is scrolling (this allows me to have huge canvas without the overhead of a huge canvas el...
TITLE: Bubbling scroll/mousewheel event QUESTION: I've setup my app/website such that I have an absolute-positioned canvas element on top of a scrollpanel, when the scrollpanel scrolls I apply on offset to the canvas to make it look like the image is scrolling (this allows me to have huge canvas without the overhead o...
[ "javascript", "html", "gwt", "mousewheel", "delta" ]
1
6
5,886
1
0
2011-05-31T23:47:43.727000
2011-06-01T00:41:53.313000
6,194,815
6,194,947
prolog instantiation error with =:= operator
I'm writing a function called subseq which checks if one list is a subsequence of another. subseq([],[]). subseq([],[Y|Ys]). subseq([X|Xs],[Y|Ys]):- X=:=Y, subseq(Xs,Ys). subseq([X|Xs],[Y|Ys]):- X=\=Y, subseq([X|Xs],Ys). When I try subseq(X,[1,2]) I get: X = []?; uncaught exception: error(instantiation_error,(=:=)/2) W...
You use =:= and =\= in the wrong context here. Those two operators should be used when you have two expressions at hand and want to evaluate and compare them. In your test, because X is not known beforehand, Prolog couldn't evaluate X and compare with Y. More information about =:= and =\= could be found here: Prolog Op...
prolog instantiation error with =:= operator I'm writing a function called subseq which checks if one list is a subsequence of another. subseq([],[]). subseq([],[Y|Ys]). subseq([X|Xs],[Y|Ys]):- X=:=Y, subseq(Xs,Ys). subseq([X|Xs],[Y|Ys]):- X=\=Y, subseq([X|Xs],Ys). When I try subseq(X,[1,2]) I get: X = []?; uncaught ex...
TITLE: prolog instantiation error with =:= operator QUESTION: I'm writing a function called subseq which checks if one list is a subsequence of another. subseq([],[]). subseq([],[Y|Ys]). subseq([X|Xs],[Y|Ys]):- X=:=Y, subseq(Xs,Ys). subseq([X|Xs],[Y|Ys]):- X=\=Y, subseq([X|Xs],Ys). When I try subseq(X,[1,2]) I get: X ...
[ "prolog" ]
1
3
2,597
1
0
2011-05-31T23:50:18.573000
2011-06-01T00:14:13.860000
6,194,824
6,194,874
Where do I get the JOGL JAR?
This might sound silly... but I don't know where to find the JOGL JAR. I searched their website ( http://jogamp.org/jogl/www/ ) and couldn't find it. Could someone please help? Thank you blargman
It looks like you can get the files from here: http://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL. Just follow one of these links: Signed Release, Signed Candidate, Candidate, off the above Wiki page to get list of files. You'll need the macosx for jogl and possibly the gluegen one as well. Here are steps...
Where do I get the JOGL JAR? This might sound silly... but I don't know where to find the JOGL JAR. I searched their website ( http://jogamp.org/jogl/www/ ) and couldn't find it. Could someone please help? Thank you blargman
TITLE: Where do I get the JOGL JAR? QUESTION: This might sound silly... but I don't know where to find the JOGL JAR. I searched their website ( http://jogamp.org/jogl/www/ ) and couldn't find it. Could someone please help? Thank you blargman ANSWER: It looks like you can get the files from here: http://jogamp.org/wik...
[ "java", "eclipse", "jar", "jogl" ]
5
5
10,050
1
0
2011-05-31T23:50:52.147000
2011-05-31T23:58:18.293000
6,194,830
6,201,250
Record Video from Camera via Version Android 2.2
enter code here When I try to recording video from camera at version Android 2.2. It has some errors.No one could find the solution. İs there any bug Android MediaRecorder API. How can I solve this. I got more errors.You can see some of them in picture. And an error like that: Camera Preview -13 Thanks a lot. https://i...
Emin, Based on the image of the logcat output you provide the crash is occuring with the start() method. You will see from the documentation for the start method that prepare() must be called first or else it will throw the IllegalStateException. In your code all the calls the prepare() are commented out? EDIT: We sort...
Record Video from Camera via Version Android 2.2 enter code here When I try to recording video from camera at version Android 2.2. It has some errors.No one could find the solution. İs there any bug Android MediaRecorder API. How can I solve this. I got more errors.You can see some of them in picture. And an error like...
TITLE: Record Video from Camera via Version Android 2.2 QUESTION: enter code here When I try to recording video from camera at version Android 2.2. It has some errors.No one could find the solution. İs there any bug Android MediaRecorder API. How can I solve this. I got more errors.You can see some of them in picture....
[ "android", "video", "video-capture" ]
1
0
3,123
1
0
2011-05-31T23:51:28.183000
2011-06-01T12:36:33.357000
6,194,837
6,194,863
$("#someDiv").attr("scrollHeight") not working in jquery-1.6.1
$("#someDiv").attr("scrollHeight") works in jquery 1.3.2 for all browsers. But on updating to jquery 1.6.1, it only works in IE9. Firefox 4.0.1, Google Chrome 11 and Safari 5 all return undefined. $("#someDiv").get(0).scrollHeight however still works for all browsers. Anybody knows what is going on?, is attr("scrollHei...
jQuery 1.6 introduced.prop and changed the meaning of.attr. Read all about it. (Always worth checking the documentation first; the page for.attr talks about this too.)
$("#someDiv").attr("scrollHeight") not working in jquery-1.6.1 $("#someDiv").attr("scrollHeight") works in jquery 1.3.2 for all browsers. But on updating to jquery 1.6.1, it only works in IE9. Firefox 4.0.1, Google Chrome 11 and Safari 5 all return undefined. $("#someDiv").get(0).scrollHeight however still works for al...
TITLE: $("#someDiv").attr("scrollHeight") not working in jquery-1.6.1 QUESTION: $("#someDiv").attr("scrollHeight") works in jquery 1.3.2 for all browsers. But on updating to jquery 1.6.1, it only works in IE9. Firefox 4.0.1, Google Chrome 11 and Safari 5 all return undefined. $("#someDiv").get(0).scrollHeight however ...
[ "javascript", "jquery" ]
18
38
26,858
1
0
2011-05-31T23:52:29.370000
2011-05-31T23:56:56.890000
6,194,839
6,194,857
Should dependency injection be used within tests?
Possible Duplicate: Using IoC for Unit Testing I am refactoring some tests and the solution uses Ninject for DI via the MS ServiceLocator. There is a separate Ninject module for the tests but in using it the testing code becomes quite difficult to follow. Do you use DI within your tests or should each test be focussed ...
Well, while highly subjective, I personally dont use a dependency injection framework when unit testing. Since I use Moq, I typically create Mock classes and then manually inject the dependencies myself. That way, I can actually mock the results and behavior quickly and easily without worrying what the framework is inj...
Should dependency injection be used within tests? Possible Duplicate: Using IoC for Unit Testing I am refactoring some tests and the solution uses Ninject for DI via the MS ServiceLocator. There is a separate Ninject module for the tests but in using it the testing code becomes quite difficult to follow. Do you use DI ...
TITLE: Should dependency injection be used within tests? QUESTION: Possible Duplicate: Using IoC for Unit Testing I am refactoring some tests and the solution uses Ninject for DI via the MS ServiceLocator. There is a separate Ninject module for the tests but in using it the testing code becomes quite difficult to foll...
[ "c#", ".net", "dependency-injection" ]
2
4
285
1
0
2011-05-31T23:52:34.130000
2011-05-31T23:55:49.993000
6,194,845
6,194,872
Saving modelform - won't validate
I'm doing something wrong here, but I can't find it. I'm using a model form: class ArtistInfo(ModelForm): class Meta: model = Onesheet fields = ( 'name', 'genre', 'location', 'biography', ) And trying to save the data entered for an existing record. def edit_artist_info(request, onesheet): onesheet = Onesheet.objects.g...
try just if request.method == 'POST': form = ArtistInfo(request.POST, instance=onesheet) if form.is_valid(): form.save() return HttpResponseRedirect('/') You were missing the return statement in your code, and the extra save() was unnecessary
Saving modelform - won't validate I'm doing something wrong here, but I can't find it. I'm using a model form: class ArtistInfo(ModelForm): class Meta: model = Onesheet fields = ( 'name', 'genre', 'location', 'biography', ) And trying to save the data entered for an existing record. def edit_artist_info(request, oneshe...
TITLE: Saving modelform - won't validate QUESTION: I'm doing something wrong here, but I can't find it. I'm using a model form: class ArtistInfo(ModelForm): class Meta: model = Onesheet fields = ( 'name', 'genre', 'location', 'biography', ) And trying to save the data entered for an existing record. def edit_artist_in...
[ "django", "django-models", "django-forms" ]
0
1
134
1
0
2011-05-31T23:53:10.400000
2011-05-31T23:58:02.913000
6,194,846
6,197,867
assembly reference for folder in a project
I have a c# project X that contains a folder COMMON, and I have several classes in the COMMON folder. Now in project Y; I am referencing using X.Common; Everything is good till now, intellisense works great. However, when I build project Y I get "The type or namespace name 'common' doesn't exists in the namespace X(are...
In visual studio, in project Y. Right click references, add reference, projects, select Project X. Try again.
assembly reference for folder in a project I have a c# project X that contains a folder COMMON, and I have several classes in the COMMON folder. Now in project Y; I am referencing using X.Common; Everything is good till now, intellisense works great. However, when I build project Y I get "The type or namespace name 'co...
TITLE: assembly reference for folder in a project QUESTION: I have a c# project X that contains a folder COMMON, and I have several classes in the COMMON folder. Now in project Y; I am referencing using X.Common; Everything is good till now, intellisense works great. However, when I build project Y I get "The type or ...
[ "c#", ".net", "visual-studio" ]
3
1
2,407
1
0
2011-05-31T23:53:19.183000
2011-06-01T07:47:29.907000
6,194,847
6,194,873
How can I utilize multiple databases in an entity framework solution simultaneously?
I have two unrelated databases and I need to pass data back and forth between them. Right now I have created two separate entity models - one for each database - but this is causing issues in my code b/c I have to do a Using nameofcontext / End Using and when I try to then use some of the results from the first section...
Since this is a website, you could create one instance of each context in Global.asax's BeginRequest event, and dispose of that instance in EndRequest. Doing that means during the rest of the event lifecycle, you have contexts that will remain open and can do what you need, but you still know they're being properly dis...
How can I utilize multiple databases in an entity framework solution simultaneously? I have two unrelated databases and I need to pass data back and forth between them. Right now I have created two separate entity models - one for each database - but this is causing issues in my code b/c I have to do a Using nameofcont...
TITLE: How can I utilize multiple databases in an entity framework solution simultaneously? QUESTION: I have two unrelated databases and I need to pass data back and forth between them. Right now I have created two separate entity models - one for each database - but this is causing issues in my code b/c I have to do ...
[ "asp.net", "vb.net", "entity-framework", "entity-framework-4", "linq-to-entities" ]
3
3
284
1
0
2011-05-31T23:53:35.703000
2011-05-31T23:58:13.737000
6,194,848
6,204,247
How to set row height Sencha Touch List
How can I set the row height in a Sencha Touch List object? I'm using HTML to format the row, rows get taller with multiple lines, but how do I set the row height? Thanks, Gerry
To edit the List elements default height, you have two ways to do it: Create your own Sencha Theme with SASS (The official Sencha way to do it). Override the Sencha Touch Theme CSS. In the first case you only need to edit the $global-row-height variable value like, for example. $global-row-height: 100px; If you want to...
How to set row height Sencha Touch List How can I set the row height in a Sencha Touch List object? I'm using HTML to format the row, rows get taller with multiple lines, but how do I set the row height? Thanks, Gerry
TITLE: How to set row height Sencha Touch List QUESTION: How can I set the row height in a Sencha Touch List object? I'm using HTML to format the row, rows get taller with multiple lines, but how do I set the row height? Thanks, Gerry ANSWER: To edit the List elements default height, you have two ways to do it: Creat...
[ "list", "sencha-touch" ]
6
10
9,718
4
0
2011-05-31T23:53:36.437000
2011-06-01T16:07:26.480000
6,194,851
6,205,864
Separator Template for table building repeater
I have built repeaters before but dont have much experience manipulating table layout with them. Presently I have a repeater that is populating the data correctly but doing so in one column. I would like it to be 4 columns. I was told using a Separator Template is the best way to do this. Here is my repeater:
I ended up using a literal as a table break. Then populating that literal based off the mod of my counter Then code behind Literal tableBreak = (Literal)e.Item.FindControl("tablebreak"); if (e.Item.ItemIndex % 4 == 3) tableBreak.Text = " ";
Separator Template for table building repeater I have built repeaters before but dont have much experience manipulating table layout with them. Presently I have a repeater that is populating the data correctly but doing so in one column. I would like it to be 4 columns. I was told using a Separator Template is the best...
TITLE: Separator Template for table building repeater QUESTION: I have built repeaters before but dont have much experience manipulating table layout with them. Presently I have a repeater that is populating the data correctly but doing so in one column. I would like it to be 4 columns. I was told using a Separator Te...
[ "c#", "asp.net", "html" ]
1
0
4,828
5
0
2011-05-31T23:54:11.490000
2011-06-01T18:20:54.190000
6,194,865
6,204,607
Serving an image from PIL dynamically
I am using PIL (Python Imaging Library), and Paste to make a very simple web page. I have a function that returns just an image tag: def home(self): return ' ' And I also have a function called photo that (ideally) returns the image to be put in the img tag: def photo(self): img = image_from_PIL # this part works outpu...
Do not return a list with the image, but the image itself. Replace return [final_img] with return final_img
Serving an image from PIL dynamically I am using PIL (Python Imaging Library), and Paste to make a very simple web page. I have a function that returns just an image tag: def home(self): return ' ' And I also have a function called photo that (ideally) returns the image to be put in the img tag: def photo(self): img = ...
TITLE: Serving an image from PIL dynamically QUESTION: I am using PIL (Python Imaging Library), and Paste to make a very simple web page. I have a function that returns just an image tag: def home(self): return ' ' And I also have a function called photo that (ideally) returns the image to be put in the img tag: def p...
[ "python", "python-imaging-library", "paste" ]
1
1
990
1
0
2011-05-31T23:57:05.750000
2011-06-01T16:33:38.173000
6,194,875
6,208,544
Getting first image from html using Python/Django
I am grabbing a bunch of html from a service and parsing it slightly. I am looking for a way to grab the link from the first image tag. Something similar like this JQuery code: var imagelink = $('img:first', feed.content).attr('src'); But of course using only Python/Django (server runs on Google app engine). I rather n...
If I do any more parsing of html I probably will look into one of the libraries suggested. But for now I have solved this by: startImgPos = post.find(' -1): endImgPos = post.find('>', startImgPos, len(post)) imageTag = post[startImgPos:endImgPos] startSrcPos = imageTag.find('src="', 0, len(post)) +5 endSrcPos = imageTa...
Getting first image from html using Python/Django I am grabbing a bunch of html from a service and parsing it slightly. I am looking for a way to grab the link from the first image tag. Something similar like this JQuery code: var imagelink = $('img:first', feed.content).attr('src'); But of course using only Python/Dja...
TITLE: Getting first image from html using Python/Django QUESTION: I am grabbing a bunch of html from a service and parsing it slightly. I am looking for a way to grab the link from the first image tag. Something similar like this JQuery code: var imagelink = $('img:first', feed.content).attr('src'); But of course usi...
[ "python", "html", "django", "image" ]
3
0
2,652
3
0
2011-05-31T23:58:26.123000
2011-06-01T22:36:46.753000
6,194,884
6,196,634
What's the difference between IPloneSiteRoot and ISiteRoot in Plone?
I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I register it?
An IPloneSiteRoot is a specific kind of ISiteRoot. IPloneSiteRoot is provided by the root of a Plone site, whereas ISiteRoot is provided by any CMF portal. If your product is only intended to work in Plone, then it doesn't really matter which interface you use. If you want it to be usable with other CMF-based applicati...
What's the difference between IPloneSiteRoot and ISiteRoot in Plone? I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I register it?
TITLE: What's the difference between IPloneSiteRoot and ISiteRoot in Plone? QUESTION: I'm Working in Plone 4.1 and I'm just curious to know the difference between Products.CMFPlone.interfaces.IPloneSiteRoot and Products.CMFCore.interfaces.ISiteRoot. If I want to register a zope-3 style view, to which one should I regi...
[ "plone", "zope3" ]
4
6
722
2
0
2011-06-01T00:00:42.710000
2011-06-01T05:20:48.233000
6,194,897
6,201,713
How do I update Windows path WITHOUT losing the original embedded environment variables
Windows 2008R2 Powershell v2.0 Original Path (as seen from Advanced System Settings/Environment Variables) is: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ From Powershell I run: [Environment]::SetEnvironmentVariable("PATH", "$($env:path;C:\Temp", "Machine"...
Kind of medieval, but seems to work: (((reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment") | select-string "\s+path\s+REG_EXPAND_SZ").line -split " ")[3]
How do I update Windows path WITHOUT losing the original embedded environment variables Windows 2008R2 Powershell v2.0 Original Path (as seen from Advanced System Settings/Environment Variables) is: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ From Powershe...
TITLE: How do I update Windows path WITHOUT losing the original embedded environment variables QUESTION: Windows 2008R2 Powershell v2.0 Original Path (as seen from Advanced System Settings/Environment Variables) is: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v...
[ "powershell", "environment-variables" ]
2
3
1,143
4
0
2011-06-01T00:03:23.077000
2011-06-01T13:13:55.207000
6,194,899
6,211,324
Authenticate to Google Talk (XMPP, Smack) using an authToken
The app I'm writing is connecting to a XMPP server, and if the user chooses, I want to give them the option to connect to their google chat account, without having to enter the credentials... To do this, I'd get the permission to use the google account, get the token and authenticate to google talk (XMPP server, using ...
You're looking for documentation on the X-GOOGLE-TOKEN SASL mechanism. This should be the beginning. Use service=mail: https://www.google.com/accounts/ClientLogin? accountType=GOOGLE& Email=YOURUSERNAME@gmail.com& Passwd=YOURPASSWORD& service=mail Which will return 200 OK and three values: SID= LSID= Auth= Parse out th...
Authenticate to Google Talk (XMPP, Smack) using an authToken The app I'm writing is connecting to a XMPP server, and if the user chooses, I want to give them the option to connect to their google chat account, without having to enter the credentials... To do this, I'd get the permission to use the google account, get t...
TITLE: Authenticate to Google Talk (XMPP, Smack) using an authToken QUESTION: The app I'm writing is connecting to a XMPP server, and if the user chooses, I want to give them the option to connect to their google chat account, without having to enter the credentials... To do this, I'd get the permission to use the goo...
[ "android", "xmpp", "smack", "google-talk" ]
4
8
4,879
1
0
2011-06-01T00:03:43.190000
2011-06-02T06:45:01.873000
6,194,900
6,195,273
How to work around "scons: warning: Two different environments were specified for target"
Suppose I have an SConstruct file that looks like this: env = Environment() env.Program("a", ["a.c", "util.c"]) env.Program("b", ["b.c", "util.c"]) This build works properly with no SCons warning messages. However, if I modify this to specify different libraries for each Program build (the actual libraries are not rel...
I found a workaround that doesn't involve creating extra variables to hold the object file nodes: env.Program("a", ["a.c", env.Object("util.c")], LIBS="m") env.Program("b", ["b.c", env.Object("util.c")], LIBS="c") This isolates the build of util.c within a single environment. Although it is specified twice, once for ea...
How to work around "scons: warning: Two different environments were specified for target" Suppose I have an SConstruct file that looks like this: env = Environment() env.Program("a", ["a.c", "util.c"]) env.Program("b", ["b.c", "util.c"]) This build works properly with no SCons warning messages. However, if I modify th...
TITLE: How to work around "scons: warning: Two different environments were specified for target" QUESTION: Suppose I have an SConstruct file that looks like this: env = Environment() env.Program("a", ["a.c", "util.c"]) env.Program("b", ["b.c", "util.c"]) This build works properly with no SCons warning messages. Howev...
[ "scons" ]
29
20
13,006
4
0
2011-06-01T00:04:07.777000
2011-06-01T01:17:18.537000
6,194,901
6,195,691
Django (audio) File Validation
I'm experimenting with a site that will allow users to upload audio files. I've read every doc that I can get my hands on but can't find much about validating files. Total newb here (never done any file validation of any kind before) and trying to figure this out. Can someone hold my hand and tell me what I need to kno...
You want to validate the file before it gets written to disk. When you upload a file, the form gets validated then the uploaded file gets passed to a handler/method that deals with the actual writing to the disk on your server. So in between these two operations, you want to perform some custom validation to make sure ...
Django (audio) File Validation I'm experimenting with a site that will allow users to upload audio files. I've read every doc that I can get my hands on but can't find much about validating files. Total newb here (never done any file validation of any kind before) and trying to figure this out. Can someone hold my hand...
TITLE: Django (audio) File Validation QUESTION: I'm experimenting with a site that will allow users to upload audio files. I've read every doc that I can get my hands on but can't find much about validating files. Total newb here (never done any file validation of any kind before) and trying to figure this out. Can so...
[ "django", "django-models", "django-file-upload" ]
23
27
5,379
1
0
2011-06-01T00:04:33.363000
2011-06-01T02:42:31.183000
6,194,910
6,194,920
jquery: how can I stop appendTo from happening instantly?
I have been googling and trying for the life of me to delay appendTo from happening instantly, so that I can do a nice fadeout first. Here, myObject is a link: My Link And I would like to move it into an unordered list: Item 1 Item 2 Item 3 By doing something like this: myObject.fadeOut(300).appendTo('#newDiv ul').fade...
Try this: myObject.fadeOut(300, function() { $(this).appendTo('#newDiv ul').fadeIn(300) }); By doing the "appendTo" in the callback from the fade, you can wait until the fade is done. All (as far as I know) the jQuery animation effects take callbacks like that.
jquery: how can I stop appendTo from happening instantly? I have been googling and trying for the life of me to delay appendTo from happening instantly, so that I can do a nice fadeout first. Here, myObject is a link: My Link And I would like to move it into an unordered list: Item 1 Item 2 Item 3 By doing something li...
TITLE: jquery: how can I stop appendTo from happening instantly? QUESTION: I have been googling and trying for the life of me to delay appendTo from happening instantly, so that I can do a nice fadeout first. Here, myObject is a link: My Link And I would like to move it into an unordered list: Item 1 Item 2 Item 3 By ...
[ "javascript", "jquery", "jquery-animate", "delay", "appendto" ]
2
6
390
1
0
2011-06-01T00:07:05.123000
2011-06-01T00:08:53.017000
6,194,912
6,195,252
Zip Code Demographics in R
I could get at my goals "the long way" but am hoping to stay completely within R. I am looking to append Census demographic data by zip code to records in my database. I know that R has a few Census-based packages, but, unless I am missing something, these data do not seem to exist at the zip code level, nor is it intu...
In short, no. Census to zip translations are generally created from proprietary sources. It's unlikely that you'll find anything at the zipcode level from a census perspective (privacy). However, that doesn't mean you're left in the cold. You can use the zipcodes that you have and append census data from the MSA, muSA ...
Zip Code Demographics in R I could get at my goals "the long way" but am hoping to stay completely within R. I am looking to append Census demographic data by zip code to records in my database. I know that R has a few Census-based packages, but, unless I am missing something, these data do not seem to exist at the zip...
TITLE: Zip Code Demographics in R QUESTION: I could get at my goals "the long way" but am hoping to stay completely within R. I am looking to append Census demographic data by zip code to records in my database. I know that R has a few Census-based packages, but, unless I am missing something, these data do not seem t...
[ "r", "census" ]
6
6
4,535
5
0
2011-06-01T00:07:27.953000
2011-06-01T01:13:23.557000
6,194,913
6,194,954
unescaping some HTML tags after they've been escaped for XSS
I have html stored in the database and I need to output it to the page. If I don't escape() it, then I get the bold formatting I want, but I run the risk of getting an XSS from the unescaped html source. If I escape() it, then it shows the raw html code bold text instead of bold text. How can I escape everything, excep...
Unescaping is the way to go. If you only whitelist a couple of tags to be converted back from the html escapes, then you won't run into XSS exploits. Workaround markups provide no advantage regarding that, as the many failed BBcode parsers prove. (Instead of converting back and forth it might however be sensible to uti...
unescaping some HTML tags after they've been escaped for XSS I have html stored in the database and I need to output it to the page. If I don't escape() it, then I get the bold formatting I want, but I run the risk of getting an XSS from the unescaped html source. If I escape() it, then it shows the raw html code bold ...
TITLE: unescaping some HTML tags after they've been escaped for XSS QUESTION: I have html stored in the database and I need to output it to the page. If I don't escape() it, then I get the bold formatting I want, but I run the risk of getting an XSS from the unescaped html source. If I escape() it, then it shows the r...
[ "php", "security", "zend-framework", "xss" ]
2
1
2,666
7
0
2011-06-01T00:07:41.020000
2011-06-01T00:15:21.913000
6,194,921
6,196,062
Java Regex find word with no = on end
I'm currently struggling with a text parser to format java protected words with there own HTML tags. so I want class HelloWorld To appear as a string class HelloWorld Which I managed to get working, however class is a protected word, so I want to be able to distinquish using regex beween class and "class" or class= Her...
Instead of "\\b"+javaWord+"\\b", try "(? But @sgusc makes a good point: this technique can't be extended to deal with keywords in longer string literals, or in comments either.
Java Regex find word with no = on end I'm currently struggling with a text parser to format java protected words with there own HTML tags. so I want class HelloWorld To appear as a string class HelloWorld Which I managed to get working, however class is a protected word, so I want to be able to distinquish using regex ...
TITLE: Java Regex find word with no = on end QUESTION: I'm currently struggling with a text parser to format java protected words with there own HTML tags. so I want class HelloWorld To appear as a string class HelloWorld Which I managed to get working, however class is a protected word, so I want to be able to distin...
[ "java", "regex" ]
2
2
359
2
0
2011-06-01T00:09:31.810000
2011-06-01T03:49:29.987000
6,194,924
6,195,437
jQuery getJSON parseerror Expected ';'
Using IE8, jQuery 1.6.1.min.js. The JSON that comes from the REST service seems to be valid (atleast when I validate it on jsonlint.com) { "requestId":"1624517264", "acknowledge":1, "errorCode":0, "totalResultCount":2, "results":[ {"EmployeeCode":"007","EmployeeUno":7,"EmployeeName":"Bond, James","Location":"Unknown","...
If that's exactly the response from urlToSvc, then it looks like you're making a JSONP request but urlToSvc is returning plain JSON. If you use a tool like Firebug to inspect the request that $.getJSON() makes, you should find that it's replacing callback=? with something like callback=jQuery152012865984649397433_13068...
jQuery getJSON parseerror Expected ';' Using IE8, jQuery 1.6.1.min.js. The JSON that comes from the REST service seems to be valid (atleast when I validate it on jsonlint.com) { "requestId":"1624517264", "acknowledge":1, "errorCode":0, "totalResultCount":2, "results":[ {"EmployeeCode":"007","EmployeeUno":7,"EmployeeNam...
TITLE: jQuery getJSON parseerror Expected ';' QUESTION: Using IE8, jQuery 1.6.1.min.js. The JSON that comes from the REST service seems to be valid (atleast when I validate it on jsonlint.com) { "requestId":"1624517264", "acknowledge":1, "errorCode":0, "totalResultCount":2, "results":[ {"EmployeeCode":"007","EmployeeU...
[ "jquery", "json", "parse-error" ]
2
4
5,419
2
0
2011-06-01T00:10:02.513000
2011-06-01T01:49:46.850000