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,251,401
6,251,474
EL expressions are not evaluated in JSP page of JSF
My inputname.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> enter your name page My welcome.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> Welcome, to JSF 1...
Using JSF 1.2 on JSP requires a minimum of Servlet 2.5 container because of the changes in EL (EL has been moved from JSF 1.1 to JSP 2.1, which is part of Servlet 2.5). You need to ensure that you're running your JSF 1.2 webapp on a Servlet 2.5 compatible container with a web.xml which is declared conform the Servlet 2...
EL expressions are not evaluated in JSP page of JSF My inputname.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> enter your name page My welcome.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://ja...
TITLE: EL expressions are not evaluated in JSP page of JSF QUESTION: My inputname.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> enter your name page My welcome.jsp file <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ tag...
[ "jsp", "jsf", "el" ]
1
4
2,708
2
0
2011-06-06T11:32:43.063000
2011-06-06T11:39:09.493000
6,251,416
6,252,343
Spring - Injecting main bean into property bean
I am trying to configure such a relation in spring: MyObject myObject = new MyObject(); myObject.setEntity( new Entity(this) ); is it possible? When I am trying such a configuration: It returns: [java] Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'myObjec...
I would not try to do all that via Spring. Also I would rely more on setter injection:............... // your code public class Main {... public void setMyObject(MyObject o) {... // Manually inject *this* reference into *entity* Entity e = o.getEntity(); e.setMain(this);... }... } public class MyObject {... public vo...
Spring - Injecting main bean into property bean I am trying to configure such a relation in spring: MyObject myObject = new MyObject(); myObject.setEntity( new Entity(this) ); is it possible? When I am trying such a configuration: It returns: [java] Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationE...
TITLE: Spring - Injecting main bean into property bean QUESTION: I am trying to configure such a relation in spring: MyObject myObject = new MyObject(); myObject.setEntity( new Entity(this) ); is it possible? When I am trying such a configuration: It returns: [java] Caused by: org.springframework.beans.factory.BeanCu...
[ "java", "spring", "dependency-injection" ]
1
1
1,057
3
0
2011-06-06T11:34:00.330000
2011-06-06T12:56:46.283000
6,251,418
6,251,575
How to create a string with shell output (backticks) in Bash?
I have been trying to create a string with a variable number of characters in it for a benchmark program. I am trying to use this to set up my messages string: messages=`perl -e 'print "X" x $size'` The goal is to create a dynamic number of characters. For example, if $size is 1 then there will be one X. If size is 5 t...
The reason that $size is not evaluated by bash is that you enclosed it in single quotation marks ( ' ). This gets more obvious if you use the $(...) syntax instead of the backticks: messages=$( perl -e 'print "X" x $size' ) The principle is that everything inside single quotes is not touched by bash (only the quotes ar...
How to create a string with shell output (backticks) in Bash? I have been trying to create a string with a variable number of characters in it for a benchmark program. I am trying to use this to set up my messages string: messages=`perl -e 'print "X" x $size'` The goal is to create a dynamic number of characters. For e...
TITLE: How to create a string with shell output (backticks) in Bash? QUESTION: I have been trying to create a string with a variable number of characters in it for a benchmark program. I am trying to use this to set up my messages string: messages=`perl -e 'print "X" x $size'` The goal is to create a dynamic number of...
[ "string", "bash" ]
0
2
3,272
4
0
2011-06-06T11:34:09.393000
2011-06-06T11:49:42.390000
6,251,434
6,251,776
Retrieve error message in ssis
Is there any way to get a string variable of error message shown in Execution result tab of a package.??? Please help.!
If you are looking for a way to log the information/warning/error messages then you can make use of SSIS logging feature. Please refer my answer in this Stack Overflow question to understand how to configure the logging feature. SSIS logging will capture all the messages that are shown in the Execution Results tab. You...
Retrieve error message in ssis Is there any way to get a string variable of error message shown in Execution result tab of a package.??? Please help.!
TITLE: Retrieve error message in ssis QUESTION: Is there any way to get a string variable of error message shown in Execution result tab of a package.??? Please help.! ANSWER: If you are looking for a way to log the information/warning/error messages then you can make use of SSIS logging feature. Please refer my answ...
[ "ssis" ]
1
2
13,277
2
0
2011-06-06T11:35:22.360000
2011-06-06T12:09:15.133000
6,251,436
6,262,534
jaxb.properties within a JAR file
I am using JAXB version 2. I am using the Sun version so that I can use the replacement of namespaces that is not functioning with standard implementation. This all works fine when my classes are in the same package of the application and the jaxb.properties file is sitting in with the model classes. When I move these ...
As it goes it was a problem with my JAR file. I had copied the package-info.java over to my JAR in the build but not copied the compiled package-info.class. Including both the package-info.java and.class has solved the issue. Thanks for reading and thanks very much for the replies.
jaxb.properties within a JAR file I am using JAXB version 2. I am using the Sun version so that I can use the replacement of namespaces that is not functioning with standard implementation. This all works fine when my classes are in the same package of the application and the jaxb.properties file is sitting in with the...
TITLE: jaxb.properties within a JAR file QUESTION: I am using JAXB version 2. I am using the Sun version so that I can use the replacement of namespaces that is not functioning with standard implementation. This all works fine when my classes are in the same package of the application and the jaxb.properties file is s...
[ "java", "jakarta-ee", "jaxb" ]
2
2
6,981
3
0
2011-06-06T11:35:31.440000
2011-06-07T08:28:34.497000
6,251,441
6,251,968
Referencing a 3rd party DLL when generating code using T4 templates
I'm trying to write a T4 template that needs to log into FB to scrape the docs. To do this i need to reference a 3rd party dll. Can this be done and if so, how?
I assume you mean you want the T4 template to use the DLL when generating code. <#@ assembly name="$(SolutionDir)thirdparty.dll" #>
Referencing a 3rd party DLL when generating code using T4 templates I'm trying to write a T4 template that needs to log into FB to scrape the docs. To do this i need to reference a 3rd party dll. Can this be done and if so, how?
TITLE: Referencing a 3rd party DLL when generating code using T4 templates QUESTION: I'm trying to write a T4 template that needs to log into FB to scrape the docs. To do this i need to reference a 3rd party dll. Can this be done and if so, how? ANSWER: I assume you mean you want the T4 template to use the DLL when g...
[ "c#", "code-generation", "t4" ]
3
9
843
1
0
2011-06-06T11:36:10.737000
2011-06-06T12:26:37.083000
6,251,444
6,251,723
is build b144 the current latest version for java-7?
its already past 2nd June! Btw I just want to know is it true that the features stated at Pure Danger are accurate? If not does anyone know where can be get an accurate overview of the finalized features in Java 7? And just one quick question, in the Download Page, it lists the version for the download at 26-may? Does ...
What you can find on the JDK7 early access download page is the latest current build. If that's b144 at the moment, then yes, b144 is the latest current build. The list at Pure Danger looks accurate. The official source is ofcourse the OpenJDK website, which you have a link to in your own question, so if you want to kn...
is build b144 the current latest version for java-7? its already past 2nd June! Btw I just want to know is it true that the features stated at Pure Danger are accurate? If not does anyone know where can be get an accurate overview of the finalized features in Java 7? And just one quick question, in the Download Page, i...
TITLE: is build b144 the current latest version for java-7? QUESTION: its already past 2nd June! Btw I just want to know is it true that the features stated at Pure Danger are accurate? If not does anyone know where can be get an accurate overview of the finalized features in Java 7? And just one quick question, in th...
[ "java", "java-me", "java-7" ]
1
1
132
1
0
2011-06-06T11:36:19.970000
2011-06-06T12:03:38.833000
6,251,445
6,251,640
Allowing users to enter keys for blowfish encryption
I am writing a sqlite database that will encrypt messages using blowfish. However in order to use it effectively the user has to be able to enter the key for the database when the program starts. The problem is the fact that I am using a randomly generated key for security but this seems to make allowing the user to en...
You could generate the password as follows: SecureRandom r = new SecureRandom(); byte[] bytes = new byte[16]; r.nextBytes(bytes); String pwd = new BigInteger(bytes).toString(Character.MAX_RADIX); System.out.println(pwd); To convert the password back to the byte array, use: bytes = new BigInteger(pwd, Character.MAX_RADI...
Allowing users to enter keys for blowfish encryption I am writing a sqlite database that will encrypt messages using blowfish. However in order to use it effectively the user has to be able to enter the key for the database when the program starts. The problem is the fact that I am using a randomly generated key for se...
TITLE: Allowing users to enter keys for blowfish encryption QUESTION: I am writing a sqlite database that will encrypt messages using blowfish. However in order to use it effectively the user has to be able to enter the key for the database when the program starts. The problem is the fact that I am using a randomly ge...
[ "java", "sqlite", "blowfish" ]
0
0
276
1
0
2011-06-06T11:36:26.900000
2011-06-06T11:56:52.797000
6,251,447
6,251,533
Encode/Decode a TextBox
I use Asp.Net 4, C# and MS SQL. For my website I use MS default solution for preventing Cross-Site Scripting. I'm also used to ENCODE all User's Inputs in my logic so that this data can be stored ENCODED in my Data Base. At the moment I'm using a GridView to do some basic CRUD operation but I'm facing a problem. CREATE...
Firstly I would say that you should never encode before storing in a database. You encode at the point of output - before you put it in a text box, or a grid or wherever. This has a few advantages; You're format agnostic - you can take your data and put it as HTML, XML, JSON or whatever because you haven't locked yours...
Encode/Decode a TextBox I use Asp.Net 4, C# and MS SQL. For my website I use MS default solution for preventing Cross-Site Scripting. I'm also used to ENCODE all User's Inputs in my logic so that this data can be stored ENCODED in my Data Base. At the moment I'm using a GridView to do some basic CRUD operation but I'm ...
TITLE: Encode/Decode a TextBox QUESTION: I use Asp.Net 4, C# and MS SQL. For my website I use MS default solution for preventing Cross-Site Scripting. I'm also used to ENCODE all User's Inputs in my logic so that this data can be stored ENCODED in my Data Base. At the moment I'm using a GridView to do some basic CRUD ...
[ "c#", "asp.net", "escaping", "html-encode" ]
4
3
2,778
1
0
2011-06-06T11:36:36.073000
2011-06-06T11:45:08.957000
6,251,455
6,253,006
HTML 5 Application Cache catch events in Chrome
I've created a website using HTML 5 offline Application Cache and it works well in most cases, but for some users it fails. In Chrome, when the application is being cached, the progress is displayed for each file and also error messages if something goes wrong, like: Application Cache Checking event Application Cache D...
I believe that the spec doesn't mention that the exact cause of the exception should be included in the error. Currently the console is your only friend. To wit, your current error "exceed quota" is due to the fact that Chrome currently limits the storage to 5MB. You can work around this by creating an app package that...
HTML 5 Application Cache catch events in Chrome I've created a website using HTML 5 offline Application Cache and it works well in most cases, but for some users it fails. In Chrome, when the application is being cached, the progress is displayed for each file and also error messages if something goes wrong, like: Appl...
TITLE: HTML 5 Application Cache catch events in Chrome QUESTION: I've created a website using HTML 5 offline Application Cache and it works well in most cases, but for some users it fails. In Chrome, when the application is being cached, the progress is displayed for each file and also error messages if something goes...
[ "html", "google-chrome", "offline-caching" ]
2
1
3,272
1
0
2011-06-06T11:37:17.977000
2011-06-06T13:49:49.647000
6,251,457
6,251,604
jQuery sliding content with css
ive seen the plugins etc to create a carousel of images etc, but what i want to achieve is having a content slider. The content would be approx 500x400px, i was hoping to just give the content a div with unique id, and have it show for, say 6 seconds but if your mouse enters then for animation to hold. I was thinkin al...
This can be done in jQuery without too much work. You already know about setInterval() and the jQuery animation functions. All you'll need to do is implement mouseenter() and mouseleave() to properly pause and continue the animations. Perhaps a setInterval() every time mouseleave() and a clearInterval() every time mous...
jQuery sliding content with css ive seen the plugins etc to create a carousel of images etc, but what i want to achieve is having a content slider. The content would be approx 500x400px, i was hoping to just give the content a div with unique id, and have it show for, say 6 seconds but if your mouse enters then for ani...
TITLE: jQuery sliding content with css QUESTION: ive seen the plugins etc to create a carousel of images etc, but what i want to achieve is having a content slider. The content would be approx 500x400px, i was hoping to just give the content a div with unique id, and have it show for, say 6 seconds but if your mouse e...
[ "javascript", "jquery", "css", "html", "slide" ]
0
1
184
2
0
2011-06-06T11:37:31.157000
2011-06-06T11:52:56.313000
6,251,458
6,251,580
Activity Transition Effects
I tested my app with a Motorola Milestone and a HTC Wildfire. I have a sliding transition animation, when I change to an other activity with the Milestone. I think this is default, because I didn't add any animation to the Theme. But on the Wildfire I don't have any transition effect. Is it possible to get the default ...
Check that your Wildfire phone has Animation enabled. Go to Settings->Display->Animation and verify that "All animations" selected.
Activity Transition Effects I tested my app with a Motorola Milestone and a HTC Wildfire. I have a sliding transition animation, when I change to an other activity with the Milestone. I think this is default, because I didn't add any animation to the Theme. But on the Wildfire I don't have any transition effect. Is it ...
TITLE: Activity Transition Effects QUESTION: I tested my app with a Motorola Milestone and a HTC Wildfire. I have a sliding transition animation, when I change to an other activity with the Milestone. I think this is default, because I didn't add any animation to the Theme. But on the Wildfire I don't have any transit...
[ "android", "animation", "transition" ]
2
4
1,355
1
0
2011-06-06T11:37:35.810000
2011-06-06T11:50:54.930000
6,251,468
6,251,583
Same Fact Table Column; Records with Multiple Reasons
I am in a situation similar to the one below: Think for instance we need to store customer sales in a fact table (under a data warehouse built with dimensional modelling). I have sales, discounts related to the sale, sales returns and cancellations to be stored. Do you think it would be advisable to store sales for a d...
If your sales are considered a good thing (I'm assuming they are) then recording sales as positive numbers makes perfect sense. Any transaction that reduces sales (i.e. discounts and returns) should therefore be recorded as negative numbers. This will make reporting your sales very natural. If you have diffent dimensio...
Same Fact Table Column; Records with Multiple Reasons I am in a situation similar to the one below: Think for instance we need to store customer sales in a fact table (under a data warehouse built with dimensional modelling). I have sales, discounts related to the sale, sales returns and cancellations to be stored. Do ...
TITLE: Same Fact Table Column; Records with Multiple Reasons QUESTION: I am in a situation similar to the one below: Think for instance we need to store customer sales in a fact table (under a data warehouse built with dimensional modelling). I have sales, discounts related to the sale, sales returns and cancellations...
[ "sql-server", "data-warehouse", "business-intelligence" ]
0
1
313
1
0
2011-06-06T11:38:39.693000
2011-06-06T11:51:07.943000
6,251,473
6,251,789
Why is my urlConnection.getContentLength size always -1?
Possible Duplicate: getContentLength() returning -1 on some devices and not others I'm doing on an Android app that will show the the route from a place to another place. So firstly I need to get the kml file and then parse in. However, my parse size is -1 which is not suppose to be so. The parse size must be bigger th...
You need to pass the correct latitude and longitude values for this. I could do this with your code. I tried passing Longitude and latitude values corrected up to 7 decimal points. I tried this. Try with following. Pune = > srcLat = 18.4577015; Pune = > srcLong = 73.8552158; Mumbai = > destLat = 19.017576; Mumbai = > d...
Why is my urlConnection.getContentLength size always -1? Possible Duplicate: getContentLength() returning -1 on some devices and not others I'm doing on an Android app that will show the the route from a place to another place. So firstly I need to get the kml file and then parse in. However, my parse size is -1 which ...
TITLE: Why is my urlConnection.getContentLength size always -1? QUESTION: Possible Duplicate: getContentLength() returning -1 on some devices and not others I'm doing on an Android app that will show the the route from a place to another place. So firstly I need to get the kml file and then parse in. However, my parse...
[ "android", "parsing", "google-maps", "kml" ]
1
0
1,780
1
0
2011-06-06T11:39:06.993000
2011-06-06T12:10:28.020000
6,251,479
6,251,541
Data contiguity in an array in Java
I'm trying to see if any series of data, beginning at array position 0, is contiguous in the sense that array[0] has a numerical value of 0, array[1] has a numerical value of 1, and so on. For example: private void isContiguous(int[] array, int position){ for(int i = 1; i < array.length; i ++){ if(!array[i].equals(null...
Something to start with: public static boolean isContiguous(int[] array) { for (int i = 0; i < array.length-1; i++) { if (array[i+1]-array[i]!= 1) { return false; } } return true; } (I don't know why you need position, OFFSET, and so on, but the above code should fulfill the written requirement)
Data contiguity in an array in Java I'm trying to see if any series of data, beginning at array position 0, is contiguous in the sense that array[0] has a numerical value of 0, array[1] has a numerical value of 1, and so on. For example: private void isContiguous(int[] array, int position){ for(int i = 1; i < array.len...
TITLE: Data contiguity in an array in Java QUESTION: I'm trying to see if any series of data, beginning at array position 0, is contiguous in the sense that array[0] has a numerical value of 0, array[1] has a numerical value of 1, and so on. For example: private void isContiguous(int[] array, int position){ for(int i ...
[ "java" ]
0
2
138
2
0
2011-06-06T11:39:25.730000
2011-06-06T11:45:40.563000
6,251,486
6,251,540
how to add a new post type and fetch all the post related to it in wordpress?
I want to add a new post type for example news in the admin and get the post related to it. How can we do it in wordpress? Do i have to add a plugin? Any help would be highly appreciated.
See the docs for register_post_type() and register_taxonomy(). Then you can use query_posts: query_posts(array( 'post_type' => 'YOUR POST TYPE', 'taxonomy' => 'YOUR TAXONOMY FOR THE POST TYPE', 'terms' => $array_of_categories, 'orderby' => 'menu_order', 'order' => 'ASC' ));
how to add a new post type and fetch all the post related to it in wordpress? I want to add a new post type for example news in the admin and get the post related to it. How can we do it in wordpress? Do i have to add a plugin? Any help would be highly appreciated.
TITLE: how to add a new post type and fetch all the post related to it in wordpress? QUESTION: I want to add a new post type for example news in the admin and get the post related to it. How can we do it in wordpress? Do i have to add a plugin? Any help would be highly appreciated. ANSWER: See the docs for register_p...
[ "wordpress" ]
0
2
58
1
0
2011-06-06T11:40:14.680000
2011-06-06T11:45:39.443000
6,251,490
6,251,507
Why doesn't Apache serve PHP files with a Last-Modified header?
Is this by design? On my Debian (Etch) server I noticed that Apache (2.2) will not send a Last-Modified header when serving PHP (mod_5.2.0) files (we're talking plain-jane echo 'Hello World'; PHP files). Additionally, I noticed that the header Accept-Ranges is also not served by Apache for PHP files, although my main c...
PHP are dynamic page that can change. So Apache can't know the Last-Modified header. You can add your own header with: header('Last-Modified: GMT time'); Of course if you need this header maybe you are looking to manage the request header If-Modified-Since too. You can find it in $_SERVER['HTTP_IF_MODIFIED_SINCE']
Why doesn't Apache serve PHP files with a Last-Modified header? Is this by design? On my Debian (Etch) server I noticed that Apache (2.2) will not send a Last-Modified header when serving PHP (mod_5.2.0) files (we're talking plain-jane echo 'Hello World'; PHP files). Additionally, I noticed that the header Accept-Range...
TITLE: Why doesn't Apache serve PHP files with a Last-Modified header? QUESTION: Is this by design? On my Debian (Etch) server I noticed that Apache (2.2) will not send a Last-Modified header when serving PHP (mod_5.2.0) files (we're talking plain-jane echo 'Hello World'; PHP files). Additionally, I noticed that the h...
[ "php", "apache", "http-headers" ]
0
6
2,252
2
0
2011-06-06T11:40:44.437000
2011-06-06T11:42:43.170000
6,251,498
6,277,908
match text between two html custom tags but not other custom tags
I have something like the following;- <--customMarker>Test1<--/customMarker> <--customMarker key='myKEY'>Test2<--/customMarker> <--customMarker>Test3 <--customInnerMarker>Test4<--/customInnerMarker> <--/customMarker> I need to be able to replace text between the customMarker tags, I tried the following;- str.replace(/<...
In the end, I did something like the following (incase anyone else needs this. enjoy!!! But note: Word about town is that using regex with html tags is not ideal, so do your own research and make up your mind. For me, it had to be done this way, mostly bcos i wanted to, but also bcos it simplified the job in this insta...
match text between two html custom tags but not other custom tags I have something like the following;- <--customMarker>Test1<--/customMarker> <--customMarker key='myKEY'>Test2<--/customMarker> <--customMarker>Test3 <--customInnerMarker>Test4<--/customInnerMarker> <--/customMarker> I need to be able to replace text bet...
TITLE: match text between two html custom tags but not other custom tags QUESTION: I have something like the following;- <--customMarker>Test1<--/customMarker> <--customMarker key='myKEY'>Test2<--/customMarker> <--customMarker>Test3 <--customInnerMarker>Test4<--/customInnerMarker> <--/customMarker> I need to be able t...
[ "javascript", "regex" ]
2
2
1,155
3
0
2011-06-06T11:41:26.710000
2011-06-08T11:17:11.920000
6,251,500
6,251,922
Approach to unit-testing large batches of dynamically generated strings
My web app has a class for analysing and manipulating the data stored in the URL's hash, which look something like http://myapp.com/#!/location/hornsea/season/spring/facilities/+shop+swimming-airport/size/50 To be able to unit test the various permutations I'm storing some URL fragments in an object (e.g. var fragments...
You can test this with an inverse function test. You have to write a function (encode) that's the inverse function to your URL parser. The encode function constructs the URL from the valid input values. The test has the form: input = {"location": "hornsea", "season": "winter", "size": "50"} assert input == parse(encode...
Approach to unit-testing large batches of dynamically generated strings My web app has a class for analysing and manipulating the data stored in the URL's hash, which look something like http://myapp.com/#!/location/hornsea/season/spring/facilities/+shop+swimming-airport/size/50 To be able to unit test the various perm...
TITLE: Approach to unit-testing large batches of dynamically generated strings QUESTION: My web app has a class for analysing and manipulating the data stored in the URL's hash, which look something like http://myapp.com/#!/location/hornsea/season/spring/facilities/+shop+swimming-airport/size/50 To be able to unit tes...
[ "javascript", "unit-testing", "batch-processing" ]
1
0
119
1
0
2011-06-06T11:41:43.640000
2011-06-06T12:23:23.497000
6,251,504
6,251,810
How to load an arbitrary image from a BLOB stream into a TImage?
If I understand it correctly, TImage.LoadFromFile determines the type of picture from the file extension. Is there any way to detect the image type automatically from a TBlobStream with a raw image in it? My current code: procedure LoadImageFromStream(AImage: TImage; ADataSet: TDataSet); var Stream: TStream; begin Stre...
See this SO answer for file content retrieval from header. Or you can use our TSynPicture class, which will handle all kind of pictures (bmp/gif/tiff/jpg/png) using Gdi+ library, in one single class. So your TPicture can be this unique class, for any kind of picture. With less code overhead than the Jpeg or PNG Delphi ...
How to load an arbitrary image from a BLOB stream into a TImage? If I understand it correctly, TImage.LoadFromFile determines the type of picture from the file extension. Is there any way to detect the image type automatically from a TBlobStream with a raw image in it? My current code: procedure LoadImageFromStream(AIm...
TITLE: How to load an arbitrary image from a BLOB stream into a TImage? QUESTION: If I understand it correctly, TImage.LoadFromFile determines the type of picture from the file extension. Is there any way to detect the image type automatically from a TBlobStream with a raw image in it? My current code: procedure LoadI...
[ "delphi", "stream", "delphi-2007", "detect", "timage" ]
9
16
16,466
4
0
2011-06-06T11:42:13.450000
2011-06-06T12:12:24.167000
6,251,505
6,251,616
Ruby: execute bash command, capture output AND dump to screen at the same time
So my problem is that I need to have the output of running the command dumped to the screen and also capture it in a variable in a ruby script. I know that I can do the second part like this: some_variable = `./some_kickbutt` But my problem is that I need it to still print to the console as Hudson captures that output ...
Just tee the stdout stream to stderr like so: ruby -e 'var = `ls | tee /dev/stderr`; puts "\nFROM RUBY\n\n"; puts var' | nl ruby -e 'var = `ls | tee /dev/stderr`; puts "\nFROM RUBY\n\n"; puts var' 2>&1 | nl
Ruby: execute bash command, capture output AND dump to screen at the same time So my problem is that I need to have the output of running the command dumped to the screen and also capture it in a variable in a ruby script. I know that I can do the second part like this: some_variable = `./some_kickbutt` But my problem ...
TITLE: Ruby: execute bash command, capture output AND dump to screen at the same time QUESTION: So my problem is that I need to have the output of running the command dumped to the screen and also capture it in a variable in a ruby script. I know that I can do the second part like this: some_variable = `./some_kickbut...
[ "ruby", "bash", "capture" ]
1
5
960
1
0
2011-06-06T11:42:34.110000
2011-06-06T11:54:02.327000
6,251,520
6,251,609
'Refire' jQuery every second?
The following code adds a class to the last div: $(".mydivs:last").addClass('added'); This works on page load but the divs are in an animation, so the order changes. Is there a way to make the code run every second, so the class is added to the last div each time? For me I dont think it matters that eventually every di...
you can use animation or: setInterval(function(){ $(".mydivs:last").toggleClass('added'); },1000); // add or remove class `added` after every one second; two change the duration you can chage the value of `1000`
'Refire' jQuery every second? The following code adds a class to the last div: $(".mydivs:last").addClass('added'); This works on page load but the divs are in an animation, so the order changes. Is there a way to make the code run every second, so the class is added to the last div each time? For me I dont think it ma...
TITLE: 'Refire' jQuery every second? QUESTION: The following code adds a class to the last div: $(".mydivs:last").addClass('added'); This works on page load but the divs are in an animation, so the order changes. Is there a way to make the code run every second, so the class is added to the last div each time? For me ...
[ "javascript", "jquery" ]
1
3
1,882
4
0
2011-06-06T11:43:52.370000
2011-06-06T11:53:17.730000
6,251,521
6,251,620
How to create PHP function to render menu?
I do render menu in HTML like that Option 1 Option 2 Now I want to put that code into function render_menu('current_option'); Do I have to put the whole string into one echo statement?
you can put it all in echo or just use it like that by wrapping it inside output buffering.
How to create PHP function to render menu? I do render menu in HTML like that Option 1 Option 2 Now I want to put that code into function render_menu('current_option'); Do I have to put the whole string into one echo statement?
TITLE: How to create PHP function to render menu? QUESTION: I do render menu in HTML like that Option 1 Option 2 Now I want to put that code into function render_menu('current_option'); Do I have to put the whole string into one echo statement? ANSWER: you can put it all in echo or just use it like that by wrapping i...
[ "php" ]
0
3
1,250
2
0
2011-06-06T11:44:09.753000
2011-06-06T11:54:32.653000
6,251,528
6,251,545
Can't find the bug in javascript
Code: for(int j=0; j <\/option>'; } Firebug is giving this error: Missing; after for loop initializer.
Javascript doesn't understand int. Use var instead. Some other pointers: Assuming virtualFields is an ordinary array, length is a property, not a method. You may need to html escape the virtualFields[j] values that you're concatenating like that. You only need to escape / inside a regular expression, not within an ordi...
Can't find the bug in javascript Code: for(int j=0; j <\/option>'; } Firebug is giving this error: Missing; after for loop initializer.
TITLE: Can't find the bug in javascript QUESTION: Code: for(int j=0; j <\/option>'; } Firebug is giving this error: Missing; after for loop initializer. ANSWER: Javascript doesn't understand int. Use var instead. Some other pointers: Assuming virtualFields is an ordinary array, length is a property, not a method. You...
[ "javascript" ]
2
10
167
2
0
2011-06-06T11:44:56.720000
2011-06-06T11:46:08.907000
6,251,536
6,251,557
Const procedure in C++, weird error in Visual Studio C++ 2010?
class a{ public: int b; static int c; virtual void mod() const { c=4; } }; int _tmain(int argc, _TCHAR* argv[]) { a bi; return 0; } Look at this... After compiling it using Visual Studio C++ 2010 compiler, I get... cpplearningconsole.obj: error LNK2001: unresolved external symbol "public: static int a::c" (?c@a@@2HA...
You have just declared the static variable in the class definition, you need to define it in the by doing int a::c = 0;.
Const procedure in C++, weird error in Visual Studio C++ 2010? class a{ public: int b; static int c; virtual void mod() const { c=4; } }; int _tmain(int argc, _TCHAR* argv[]) { a bi; return 0; } Look at this... After compiling it using Visual Studio C++ 2010 compiler, I get... cpplearningconsole.obj: error LNK2001: ...
TITLE: Const procedure in C++, weird error in Visual Studio C++ 2010? QUESTION: class a{ public: int b; static int c; virtual void mod() const { c=4; } }; int _tmain(int argc, _TCHAR* argv[]) { a bi; return 0; } Look at this... After compiling it using Visual Studio C++ 2010 compiler, I get... cpplearningconsole.ob...
[ "c++", "visual-c++-2010" ]
0
8
333
4
0
2011-06-06T11:45:25.980000
2011-06-06T11:47:59.003000
6,251,553
6,251,886
Cleanest way of working out next variable name based on sequential order?
Hope my title explains it ok! Here's more detail: I'm creating an array which stores keys & their values. Eg. test1 = hello test2 = world test3 = foo What is the cleanest way of working out what to call the next key? Let's say I will know the first part is 'test', but I don't know what the highest value number is. Obvi...
Implementation of @alex answer without using a loop: $arr = array('test6', 'test45', 'test23'); $max = max(filter_var_array($arr, FILTER_SANITIZE_NUMBER_INT)); $newKey = 'test'. ++$max; // string(6) "test46" CodePad
Cleanest way of working out next variable name based on sequential order? Hope my title explains it ok! Here's more detail: I'm creating an array which stores keys & their values. Eg. test1 = hello test2 = world test3 = foo What is the cleanest way of working out what to call the next key? Let's say I will know the fir...
TITLE: Cleanest way of working out next variable name based on sequential order? QUESTION: Hope my title explains it ok! Here's more detail: I'm creating an array which stores keys & their values. Eg. test1 = hello test2 = world test3 = foo What is the cleanest way of working out what to call the next key? Let's say I...
[ "php", "variables", "key", "sequential" ]
1
3
172
4
0
2011-06-06T11:47:26.447000
2011-06-06T12:19:34.637000
6,251,554
6,251,649
Does sort function consider the leaf nodes in a multilevel array?
This following piece of code is meant to create a multilevel array, print it, then shuffle it, again print it, and sort the array. $arr=array( array( array('a','b','c') ), array( array('d','e','f') ), array( array('g','h','i') ), ); print_r($arr); shuffle($arr); print_r($arr); sort($arr); print_r($arr); Now the odd thi...
See the array section of PHP's comparison operator reference, especially the array comparison transcription. Basically PHP first compares the amount of keys in the array, then checks if the arrays have the same keys (in this case, 0 for the inner arrays) and then compares the values. Because you have a nested array the...
Does sort function consider the leaf nodes in a multilevel array? This following piece of code is meant to create a multilevel array, print it, then shuffle it, again print it, and sort the array. $arr=array( array( array('a','b','c') ), array( array('d','e','f') ), array( array('g','h','i') ), ); print_r($arr); shuffl...
TITLE: Does sort function consider the leaf nodes in a multilevel array? QUESTION: This following piece of code is meant to create a multilevel array, print it, then shuffle it, again print it, and sort the array. $arr=array( array( array('a','b','c') ), array( array('d','e','f') ), array( array('g','h','i') ), ); pri...
[ "php", "sorting", "shuffle" ]
5
3
102
1
0
2011-06-06T11:47:40.143000
2011-06-06T11:57:40.983000
6,251,558
6,251,598
facebook like button not displaying news article content
I'm implementing a facebook like button on a simple blog/news section I created in an MVC 3 web application. I used the XFBML way to implement this. It works, but not completely. When clicking and checking it on facebook, it shows the title I specified. Here is a piece of code. The viewbag information comes from my vie...
see the facebook url linter it shows you exactly what facebook sees when greping the url. Also you should read up on the other meta tags
facebook like button not displaying news article content I'm implementing a facebook like button on a simple blog/news section I created in an MVC 3 web application. I used the XFBML way to implement this. It works, but not completely. When clicking and checking it on facebook, it shows the title I specified. Here is a...
TITLE: facebook like button not displaying news article content QUESTION: I'm implementing a facebook like button on a simple blog/news section I created in an MVC 3 web application. I used the XFBML way to implement this. It works, but not completely. When clicking and checking it on facebook, it shows the title I sp...
[ "facebook", "asp.net-mvc-3", "blogs" ]
0
1
463
1
0
2011-06-06T11:48:08.447000
2011-06-06T11:52:18.977000
6,251,562
6,251,732
AppStore submission devices
We have in store an app which displays a series of videos through HTTP Live Streaming. Due to the nature of this videos, and the screensize of the iPhone/iPod device, we have decided to leave behind everything that does not have retina display. The reason? Well, this videos are encoded in high resolution, and even that...
You can put constraints on the App in the store, informing of the need for retina display or whatever device capability it needs (i.e., Camera [not on old iPod Touch], GPS, etc.). It does lead to bad reviews, but you cannot stop idiots in the world from buying a product. There have been plenty of cases brought to court...
AppStore submission devices We have in store an app which displays a series of videos through HTTP Live Streaming. Due to the nature of this videos, and the screensize of the iPhone/iPod device, we have decided to leave behind everything that does not have retina display. The reason? Well, this videos are encoded in hi...
TITLE: AppStore submission devices QUESTION: We have in store an app which displays a series of videos through HTTP Live Streaming. Due to the nature of this videos, and the screensize of the iPhone/iPod device, we have decided to leave behind everything that does not have retina display. The reason? Well, this videos...
[ "iphone", "app-store", "retina-display" ]
0
0
147
3
0
2011-06-06T11:48:15.103000
2011-06-06T12:05:04.323000
6,251,567
6,251,908
Creating a portlet from existing WAR file
I have an existing war file, nothing special about it, just a normal web application. I am making a portal page and I want to make this existing web application into a portlet. Anyone know how to go about doing that? Basically if I could just stick this war file into a portlet window, that would be great but I don't kn...
Yes you can package your portlet wars in the specified format and ensure you have a portlet.xml in addition to the web.xml I have not used OpenPortal but I assume it is the portal framework that allows you to deploy your individual portlet as a war. A diagram example is available here. See 5.2.1.2. Package Structure fo...
Creating a portlet from existing WAR file I have an existing war file, nothing special about it, just a normal web application. I am making a portal page and I want to make this existing web application into a portlet. Anyone know how to go about doing that? Basically if I could just stick this war file into a portlet ...
TITLE: Creating a portlet from existing WAR file QUESTION: I have an existing war file, nothing special about it, just a normal web application. I am making a portal page and I want to make this existing web application into a portlet. Anyone know how to go about doing that? Basically if I could just stick this war fi...
[ "tomcat", "portlet", "war" ]
1
2
613
1
0
2011-06-06T11:48:29.870000
2011-06-06T12:22:41.513000
6,251,569
6,253,027
converting text size into data coordinates
In matplotlib, what is a way of converting the text box size into data coordinates? For example, in this toy script I'm fine-tuning the coordinates of the text box so that it's next to a data point. #!/usr/bin/python import matplotlib.pyplot as plt xx=[1,2,3] yy=[2,3,4] dy=[0.1,0.2,0.05] fig=plt.figure() ax=fig.add_s...
I'm not happy with it at all, but the following works; I was getting frustrated until I found this code for a similar problem, which suggested a way to get at the renderer. import matplotlib.pyplot as plt xx=[1,2,3] yy=[2,3,4] dy=[0.1,0.2,0.05] fig=plt.figure() figname = "out.png" ax=fig.add_subplot(111) ax.errorbar...
converting text size into data coordinates In matplotlib, what is a way of converting the text box size into data coordinates? For example, in this toy script I'm fine-tuning the coordinates of the text box so that it's next to a data point. #!/usr/bin/python import matplotlib.pyplot as plt xx=[1,2,3] yy=[2,3,4] dy=[0...
TITLE: converting text size into data coordinates QUESTION: In matplotlib, what is a way of converting the text box size into data coordinates? For example, in this toy script I'm fine-tuning the coordinates of the text box so that it's next to a data point. #!/usr/bin/python import matplotlib.pyplot as plt xx=[1,2,3...
[ "python", "matplotlib" ]
8
7
3,258
2
0
2011-06-06T11:48:33.373000
2011-06-06T13:51:38.463000
6,251,573
6,251,607
C# convert any format string to double
I tried searching google and stackoverflow without success. I'm having a problem with "Input string was not in a correct format." exception with an application I'm working at. Thing is, that I convert some double values to strings with doubleNumber.ToString("N2"); in order to store them in XML file. When I switch testi...
You have to specify a culture because (eg.) "3,001" is ambiguous - is it 3.001 or 3001? Depending on what your numbers look like, perhaps you could attempt to detect the culture by counting number of, and. characters and/or checking their positions.
C# convert any format string to double I tried searching google and stackoverflow without success. I'm having a problem with "Input string was not in a correct format." exception with an application I'm working at. Thing is, that I convert some double values to strings with doubleNumber.ToString("N2"); in order to stor...
TITLE: C# convert any format string to double QUESTION: I tried searching google and stackoverflow without success. I'm having a problem with "Input string was not in a correct format." exception with an application I'm working at. Thing is, that I convert some double values to strings with doubleNumber.ToString("N2")...
[ "c#", "string", "format", "double", "type-conversion" ]
2
3
3,257
2
0
2011-06-06T11:49:31.750000
2011-06-06T11:53:11.687000
6,251,578
6,261,773
Does Grails + Maven + JCL work in conjunction?
I'm working with IntelliJ IDEA 10.0.1 and Grails 1.3.7. I have a mavenized Grails project which depends on many logging libraries. Here's the problem: I have to use JCL as logging framework, but grails per default is working with SLF4J and has some default dependencies like jcl-over-slf4j, which are inherited by every ...
Ok I think I got the answer now.. The problem is that the defined maven-grails-plugin (which is mandatory when you use maven + grails) within my pom file depends on jcl-over-slf4j and therefore gets downloaded when I start my application through maven. With my current maven version (2.2.1) it's not possible to exclude ...
Does Grails + Maven + JCL work in conjunction? I'm working with IntelliJ IDEA 10.0.1 and Grails 1.3.7. I have a mavenized Grails project which depends on many logging libraries. Here's the problem: I have to use JCL as logging framework, but grails per default is working with SLF4J and has some default dependencies lik...
TITLE: Does Grails + Maven + JCL work in conjunction? QUESTION: I'm working with IntelliJ IDEA 10.0.1 and Grails 1.3.7. I have a mavenized Grails project which depends on many logging libraries. Here's the problem: I have to use JCL as logging framework, but grails per default is working with SLF4J and has some defaul...
[ "grails" ]
0
0
268
1
0
2011-06-06T11:50:20.177000
2011-06-07T07:14:15.083000
6,251,590
6,252,130
Variables in PDE map files
Some PDE builds use map files. In my case, the project is BIRT and the map files contains things like: plugin@org.eclipse.birt.chart.device.extension=r262_v20110127,:ext:xgu@dev.eclipse.org:/cvsroot/birt,,source/org.eclipse.birt.chart.device.extension plugin@org.apache.batik.svggen.source,1.6.0=GET,http://build-birt/so...
Check in your customTargets.xml file (copied from the template). I have a getMapFiles target where it grabs the map files (in my case) from CVS. You could add a line at the end of that target to fix your map files. You might be able to use the replace task, or you may need something more sed-like. ex replace: My exampl...
Variables in PDE map files Some PDE builds use map files. In my case, the project is BIRT and the map files contains things like: plugin@org.eclipse.birt.chart.device.extension=r262_v20110127,:ext:xgu@dev.eclipse.org:/cvsroot/birt,,source/org.eclipse.birt.chart.device.extension plugin@org.apache.batik.svggen.source,1.6...
TITLE: Variables in PDE map files QUESTION: Some PDE builds use map files. In my case, the project is BIRT and the map files contains things like: plugin@org.eclipse.birt.chart.device.extension=r262_v20110127,:ext:xgu@dev.eclipse.org:/cvsroot/birt,,source/org.eclipse.birt.chart.device.extension plugin@org.apache.batik...
[ "eclipse", "pde", "map-files" ]
0
1
213
1
0
2011-06-06T11:51:49.300000
2011-06-06T12:38:40.720000
6,251,599
6,251,688
How to convert pixel formats? From 32bppRGB to 16bpp grayscale in C#
I need to do some thresholding for my image. The threshold filter function just accepts 8-16bpp grayscale. My bitmap picture has the 32bppRGB pixelformat. Please suggest some code for the same. (I also want to know if it is possible without pixel by pixel operations) p.s. I am using the Aforge.NET for thresholding. Tha...
Easiest way: public static Bitmap MakeGrayscale(Bitmap original) { //make an empty bitmap the same size as original Bitmap newBitmap = new Bitmap(original.Width, original.Height); for (int i = 0; i < original.Width; i++) { for (int j = 0; j < original.Height; j++) { //get the pixel from the original image Color origin...
How to convert pixel formats? From 32bppRGB to 16bpp grayscale in C# I need to do some thresholding for my image. The threshold filter function just accepts 8-16bpp grayscale. My bitmap picture has the 32bppRGB pixelformat. Please suggest some code for the same. (I also want to know if it is possible without pixel by p...
TITLE: How to convert pixel formats? From 32bppRGB to 16bpp grayscale in C# QUESTION: I need to do some thresholding for my image. The threshold filter function just accepts 8-16bpp grayscale. My bitmap picture has the 32bppRGB pixelformat. Please suggest some code for the same. (I also want to know if it is possible ...
[ "c#", "image", "image-processing", "pixel", "aforge" ]
5
4
10,818
2
0
2011-06-06T11:52:31.547000
2011-06-06T12:00:26.307000
6,251,613
6,251,712
[Symfony]--sfGuardPlugin--SignIn
I use symfony 1.4 In my index page, I have created some fields as login form. When using sfGuardPlugin, it generate automaticly its form. So, what I'm searching for is how to replace the default form created by the new which I have created. thanks
By default, sfGuardAuth module comes with 2 very simple templates: signinSuccess.php secureSuccess.php If you want to customize one of these templates: Create a sfGuardAuth module in your application (don't use the init-module task, just create a sfGuardAuth directory) Create a template with the name of the template yo...
[Symfony]--sfGuardPlugin--SignIn I use symfony 1.4 In my index page, I have created some fields as login form. When using sfGuardPlugin, it generate automaticly its form. So, what I'm searching for is how to replace the default form created by the new which I have created. thanks
TITLE: [Symfony]--sfGuardPlugin--SignIn QUESTION: I use symfony 1.4 In my index page, I have created some fields as login form. When using sfGuardPlugin, it generate automaticly its form. So, what I'm searching for is how to replace the default form created by the new which I have created. thanks ANSWER: By default, ...
[ "authentication", "symfony1", "sfguard" ]
0
6
1,053
1
0
2011-06-06T11:53:34.620000
2011-06-06T12:02:40.483000
6,251,614
6,251,809
Weird lein uberwar behavior
I'm executing lein uberwar for my test webapp and I'm getting the following weird error: Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol (servlet.clj:1) The servlet.clj contains the following: (ns test.servlet (:use ring.util.servlet) (:require test.route...
You need to put it inside a vector: (:require [test.routes:as routes])
Weird lein uberwar behavior I'm executing lein uberwar for my test webapp and I'm getting the following weird error: Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol (servlet.clj:1) The servlet.clj contains the following: (ns test.servlet (:use ring.util.s...
TITLE: Weird lein uberwar behavior QUESTION: I'm executing lein uberwar for my test webapp and I'm getting the following weird error: Exception in thread "main" java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.Symbol (servlet.clj:1) The servlet.clj contains the following: (ns test.servlet...
[ "clojure", "war", "compojure" ]
3
8
865
1
0
2011-06-06T11:53:36.633000
2011-06-06T12:12:23.607000
6,251,618
6,252,849
Is there a JenkinsCI plugin for WebSphere Portal 6.1?
Is there a JenkinsCI plugin for WebSphere Portal 6.1?
Do either of these help? https://wiki.jenkins-ci.org/display/JENKINS/WAS+Builder+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Deploy+WebSphere+Plugin
Is there a JenkinsCI plugin for WebSphere Portal 6.1? Is there a JenkinsCI plugin for WebSphere Portal 6.1?
TITLE: Is there a JenkinsCI plugin for WebSphere Portal 6.1? QUESTION: Is there a JenkinsCI plugin for WebSphere Portal 6.1? ANSWER: Do either of these help? https://wiki.jenkins-ci.org/display/JENKINS/WAS+Builder+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Deploy+WebSphere+Plugin
[ "continuous-integration", "jenkins", "websphere-portal" ]
1
3
882
2
0
2011-06-06T11:54:08.850000
2011-06-06T13:38:48.633000
6,251,626
6,256,871
Choosing a subset in uniformly random manner?
Question is: Write a method to randomly generate a set of m integers from an array of size n. Each element must have equal probability of being chosen. Is this answer correct?: I pick a first integer uniformly randomly. pick next. if it already exists. I don't take it else take it. and continue till I have m integers.
let m be the number of elements to select for i = 1; i <= m; i++ pick a random number from 1 to n, call it j swap array[j] and array [n] (assuming 1 indexed arrays) n-- At the end of the loop, the last m elements of array is your random subset. There is a variation on fisher-yates shuffle.
Choosing a subset in uniformly random manner? Question is: Write a method to randomly generate a set of m integers from an array of size n. Each element must have equal probability of being chosen. Is this answer correct?: I pick a first integer uniformly randomly. pick next. if it already exists. I don't take it else ...
TITLE: Choosing a subset in uniformly random manner? QUESTION: Question is: Write a method to randomly generate a set of m integers from an array of size n. Each element must have equal probability of being chosen. Is this answer correct?: I pick a first integer uniformly randomly. pick next. if it already exists. I d...
[ "random", "combinatorics" ]
5
7
2,044
4
0
2011-06-06T11:55:01.593000
2011-06-06T19:15:08.553000
6,251,635
6,251,798
Is this kind of notation legal in Objective - C
CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778}; MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2}; MKCoordinateRegion region = {coord, span}; What is this? Curly brackets? Also shouldn't that be CLLocationCoordinate2D * coord I saw them on http://www.iphonedevsdk.com/foru...
This is C99 “designated initializer” syntax for initializing structs. (It has nothing to do with the Objective-C concept of “designated initializers” for classes.)
Is this kind of notation legal in Objective - C CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778}; MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2}; MKCoordinateRegion region = {coord, span}; What is this? Curly brackets? Also shouldn't that be CLLocationCoordinate2D * coor...
TITLE: Is this kind of notation legal in Objective - C QUESTION: CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778}; MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2}; MKCoordinateRegion region = {coord, span}; What is this? Curly brackets? Also shouldn't that be CLLocationC...
[ "objective-c", "xcode4" ]
3
6
138
1
0
2011-06-06T11:55:59.457000
2011-06-06T12:11:16.810000
6,251,638
6,251,738
<Audio> fallback through Javascript
I want to understand how to implement HTML5 fallback using Javascript... i.e. I have a div on my page, to which, I dynamically append tag when "Play audio" link is clicked currently.. i.e. I currently use function playSound(audioUrl) { var x = document.getElementById("playAudio"); x.innerHTML = ' '; } I want to have th...
You could use Modernizr to detect audio support. If you don't want to include that library for a simple thing, this should do it... var audioSupport = document.createElement('audio').hasOwnProperty('src'); jsFiddle. So that would be... function playSound(audioUrl) { var audioSupport = document.createElement('audio').ha...
<Audio> fallback through Javascript I want to understand how to implement HTML5 fallback using Javascript... i.e. I have a div on my page, to which, I dynamically append tag when "Play audio" link is clicked currently.. i.e. I currently use function playSound(audioUrl) { var x = document.getElementById("playAudio"); x....
TITLE: <Audio> fallback through Javascript QUESTION: I want to understand how to implement HTML5 fallback using Javascript... i.e. I have a div on my page, to which, I dynamically append tag when "Play audio" link is clicked currently.. i.e. I currently use function playSound(audioUrl) { var x = document.getElementByI...
[ "javascript", "html", "embed", "html5-audio" ]
1
4
1,448
1
0
2011-06-06T11:56:15.777000
2011-06-06T12:05:34.283000
6,251,641
6,251,685
Priority inversion
I am having problem understanding Priority Inversion Snippet from the article: Consider there is a task L, with low priority. This task requires resource R. Consider that L is running and it acquires resource R. Now, there is another task H, with high priority. This task also requires resource R. Consider H starts afte...
Because M does not require resource R, so it is able to run while L still has it in use; H, on the other hand, cannot run until L is able to release R.
Priority inversion I am having problem understanding Priority Inversion Snippet from the article: Consider there is a task L, with low priority. This task requires resource R. Consider that L is running and it acquires resource R. Now, there is another task H, with high priority. This task also requires resource R. Con...
TITLE: Priority inversion QUESTION: I am having problem understanding Priority Inversion Snippet from the article: Consider there is a task L, with low priority. This task requires resource R. Consider that L is running and it acquires resource R. Now, there is another task H, with high priority. This task also requir...
[ "multithreading", "computer-science" ]
5
4
515
1
0
2011-06-06T11:56:55.467000
2011-06-06T12:00:19.597000
6,251,645
6,252,206
How to implement image upload while creating a user directory if he doesn't have one in django?
I have two model in my profile that request image upload. One is just a market place where all the images can be together, i don't care, but the other is a photo gallery. I ready many ways to upload images (most are very old - 2007/2008). and didn't really find the right way yet. So,Here i am, hoping that i will get my...
Maybe you can write your own Storage class which takes into account the current user to determine the directory to store the file? Maybe it is even possible to abuse the existing system and change the FileField.storage in for example the constructor. I am not sure if this is easily possible, and it will probably be a v...
How to implement image upload while creating a user directory if he doesn't have one in django? I have two model in my profile that request image upload. One is just a market place where all the images can be together, i don't care, but the other is a photo gallery. I ready many ways to upload images (most are very old...
TITLE: How to implement image upload while creating a user directory if he doesn't have one in django? QUESTION: I have two model in my profile that request image upload. One is just a market place where all the images can be together, i don't care, but the other is a photo gallery. I ready many ways to upload images ...
[ "python", "django", "python-imaging-library", "django-models" ]
0
3
142
3
0
2011-06-06T11:57:17.070000
2011-06-06T12:45:08.773000
6,251,655
6,251,698
How to protect a site from (google) caching?
I would like to hide some content from public (like google cached pages). Is it possible?
Option 1: Disable 'Show Cached Site' Link In Google Search Results If you want to prevent google from archiving your site, add the following meta tag to your section: If your site is already cached by Google, you can request its removal using Google's URL removal tool. For more instructions on how to use this tool, see...
How to protect a site from (google) caching? I would like to hide some content from public (like google cached pages). Is it possible?
TITLE: How to protect a site from (google) caching? QUESTION: I would like to hide some content from public (like google cached pages). Is it possible? ANSWER: Option 1: Disable 'Show Cached Site' Link In Google Search Results If you want to prevent google from archiving your site, add the following meta tag to your ...
[ "php" ]
11
10
16,482
8
0
2011-06-06T11:58:06.233000
2011-06-06T12:01:28.550000
6,251,656
6,251,692
SELECT and SET with ROWCOUNT
I have a SP with which I fetch a defined amount of rows. How can I change the value of a column in the fetched rows? Such as 'has been fetched' = 1. Any advice? EDIT: The SP looks something like this SET ROWCOUNT @numberOfRows SELECT * FROM tableA where notSent = 1 I would like to change the 'notSent' colum for all th...
1) Don't use Select * in a stored procedure - always specifically list the fields required as shown below - replace field1,2,3 etc with the actual fields you want returned. OK - Modified answer: 2) Set a flag on the columns you want to select and update with a value that will not be otherwise programmatically set - e.g...
SELECT and SET with ROWCOUNT I have a SP with which I fetch a defined amount of rows. How can I change the value of a column in the fetched rows? Such as 'has been fetched' = 1. Any advice? EDIT: The SP looks something like this SET ROWCOUNT @numberOfRows SELECT * FROM tableA where notSent = 1 I would like to change t...
TITLE: SELECT and SET with ROWCOUNT QUESTION: I have a SP with which I fetch a defined amount of rows. How can I change the value of a column in the fetched rows? Such as 'has been fetched' = 1. Any advice? EDIT: The SP looks something like this SET ROWCOUNT @numberOfRows SELECT * FROM tableA where notSent = 1 I woul...
[ "sql-server-2008-r2" ]
0
2
432
1
0
2011-06-06T11:58:09.503000
2011-06-06T12:00:41.407000
6,251,657
6,251,927
cannot add view to the edmx
When trying to add a view to the edmx file, nothing happens. I opened the edmx file using wxl editor and I noticed the following error: warning 6013: The table/view 'CellularOrders.dbo.V_LINK' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the e...
Each table or view added to entity model must have some key. It actually doesn't have to be primary key. If the table doesn't have the primary key defined EF will try to infer a key using simple rule: It will take all non-nullable non-computed non-binary columns and marks them as an entity key. If none such column exis...
cannot add view to the edmx When trying to add a view to the edmx file, nothing happens. I opened the edmx file using wxl editor and I noticed the following error: warning 6013: The table/view 'CellularOrders.dbo.V_LINK' does not have a primary key defined and no valid primary key could be inferred. This table/view has...
TITLE: cannot add view to the edmx QUESTION: When trying to add a view to the edmx file, nothing happens. I opened the edmx file using wxl editor and I noticed the following error: warning 6013: The table/view 'CellularOrders.dbo.V_LINK' does not have a primary key defined and no valid primary key could be inferred. T...
[ "c#", ".net", "entity-framework" ]
29
30
54,392
7
0
2011-06-06T11:58:32.687000
2011-06-06T12:23:34.163000
6,251,660
6,251,703
Add DLL in ASP NET Web Service
Today I added DLL in my ASP NET Web Service.I found two ways to add DLL. First one is - Right click on project << Add Reference << Browser << Select the DLL. Second one is - Right click on bin folder << Add Existing Item << Select the DLL. Both are working fine.So now my question is " Is there any difference between bo...
you forgot the 3rd one... Drag the dll directly into your BIN fodler:) They all the same, though I suggest the "correct way", add your Libraries through Add Reference Menu
Add DLL in ASP NET Web Service Today I added DLL in my ASP NET Web Service.I found two ways to add DLL. First one is - Right click on project << Add Reference << Browser << Select the DLL. Second one is - Right click on bin folder << Add Existing Item << Select the DLL. Both are working fine.So now my question is " Is ...
TITLE: Add DLL in ASP NET Web Service QUESTION: Today I added DLL in my ASP NET Web Service.I found two ways to add DLL. First one is - Right click on project << Add Reference << Browser << Select the DLL. Second one is - Right click on bin folder << Add Existing Item << Select the DLL. Both are working fine.So now my...
[ "asp.net", "dll" ]
0
0
2,827
1
0
2011-06-06T11:58:47.427000
2011-06-06T12:01:51.563000
6,251,662
6,255,334
writing to global environment when running in parallel
I have a data.frame of cells, values and coordinates. It resides in the global environment. > head(cont.values) cell value x y 1 11117 NA -34 322 2 11118 NA -30 322 3 11119 NA -26 322 4 11120 NA -22 322 5 11121 NA -18 322 6 11122 NA -14 322 Because my custom function takes almost a second to calculate individual cell (...
The pattern of a central store that workers consult for values is implemented in the rredis package on CRAN. The idea is that the Redis server maintains a store of key-value pairs (your global data frame, re-implemented). Workers query the server to see if the value has been calculated ( redisGet ) and if not do the ca...
writing to global environment when running in parallel I have a data.frame of cells, values and coordinates. It resides in the global environment. > head(cont.values) cell value x y 1 11117 NA -34 322 2 11118 NA -30 322 3 11119 NA -26 322 4 11120 NA -22 322 5 11121 NA -18 322 6 11122 NA -14 322 Because my custom functi...
TITLE: writing to global environment when running in parallel QUESTION: I have a data.frame of cells, values and coordinates. It resides in the global environment. > head(cont.values) cell value x y 1 11117 NA -34 322 2 11118 NA -30 322 3 11119 NA -26 322 4 11120 NA -22 322 5 11121 NA -18 322 6 11122 NA -14 322 Becaus...
[ "r", "parallel-processing", "snowfall" ]
6
4
3,686
3
0
2011-06-06T11:58:54.670000
2011-06-06T16:49:41.493000
6,251,664
6,252,560
How to use AQtime (free) in Delphi XE?
Embarcadero says that I got some free version of AQtime when I purchased my Delphi XE license. However, today I tried to run for the first time AQtime and I got an error message: 'You are using AQTime Standard... Line-level profiling can be performed in AQTime Pro only' and then it says to upgrade to Pro. I see only an...
That's right - the Standard edition of AQtime has some features missing. In your case, the missing feature you are trying to use is the line-level profiling - the thing that shows you links to specific code lines in the profiling results. The Standard edition can profile only on the Routine level - you will see routine...
How to use AQtime (free) in Delphi XE? Embarcadero says that I got some free version of AQtime when I purchased my Delphi XE license. However, today I tried to run for the first time AQtime and I got an error message: 'You are using AQTime Standard... Line-level profiling can be performed in AQTime Pro only' and then i...
TITLE: How to use AQtime (free) in Delphi XE? QUESTION: Embarcadero says that I got some free version of AQtime when I purchased my Delphi XE license. However, today I tried to run for the first time AQtime and I got an error message: 'You are using AQTime Standard... Line-level profiling can be performed in AQTime Pr...
[ "delphi", "delphi-xe", "aqtime" ]
1
4
7,811
1
0
2011-06-06T11:58:55.353000
2011-06-06T13:16:05.767000
6,251,674
6,251,773
How do I indent properly with TextMate?
I'm reading Michael Hartl's Ruby on Rails 3 Tutorials. I just came across my first example of code (HTML really) being long enough to wrap to a second line. Here's what it looks like in my TextMate... The lines between the paragraph tags aren't lined up below the "a href" (as I'm thinking they should be). Now here is t...
Go to View and turn softwrap off, then put linebreaks and tabs in manually.
How do I indent properly with TextMate? I'm reading Michael Hartl's Ruby on Rails 3 Tutorials. I just came across my first example of code (HTML really) being long enough to wrap to a second line. Here's what it looks like in my TextMate... The lines between the paragraph tags aren't lined up below the "a href" (as I'm...
TITLE: How do I indent properly with TextMate? QUESTION: I'm reading Michael Hartl's Ruby on Rails 3 Tutorials. I just came across my first example of code (HTML really) being long enough to wrap to a second line. Here's what it looks like in my TextMate... The lines between the paragraph tags aren't lined up below th...
[ "ruby-on-rails", "textmate", "indentation" ]
2
8
1,612
3
0
2011-06-06T11:59:25.590000
2011-06-06T12:09:05.650000
6,251,678
6,251,705
Doesn't TortoiseHg Auto Synch with Server
I have created a repository on https://bitbucket.org/ and use TortoiseHg to clone it to a folder in my local machine. I am able to add files commit files, but what I find is they never get updated on the Server at Bitbucket. By some fiddling, I found that there is this synch option. What I don't get is, why do I have t...
When you commit, you commit to your local repository - i.e. to the.hg directory in the root of your project.. To synch with the remote repository you need to explicitly push your changes. This is how DVCSs work - it's not the same model as SVN.
Doesn't TortoiseHg Auto Synch with Server I have created a repository on https://bitbucket.org/ and use TortoiseHg to clone it to a folder in my local machine. I am able to add files commit files, but what I find is they never get updated on the Server at Bitbucket. By some fiddling, I found that there is this synch op...
TITLE: Doesn't TortoiseHg Auto Synch with Server QUESTION: I have created a repository on https://bitbucket.org/ and use TortoiseHg to clone it to a folder in my local machine. I am able to add files commit files, but what I find is they never get updated on the Server at Bitbucket. By some fiddling, I found that ther...
[ "mercurial", "synchronization", "tortoisehg", "bitbucket" ]
1
6
699
2
0
2011-06-06T11:59:55.243000
2011-06-06T12:02:00.673000
6,251,681
6,253,854
jQuery Masonry callback not working
I am trying to get a callback function to execute when jQuery Masonry has done its positioning magic, preventing a flash of unstyled content in my code. For the purpose of testing, though, I am using a simple alert that isn't called at all. var $jigsaw = $('#jigsaw'); $jigsaw.imagesLoaded( function(){ $jigsaw.masonry(...
Callbacks with Masonry v2.0 are undocumented and not quite supported. But callbacks are awesome with Isotope v1.5! If you want proper callbacks that trigger after the end of a transition or animation, Isotope is the way to go. The reason being is that you might be using CSS transitions or jQuery animation or neither. S...
jQuery Masonry callback not working I am trying to get a callback function to execute when jQuery Masonry has done its positioning magic, preventing a flash of unstyled content in my code. For the purpose of testing, though, I am using a simple alert that isn't called at all. var $jigsaw = $('#jigsaw'); $jigsaw.images...
TITLE: jQuery Masonry callback not working QUESTION: I am trying to get a callback function to execute when jQuery Masonry has done its positioning magic, preventing a flash of unstyled content in my code. For the purpose of testing, though, I am using a simple alert that isn't called at all. var $jigsaw = $('#jigsaw'...
[ "jquery", "callback", "jquery-callback", "jquery-masonry", "fouc" ]
3
3
10,345
4
0
2011-06-06T12:00:06.553000
2011-06-06T14:51:44.017000
6,251,707
6,251,839
How do I ensure that a data member is initialized to a value instead of remaning default-initialized?
I was asking myself something this morning, and I can't find the words to properly "google" for it: Lets say I have: struct Foo { int bar; }; struct Foo2 { int bar; Foo2() {} }; struct Foo3 { int bar; Foo3(): bar(0) {} }; Now, if I default-initialize Foo, Foo2 and Foo3: Foo foo; Foo2 foo2; Foo3 foo3; In which case(s)...
Only foo3 will be in all contexts. foo2 and foo will be if they are of static duration. Note that objects of type Foo may be zero initialized in other contexts: Foo* foo = new Foo(); // will initialize bar to 0 Foo* foox = new Foo; // will not initialize bar to 0 while Foo2 will not: Foo2* foo = new Foo2(); // will not...
How do I ensure that a data member is initialized to a value instead of remaning default-initialized? I was asking myself something this morning, and I can't find the words to properly "google" for it: Lets say I have: struct Foo { int bar; }; struct Foo2 { int bar; Foo2() {} }; struct Foo3 { int bar; Foo3(): bar(0) ...
TITLE: How do I ensure that a data member is initialized to a value instead of remaning default-initialized? QUESTION: I was asking myself something this morning, and I can't find the words to properly "google" for it: Lets say I have: struct Foo { int bar; }; struct Foo2 { int bar; Foo2() {} }; struct Foo3 { int ba...
[ "c++", "class", "initialization", "language-lawyer", "default-initialization" ]
25
32
13,368
4
0
2011-06-06T12:02:23.403000
2011-06-06T12:15:28.707000
6,251,708
6,262,314
Xcode4 and the darn SCM
I have project A (old), project B (new), and project C (new). I want to use a few classes from project A in the new projects B and C. Project A is under source control (Subversion). Project B is under source control (Subversion). Project C is not under source control. When i copy files from project A to project B and p...
I was able to fix my problem by deleting the.svn folders. Maybe this'll help someone else who stumble across this post. http://www.hacktrix.com/how-to-delete-svn-folders-from-your-project-on-windows-linux-and-mac p.s. Subversion integration with Xcode4 is bad. At it's core, Xcode3 used to work great with Subversion. Th...
Xcode4 and the darn SCM I have project A (old), project B (new), and project C (new). I want to use a few classes from project A in the new projects B and C. Project A is under source control (Subversion). Project B is under source control (Subversion). Project C is not under source control. When i copy files from proj...
TITLE: Xcode4 and the darn SCM QUESTION: I have project A (old), project B (new), and project C (new). I want to use a few classes from project A in the new projects B and C. Project A is under source control (Subversion). Project B is under source control (Subversion). Project C is not under source control. When i co...
[ "svn", "version-control", "xcode4" ]
1
0
232
2
0
2011-06-06T12:02:25.523000
2011-06-07T08:06:52.997000
6,251,713
6,252,642
How can I impose these constraints on my model using django?
This is my model: class MyModel(models.Model): s1 = models.CharField(max_length=255) s2 = models.CharField(max_length=255) I was expecting django not to allow me to have empty strings considered as valid, as I read in the documentation that both blank and null are by default false. Example: python manage.py shell >>> a...
blank is a validation-related attribute, which means it will only apply when data is entered via the django-admin site or a form derived from the model using ModelForm. Example: class MyForm(forms.ModelForm): class Meta: model = MyModel >>> f = MyForm({"s1":""}) >>> f.is_valid() False >>> f = MyForm({"s1":"hello world...
How can I impose these constraints on my model using django? This is my model: class MyModel(models.Model): s1 = models.CharField(max_length=255) s2 = models.CharField(max_length=255) I was expecting django not to allow me to have empty strings considered as valid, as I read in the documentation that both blank and nul...
TITLE: How can I impose these constraints on my model using django? QUESTION: This is my model: class MyModel(models.Model): s1 = models.CharField(max_length=255) s2 = models.CharField(max_length=255) I was expecting django not to allow me to have empty strings considered as valid, as I read in the documentation that ...
[ "python", "django-models" ]
2
2
448
1
0
2011-06-06T12:02:53.840000
2011-06-06T13:22:09.873000
6,251,717
6,251,882
CakePHP transparent saving of unique data
I have models Person and Phone/Email with HABTM relationship. After some pain I found out, that my life is easier, when I break HABTM into: Person hasMany PeoplePhone, Phone hasMany PeoplePhone, PeoplePhone belongsTo (Person,Phone). Well, I don't need any help with this:-) now, my problem is different: Before I can pai...
If I were you, I would stick with default Cake functionality rather than what you are doing. All of this functionality is built into Cake, so why reinvent the wheel? First, HABTM relationships already work as you have broken them out. You can access the join models by adding with in your model associations. This should...
CakePHP transparent saving of unique data I have models Person and Phone/Email with HABTM relationship. After some pain I found out, that my life is easier, when I break HABTM into: Person hasMany PeoplePhone, Phone hasMany PeoplePhone, PeoplePhone belongsTo (Person,Phone). Well, I don't need any help with this:-) now,...
TITLE: CakePHP transparent saving of unique data QUESTION: I have models Person and Phone/Email with HABTM relationship. After some pain I found out, that my life is easier, when I break HABTM into: Person hasMany PeoplePhone, Phone hasMany PeoplePhone, PeoplePhone belongsTo (Person,Phone). Well, I don't need any help...
[ "cakephp", "unique", "has-and-belongs-to-many" ]
0
1
867
2
0
2011-06-06T12:02:58.787000
2011-06-06T12:19:07.003000
6,251,718
6,258,259
Wrong URL when consuming existing Java REST API using rails ActiveResource
I am new to ruby on rails.I am trying to consume my existing Java REST api using Rails, ActiveResource class, but every time resource URL hit, is wrong ( https://myapp/resource/**apis**/responce.json ), where the correct url is ( https://myapp/resource/**api**/responce.json ) Problem is active resource mapping apis/ in...
The self.element_name = "api" is fixing the pluralization when you are doing a find(:first) or similar. What you need is self.collection_name = "api". That should fix the URL it is creating.
Wrong URL when consuming existing Java REST API using rails ActiveResource I am new to ruby on rails.I am trying to consume my existing Java REST api using Rails, ActiveResource class, but every time resource URL hit, is wrong ( https://myapp/resource/**apis**/responce.json ), where the correct url is ( https://myapp/r...
TITLE: Wrong URL when consuming existing Java REST API using rails ActiveResource QUESTION: I am new to ruby on rails.I am trying to consume my existing Java REST api using Rails, ActiveResource class, but every time resource URL hit, is wrong ( https://myapp/resource/**apis**/responce.json ), where the correct url is...
[ "ruby-on-rails-3", "api", "rest", "activeresource" ]
1
8
830
1
0
2011-06-06T12:03:17.180000
2011-06-06T21:31:37.463000
6,251,721
6,263,365
Problem running multiple instances of a plugin
I developed a simple plugin to sent request to a JSON text file, retrieve a data containing image list and append the html in the element calling the plugin. Now, the code is working fine while it is running on only one element, but when I am using it on more than one element, now the elements get loaded on the last el...
You're assigning to elementID without declaring it. This means it'll be a global variable, which means it'll always be equal to the last thing assigned to it (in this case, #that ). If you just keep a local reference to the element, the code will work. Here's a modified jsfiddle: http://jsfiddle.net/s9BDT/ Code inside ...
Problem running multiple instances of a plugin I developed a simple plugin to sent request to a JSON text file, retrieve a data containing image list and append the html in the element calling the plugin. Now, the code is working fine while it is running on only one element, but when I am using it on more than one elem...
TITLE: Problem running multiple instances of a plugin QUESTION: I developed a simple plugin to sent request to a JSON text file, retrieve a data containing image list and append the html in the element calling the plugin. Now, the code is working fine while it is running on only one element, but when I am using it on ...
[ "jquery-plugins", "jquery" ]
2
0
375
1
0
2011-06-06T12:03:32.500000
2011-06-07T09:40:48.050000
6,251,728
6,252,112
How to pass a string from one view to another in tab based app
I have created a tab based application having 4 tabs and 4 views respective to these tabs. I have a string in first view and when I printing this string in second view it printing null. In first view.h NSString *dateString; @property(nonatomic,retain) NSString *dateString; In first view.m @synthesize dateString; dateSt...
Create NSString variable in Application delegate class and set the Property and make synthesize that variable. And set the @"" (blank) value in applicationDidFinishLaunching method. For Example - my variable name is str, then initialize str in applicationDidFinishLaunching like self.str = [NSString stringWithFormat:@""...
How to pass a string from one view to another in tab based app I have created a tab based application having 4 tabs and 4 views respective to these tabs. I have a string in first view and when I printing this string in second view it printing null. In first view.h NSString *dateString; @property(nonatomic,retain) NSStr...
TITLE: How to pass a string from one view to another in tab based app QUESTION: I have created a tab based application having 4 tabs and 4 views respective to these tabs. I have a string in first view and when I printing this string in second view it printing null. In first view.h NSString *dateString; @property(nonat...
[ "iphone", "objective-c", "ipad", "uitabbarcontroller" ]
0
1
1,144
5
0
2011-06-06T12:04:31.437000
2011-06-06T12:37:33.413000
6,251,733
6,251,805
Using Statement and Connection Pooling
I recently came to know the concept of 'connection pooling' in.NET, and as such I have a little doubt I would like anyone to clarify it for me. If I use the following piece of code, when will the database connection be returned to the pool so that it can be used by another part of the application? using (SqlConnection ...
The connection will indeed be returned to the pool after the using block has finished executing. The using statement is syntactic sugar - the compiler generates a correct Dispose block which closes the connection, thus returning it to the connection pool.
Using Statement and Connection Pooling I recently came to know the concept of 'connection pooling' in.NET, and as such I have a little doubt I would like anyone to clarify it for me. If I use the following piece of code, when will the database connection be returned to the pool so that it can be used by another part of...
TITLE: Using Statement and Connection Pooling QUESTION: I recently came to know the concept of 'connection pooling' in.NET, and as such I have a little doubt I would like anyone to clarify it for me. If I use the following piece of code, when will the database connection be returned to the pool so that it can be used ...
[ ".net", "sql-server-2005", "connection-pooling" ]
1
2
669
2
0
2011-06-06T12:05:04.917000
2011-06-06T12:12:05.180000
6,251,735
6,251,790
Why does Motorola Atrix load mdpi-drawables?
I created an AVD. resolution: 540 x 960 hw.lcd.density: 275 Before starting the AVD I scaled the emulator to 4". So the AVD is similiar to the Atrix. But why does it load mdpi drawable? I put a Bitmap in these folders: drawble-ldpi drawble-mdpi drawble-hdpi The Bitmap contains only a small Text, which says "ldpi", "mdp...
Seems someone else had a similar issue, but managed to resolve it: Android Eclipse emulator problem: Runs WVGA(hdpi) as a mdpi screen
Why does Motorola Atrix load mdpi-drawables? I created an AVD. resolution: 540 x 960 hw.lcd.density: 275 Before starting the AVD I scaled the emulator to 4". So the AVD is similiar to the Atrix. But why does it load mdpi drawable? I put a Bitmap in these folders: drawble-ldpi drawble-mdpi drawble-hdpi The Bitmap contai...
TITLE: Why does Motorola Atrix load mdpi-drawables? QUESTION: I created an AVD. resolution: 540 x 960 hw.lcd.density: 275 Before starting the AVD I scaled the emulator to 4". So the AVD is similiar to the Atrix. But why does it load mdpi drawable? I put a Bitmap in these folders: drawble-ldpi drawble-mdpi drawble-hdpi...
[ "android" ]
1
2
671
1
0
2011-06-06T12:05:23.343000
2011-06-06T12:10:42.480000
6,251,744
6,252,075
How to connect to MySQL from within Drupal
I need to connect to mysql database and select some records in Drupal 7. How can I do it from within Drupal 7. I tried this code, but it doesn't work: db_set_active('default'); $sql = mysql_query("SELECT * FROM users"); while($result = mysql_fetch_array($sql)) { echo $result["uid"]; echo $result["name"]; Any ideas?
In Drupal 7 you are already connected to the database. You want to use the database abstraction layer. You can use db_select if you are trying to select from the users table. See some examples in the link... fields('u') ->execute() ->fetchAssoc();?>
How to connect to MySQL from within Drupal I need to connect to mysql database and select some records in Drupal 7. How can I do it from within Drupal 7. I tried this code, but it doesn't work: db_set_active('default'); $sql = mysql_query("SELECT * FROM users"); while($result = mysql_fetch_array($sql)) { echo $result[...
TITLE: How to connect to MySQL from within Drupal QUESTION: I need to connect to mysql database and select some records in Drupal 7. How can I do it from within Drupal 7. I tried this code, but it doesn't work: db_set_active('default'); $sql = mysql_query("SELECT * FROM users"); while($result = mysql_fetch_array($sql...
[ "mysql", "drupal", "database-connection", "drupal-7" ]
1
2
1,848
1
0
2011-06-06T12:06:02.797000
2011-06-06T12:34:26.537000
6,251,749
6,251,778
C# Explicit Operators and Inheritance
I'm sure this is a stupid question, but why does the following code not call the explicit operator for the cast on the child class MyBool? public class DataType { public static explicit operator bool(DataType D) { return false; } public static explicit operator DataType(bool B) { return new DataType(); } } public cla...
why does the following code not call the explicit operator for the cast on the child class MyBool? Because the operator functions are static, hence also non- virtual and thus their target is resolved at compile time rather than runtime. This is the expected behaviour. If you want to have polymorphic conversion operator...
C# Explicit Operators and Inheritance I'm sure this is a stupid question, but why does the following code not call the explicit operator for the cast on the child class MyBool? public class DataType { public static explicit operator bool(DataType D) { return false; } public static explicit operator DataType(bool B) { ...
TITLE: C# Explicit Operators and Inheritance QUESTION: I'm sure this is a stupid question, but why does the following code not call the explicit operator for the cast on the child class MyBool? public class DataType { public static explicit operator bool(DataType D) { return false; } public static explicit operator D...
[ "c#", "operator-overloading" ]
10
21
11,541
3
0
2011-06-06T12:06:20.790000
2011-06-06T12:09:35.577000
6,251,761
6,252,937
How do I identify whether someone installed my app from the Chrome Web Store and then signed in with Google OpenID?
If someone installs my app in the Chrome Web Store, I authenticate them using their Google OpenID profile and sign them into the app automatically. In order to handle problems (eg. if the user accidentally uninstalls the app from Chrome but still wants to use it by opening the URL manually) we offer a "sign in with Goo...
The easiest thing that we suggest is to check for the presence of chrome.app.isInstalled in your client page. This is only visible for apps that are installed. if(chrome && chrome.app && chrome.app.isInstalled == true) alert('installed'); On the server side of things, you have a couple of options: Set the web_url for t...
How do I identify whether someone installed my app from the Chrome Web Store and then signed in with Google OpenID? If someone installs my app in the Chrome Web Store, I authenticate them using their Google OpenID profile and sign them into the app automatically. In order to handle problems (eg. if the user accidentall...
TITLE: How do I identify whether someone installed my app from the Chrome Web Store and then signed in with Google OpenID? QUESTION: If someone installs my app in the Chrome Web Store, I authenticate them using their Google OpenID profile and sign them into the app automatically. In order to handle problems (eg. if th...
[ "web-applications", "google-chrome", "google-openid", "webstore", "chrome-web-store" ]
0
2
230
1
0
2011-06-06T12:07:40.953000
2011-06-06T13:44:31.023000
6,251,762
6,251,894
java: search file according to its name in directory and subdirectories
I need a to find file according to its name in directory tree. And then show a path to this file. I found something like this, but it search according extension. Could anybody help me how can I rework this code to my needs...thanks public class filesFinder { public static void main(String[] args) { File root = new File...
public class Test { public static void main(String[] args) { File root = new File("c:\\test"); String fileName = "a.txt"; try { boolean recursive = true; Collection files = FileUtils.listFiles(root, null, recursive); for (Iterator iterator = files.iterator(); iterator.hasNext();) { File file = (File) iterator.next();...
java: search file according to its name in directory and subdirectories I need a to find file according to its name in directory tree. And then show a path to this file. I found something like this, but it search according extension. Could anybody help me how can I rework this code to my needs...thanks public class fil...
TITLE: java: search file according to its name in directory and subdirectories QUESTION: I need a to find file according to its name in directory tree. And then show a path to this file. I found something like this, but it search according extension. Could anybody help me how can I rework this code to my needs...thank...
[ "java", "search", "subdirectory" ]
11
12
50,461
6
0
2011-06-06T12:07:50.220000
2011-06-06T12:20:24.183000
6,251,772
6,259,138
How to determine whether WCF Service is hosted within IIS or something else?
I have a WCF Service that is sometimes hosted within IIS and sometimes hosted within a Windows Service. This is necessary for different deployment options for my application. What's a good way within the service object to determine where it is hosted? The reason I want this is that when my service is hosted in IIS it g...
I opted to subclass my service class and used the subclass when hosting in my Windows Service. The only difference in the subclass is that it knows to get its config info from the registry instead of the default location: the config manager. This is kinda nicer that what I originally wanted because the service doesn't ...
How to determine whether WCF Service is hosted within IIS or something else? I have a WCF Service that is sometimes hosted within IIS and sometimes hosted within a Windows Service. This is necessary for different deployment options for my application. What's a good way within the service object to determine where it is...
TITLE: How to determine whether WCF Service is hosted within IIS or something else? QUESTION: I have a WCF Service that is sometimes hosted within IIS and sometimes hosted within a Windows Service. This is necessary for different deployment options for my application. What's a good way within the service object to det...
[ "c#", ".net", "wcf" ]
1
1
2,300
3
0
2011-06-06T12:08:49.347000
2011-06-06T23:24:41.080000
6,251,775
6,252,389
jQuery apply css to penultimate element?
I need to apply CSS to the 2nd to last element. Ive found an answer on this in the thread below: Get penultimate element But how to I change the syntax to apply CSS? The following doesn't work: $("a:last").prev().css('width','250px'); Thanks Ive tried applying @tweak method's but it doesn't work. setInterval(function()...
Based on your post revision, I would suggest: setInterval(function(){ $(".image-cont:last").prev().find(".image-cont2").css('width', '250px'); },1000); But without you posting your HTML and pinpointing the element you need, I'm still not sure if this is the answer you want. By way of explanation: prev goes 'back' from ...
jQuery apply css to penultimate element? I need to apply CSS to the 2nd to last element. Ive found an answer on this in the thread below: Get penultimate element But how to I change the syntax to apply CSS? The following doesn't work: $("a:last").prev().css('width','250px'); Thanks Ive tried applying @tweak method's bu...
TITLE: jQuery apply css to penultimate element? QUESTION: I need to apply CSS to the 2nd to last element. Ive found an answer on this in the thread below: Get penultimate element But how to I change the syntax to apply CSS? The following doesn't work: $("a:last").prev().css('width','250px'); Thanks Ive tried applying ...
[ "jquery" ]
1
0
1,041
6
0
2011-06-06T12:09:14.340000
2011-06-06T13:00:24.377000
6,251,780
6,254,194
Unable to access SRCROOT in Xcode 4 scheme pre-build action scripts
Are certain variables that were available to run scripts in Xcode 3 no longer available to pre-build script actions in Xcode 4? The script PLIST_FILE="$SRCROOT/$INFOPLIST_FILE" echo "${PLIST_FILE}" produces just "/" as output: neither SRCROOT nor INFOPLIST_FILE appear to be defined. Do these have new names in Xcode 4; ...
Update: Xcode 4.1 finally addresses this issue. A new popup in the script editor lets you choose the target on which Xcode bases the environment variables it makes available to your script (you can still choose "none"... an option of questionable usefulness). Old Post About 4.0 Follows That's because, for whatever reas...
Unable to access SRCROOT in Xcode 4 scheme pre-build action scripts Are certain variables that were available to run scripts in Xcode 3 no longer available to pre-build script actions in Xcode 4? The script PLIST_FILE="$SRCROOT/$INFOPLIST_FILE" echo "${PLIST_FILE}" produces just "/" as output: neither SRCROOT nor INFOP...
TITLE: Unable to access SRCROOT in Xcode 4 scheme pre-build action scripts QUESTION: Are certain variables that were available to run scripts in Xcode 3 no longer available to pre-build script actions in Xcode 4? The script PLIST_FILE="$SRCROOT/$INFOPLIST_FILE" echo "${PLIST_FILE}" produces just "/" as output: neither...
[ "path", "xcode4", "environment-variables", "xcodebuild", "buildpath" ]
1
13
3,710
4
0
2011-06-06T12:09:45.463000
2011-06-06T15:17:34.653000
6,251,783
6,255,362
What is the best way of extracting information from a existing database without having the complete entity structure in a new java application?
The current application that I'm involved in is somewhat a monster with a very complex entity structure and a very tight coupling to the Seam framework. In a couple of weeks I will begin refactoring this monolith, but before that I need to create a small application that will collect some information from the database ...
What data do you need to export, and in what format? Do you really need an ORM layer, or can you just use Spring JDBC to query the tables directly? What is the lifespan of your small application, and how likely is it to mutate into a large application? I'd recommend doing something quick and simple with SQL, then swapp...
What is the best way of extracting information from a existing database without having the complete entity structure in a new java application? The current application that I'm involved in is somewhat a monster with a very complex entity structure and a very tight coupling to the Seam framework. In a couple of weeks I ...
TITLE: What is the best way of extracting information from a existing database without having the complete entity structure in a new java application? QUESTION: The current application that I'm involved in is somewhat a monster with a very complex entity structure and a very tight coupling to the Seam framework. In a ...
[ "hibernate", "spring", "entity-relationship" ]
1
1
61
2
0
2011-06-06T12:10:12.013000
2011-06-06T16:51:41.017000
6,251,784
6,253,440
Grails g:select tag with small picture for each option
Is it possible to have a picture per option in tag? The select list is going to show different file extensions (e.g. xls, pdf, csv, etc.). I would like to have the picture shown based on the file extension type. If it can only be done using css, could you inform how each one will have different picture?
There are several ways to achieve this. None of which will work using the g:select tag directly. The simplest of which is probably just using CSS to provide a background-image for each option element as well as some slight positioning CSS. For a more 'out of the box' solution you might look at something like this.
Grails g:select tag with small picture for each option Is it possible to have a picture per option in tag? The select list is going to show different file extensions (e.g. xls, pdf, csv, etc.). I would like to have the picture shown based on the file extension type. If it can only be done using css, could you inform ho...
TITLE: Grails g:select tag with small picture for each option QUESTION: Is it possible to have a picture per option in tag? The select list is going to show different file extensions (e.g. xls, pdf, csv, etc.). I would like to have the picture shown based on the file extension type. If it can only be done using css, c...
[ "html", "css", "grails", "select", "gsp" ]
1
2
842
1
0
2011-06-06T12:10:16.647000
2011-06-06T14:21:35.467000
6,251,787
6,251,833
How do I get the name of the calling function?
I am using gnu tool chain. How can I, at run time, find caller of a function? i.e for example function B() gets called by many functions using function pointers. Now, whenever B gets called, I want to print the callers name. I need this for debugging a certain issue.
If you're using GNU, you can use the backtrace functions. There's an example of the use on that man page.
How do I get the name of the calling function? I am using gnu tool chain. How can I, at run time, find caller of a function? i.e for example function B() gets called by many functions using function pointers. Now, whenever B gets called, I want to print the callers name. I need this for debugging a certain issue.
TITLE: How do I get the name of the calling function? QUESTION: I am using gnu tool chain. How can I, at run time, find caller of a function? i.e for example function B() gets called by many functions using function pointers. Now, whenever B gets called, I want to print the callers name. I need this for debugging a ce...
[ "c", "gcc", "function-pointers" ]
18
18
24,053
3
0
2011-06-06T12:10:20.873000
2011-06-06T12:14:59.487000
6,251,797
6,259,720
Effect of enable-call-by-reference
I get the messages and Why would this not be enabled by default, as remote calls are still possible and done by value if the flag is set to True? Is there any negative effect when setting it to True?
call-by-reference = true is not compliant with the EJB specification. The goal of remote EJBs was to provide a location transparency. In other words, if the target EJB is in another JVM, then clearly the data must somehow be copied to that JVM, so for consistency, calls to an EJB in the same JVM are also copied. If cal...
Effect of enable-call-by-reference I get the messages and Why would this not be enabled by default, as remote calls are still possible and done by value if the flag is set to True? Is there any negative effect when setting it to True?
TITLE: Effect of enable-call-by-reference QUESTION: I get the messages and Why would this not be enabled by default, as remote calls are still possible and done by value if the flag is set to True? Is there any negative effect when setting it to True? ANSWER: call-by-reference = true is not compliant with the EJB spe...
[ "performance", "weblogic", "ejb" ]
13
16
12,506
1
0
2011-06-06T12:11:13.767000
2011-06-07T01:12:42.200000
6,251,799
6,270,925
drupal, tree in search form
I want to make a search result page based on eBay/allegro, by that i mean: left box -> category (with hit count) center -> table with hits. it should looks like that: (left box is most important) And now, my current modules/Content types looks like that: Content Types: Content Taxonomy Fields - taxonomy used with CCK. ...
This is a tricky task. There are always many ways to accomplish it. If it was me, I would write my own module from scratch. Having it interface with views will be a little complicated. Just to give you some starting tips: In the main view, you need to either add an exposed form where you can select the category AND/OR ...
drupal, tree in search form I want to make a search result page based on eBay/allegro, by that i mean: left box -> category (with hit count) center -> table with hits. it should looks like that: (left box is most important) And now, my current modules/Content types looks like that: Content Types: Content Taxonomy Field...
TITLE: drupal, tree in search form QUESTION: I want to make a search result page based on eBay/allegro, by that i mean: left box -> category (with hit count) center -> table with hits. it should looks like that: (left box is most important) And now, my current modules/Content types looks like that: Content Types: Cont...
[ "drupal-6", "drupal-modules" ]
1
1
129
1
0
2011-06-06T12:11:25.303000
2011-06-07T20:00:46.793000
6,251,813
6,251,896
Is there a way to make the Facebook PHP SDK and Javascript SDK communicate
I use the PHP SDK for several backend functions that integrate Facebook, and I use the Javascript SDK to do things like embed widgets (eg: Like buttons etc). Is there a technique to get them to communicate with each other? Eg, if my users login using my sites social login (which uses the PHP SDK) can I log that info wi...
If you use the JS SDK to login you can configure it to create the facebook cookie. You can then extract the token from that and use it in the PHP sdk, as covered here FB.init({appId: 'your app id', status: true, cookie: true, xfbml: true}); If you set cookie to true, you'll get a cookie on the server side with a token ...
Is there a way to make the Facebook PHP SDK and Javascript SDK communicate I use the PHP SDK for several backend functions that integrate Facebook, and I use the Javascript SDK to do things like embed widgets (eg: Like buttons etc). Is there a technique to get them to communicate with each other? Eg, if my users login ...
TITLE: Is there a way to make the Facebook PHP SDK and Javascript SDK communicate QUESTION: I use the PHP SDK for several backend functions that integrate Facebook, and I use the Javascript SDK to do things like embed widgets (eg: Like buttons etc). Is there a technique to get them to communicate with each other? Eg, ...
[ "php", "javascript", "facebook-graph-api" ]
3
0
1,127
2
0
2011-06-06T12:13:08.143000
2011-06-06T12:20:39.683000
6,251,815
6,251,872
How can I prevent line break when reading a CSV text file with php?
I have a CSV text file which contains serval entries of "books", each book is on one line (separator: line break), and each column is separated by a tabulation. I'm reading the content the file with: $books = file( "/path/to/file/mycsv.txt", FILE_SKIP_EMPTY_LINES ); That way I can go throuhg each element of the "books"...
Does your file include quotes around the description column, because if it does I believe fgetcsv handles that situation.
How can I prevent line break when reading a CSV text file with php? I have a CSV text file which contains serval entries of "books", each book is on one line (separator: line break), and each column is separated by a tabulation. I'm reading the content the file with: $books = file( "/path/to/file/mycsv.txt", FILE_SKIP_...
TITLE: How can I prevent line break when reading a CSV text file with php? QUESTION: I have a CSV text file which contains serval entries of "books", each book is on one line (separator: line break), and each column is separated by a tabulation. I'm reading the content the file with: $books = file( "/path/to/file/mycs...
[ "php", "file", "csv", "line-breaks" ]
1
3
1,316
2
0
2011-06-06T12:13:33.540000
2011-06-06T12:18:05.410000
6,251,821
6,251,984
Custom MVVM implementation Vs. PRISM
This question is inspired from this closed question: What does Prism actually offer the developer? And is it worth it? I have already implemented my own custom MVVM implementations in enterprise applications. I am interested in knowing: Why should I learn PRISM (specifically PRISM, not other MVVM frameworks)? Benefits ...
As with many frameworks that do a common task for you, you get: Tested by many more eyeballs: than just yourself. This (hopefully) includes unit tests, which you may or may not be doing while building your own framework. More readable for other developers: nobody else has experience with your custom MVVM framework. But...
Custom MVVM implementation Vs. PRISM This question is inspired from this closed question: What does Prism actually offer the developer? And is it worth it? I have already implemented my own custom MVVM implementations in enterprise applications. I am interested in knowing: Why should I learn PRISM (specifically PRISM, ...
TITLE: Custom MVVM implementation Vs. PRISM QUESTION: This question is inspired from this closed question: What does Prism actually offer the developer? And is it worth it? I have already implemented my own custom MVVM implementations in enterprise applications. I am interested in knowing: Why should I learn PRISM (sp...
[ ".net", "wpf", "mvvm", "frameworks", "prism" ]
28
27
8,935
4
0
2011-06-06T12:13:58.877000
2011-06-06T12:28:17.333000
6,251,835
6,251,888
Kd-Tree Question
I am trying to implementation and understand KdTree, Following is the link I found. http://ldots.org/kdtree/#buildingAkDTree But I fail to understand following algorithm tuple function build_kd_tree(int depth, set points): if points contains only one point: return that point as a leaf. if depth is even: Calculate the ...
Your points have x and y values. The median of x values can be obtained by sorting by x, then taking the middle element's x (for an odd number of points ) or the mean of the two middle points ' x (for an even number of points ). Alternatively, use a fast selection algorithm such as median-of-medians.
Kd-Tree Question I am trying to implementation and understand KdTree, Following is the link I found. http://ldots.org/kdtree/#buildingAkDTree But I fail to understand following algorithm tuple function build_kd_tree(int depth, set points): if points contains only one point: return that point as a leaf. if depth is eve...
TITLE: Kd-Tree Question QUESTION: I am trying to implementation and understand KdTree, Following is the link I found. http://ldots.org/kdtree/#buildingAkDTree But I fail to understand following algorithm tuple function build_kd_tree(int depth, set points): if points contains only one point: return that point as a leaf...
[ "algorithm", "data-structures", "kdtree" ]
1
0
1,434
1
0
2011-06-06T12:15:09.407000
2011-06-06T12:19:52.963000
6,251,851
6,252,270
Split an array and organize the values
I have the following PHP array: $b = array ( 0 =>"03xxx", //Index of main, substr(index,0,2) 1 =>"04xxx", 2 =>"05xxx", //3 =>"06xxx" // missing "06" //4 =>"07xxx", 6 =>"04xxx", 7 =>"05xxx", 8 =>"06xxx", //9 =>"07xxx" 10 =>"08xxx", 11 =>"03xxx",// new index of main 12 =>"04xxx", 13 =>"05xxx", 14 =>"06xxx", //15 =>...
Watch it live here: http://codepad.org/SWOur3HD version(0.4) Here is the source code just in case the link dies: "03xxx", //Index of main, substr(index,0,2) 1 =>"04xxx", //2 =>"05xxx", //3 =>"06xxx" // missing "06" 4 =>"07xxx", 5 =>"08xxx", 6 =>"04xxx", 7 =>"05xxx", 8 =>"06xxx", //9 =>"07xxx" 10 =>"08xxx", 11 =>"03x...
Split an array and organize the values I have the following PHP array: $b = array ( 0 =>"03xxx", //Index of main, substr(index,0,2) 1 =>"04xxx", 2 =>"05xxx", //3 =>"06xxx" // missing "06" //4 =>"07xxx", 6 =>"04xxx", 7 =>"05xxx", 8 =>"06xxx", //9 =>"07xxx" 10 =>"08xxx", 11 =>"03xxx",// new index of main 12 =>"04xxx...
TITLE: Split an array and organize the values QUESTION: I have the following PHP array: $b = array ( 0 =>"03xxx", //Index of main, substr(index,0,2) 1 =>"04xxx", 2 =>"05xxx", //3 =>"06xxx" // missing "06" //4 =>"07xxx", 6 =>"04xxx", 7 =>"05xxx", 8 =>"06xxx", //9 =>"07xxx" 10 =>"08xxx", 11 =>"03xxx",// new index of...
[ "php", "arrays" ]
0
2
171
1
0
2011-06-06T12:16:40.497000
2011-06-06T12:51:06.317000
6,251,858
6,252,013
Pattern Matching and List Comprehension in List of Tuples
type a = [(Int,Int,Int,Int)] fun:: a -> Int func [a,b,c,d] =? I have a list of tuples like this what i required is to apply list comprehensions or pattern matching.. example taking sum or filter only divide 2 numbers... i just want a start how to access values and or a list comprehension to this List of Tuples
To sum up the a s, use something like this: type A = [(Int, Int, Int, Int)] func:: A -> Int func tuples = sum [a | (a, b, c, d) <- tuples] Also note that a type alias must begin with an upper case letter. Lower case letters are used for type variables.
Pattern Matching and List Comprehension in List of Tuples type a = [(Int,Int,Int,Int)] fun:: a -> Int func [a,b,c,d] =? I have a list of tuples like this what i required is to apply list comprehensions or pattern matching.. example taking sum or filter only divide 2 numbers... i just want a start how to access values ...
TITLE: Pattern Matching and List Comprehension in List of Tuples QUESTION: type a = [(Int,Int,Int,Int)] fun:: a -> Int func [a,b,c,d] =? I have a list of tuples like this what i required is to apply list comprehensions or pattern matching.. example taking sum or filter only divide 2 numbers... i just want a start how...
[ "list", "haskell", "pattern-matching", "list-comprehension" ]
2
8
10,906
2
0
2011-06-06T12:17:05.100000
2011-06-06T12:30:17.340000
6,251,863
6,276,133
error while loading shared libraries
My problem is very weird. I am developing in eclipse using QT lib and gtest on ubuntu 11.04. I am getting error while loading shared libraries: libRtdb.so.1 only while i wish to Debug. Run works without a problem. I have my LD_LIBRARY_PATH set, without it Run doesn't work. Are there any separated settings in eclipse fo...
Was investigating the problem some more since the previous solution didn't work so well. Seems like my LD_LIBRARY_PATH environment variable is being reset somewhere. Unfortunately i didn't find where, so atm my temporary solution will have to be the following: Setting LD_LIBRARY_PATH environment variable in terminal an...
error while loading shared libraries My problem is very weird. I am developing in eclipse using QT lib and gtest on ubuntu 11.04. I am getting error while loading shared libraries: libRtdb.so.1 only while i wish to Debug. Run works without a problem. I have my LD_LIBRARY_PATH set, without it Run doesn't work. Are there...
TITLE: error while loading shared libraries QUESTION: My problem is very weird. I am developing in eclipse using QT lib and gtest on ubuntu 11.04. I am getting error while loading shared libraries: libRtdb.so.1 only while i wish to Debug. Run works without a problem. I have my LD_LIBRARY_PATH set, without it Run doesn...
[ "eclipse", "qt" ]
1
3
9,576
1
0
2011-06-06T12:17:25.053000
2011-06-08T08:30:33.640000
6,251,864
6,254,462
Changing skin layer based on URL
I am creating a site which will have a "desktop" and a "mobile" theme. I've two theme packages for this site: mysite.theme and mysite.mobile_theme. The mobile_theme is a stripped down version of the desktop theme, with new views and a reduced set of viewlets. I want to switch between these two themes based on the URL t...
You could use collective.editskinswitcher. Its main use case is to use the Plone Default theme on say edit.example.com and My Custom Theme on www.example.com. You can probably tweak its property sheet to fit your use case though. Since the 'mobile theme' use case is fairly common I would accept patches to make that eas...
Changing skin layer based on URL I am creating a site which will have a "desktop" and a "mobile" theme. I've two theme packages for this site: mysite.theme and mysite.mobile_theme. The mobile_theme is a stripped down version of the desktop theme, with new views and a reduced set of viewlets. I want to switch between th...
TITLE: Changing skin layer based on URL QUESTION: I am creating a site which will have a "desktop" and a "mobile" theme. I've two theme packages for this site: mysite.theme and mysite.mobile_theme. The mobile_theme is a stripped down version of the desktop theme, with new views and a reduced set of viewlets. I want to...
[ "plone", "zope" ]
2
2
679
3
0
2011-06-06T12:17:28.330000
2011-06-06T15:37:39.330000
6,251,873
6,251,920
Linq left outer join onto same list to find leaf nodes
I have an in memory List. Is it possible to to use linq to select all leaf nodes? The SQL would look something like this: SELECT t1.Name FROM Tree t1 LEFT JOIN Tree t2 ON t1.UserId = t2.ParentId WHERE t2.UserId is null The closest that I've got is (i still need to filter out the nulls): var test = from t1 in list join ...
EDIT: Okay, I'd misunderstood before. So you're basically after items ( t1 ) in the list where there isn't no element t2 such that t1.UserId == t2.ParentId? In that case, I suggest you use: I suspect you want: var test = from t1 in list join t2 in list on t1.UserId equals t2.ParentId into g where!g.Any() select t1.Name...
Linq left outer join onto same list to find leaf nodes I have an in memory List. Is it possible to to use linq to select all leaf nodes? The SQL would look something like this: SELECT t1.Name FROM Tree t1 LEFT JOIN Tree t2 ON t1.UserId = t2.ParentId WHERE t2.UserId is null The closest that I've got is (i still need to ...
TITLE: Linq left outer join onto same list to find leaf nodes QUESTION: I have an in memory List. Is it possible to to use linq to select all leaf nodes? The SQL would look something like this: SELECT t1.Name FROM Tree t1 LEFT JOIN Tree t2 ON t1.UserId = t2.ParentId WHERE t2.UserId is null The closest that I've got is...
[ "c#", "linq", "tree" ]
0
2
1,627
2
0
2011-06-06T12:18:16.400000
2011-06-06T12:23:19.407000
6,251,874
6,282,814
Any .NET examples for Yahoo Query Language (YQL)?
I'd like to make some simple calls to Yahoo Query Language (YQL). Has anyone implemented this in.NET? Here is the query I'd like to make from.NET: select MarketCapitalization from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT","unknown") Update Everything is working 100%, thanks @fernaramburu.
Yes. There two good examples that are actually working because I just tested some hours ago... http://jarloo.com/get-yahoo-finance-api-data-via-yql/ and http://jarloo.com/code/get-historical-stock-data/ Hope this help! It helps me a lot!
Any .NET examples for Yahoo Query Language (YQL)? I'd like to make some simple calls to Yahoo Query Language (YQL). Has anyone implemented this in.NET? Here is the query I'd like to make from.NET: select MarketCapitalization from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT","unknown") Update Everyt...
TITLE: Any .NET examples for Yahoo Query Language (YQL)? QUESTION: I'd like to make some simple calls to Yahoo Query Language (YQL). Has anyone implemented this in.NET? Here is the query I'd like to make from.NET: select MarketCapitalization from yahoo.finance.quotes where symbol in ("YHOO","AAPL","GOOG","MSFT","unkno...
[ "c#", ".net", "visual-studio-2010", "yql" ]
12
8
12,043
4
0
2011-06-06T12:18:19.390000
2011-06-08T17:31:28.980000
6,251,875
6,252,015
Using finders to query a referenced model in Rails 3?
I have a model called Person that has_one Address. Person has fields like first_name and last_name; Address has postal_code, state, and so on. I know how to use finders to find all people with a certain name; that's Person.find_by_last_name("Smith"). But how do I find all people where: their first_name is "Bob"; and th...
When you're looking for exact values, you can pass a hash of the values you'd like to match to where. Each referenced model is its own nested hash, as in the example below: Person. where(:first_name => 'Bob'). where(:last_name => 'Smith'). where(:address => {:postal_code => '12345' }). # queries associated Address wher...
Using finders to query a referenced model in Rails 3? I have a model called Person that has_one Address. Person has fields like first_name and last_name; Address has postal_code, state, and so on. I know how to use finders to find all people with a certain name; that's Person.find_by_last_name("Smith"). But how do I fi...
TITLE: Using finders to query a referenced model in Rails 3? QUESTION: I have a model called Person that has_one Address. Person has fields like first_name and last_name; Address has postal_code, state, and so on. I know how to use finders to find all people with a certain name; that's Person.find_by_last_name("Smith"...
[ "ruby-on-rails-3", "activerecord" ]
2
1
43
1
0
2011-06-06T12:18:20.343000
2011-06-06T12:30:20.123000
6,251,880
6,252,916
Error while uploading a zip file in Django . How to debug this?
My form looks like this def handle(self,filefield_data): """ Upload the file data, in chunks, to the SHP_UPLOAD_DIR specified in settings.py. """ # ensure the upload directory exists if not os.path.exists(settings.SHP_UPLOAD_DIR): os.makedirs(settings.SHP_UPLOAD_DIR) # contruct the full filepath and filename downloade...
You need to add a line to your settings.py file: SHP_UPLOAD_DIR = r"c:\path\to\directory" You will need to create this directory yourself*, and it can be anywhere there is space for the files to live. The only requirement is that the user your website is running as has to be able to write to it. Your best bet is to put...
Error while uploading a zip file in Django . How to debug this? My form looks like this def handle(self,filefield_data): """ Upload the file data, in chunks, to the SHP_UPLOAD_DIR specified in settings.py. """ # ensure the upload directory exists if not os.path.exists(settings.SHP_UPLOAD_DIR): os.makedirs(settings.SHP_...
TITLE: Error while uploading a zip file in Django . How to debug this? QUESTION: My form looks like this def handle(self,filefield_data): """ Upload the file data, in chunks, to the SHP_UPLOAD_DIR specified in settings.py. """ # ensure the upload directory exists if not os.path.exists(settings.SHP_UPLOAD_DIR): os.make...
[ "django" ]
0
0
186
1
0
2011-06-06T12:18:53.043000
2011-06-06T13:43:15.940000
6,251,900
6,252,336
tinymce formatting
I am using the following code block to format text: 'formats': { 'format_code': { 'block': 'pre', 'styles': { 'color': '#000000', 'backgroundColor': '#f0f0f0', 'fontFamily': 'monaco,consolas,courier new,monospace', 'fontSize': '1.0em', 'width': '80%', 'minHeight': '5.0em', 'maxHeight': '15.0em', 'overflow': 'auto', 'bo...
The CSS is almost identical. The camelCase properties are dash seperated in CSS and the font containing a space must be quoted..myClassSelector { color:#000000; backgroundColor:#f0f0f0; font-family:monaco,consolas,"courier new",monospace; font-size:1em; width:80%; min-height:5em; max-height:15em; overflow:auto; border:...
tinymce formatting I am using the following code block to format text: 'formats': { 'format_code': { 'block': 'pre', 'styles': { 'color': '#000000', 'backgroundColor': '#f0f0f0', 'fontFamily': 'monaco,consolas,courier new,monospace', 'fontSize': '1.0em', 'width': '80%', 'minHeight': '5.0em', 'maxHeight': '15.0em', 'ove...
TITLE: tinymce formatting QUESTION: I am using the following code block to format text: 'formats': { 'format_code': { 'block': 'pre', 'styles': { 'color': '#000000', 'backgroundColor': '#f0f0f0', 'fontFamily': 'monaco,consolas,courier new,monospace', 'fontSize': '1.0em', 'width': '80%', 'minHeight': '5.0em', 'maxHeigh...
[ "css", "tinymce" ]
2
1
801
1
0
2011-06-06T12:21:17.753000
2011-06-06T12:56:12.070000
6,251,902
6,251,934
Cannot get length of a list
Hay, i have the following list var feedObjects = { 0:[ "url", "image" ], 1:[ "url", "image" ] } However when i try doing feedObjects.length it always returns null, any ideas?
You have an Object ( {} are the literal Object notation), not an Array, so there is no length property. You will need to iterate over it with for ( in ), except this guarantees no ordering of the properties, unlike an Array (though in practice they generally come in the order defined). Better still, swap { } with [ ] a...
Cannot get length of a list Hay, i have the following list var feedObjects = { 0:[ "url", "image" ], 1:[ "url", "image" ] } However when i try doing feedObjects.length it always returns null, any ideas?
TITLE: Cannot get length of a list QUESTION: Hay, i have the following list var feedObjects = { 0:[ "url", "image" ], 1:[ "url", "image" ] } However when i try doing feedObjects.length it always returns null, any ideas? ANSWER: You have an Object ( {} are the literal Object notation), not an Array, so there is no len...
[ "javascript", "appcelerator" ]
3
8
15,553
4
0
2011-06-06T12:21:52.560000
2011-06-06T12:23:58.380000
6,251,909
6,252,248
java.util.Scanner#findWithHorizon throws OutOfMemory exception on 32Mb input stream
Search string '4914904' exists at the tail of the stream. Here's the code Scanner sc = new Scanner(xmlInputStream, "UTF-8"); if(sc.findWithinHorizon('4914904', 0)!= null) { // <--- exception is thrown here } Any suggestions would be highly appreciated.
If you read the API for Scanner, you will see that if you pass the argument 0 to findWithinHorizon that it will read the entire buffer at once. Since you don't do anything with the value from this I see a few options. Try changing to useDelimiter(String pattern) and then call if(sc.hasNext()) which may help some with t...
java.util.Scanner#findWithHorizon throws OutOfMemory exception on 32Mb input stream Search string '4914904' exists at the tail of the stream. Here's the code Scanner sc = new Scanner(xmlInputStream, "UTF-8"); if(sc.findWithinHorizon('4914904', 0)!= null) { // <--- exception is thrown here } Any suggestions would be hig...
TITLE: java.util.Scanner#findWithHorizon throws OutOfMemory exception on 32Mb input stream QUESTION: Search string '4914904' exists at the tail of the stream. Here's the code Scanner sc = new Scanner(xmlInputStream, "UTF-8"); if(sc.findWithinHorizon('4914904', 0)!= null) { // <--- exception is thrown here } Any sugges...
[ "java" ]
0
1
300
2
0
2011-06-06T12:22:43.370000
2011-06-06T12:48:26.533000
6,251,910
6,251,991
ActiveModel equivalent for ActiveRecord has_attribute?
I am using ActiveModel because I am hooking up to a third party API rather than a db. I have written my own initialiser so that I can pass in a hash and this be converted to attributes on the model - to support some of the forms in the application. attr_accessor:Id,:FirstName,:LastName,... def initialize(attributes = ...
Based on the code example above, you don't need to use an ActiveModel method similar to has_attribute? at all--you can simply fall back to plain ol' Ruby: def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) if respond_to?("#{name}=") end end This will only assign the attribute if it...
ActiveModel equivalent for ActiveRecord has_attribute? I am using ActiveModel because I am hooking up to a third party API rather than a db. I have written my own initialiser so that I can pass in a hash and this be converted to attributes on the model - to support some of the forms in the application. attr_accessor:Id...
TITLE: ActiveModel equivalent for ActiveRecord has_attribute? QUESTION: I am using ActiveModel because I am hooking up to a third party API rather than a db. I have written my own initialiser so that I can pass in a hash and this be converted to attributes on the model - to support some of the forms in the application...
[ "ruby-on-rails", "activemodel" ]
4
4
1,918
1
0
2011-06-06T12:22:46.367000
2011-06-06T12:28:52.603000
6,251,912
6,252,564
How to call Service in Grails with groovy
I have one service in that i have a method to call and how can i acces this service. I have seen sms plugin and installed it and How can i send sms from my application to the different mobiles.I followed the grails sms plugin but i didn't get any results ecxept ecxeptions class SipgateService { static transactional = ...
If you want to call the plugin from a service method, you would need to do: change the name of your service (so it isn't called SipgateService ) Add the def sipgateService as a class definition, not a method one Does this work? class MySMSService { static transactional = true def sipgateService // This will be injecte...
How to call Service in Grails with groovy I have one service in that i have a method to call and how can i acces this service. I have seen sms plugin and installed it and How can i send sms from my application to the different mobiles.I followed the grails sms plugin but i didn't get any results ecxept ecxeptions class...
TITLE: How to call Service in Grails with groovy QUESTION: I have one service in that i have a method to call and how can i acces this service. I have seen sms plugin and installed it and How can i send sms from my application to the different mobiles.I followed the grails sms plugin but i didn't get any results ecxep...
[ "grails", "groovy", "grails-plugin" ]
2
5
3,431
1
0
2011-06-06T12:22:58.660000
2011-06-06T13:16:23.317000
6,251,914
6,259,284
Guidance for synchronising reverse associations in Entity Framework 4.1
EF 4.1 synchronises reverse associations when you create your instances. Is there any documentation of or best practices guidance available for this behaviour? What I mean by synchronising the reverse association is that given: public class Blog { public Blog() { Posts = new List (); } public int Id { get; set; } publi...
I believe - but I'm not sure - with "synchronising the reverse association" you mean a feature in Entity Framework which is called Relationship Fix-up or Relationship Span and is responsible to assign automatically navigation properties between objects in the ObjectContext. This is not specific to EF 4.1 but exists als...
Guidance for synchronising reverse associations in Entity Framework 4.1 EF 4.1 synchronises reverse associations when you create your instances. Is there any documentation of or best practices guidance available for this behaviour? What I mean by synchronising the reverse association is that given: public class Blog { ...
TITLE: Guidance for synchronising reverse associations in Entity Framework 4.1 QUESTION: EF 4.1 synchronises reverse associations when you create your instances. Is there any documentation of or best practices guidance available for this behaviour? What I mean by synchronising the reverse association is that given: pu...
[ "entity-framework-4.1", "ef-code-first" ]
8
9
2,867
1
0
2011-06-06T12:23:01.890000
2011-06-06T23:46:40.657000
6,251,932
6,251,987
how to expand TextField height when we are entering text in it
//#style sendMessage txtSendMessage = new TextField("Send Message","",150, TextField.ANY); this.smsScreen.append(txtSendMessage);
In what language, java? You can add an event listener to the textbox and every time, some one types a char, you can check the size of the text that the texbox is holding and change the style of the textbox. If you want a more precise answer, please supply some more info about the programming language, what type of gui ...
how to expand TextField height when we are entering text in it //#style sendMessage txtSendMessage = new TextField("Send Message","",150, TextField.ANY); this.smsScreen.append(txtSendMessage);
TITLE: how to expand TextField height when we are entering text in it QUESTION: //#style sendMessage txtSendMessage = new TextField("Send Message","",150, TextField.ANY); this.smsScreen.append(txtSendMessage); ANSWER: In what language, java? You can add an event listener to the textbox and every time, some one types ...
[ "java-me" ]
0
1
236
1
0
2011-06-06T12:23:53.060000
2011-06-06T12:28:40.717000
6,251,937
6,252,212
How to replace selected text with html in a contenteditable element?
With a contenteditable element how can I replace the selected content with my own html?
See here for working jsFiddle: http://jsfiddle.net/dKaJ3/2/ function getSelectionHtml() { var html = ""; if (typeof window.getSelection!= "undefined") { var sel = window.getSelection(); if (sel.rangeCount) { var container = document.createElement("div"); for (var i = 0, len = sel.rangeCount; i < len; ++i) { container.a...
How to replace selected text with html in a contenteditable element? With a contenteditable element how can I replace the selected content with my own html?
TITLE: How to replace selected text with html in a contenteditable element? QUESTION: With a contenteditable element how can I replace the selected content with my own html? ANSWER: See here for working jsFiddle: http://jsfiddle.net/dKaJ3/2/ function getSelectionHtml() { var html = ""; if (typeof window.getSelection!...
[ "javascript", "jquery", "contenteditable" ]
47
70
61,900
2
0
2011-06-06T12:24:03.430000
2011-06-06T12:45:21.403000
6,251,940
6,252,026
linux / virtual/physical page sizes
Is the page size constant? To be more specific, getconf PAGE_SIZE gives 4096, fair enough. But can this change through a program's runtime? Or is it constant throughout the entire OS process spawn. I.e., is it possible for a process to have 1024 and 2048 AND 4096 page sizes? Let's just talk virtual page sizes for now. ...
It is possible for a process to use more than one pagesize. On newer kernels this may even happen without notice, see Andrea Arcangelis transparent huge pages. Other than that, you can request memory with a different (usually larger) page size over hugetlbfs. The main reason for having big pages is performance, the TLB...
linux / virtual/physical page sizes Is the page size constant? To be more specific, getconf PAGE_SIZE gives 4096, fair enough. But can this change through a program's runtime? Or is it constant throughout the entire OS process spawn. I.e., is it possible for a process to have 1024 and 2048 AND 4096 page sizes? Let's ju...
TITLE: linux / virtual/physical page sizes QUESTION: Is the page size constant? To be more specific, getconf PAGE_SIZE gives 4096, fair enough. But can this change through a program's runtime? Or is it constant throughout the entire OS process spawn. I.e., is it possible for a process to have 1024 and 2048 AND 4096 pa...
[ "linux", "page-size" ]
4
3
643
1
0
2011-06-06T12:24:38.063000
2011-06-06T12:31:02.263000
6,251,945
6,252,023
Add Project Reference vs Add DLL Reference
I am newbie in.net.Today I have created a sample. In that sample, I have stored data in database using N Tier architecture. If I want to use to Use BL or DAL method in other project(I mean BL method in UI or DAL method in BL), I found two ways. First one is - Right click on project << Add Reference << Select Project in...
The correct way to do it is to add a project reference. one of the most important differences is that a project reference is updated automatically when you change the referenced project. for example- If you change your DAL method from GetEmployees() to GetAllEmployees() then you can use GetAllEmployees() immediately in...
Add Project Reference vs Add DLL Reference I am newbie in.net.Today I have created a sample. In that sample, I have stored data in database using N Tier architecture. If I want to use to Use BL or DAL method in other project(I mean BL method in UI or DAL method in BL), I found two ways. First one is - Right click on pr...
TITLE: Add Project Reference vs Add DLL Reference QUESTION: I am newbie in.net.Today I have created a sample. In that sample, I have stored data in database using N Tier architecture. If I want to use to Use BL or DAL method in other project(I mean BL method in UI or DAL method in BL), I found two ways. First one is -...
[ "asp.net" ]
4
4
4,098
4
0
2011-06-06T12:25:15.757000
2011-06-06T12:30:57.943000
6,251,948
6,251,996
Microsoft.Phone.Controls.Toolkit unable to import using directive
I have downloaded and installed Microsoft.Phone.Controls.Toolkit and I am able to include it in the xaml page, but I am unable to include it in the C# file(like "using Microsoft.Phone.Controls.Toolkit" ). any idea why this happens?
...try to build and after add using Microsoft.Phone.Controls.Toolkit;
Microsoft.Phone.Controls.Toolkit unable to import using directive I have downloaded and installed Microsoft.Phone.Controls.Toolkit and I am able to include it in the xaml page, but I am unable to include it in the C# file(like "using Microsoft.Phone.Controls.Toolkit" ). any idea why this happens?
TITLE: Microsoft.Phone.Controls.Toolkit unable to import using directive QUESTION: I have downloaded and installed Microsoft.Phone.Controls.Toolkit and I am able to include it in the xaml page, but I am unable to include it in the C# file(like "using Microsoft.Phone.Controls.Toolkit" ). any idea why this happens? ANS...
[ "windows-phone-7" ]
0
0
964
3
0
2011-06-06T12:25:18.217000
2011-06-06T12:29:22.910000
6,251,956
6,252,019
String delete in VIM
I have a file that has the general form as number,number,string and i want to delete both the numbers from each line and extract only the string. What would the regexp be?
You can use::s/^[0-9]*,[0-9]*,// For the whole file, that's::%s/^[0-9]*,[0-9]*,//
String delete in VIM I have a file that has the general form as number,number,string and i want to delete both the numbers from each line and extract only the string. What would the regexp be?
TITLE: String delete in VIM QUESTION: I have a file that has the general form as number,number,string and i want to delete both the numbers from each line and extract only the string. What would the regexp be? ANSWER: You can use::s/^[0-9]*,[0-9]*,// For the whole file, that's::%s/^[0-9]*,[0-9]*,//
[ "regex", "linux", "vim" ]
5
12
1,047
2
0
2011-06-06T12:25:57.060000
2011-06-06T12:30:30.873000
6,251,963
6,251,986
StringBuilder, differences between two syntaxes
Is there a difference between: StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into " + listeLibelleTable[index] + " ( "); and StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into "); requete.Append(listeLibelleTable[index]); requete.Append(" ( "); When I say "difference" I mea...
Unless listeLibelleTable[index] can indeed be resolved at compile time (which I greatly doubt), using the string concatenation seems to be counter productive to the use of the StringBuilder. In your second example you are concatenating a string and then appending it instead of appending to the StringBuilder. In either ...
StringBuilder, differences between two syntaxes Is there a difference between: StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into " + listeLibelleTable[index] + " ( "); and StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into "); requete.Append(listeLibelleTable[index]); requ...
TITLE: StringBuilder, differences between two syntaxes QUESTION: Is there a difference between: StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into " + listeLibelleTable[index] + " ( "); and StringBuilder requete = new StringBuilder(); requete.Append(" INSERT into "); requete.Append(listeLibelleT...
[ "c#", "performance", "stringbuilder" ]
0
4
272
4
0
2011-06-06T12:26:27.580000
2011-06-06T12:28:40.663000
6,251,964
6,252,310
Layout containing listview, unable to switch to new activity onitemclick
I am having a listview as part of a mainLayout and Onclickevent on listview is not working. Can anybody give me pointer where I am wrong? Here's the code snippet: public class HostListActivity extends ListActivity { public ArrayList deviceList; static LinearLayout mainLayout; public ListView hostListView; public void...
You extend ListActivity but you do not use any feature from this class. I have noticed that this correlates with not working OnItemClickListener. Simply changing: public class HostListActivity extends ListActivity { to public class HostListActivity extends Activity { will help.
Layout containing listview, unable to switch to new activity onitemclick I am having a listview as part of a mainLayout and Onclickevent on listview is not working. Can anybody give me pointer where I am wrong? Here's the code snippet: public class HostListActivity extends ListActivity { public ArrayList deviceList; s...
TITLE: Layout containing listview, unable to switch to new activity onitemclick QUESTION: I am having a listview as part of a mainLayout and Onclickevent on listview is not working. Can anybody give me pointer where I am wrong? Here's the code snippet: public class HostListActivity extends ListActivity { public Array...
[ "android", "android-layout", "android-listview" ]
0
1
558
2
0
2011-06-06T12:26:30.440000
2011-06-06T12:53:57.227000
6,251,965
6,252,131
Getting rid of "==" syntax error in android
The elseif(v == button2) line gives an error saying that "Syntax error on token '==', delete this token". I got the idea of using this from the topic "Variable OnClick listener android" from this website. Can anyone please tell me how to use it? Here is my code: View.OnClickListener yourListener = new View.OnClickListe...
ah... Your code sample is a mess... I've re-formatted it and correct errors. Now it should work. View.OnClickListener yourListener = new View.OnClickListener() { public void onClick(View v) { if (v == button1) { new AlertDialog.Builder(v.getContext()).setTitle("Paracettamol").setMessage( "This medicine is generally use...
Getting rid of "==" syntax error in android The elseif(v == button2) line gives an error saying that "Syntax error on token '==', delete this token". I got the idea of using this from the topic "Variable OnClick listener android" from this website. Can anyone please tell me how to use it? Here is my code: View.OnClickL...
TITLE: Getting rid of "==" syntax error in android QUESTION: The elseif(v == button2) line gives an error saying that "Syntax error on token '==', delete this token". I got the idea of using this from the topic "Variable OnClick listener android" from this website. Can anyone please tell me how to use it? Here is my c...
[ "java", "android" ]
1
1
165
2
0
2011-06-06T12:26:31.717000
2011-06-06T12:38:41.403000