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,265,228 | 6,265,333 | Selecting a row in DataGridView programmatically | How can I select a particular range of rows in a DataGridView programmatically at runtime? | Not tested, but I think you can do the following: dataGrid.Rows[index].Selected = true; or you could do the following (but again: not tested): dataGrid.SelectedRows.Clear(); foreach(DataGridViewRow row in dataGrid.Rows) { if(YOUR CONDITION) row.Selected = true; } | Selecting a row in DataGridView programmatically How can I select a particular range of rows in a DataGridView programmatically at runtime? | TITLE:
Selecting a row in DataGridView programmatically
QUESTION:
How can I select a particular range of rows in a DataGridView programmatically at runtime?
ANSWER:
Not tested, but I think you can do the following: dataGrid.Rows[index].Selected = true; or you could do the following (but again: not tested): dataGrid.S... | [
"c#",
".net",
"winforms",
"datagridview"
] | 141 | 178 | 303,901 | 7 | 0 | 2011-06-07T12:36:26.803000 | 2011-06-07T12:44:15.903000 |
6,265,229 | 6,265,469 | Visual Basic Regular Expression Question | I have a list of string. When user inputs chars in, the program would display all possible strings from the list in a textbox. Dim fruit as new List(Of String) 'contains apple,orange,pear,banana Dim rx as New Regex(fruit) For example If user enters a,p,l,e,r, then the program would display apple and pear. It should mat... | LINQ Approach: Dim fruits As New List(Of String) From { "apple", "orange", "pear", "banana" } Dim input As String = "a,p,l,e,r" Dim letters As String = input.Replace(",", "") Dim result = fruits.Where(Function(fruit) Not fruit.Except(letters).Any()) Regex Approach: A regex pattern to match the results would resemble so... | Visual Basic Regular Expression Question I have a list of string. When user inputs chars in, the program would display all possible strings from the list in a textbox. Dim fruit as new List(Of String) 'contains apple,orange,pear,banana Dim rx as New Regex(fruit) For example If user enters a,p,l,e,r, then the program wo... | TITLE:
Visual Basic Regular Expression Question
QUESTION:
I have a list of string. When user inputs chars in, the program would display all possible strings from the list in a textbox. Dim fruit as new List(Of String) 'contains apple,orange,pear,banana Dim rx as New Regex(fruit) For example If user enters a,p,l,e,r, t... | [
"regex",
"vb.net"
] | 5 | 7 | 908 | 1 | 0 | 2011-06-07T12:36:34.033000 | 2011-06-07T12:55:04.947000 |
6,265,236 | 6,265,260 | Error in strtok function in C | I am using a simple program to tokenize a string using strtok function. Here is the code - # include char str[] = "now # time for all # good men to # aid of their country"; //line a char delims[] = "#"; char *result = NULL; result = strtok( str, delims ); while( result!= NULL ) { printf( "result is \"%s\"\n", result );... | You can't modify a string literal. The c faq on the subject explains it best. In a nutshell if you declare char *stuff = "Read-only stuff"; You can't modify it. The fact that strtok accepts a char * is related to the fact that you can't pass arrays to functions, you can only pass addresses. Another c faq entry might he... | Error in strtok function in C I am using a simple program to tokenize a string using strtok function. Here is the code - # include char str[] = "now # time for all # good men to # aid of their country"; //line a char delims[] = "#"; char *result = NULL; result = strtok( str, delims ); while( result!= NULL ) { printf( "... | TITLE:
Error in strtok function in C
QUESTION:
I am using a simple program to tokenize a string using strtok function. Here is the code - # include char str[] = "now # time for all # good men to # aid of their country"; //line a char delims[] = "#"; char *result = NULL; result = strtok( str, delims ); while( result!= ... | [
"c",
"strtok",
"string"
] | 4 | 5 | 4,243 | 3 | 0 | 2011-06-07T12:37:02.363000 | 2011-06-07T12:39:30.610000 |
6,265,237 | 6,265,285 | Function returning undefined when value set to null | I have got a function that returns the coordinates of a valid address but im having some difficulties is its an inavlid address. I was hoping to get a null value for pos1,which I set in the function if geocode fails to find a valid address.But I'm getting undefined,I know Im doing something really stupid but just cant ... | Your problem is that the callback function from the geocoder will not run until long after that "getCoordinates()" has returned. The structure of the code you've written simply will not work. Instead of expecting "getCoordinates()" to return something, you need to write it so that you pass in another function to be cal... | Function returning undefined when value set to null I have got a function that returns the coordinates of a valid address but im having some difficulties is its an inavlid address. I was hoping to get a null value for pos1,which I set in the function if geocode fails to find a valid address.But I'm getting undefined,I ... | TITLE:
Function returning undefined when value set to null
QUESTION:
I have got a function that returns the coordinates of a valid address but im having some difficulties is its an inavlid address. I was hoping to get a null value for pos1,which I set in the function if geocode fails to find a valid address.But I'm ge... | [
"javascript",
"google-maps"
] | 0 | 2 | 243 | 1 | 0 | 2011-06-07T12:37:06.663000 | 2011-06-07T12:41:20.563000 |
6,265,239 | 6,265,900 | submit an ios app using ios5 OS and ios5 sdk | I'm wondering if I can install IOS 5 and the IOS 5 SDK and still be able to develop and submit apps to Apple? Or once I install IOS 5 I'm forced to install the IOS5 SDK (from what I understand I can't test my applications using a stable 4.3 SDK when running my iDevice with new IO 5) So am I able to develop my applicati... | You can install several Xcode versions next to each other and thus use the non-beta for submitting to the AppStore. Actually I recommend to always install the Xcode betas somewhere else in case you run into issues. For example, the Xcode 4.0 betas sometimes had so many crashes that it was PIA to use them. Going back to... | submit an ios app using ios5 OS and ios5 sdk I'm wondering if I can install IOS 5 and the IOS 5 SDK and still be able to develop and submit apps to Apple? Or once I install IOS 5 I'm forced to install the IOS5 SDK (from what I understand I can't test my applications using a stable 4.3 SDK when running my iDevice with n... | TITLE:
submit an ios app using ios5 OS and ios5 sdk
QUESTION:
I'm wondering if I can install IOS 5 and the IOS 5 SDK and still be able to develop and submit apps to Apple? Or once I install IOS 5 I'm forced to install the IOS5 SDK (from what I understand I can't test my applications using a stable 4.3 SDK when running... | [
"iphone",
"ios",
"sdk",
"beta",
"ios5"
] | 5 | 4 | 2,138 | 3 | 0 | 2011-06-07T12:37:08.380000 | 2011-06-07T13:28:06.747000 |
6,265,240 | 6,265,313 | Determining value of preprocessor token | How can I tell what the value of the __GNUC__ definition is on my C++ compiler? | You can get all the GCC predefined macros with this: g++ -dM -E - < /dev/null A quick grep will get you what you want. | Determining value of preprocessor token How can I tell what the value of the __GNUC__ definition is on my C++ compiler? | TITLE:
Determining value of preprocessor token
QUESTION:
How can I tell what the value of the __GNUC__ definition is on my C++ compiler?
ANSWER:
You can get all the GCC predefined macros with this: g++ -dM -E - < /dev/null A quick grep will get you what you want. | [
"c++",
"macros"
] | 3 | 7 | 156 | 3 | 0 | 2011-06-07T12:37:14.700000 | 2011-06-07T12:42:53.547000 |
6,265,254 | 6,265,603 | How to create SoundCloud api object? | In my iPhone app, I'm trying to allow users to post an audio track to Facebook via Soundcloud. I've been going through this tutorial and have reached this line of code: [api performMethod:@"GET" onResource:@"me/connections.json" withParameters:nil context:nil userInfo:nil]; My question is going to show how much of a no... | If you open the test projects it shows you in the app delegate how to create the API object. | How to create SoundCloud api object? In my iPhone app, I'm trying to allow users to post an audio track to Facebook via Soundcloud. I've been going through this tutorial and have reached this line of code: [api performMethod:@"GET" onResource:@"me/connections.json" withParameters:nil context:nil userInfo:nil]; My quest... | TITLE:
How to create SoundCloud api object?
QUESTION:
In my iPhone app, I'm trying to allow users to post an audio track to Facebook via Soundcloud. I've been going through this tutorial and have reached this line of code: [api performMethod:@"GET" onResource:@"me/connections.json" withParameters:nil context:nil userI... | [
"objective-c",
"facebook",
"soundcloud"
] | 0 | 1 | 381 | 1 | 0 | 2011-06-07T12:39:22.630000 | 2011-06-07T13:05:34.197000 |
6,265,258 | 6,265,322 | what is the default scope in JSF 1.1? | beanName BeanClasss session Is it mandatory to specify the scope of a manage bean in JSF 1.1. If it it is not mandatory, then what is the default scope? | The entry is mandatory for the faces-config.xml to be parsed correctly. Omitting it would result in a XML parsing error. However, next to request, session and application JSF also supports a scope of none. | what is the default scope in JSF 1.1? beanName BeanClasss session Is it mandatory to specify the scope of a manage bean in JSF 1.1. If it it is not mandatory, then what is the default scope? | TITLE:
what is the default scope in JSF 1.1?
QUESTION:
beanName BeanClasss session Is it mandatory to specify the scope of a manage bean in JSF 1.1. If it it is not mandatory, then what is the default scope?
ANSWER:
The entry is mandatory for the faces-config.xml to be parsed correctly. Omitting it would result in a ... | [
"jsf"
] | 2 | 1 | 1,260 | 1 | 0 | 2011-06-07T12:39:27.730000 | 2011-06-07T12:43:36.183000 |
6,265,271 | 6,266,088 | Jquery date validation bug | I've been trying to implement a jQuery function to validate date formats but I have encountered a curious problem. When the number '8' or '9' is contained in the day or month, (ex: 08/06/2011) it says the date is invalid... A demo is available here: http://www.geektantra.com/projects/jquery-form-validate/advanced_demo/... | When there are problems with the values 08 and 09, you almost certainly forgot to specify the radix parameter on parseInt(). If it's not specified, it tries to auto-detect the base from the input, and if it finds a leading zero, it tries to parse it as an octal number. For numbers 00 to 07 it's not an issue, it even ev... | Jquery date validation bug I've been trying to implement a jQuery function to validate date formats but I have encountered a curious problem. When the number '8' or '9' is contained in the day or month, (ex: 08/06/2011) it says the date is invalid... A demo is available here: http://www.geektantra.com/projects/jquery-f... | TITLE:
Jquery date validation bug
QUESTION:
I've been trying to implement a jQuery function to validate date formats but I have encountered a curious problem. When the number '8' or '9' is contained in the day or month, (ex: 08/06/2011) it says the date is invalid... A demo is available here: http://www.geektantra.com... | [
"javascript",
"jquery",
"jquery-validate"
] | 0 | 4 | 889 | 1 | 0 | 2011-06-07T12:40:05.060000 | 2011-06-07T13:40:22.333000 |
6,265,277 | 6,265,714 | How to i get a marker (or pin) on a specified location for google maps? | This is the link that i was using for google map with one marker on a specific latitude and longitude. But with this code, i get two markers. An arrow on specific address i wanted and a pin at the center of the town or city of that address. May i know what is wrong here? I want just one pin on specific address, not on ... | Google Maps tries to mark any other noteworthy places in the area. There are a couple methods you can use to stop this. One method is to add loc: to your GPS query like this: http://maps.google.com/maps?key=ABQIAAAAyzfPKfpu4h_2V2EY0MQKcBQLL4oEiRrONF_Oyv5y1AbK0VEmMxQN1Z5_-BmLvlLLFYiLTknmwufmIg&mapclient=jsapi&ie=UTF8&sp... | How to i get a marker (or pin) on a specified location for google maps? This is the link that i was using for google map with one marker on a specific latitude and longitude. But with this code, i get two markers. An arrow on specific address i wanted and a pin at the center of the town or city of that address. May i k... | TITLE:
How to i get a marker (or pin) on a specified location for google maps?
QUESTION:
This is the link that i was using for google map with one marker on a specific latitude and longitude. But with this code, i get two markers. An arrow on specific address i wanted and a pin at the center of the town or city of tha... | [
"c#",
"asp.net",
"google-maps"
] | 0 | 1 | 2,196 | 1 | 0 | 2011-06-07T12:40:21.920000 | 2011-06-07T13:12:52.073000 |
6,265,284 | 6,265,529 | Commands in Paramiko block due to script execution time | hello guys i have three server and i mange it from SSH so i made this script to run my Register script "Register.py" so everyday i turn on Register mode so the problem how i can login to multiple SSH connection without close the other import paramiko import os ZI1={"ip":"192.168.1.2","pass":"Administrator"} ZI2={"ip":"... | Another way is using Thread if you need do some action based on return of Register.py See example: import paramiko import os import sys from threading import Thread
SERVER_LIST = [{"ip":"192.168.1.2","pass":"Administrator"},{"ip":"192.168.1.4","pass":"AdminStudents"},{"ip":"192.168.1.3","pass":"AdminTeachers"}]
class... | Commands in Paramiko block due to script execution time hello guys i have three server and i mange it from SSH so i made this script to run my Register script "Register.py" so everyday i turn on Register mode so the problem how i can login to multiple SSH connection without close the other import paramiko import os ZI1... | TITLE:
Commands in Paramiko block due to script execution time
QUESTION:
hello guys i have three server and i mange it from SSH so i made this script to run my Register script "Register.py" so everyday i turn on Register mode so the problem how i can login to multiple SSH connection without close the other import para... | [
"python",
"session",
"ssh",
"paramiko"
] | 0 | 0 | 1,276 | 3 | 0 | 2011-06-07T12:41:19.440000 | 2011-06-07T12:59:36.643000 |
6,265,288 | 6,271,763 | unique_ptr custom storage type example? | Howard Hinnant explained that unique_ptr can also use a custom storage type. He mentions as an example " shared memory ". He only gives the rough idea (which is fine for a quick intro). But can anyone complete his example for a "custom storage type" (be it shared memory or not)? To support placing unique_ptr into share... | You might be interested in boost::offset_ptr which served as the motivating use case for this customization point in unique_ptr. offset_ptr is a fully developed pointer type which could be installed into a custom deleter using a simple typedef. Its use case is to put unique_ptr into shared memory. | unique_ptr custom storage type example? Howard Hinnant explained that unique_ptr can also use a custom storage type. He mentions as an example " shared memory ". He only gives the rough idea (which is fine for a quick intro). But can anyone complete his example for a "custom storage type" (be it shared memory or not)? ... | TITLE:
unique_ptr custom storage type example?
QUESTION:
Howard Hinnant explained that unique_ptr can also use a custom storage type. He mentions as an example " shared memory ". He only gives the rough idea (which is fine for a quick intro). But can anyone complete his example for a "custom storage type" (be it share... | [
"c++11",
"unique-ptr"
] | 2 | 2 | 1,539 | 2 | 0 | 2011-06-07T12:41:34.323000 | 2011-06-07T21:16:23.633000 |
6,265,296 | 6,265,474 | Is there any other way to create an exe file from a java source other than ant script | Possible Duplicate: How can I convert my Java program to an.exe file? I need to create an exe file from my java source. My requirement is to use other ways except ant script. Is there any other way to create the exe file. | You need to be clear about your requirements. There are various ways to create an EXE from Java. The exe could be native compiled or could be using JRE. GCJ is the example of native compiled exe and Launch4J is an example of exe which is using JRE. Please refer to following link for more details: How can I convert my J... | Is there any other way to create an exe file from a java source other than ant script Possible Duplicate: How can I convert my Java program to an.exe file? I need to create an exe file from my java source. My requirement is to use other ways except ant script. Is there any other way to create the exe file. | TITLE:
Is there any other way to create an exe file from a java source other than ant script
QUESTION:
Possible Duplicate: How can I convert my Java program to an.exe file? I need to create an exe file from my java source. My requirement is to use other ways except ant script. Is there any other way to create the exe ... | [
"java",
"exe"
] | 0 | 1 | 251 | 2 | 0 | 2011-06-07T12:42:13.630000 | 2011-06-07T12:55:36.567000 |
6,265,297 | 6,265,568 | Is there a way to display HTML in silverlight without an iframe overlay? | I am trying to incorporate some HTML into a silverlight application however even commercial solutions such as C1 HtmlHost control use the widely discussed silverlight iframe overlay technique. This technique means that any silverlight dialogs still have the HTML "floating" above them, I want dialogs in silverlight to a... | If your application is running out-of-browser you can use the browser component - if you want it inside your browser application you need to wait for silverlight 5. | Is there a way to display HTML in silverlight without an iframe overlay? I am trying to incorporate some HTML into a silverlight application however even commercial solutions such as C1 HtmlHost control use the widely discussed silverlight iframe overlay technique. This technique means that any silverlight dialogs stil... | TITLE:
Is there a way to display HTML in silverlight without an iframe overlay?
QUESTION:
I am trying to incorporate some HTML into a silverlight application however even commercial solutions such as C1 HtmlHost control use the widely discussed silverlight iframe overlay technique. This technique means that any silver... | [
".net",
"html",
"silverlight"
] | 0 | 1 | 324 | 1 | 0 | 2011-06-07T12:42:17.340000 | 2011-06-07T13:02:47.540000 |
6,265,308 | 6,265,580 | Java Applet - Unable to change default platform encoding to some other | I am facing an encoding problem (I guess) when I try to upload a file with file name having swedish charachters Ӧ Ӓ å. Applet works fine when I upload a file on Windows but not on Mac OS. The filename gets messed up when print it on the server side, which is a Domino server, and shows boxes on Mac but When I set the en... | Java strings are always internally encoded as UTF-16, but this is not relevant to your problem, and the attempt to "set the encoding" of a string is inherently wrong. Encodings are used to translate between Strings and bytes. Your problem is that at some point where this is done, you are not specifying an encoding, so ... | Java Applet - Unable to change default platform encoding to some other I am facing an encoding problem (I guess) when I try to upload a file with file name having swedish charachters Ӧ Ӓ å. Applet works fine when I upload a file on Windows but not on Mac OS. The filename gets messed up when print it on the server side,... | TITLE:
Java Applet - Unable to change default platform encoding to some other
QUESTION:
I am facing an encoding problem (I guess) when I try to upload a file with file name having swedish charachters Ӧ Ӓ å. Applet works fine when I upload a file on Windows but not on Mac OS. The filename gets messed up when print it o... | [
"java",
"encoding",
"applet",
"lotus-domino",
"osx-leopard"
] | 3 | 2 | 2,045 | 2 | 0 | 2011-06-07T12:42:47.983000 | 2011-06-07T13:03:31.077000 |
6,265,309 | 6,265,484 | cannot deploy to Azure storage | Im trying to deploy an app into Azure, its basically a completely fresh vanilla cloud app with an ASP.NET webrole created in VS2010. When I try to create a new hosted service and I choose the files created by the publish step, all I ever get is "Uploading the selected package has failed, please verify your network conn... | As an alternative, you may want to deploy your Azure projects from inside Visual Studio. It's much easier.. Just right click on your cloud project in Solution Explorer > Publish. http://msdn.microsoft.com/library/ff683672.aspx | cannot deploy to Azure storage Im trying to deploy an app into Azure, its basically a completely fresh vanilla cloud app with an ASP.NET webrole created in VS2010. When I try to create a new hosted service and I choose the files created by the publish step, all I ever get is "Uploading the selected package has failed, ... | TITLE:
cannot deploy to Azure storage
QUESTION:
Im trying to deploy an app into Azure, its basically a completely fresh vanilla cloud app with an ASP.NET webrole created in VS2010. When I try to create a new hosted service and I choose the files created by the publish step, all I ever get is "Uploading the selected pa... | [
"deployment",
"azure"
] | 0 | 1 | 452 | 1 | 0 | 2011-06-07T12:42:48.570000 | 2011-06-07T12:56:27.753000 |
6,265,330 | 6,265,410 | Java: Are all monitors released when thread waits on an object? | Before a thread can wait on an object, it has to acquire a monitor on that object. The monitor is then released, and the thread attempts to re-acquired it once it awakes. But what happens to other monitors the thread holds when it calls wait? Consider this example: Object a = //... Object b = //...
synchronized(a) { s... | Only b. The authoritarian source for these type of questions is the Java Language Specification. The relevant section in this case is 17.8 Wait Sets and Notification: Let thread t be the thread executing the wait method on object m, and let n be the number of lock actions by t on m that have not been matched by unlock ... | Java: Are all monitors released when thread waits on an object? Before a thread can wait on an object, it has to acquire a monitor on that object. The monitor is then released, and the thread attempts to re-acquired it once it awakes. But what happens to other monitors the thread holds when it calls wait? Consider this... | TITLE:
Java: Are all monitors released when thread waits on an object?
QUESTION:
Before a thread can wait on an object, it has to acquire a monitor on that object. The monitor is then released, and the thread attempts to re-acquired it once it awakes. But what happens to other monitors the thread holds when it calls w... | [
"java",
"multithreading",
"wait",
"synchronized"
] | 20 | 17 | 4,113 | 3 | 0 | 2011-06-07T12:44:03.827000 | 2011-06-07T12:50:45.410000 |
6,265,332 | 6,265,393 | Why use (360 * 16) instead of just 360 degrees? | I noticed this while using Qt, going through the code examples. When they try to set the range for the variable that stores angle ( angle in this case), why does it need to be 360 multiplied by 16, instead of just 360? the code (from the hellogl example) is static void qNormalizeAngle(int ∠) { while (angle < 0) angle +... | Buried in this article: The values are multiplied by 16 because QPainter expresses angles as sixteenths of a degree. | Why use (360 * 16) instead of just 360 degrees? I noticed this while using Qt, going through the code examples. When they try to set the range for the variable that stores angle ( angle in this case), why does it need to be 360 multiplied by 16, instead of just 360? the code (from the hellogl example) is static void qN... | TITLE:
Why use (360 * 16) instead of just 360 degrees?
QUESTION:
I noticed this while using Qt, going through the code examples. When they try to set the range for the variable that stores angle ( angle in this case), why does it need to be 360 multiplied by 16, instead of just 360? the code (from the hellogl example)... | [
"qt",
"graphics"
] | 4 | 5 | 323 | 1 | 0 | 2011-06-07T12:44:14.997000 | 2011-06-07T12:48:57.723000 |
6,265,350 | 6,265,652 | iphone "Go" key pad button and android "Enter" keypad button | I have a site which is optimized for mobile devices. I also have a sign in page on this site. Once a user fills the credentials he/she can sign in using a sign in button. but I also want that the same operation happen when they tab the "Go" button or "Enter" button on the key pad. how can we implement that? the other t... | For the first part - a standard will be activated by default when the "Go"/"Enter" button will be pressed, as with the "Enter" key will work on a desktop browser. For other special input types, there are those: They are documented well on Dive Into HTML5 page. Important: remember that elements have to be enclosed insid... | iphone "Go" key pad button and android "Enter" keypad button I have a site which is optimized for mobile devices. I also have a sign in page on this site. Once a user fills the credentials he/she can sign in using a sign in button. but I also want that the same operation happen when they tab the "Go" button or "Enter" ... | TITLE:
iphone "Go" key pad button and android "Enter" keypad button
QUESTION:
I have a site which is optimized for mobile devices. I also have a sign in page on this site. Once a user fills the credentials he/she can sign in using a sign in button. but I also want that the same operation happen when they tab the "Go" ... | [
"javascript",
"iphone",
"android",
"html",
"keypad"
] | 2 | 2 | 3,074 | 1 | 0 | 2011-06-07T12:45:21.533000 | 2011-06-07T13:08:39.067000 |
6,265,365 | 6,265,407 | Pinpoint the Center | I am developing a circular chart that will have lines that move around it (like a clock, but not necessarily that regular). The lines will actually be representative of vectors, so they will have an angle and a magnitude. I am doing this with images (unless somebody has a better idea) and I am changing the size of the ... | Does anybody have any ideas for developing an algorithm to keep the image "centered" or have an idea for a better way to do this? I would use HTML and the canvas tag, but I have to support IE8. You should use Raphaël: http://raphaeljs.com/ Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ an... | Pinpoint the Center I am developing a circular chart that will have lines that move around it (like a clock, but not necessarily that regular). The lines will actually be representative of vectors, so they will have an angle and a magnitude. I am doing this with images (unless somebody has a better idea) and I am chang... | TITLE:
Pinpoint the Center
QUESTION:
I am developing a circular chart that will have lines that move around it (like a clock, but not necessarily that regular). The lines will actually be representative of vectors, so they will have an angle and a magnitude. I am doing this with images (unless somebody has a better id... | [
"javascript",
"html",
"css"
] | 3 | 2 | 126 | 1 | 0 | 2011-06-07T12:46:34.560000 | 2011-06-07T12:50:38.593000 |
6,265,367 | 6,265,431 | Can't understand why does canvas not edited | This is a function of a json object. canvas param is a canvas with image loaded and canvasCtx is a context of the canvas. The problem is that when i move the slider, the canvas is edited only once and if i move it again nothing happens. But if i add the strings that i marked, everything works fine. Why? EditBrightness:... | Probably because you change canvas, canvasCtx variables which you pass to this method somewhere outside the code which you show us. | Can't understand why does canvas not edited This is a function of a json object. canvas param is a canvas with image loaded and canvasCtx is a context of the canvas. The problem is that when i move the slider, the canvas is edited only once and if i move it again nothing happens. But if i add the strings that i marked,... | TITLE:
Can't understand why does canvas not edited
QUESTION:
This is a function of a json object. canvas param is a canvas with image loaded and canvasCtx is a context of the canvas. The problem is that when i move the slider, the canvas is edited only once and if i move it again nothing happens. But if i add the stri... | [
"javascript",
"jquery",
"visibility",
"pixastic"
] | 1 | 0 | 206 | 1 | 0 | 2011-06-07T12:46:47.367000 | 2011-06-07T12:52:09.177000 |
6,265,372 | 6,265,604 | Why is my variable null? | I'm currently editing a working project with some experience on PHP. I know a bit about the basics but I know only a little about MVC and Code-Igniter so ofcourse I will be facing some problems. My first problem is that i'm trying to fill a drop down list from a controller. The view is called "overview_screen.php" and ... | Given the output, your view is likely to be passing through the parser library of CI. Code should be like this: function index() { $this->load->library('parser'); $data['years'] = $this->getYears(); $data['menu'] = $this->getMenu();
$this->parser->parse('overview_screen',$data);
} I say this because I see the use of ... | Why is my variable null? I'm currently editing a working project with some experience on PHP. I know a bit about the basics but I know only a little about MVC and Code-Igniter so ofcourse I will be facing some problems. My first problem is that i'm trying to fill a drop down list from a controller. The view is called "... | TITLE:
Why is my variable null?
QUESTION:
I'm currently editing a working project with some experience on PHP. I know a bit about the basics but I know only a little about MVC and Code-Igniter so ofcourse I will be facing some problems. My first problem is that i'm trying to fill a drop down list from a controller. Th... | [
"php",
"arrays",
"codeigniter",
"drop-down-menu"
] | 3 | 1 | 197 | 4 | 0 | 2011-06-07T12:47:13.943000 | 2011-06-07T13:05:40.437000 |
6,265,373 | 6,265,482 | Problem switching hidden value of an input | I want to toggle the value of a hidden input, between advanced and normal? But the below script doesn't work, nothing happens. $('#advancedLink').click(function () { $("#searchType").val($(this).text() == 'normal'? 'advanced': 'normal'); return false; }); However, if I switch place of normal and advanced it will work o... | You're checking the value of the link but setting the value for the text box. Since the value of the link never changes, the text box value does not change either. Here's a fiddle: http://jsfiddle.net/GKfWB/ $('#advancedLink').click(function () { $("#searchType").val($('#searchType').val() == 'normal'? 'advanced': 'nor... | Problem switching hidden value of an input I want to toggle the value of a hidden input, between advanced and normal? But the below script doesn't work, nothing happens. $('#advancedLink').click(function () { $("#searchType").val($(this).text() == 'normal'? 'advanced': 'normal'); return false; }); However, if I switch ... | TITLE:
Problem switching hidden value of an input
QUESTION:
I want to toggle the value of a hidden input, between advanced and normal? But the below script doesn't work, nothing happens. $('#advancedLink').click(function () { $("#searchType").val($(this).text() == 'normal'? 'advanced': 'normal'); return false; }); How... | [
"jquery"
] | 1 | 2 | 406 | 3 | 0 | 2011-06-07T12:47:24.540000 | 2011-06-07T12:56:13.473000 |
6,265,377 | 6,277,472 | seam clickable data table | I am using seam and, i want to do like that: i want to show list of posts then the user clicks post and clicked post will be shown. My code is: title my bean is: @Stateful @Name("postBean") public class PostBeanImpl extends BaseBean implements PostBean {
@PersistenceContext private EntityManager entityManager;
@In(re... | Have a look at the @DataModelSelection annotation - this allows you to access the clicked object within a datamodel. | seam clickable data table I am using seam and, i want to do like that: i want to show list of posts then the user clicks post and clicked post will be shown. My code is: title my bean is: @Stateful @Name("postBean") public class PostBeanImpl extends BaseBean implements PostBean {
@PersistenceContext private EntityMana... | TITLE:
seam clickable data table
QUESTION:
I am using seam and, i want to do like that: i want to show list of posts then the user clicks post and clicked post will be shown. My code is: title my bean is: @Stateful @Name("postBean") public class PostBeanImpl extends BaseBean implements PostBean {
@PersistenceContext ... | [
"java",
"seam"
] | 1 | 1 | 237 | 1 | 0 | 2011-06-07T12:47:45.403000 | 2011-06-08T10:40:19.093000 |
6,265,381 | 6,265,405 | C# Short Error: Negating the minimum value of a twos complement number is invalid | I have been encountering this error for my project, which involves working with Digital Audio Signals. So I have been getting the amplitude values and recently encountered this error. This occurs when the amplitude value encountered is "-32768" upon debugging. I am storing the values in a short[] array. I have a hunch ... | 16 bit signed int ( short ) takes values between -32,768 and 32,767. Negating -32768, or getting the absolute value, is impossible to do inside a 16 bit signed integer. The value (32,768) is greater than the maximum possible positive value (32,767). I would not like to advise you how to solve the problem without knowin... | C# Short Error: Negating the minimum value of a twos complement number is invalid I have been encountering this error for my project, which involves working with Digital Audio Signals. So I have been getting the amplitude values and recently encountered this error. This occurs when the amplitude value encountered is "-... | TITLE:
C# Short Error: Negating the minimum value of a twos complement number is invalid
QUESTION:
I have been encountering this error for my project, which involves working with Digital Audio Signals. So I have been getting the amplitude values and recently encountered this error. This occurs when the amplitude value... | [
"c#",
"short"
] | 25 | 34 | 21,632 | 4 | 0 | 2011-06-07T12:47:51.690000 | 2011-06-07T12:50:19.520000 |
6,265,388 | 6,266,053 | iPhone SDK - shouldAutorotateToInterfaceOrientation Question | I am trying to run some code in my iPhone app when the device is rotated left or right. Clearly, I can do this using shouldAutorotateToInterfaceOrientation, However, I DO NOT want to rotate the controls/subviews on the view. I can stop the subviews from rotating by returning NO to the above method: - (BOOL)shouldAutoro... | If you need to just follow the device rotations, you can do this by listening for UIDeviceOrientationDidChangeNotification notification and then getting the current orientation using the orientation property of the UIDevice singleton. You will have to start and stop these notifications by calling beginGeneratingDeviceO... | iPhone SDK - shouldAutorotateToInterfaceOrientation Question I am trying to run some code in my iPhone app when the device is rotated left or right. Clearly, I can do this using shouldAutorotateToInterfaceOrientation, However, I DO NOT want to rotate the controls/subviews on the view. I can stop the subviews from rotat... | TITLE:
iPhone SDK - shouldAutorotateToInterfaceOrientation Question
QUESTION:
I am trying to run some code in my iPhone app when the device is rotated left or right. Clearly, I can do this using shouldAutorotateToInterfaceOrientation, However, I DO NOT want to rotate the controls/subviews on the view. I can stop the s... | [
"iphone",
"objective-c",
"cocoa-touch"
] | 0 | 1 | 1,149 | 3 | 0 | 2011-06-07T12:48:34.043000 | 2011-06-07T13:38:53.917000 |
6,265,389 | 6,265,816 | wxPython: Is there a control that will allow you to hide windows? | What I am looking for is a control or option that I can use slide sections of my GUI in and out of view. Im considering using different tabs to do this, but that would mean I would have 16 tabs, and I don't like the way it looks. What I have in mind is a series of labels down the right side of my gui. A click on each l... | There are lots of other "book" controls that might fit your need. Try the Listbook or the Toolbook controls. There are examples in the wxPython demo or you can try http://www.blog.pythonlibrary.org/2009/12/03/the-book-controls-of-wxpython-part-1-of-2/2/ or http://www.blog.pythonlibrary.org/2009/12/03/the-book-controls-... | wxPython: Is there a control that will allow you to hide windows? What I am looking for is a control or option that I can use slide sections of my GUI in and out of view. Im considering using different tabs to do this, but that would mean I would have 16 tabs, and I don't like the way it looks. What I have in mind is a... | TITLE:
wxPython: Is there a control that will allow you to hide windows?
QUESTION:
What I am looking for is a control or option that I can use slide sections of my GUI in and out of view. Im considering using different tabs to do this, but that would mean I would have 16 tabs, and I don't like the way it looks. What I... | [
"user-interface",
"wxpython"
] | 1 | 2 | 129 | 1 | 0 | 2011-06-07T12:48:34.060000 | 2011-06-07T13:20:01.610000 |
6,265,396 | 6,273,987 | Fetch inherited instances from MongoDB using C# | I'm using the official MongoDb C# driver. My scenario: I store objects into MongoDb. All objects are instances of classes that inherit from the same root class. At design time I do not know all classes that can be stored (i.e they can be plugged in) - so I need some way to tell the serializer/driver how to map the clas... | The official C# driver will write a "_t" discriminator value whenever the actual type of an object is different than the nominal type. So for example: MyRootClass obj = new MyDerivedClass(); collection.Insert(obj); The Insert statement could also have been written: collection.Insert (obj); but it's easier to let the co... | Fetch inherited instances from MongoDB using C# I'm using the official MongoDb C# driver. My scenario: I store objects into MongoDb. All objects are instances of classes that inherit from the same root class. At design time I do not know all classes that can be stored (i.e they can be plugged in) - so I need some way t... | TITLE:
Fetch inherited instances from MongoDB using C#
QUESTION:
I'm using the official MongoDb C# driver. My scenario: I store objects into MongoDb. All objects are instances of classes that inherit from the same root class. At design time I do not know all classes that can be stored (i.e they can be plugged in) - so... | [
"c#",
"mongodb",
"mongodb-.net-driver"
] | 5 | 9 | 2,907 | 3 | 0 | 2011-06-07T12:49:08 | 2011-06-08T03:46:24.617000 |
6,265,402 | 6,265,435 | How do I return first value on joined tables with aggregated columns | I have a set of tables that I would like to build a view from, for example: Member ID ¦ Name ---¦------ 1 ¦ John Transaction ID¦ MemberID --¦----------- 1 ¦ 1 TransactionPart ID ¦ TransactionID ¦ SchemeID ¦ Value ---¦---------------¦----------¦------- 1 ¦ 1 ¦ 1 ¦ 150 2 ¦ 1 ¦ 2 ¦ 50 Scheme ID ¦ EmailAddress ---¦--------... | You were almost there, all that's needed is to NOT group on the EmailAddres. Use any of the aggregated functions to return a EmailAddress. (I have used MIN ) SQL Statement SELECT m.Name as Name, SUM(tp.Value) as TotalValue, MIN(s.EmailAddress) as EmailAddress FROM Member m INNER JOIN Transaction t ON m.ID = t.MemberID ... | How do I return first value on joined tables with aggregated columns I have a set of tables that I would like to build a view from, for example: Member ID ¦ Name ---¦------ 1 ¦ John Transaction ID¦ MemberID --¦----------- 1 ¦ 1 TransactionPart ID ¦ TransactionID ¦ SchemeID ¦ Value ---¦---------------¦----------¦-------... | TITLE:
How do I return first value on joined tables with aggregated columns
QUESTION:
I have a set of tables that I would like to build a view from, for example: Member ID ¦ Name ---¦------ 1 ¦ John Transaction ID¦ MemberID --¦----------- 1 ¦ 1 TransactionPart ID ¦ TransactionID ¦ SchemeID ¦ Value ---¦---------------¦... | [
"sql",
"sql-server-2008",
"join",
"aggregate-functions"
] | 2 | 1 | 576 | 3 | 0 | 2011-06-07T12:49:59.203000 | 2011-06-07T12:52:23.637000 |
6,265,411 | 6,265,518 | Why specifying Model in Backbone Collection | What is the aim of specifying a model in a Backbone collection? It seems that the collection need its own url. Why do this: Backbone.Collection.extend({ url: '/rest/product', model: Model }); Instead of: Backbone.Collection.extend({ url: '/rest/product' }); With a model like this: var Model = Backbone.Model.extend({ ur... | What is the aim of specifying a model in a Backbone collection Backbone.Collection.extend({ url: '/rest/product', model: Model }); Basically your saying every model inside the collection is an instance of Model. It's also useful for doing this col.add({ prop1: "foo",... }); And it will call new Model({prop1: "foo",... ... | Why specifying Model in Backbone Collection What is the aim of specifying a model in a Backbone collection? It seems that the collection need its own url. Why do this: Backbone.Collection.extend({ url: '/rest/product', model: Model }); Instead of: Backbone.Collection.extend({ url: '/rest/product' }); With a model like ... | TITLE:
Why specifying Model in Backbone Collection
QUESTION:
What is the aim of specifying a model in a Backbone collection? It seems that the collection need its own url. Why do this: Backbone.Collection.extend({ url: '/rest/product', model: Model }); Instead of: Backbone.Collection.extend({ url: '/rest/product' }); ... | [
"collections",
"model",
"backbone.js"
] | 3 | 11 | 2,406 | 1 | 0 | 2011-06-07T12:50:48.097000 | 2011-06-07T12:58:33.950000 |
6,265,417 | 6,265,941 | Dynamically querying a String is Strings.xml file | Normally i am using getString(R.string.) to query strings in xml file. Is there any way to query xml file via getString(""). Because in my code i want to load the string present in resource file dynamically according to the condition. Any help would be really useful for me in learning android. -Regards, Ron.. | You can retrieve the id of a string resource dynamically as follows: int resId = getResources().getIdentifier("key_name", "string", getPackageName()); Log.d("MyApp", "resource id is " + resId + " and value is " + getString(resId)); Where key_name is the name of a string in your strings.xml. I hope I have understood you... | Dynamically querying a String is Strings.xml file Normally i am using getString(R.string.) to query strings in xml file. Is there any way to query xml file via getString(""). Because in my code i want to load the string present in resource file dynamically according to the condition. Any help would be really useful for... | TITLE:
Dynamically querying a String is Strings.xml file
QUESTION:
Normally i am using getString(R.string.) to query strings in xml file. Is there any way to query xml file via getString(""). Because in my code i want to load the string present in resource file dynamically according to the condition. Any help would be... | [
"android",
"android-layout"
] | 0 | 0 | 797 | 1 | 0 | 2011-06-07T12:51:23.603000 | 2011-06-07T13:30:54.880000 |
6,265,423 | 6,265,554 | How to set Richfaces datascoller Max Page Size? | We are developing web based java application. Richfaces used as library.And we have datatable with datascroller. For now I can send current datascroller index to the backed bean.But the problem is I can not set list size to datascroller(or databable). Can anyone give a clue?or source please? Thanks in advance. | If you are talking about pagination, try setting or however many rows you want. If you just want to minimize the number of records that are available, just edit your SQL query: SELECT TOP 10 * FROM foo. | How to set Richfaces datascoller Max Page Size? We are developing web based java application. Richfaces used as library.And we have datatable with datascroller. For now I can send current datascroller index to the backed bean.But the problem is I can not set list size to datascroller(or databable). Can anyone give a cl... | TITLE:
How to set Richfaces datascoller Max Page Size?
QUESTION:
We are developing web based java application. Richfaces used as library.And we have datatable with datascroller. For now I can send current datascroller index to the backed bean.But the problem is I can not set list size to datascroller(or databable). Ca... | [
"jsf",
"datatable",
"indexing",
"richfaces"
] | 1 | 2 | 1,412 | 1 | 0 | 2011-06-07T12:51:45.230000 | 2011-06-07T13:02:03.993000 |
6,265,427 | 6,265,618 | UITableView Problem with loading in data and showing HUD | I have a UITableView with a Navigation Controller. The table view is made up of custom cells that each contain data that is downloaded from a server, obviously this downloading is time consuming and therefore I would like to show a HUD of some sort while this happens. My problem is this, when I press the button to tran... | I think you should make the whole thing asynchronous. I mean, once you get to your table, you render it as empty, assigning to it a data source with no data, make a HUD appear, then you launch a thread that will load data from the remote server. Once the thread has completed its task, you can send a notification throug... | UITableView Problem with loading in data and showing HUD I have a UITableView with a Navigation Controller. The table view is made up of custom cells that each contain data that is downloaded from a server, obviously this downloading is time consuming and therefore I would like to show a HUD of some sort while this hap... | TITLE:
UITableView Problem with loading in data and showing HUD
QUESTION:
I have a UITableView with a Navigation Controller. The table view is made up of custom cells that each contain data that is downloaded from a server, obviously this downloading is time consuming and therefore I would like to show a HUD of some s... | [
"iphone",
"ios",
"uitableview",
"loading",
"nsxmlparser"
] | 0 | 2 | 485 | 1 | 0 | 2011-06-07T12:51:58.923000 | 2011-06-07T13:06:19.743000 |
6,265,443 | 6,268,562 | Google Maps Javascript API V3 : Search Requests | When calling search service api var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316); var request = { location: pyrmont, radius: '500', types: ['store'] }; service = new google.maps.places.PlacesService(map); service.search(request, callback); is it necessary to give the location/radius of the search area? Wha... | Calls to search() must contain either a location and a radius, or else a bounds (as a LatLngBounds object). This is documented at http://code.google.com/apis/maps/documentation/javascript/places.html#place_search_requests. You could see what happens if you specify a LatLngBnds that covers the entire world. Haven't trie... | Google Maps Javascript API V3 : Search Requests When calling search service api var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316); var request = { location: pyrmont, radius: '500', types: ['store'] }; service = new google.maps.places.PlacesService(map); service.search(request, callback); is it necessary to ... | TITLE:
Google Maps Javascript API V3 : Search Requests
QUESTION:
When calling search service api var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316); var request = { location: pyrmont, radius: '500', types: ['store'] }; service = new google.maps.places.PlacesService(map); service.search(request, callback); i... | [
"javascript",
"google-maps-api-3"
] | 0 | 4 | 4,450 | 1 | 0 | 2011-06-07T12:52:36.533000 | 2011-06-07T16:34:55.283000 |
6,265,445 | 6,265,477 | stop vb.net pausing when i scroll or move windows | I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution). The problem I'm having is that whenever I scroll the window (or move any of the smaller, addi... | Essentially, you can’t (reliably). Don’t use scroll controls, or in fact any controls at all. It’s a common beginners’ error to use multiple controls in a game. Render all your game in one PictureBox control and scroll that using e.g. the ScrollDC Windows API function, or by building up the graphic incrementally as the... | stop vb.net pausing when i scroll or move windows I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution). The problem I'm having is that whenever I s... | TITLE:
stop vb.net pausing when i scroll or move windows
QUESTION:
I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution). The problem I'm having is... | [
"vb.net"
] | 1 | 3 | 230 | 1 | 0 | 2011-06-07T12:52:50.203000 | 2011-06-07T12:55:44.117000 |
6,265,449 | 6,265,594 | Data bind to a portion of a collection | I have a static collection of items (say numbers from 1 to 100) that I'm presenting in a ComboBox. I can bind these items to the ComboBox no problem. My question is how to bind a second ComboBox to a subset of those items. The behavior I want is to have the second ComboBox bound to the subset of items remaining after t... | I would do this with a using MVVM pattern. Create a class that implements INotifyChange and expose three Property. ICollection FullCollection int FirstIndex ICollection PartialCollection Use this class as DataContext for your Control and bind SelectedIndex of the first combo box to FirstIndex property, ItemSource of fi... | Data bind to a portion of a collection I have a static collection of items (say numbers from 1 to 100) that I'm presenting in a ComboBox. I can bind these items to the ComboBox no problem. My question is how to bind a second ComboBox to a subset of those items. The behavior I want is to have the second ComboBox bound t... | TITLE:
Data bind to a portion of a collection
QUESTION:
I have a static collection of items (say numbers from 1 to 100) that I'm presenting in a ComboBox. I can bind these items to the ComboBox no problem. My question is how to bind a second ComboBox to a subset of those items. The behavior I want is to have the secon... | [
"wpf",
"data-binding"
] | 3 | 3 | 1,317 | 6 | 0 | 2011-06-07T12:53:04.777000 | 2011-06-07T13:04:39.673000 |
6,265,453 | 6,265,591 | OpCodes.Castclass. Is it necessary? | Is it necessary to emit OpCode.CastClass(typeof(A)) when you having a reference to instance of (B) on top of stack, where B is class, derived from A, when preparing for a call to method with argument of type A? Addition: interface IFoo { void IFoo();
}
public class A:IFoo { public void IFoo() {
} } public class B:A,... | I guess you have something like this: class A { public void Foo() { } }
class B: A { } and need to decide between: B b = new B(); b.Foo(); and B b = new B(); ((A)b).Foo(); Both work. But the cast is not necessary, because B inherits all members from A. | OpCodes.Castclass. Is it necessary? Is it necessary to emit OpCode.CastClass(typeof(A)) when you having a reference to instance of (B) on top of stack, where B is class, derived from A, when preparing for a call to method with argument of type A? Addition: interface IFoo { void IFoo();
}
public class A:IFoo { public ... | TITLE:
OpCodes.Castclass. Is it necessary?
QUESTION:
Is it necessary to emit OpCode.CastClass(typeof(A)) when you having a reference to instance of (B) on top of stack, where B is class, derived from A, when preparing for a call to method with argument of type A? Addition: interface IFoo { void IFoo();
}
public clas... | [
"c#",
"cil",
"reflection.emit"
] | 3 | 2 | 949 | 1 | 0 | 2011-06-07T12:53:27.520000 | 2011-06-07T13:04:22.833000 |
6,265,463 | 6,265,500 | Looking for OpenSource ASP.NET Project Management | I found some really good solutions alike: CollabNet (on grails) and others But when I want to make some changes for my own I really want it being ASP.NET based. Sadly I can't find good solution for it. Is there open-source project-management systems on asp.net? Added: So I'm looking for something that will highlight an... | try bugnet. Though its much of a bug tracker but maybe it helps. | Looking for OpenSource ASP.NET Project Management I found some really good solutions alike: CollabNet (on grails) and others But when I want to make some changes for my own I really want it being ASP.NET based. Sadly I can't find good solution for it. Is there open-source project-management systems on asp.net? Added: S... | TITLE:
Looking for OpenSource ASP.NET Project Management
QUESTION:
I found some really good solutions alike: CollabNet (on grails) and others But when I want to make some changes for my own I really want it being ASP.NET based. Sadly I can't find good solution for it. Is there open-source project-management systems on... | [
"asp.net",
"project-management"
] | 3 | 1 | 8,074 | 2 | 0 | 2011-06-07T12:54:24.607000 | 2011-06-07T12:57:35.350000 |
6,265,481 | 6,265,577 | How to get height of dynamically created UITextView iphone | I am trying to create a table with cells that contain UITextViews inside them for variable amounts of text. I need to specify the height of each cell to match the content size of the textviews. I am using... - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
UITextView *hi... | You can use the sizeWithFont: method to find the dynamic height. Your heightForRowAtIndexPath: should look like this. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *text = [globalArrayWithStrings objectAtIndex:[indexPath row]]; CGSize maxSize = CGSizeMake(tex... | How to get height of dynamically created UITextView iphone I am trying to create a table with cells that contain UITextViews inside them for variable amounts of text. I need to specify the height of each cell to match the content size of the textviews. I am using... - (CGFloat)tableView:(UITableView *)tableView heightF... | TITLE:
How to get height of dynamically created UITextView iphone
QUESTION:
I am trying to create a table with cells that contain UITextViews inside them for variable amounts of text. I need to specify the height of each cell to match the content size of the textviews. I am using... - (CGFloat)tableView:(UITableView *... | [
"iphone",
"objective-c",
"ios",
"xcode",
"uitableview"
] | 2 | 5 | 4,551 | 2 | 0 | 2011-06-07T12:56:09.750000 | 2011-06-07T13:03:18.050000 |
6,265,489 | 6,265,531 | php class variables | I have a class named MyCart. Class MyCartClass { var $MyCart;
function getCart(){ return $this->MyCart; }
function addItem($item){
if ($this->MyCart){ $this->MyCart.= ','.$item; } else{ $this->MyCart = $item; }
}
};
$globalCart = new MyCartClass; // create an instance of the class The variable "$MyCart" is a stri... | If you mean saving it between request then yes you need to put it in $_SESSION. Otherwise within one request you can use your $globalCart and not lose the contents of your $myCart var. | php class variables I have a class named MyCart. Class MyCartClass { var $MyCart;
function getCart(){ return $this->MyCart; }
function addItem($item){
if ($this->MyCart){ $this->MyCart.= ','.$item; } else{ $this->MyCart = $item; }
}
};
$globalCart = new MyCartClass; // create an instance of the class The variable... | TITLE:
php class variables
QUESTION:
I have a class named MyCart. Class MyCartClass { var $MyCart;
function getCart(){ return $this->MyCart; }
function addItem($item){
if ($this->MyCart){ $this->MyCart.= ','.$item; } else{ $this->MyCart = $item; }
}
};
$globalCart = new MyCartClass; // create an instance of the ... | [
"php",
"class",
"session",
"variables"
] | 3 | 2 | 23,553 | 4 | 0 | 2011-06-07T12:56:51.737000 | 2011-06-07T12:59:41.977000 |
6,265,490 | 6,265,705 | Spring Security: How to clear `remember me` cookie programmatically? | I'm using logout method in web-app like below, but if i check remember me logout doesn't work, because cookie isn't cleared. How to clear programmatically this cookie in my method (or how to make better logout method)? public void logout() { AnonymousAuthenticationToken anonymous = new AnonymousAuthenticationToken("ano... | If you are using the standard Spring Security cookie name (which is SPRING_SECURITY_REMEMBER_ME_COOKIE ), you can do this: void cancelCookie(HttpServletRequest request, HttpServletResponse response) { String cookieName = "SPRING_SECURITY_REMEMBER_ME_COOKIE"; Cookie cookie = new Cookie(cookieName, null); cookie.setMaxAg... | Spring Security: How to clear `remember me` cookie programmatically? I'm using logout method in web-app like below, but if i check remember me logout doesn't work, because cookie isn't cleared. How to clear programmatically this cookie in my method (or how to make better logout method)? public void logout() { Anonymous... | TITLE:
Spring Security: How to clear `remember me` cookie programmatically?
QUESTION:
I'm using logout method in web-app like below, but if i check remember me logout doesn't work, because cookie isn't cleared. How to clear programmatically this cookie in my method (or how to make better logout method)? public void lo... | [
"spring",
"spring-security"
] | 7 | 5 | 7,782 | 2 | 0 | 2011-06-07T12:56:58.127000 | 2011-06-07T13:12:11.127000 |
6,265,492 | 6,265,738 | How to decide on stack vs heap vs boost::pool allocation in a case like this? | I have a class that uses boost::variant to store a double or a string, like this: class value { boost::variant val; }; It's supposed to be an immutable value type for a toy interpreter I'm playing with. At first it seemed like a good idea to pass it around by const reference and return by value, and have it allocated o... | What should I do in this case and why? As always, write the program so that it is easiest to understand. If profiling later uncovers that this is indeed a problem, you can always turn value::val into some dynamically allocated object later. (Of course, this presumes val to be abstracted away well enough for this to not... | How to decide on stack vs heap vs boost::pool allocation in a case like this? I have a class that uses boost::variant to store a double or a string, like this: class value { boost::variant val; }; It's supposed to be an immutable value type for a toy interpreter I'm playing with. At first it seemed like a good idea to ... | TITLE:
How to decide on stack vs heap vs boost::pool allocation in a case like this?
QUESTION:
I have a class that uses boost::variant to store a double or a string, like this: class value { boost::variant val; }; It's supposed to be an immutable value type for a toy interpreter I'm playing with. At first it seemed li... | [
"c++",
"boost",
"boost-variant",
"boost-pool"
] | 3 | 4 | 825 | 2 | 0 | 2011-06-07T12:57:02.793000 | 2011-06-07T13:14:51.247000 |
6,265,496 | 6,271,137 | Gson : Iterating over fromJson result | Language: Java and Gson Having parsed a JSON array, how do I: 1) Print all of its contents 2) Iterate over its contents? For example, here's my code: String JSInput = "//Json String"; Type listType = new TypeToken () {}.getType(); Input_String =GsonObject.fromJson(JSInput, listType); System.out.println(Input_String.toS... | It's not necessary to create a TypeToken just for an array. Gson will deserialize to an array type just fine. If you have an array, then you don't have to explicitly iterate through its contents just to print. You can use one of the Arrays.toString() methods. Here's an example. // output: // [{value1=one, value2=1}, {v... | Gson : Iterating over fromJson result Language: Java and Gson Having parsed a JSON array, how do I: 1) Print all of its contents 2) Iterate over its contents? For example, here's my code: String JSInput = "//Json String"; Type listType = new TypeToken () {}.getType(); Input_String =GsonObject.fromJson(JSInput, listType... | TITLE:
Gson : Iterating over fromJson result
QUESTION:
Language: Java and Gson Having parsed a JSON array, how do I: 1) Print all of its contents 2) Iterate over its contents? For example, here's my code: String JSInput = "//Json String"; Type listType = new TypeToken () {}.getType(); Input_String =GsonObject.fromJson... | [
"java",
"iterator",
"gson"
] | 1 | 3 | 2,469 | 1 | 0 | 2011-06-07T12:57:15.587000 | 2011-06-07T20:20:53.913000 |
6,265,503 | 6,265,765 | XSLT Ignores some <apply-template .. > tags | I am inserting a new element into an existing xml, I get my xpaths (where the element should be inserted) in an xml file, so I wrote a program that generates the XSLT script according to that input. Now whenever I am running it, it adds the elements to some xpaths and ignores the rest, I included all the namespaces tha... | here is a snippet of the code for two templates one that inserts the element and the other that does not insert the element at all. Please tell me what I am doing wrong in here.. In the provided code there are two templates each overriding the identity rule/template for particular elements. The fact that the first temp... | XSLT Ignores some <apply-template .. > tags I am inserting a new element into an existing xml, I get my xpaths (where the element should be inserted) in an xml file, so I wrote a program that generates the XSLT script according to that input. Now whenever I am running it, it adds the elements to some xpaths and ignores... | TITLE:
XSLT Ignores some <apply-template .. > tags
QUESTION:
I am inserting a new element into an existing xml, I get my xpaths (where the element should be inserted) in an xml file, so I wrote a program that generates the XSLT script according to that input. Now whenever I am running it, it adds the elements to some ... | [
"xml",
"xslt"
] | 1 | 1 | 460 | 2 | 0 | 2011-06-07T12:57:46.737000 | 2011-06-07T13:16:53.607000 |
6,265,509 | 6,265,598 | XAML namespaces: winfx vs netfx | When looking at the documentation for WPF (e.g. for Selector.SelectedItem ), I noticed that there are two XML naspaces: http://schemas.microsoft.com/winfx/2006/xaml/presentation and http://schemas.microsoft.com/netfx/2007/xaml/presentation. What's the difference between the two, if any? Why are there two different name... | (guessing the answer) the first version of WPF was called WinFX and was probably a separated project in MS organisation. When WinFX joined the.Net Framework, MS has probably wished to keep the namespaces defines earlier for compatibility with existing work. Later, new classes have been added, and MS decided to use a pr... | XAML namespaces: winfx vs netfx When looking at the documentation for WPF (e.g. for Selector.SelectedItem ), I noticed that there are two XML naspaces: http://schemas.microsoft.com/winfx/2006/xaml/presentation and http://schemas.microsoft.com/netfx/2007/xaml/presentation. What's the difference between the two, if any? ... | TITLE:
XAML namespaces: winfx vs netfx
QUESTION:
When looking at the documentation for WPF (e.g. for Selector.SelectedItem ), I noticed that there are two XML naspaces: http://schemas.microsoft.com/winfx/2006/xaml/presentation and http://schemas.microsoft.com/netfx/2007/xaml/presentation. What's the difference between... | [
"wpf",
"xaml",
"xml-namespaces"
] | 4 | 3 | 486 | 1 | 0 | 2011-06-07T12:57:57.410000 | 2011-06-07T13:05:10.197000 |
6,265,515 | 6,265,583 | Is it RESTful to create complex objects in a single POST? | I have a form where users create Person records. Each Person can have several attributes -- height, weight, etc. But they can also have lists of associated data such as interests, favorite movies, etc. I have a single form where all this data is collected. To me it seems like I should POST all of this data in a single ... | I don't think there is a problem with adding all data in one request as long as its inherently associated with the main resource (i.e. the person in your case). If interest, fav. movies etc are resources of their own, they should also be handled as such. | Is it RESTful to create complex objects in a single POST? I have a form where users create Person records. Each Person can have several attributes -- height, weight, etc. But they can also have lists of associated data such as interests, favorite movies, etc. I have a single form where all this data is collected. To me... | TITLE:
Is it RESTful to create complex objects in a single POST?
QUESTION:
I have a form where users create Person records. Each Person can have several attributes -- height, weight, etc. But they can also have lists of associated data such as interests, favorite movies, etc. I have a single form where all this data i... | [
"rest",
"restful-architecture"
] | 8 | 2 | 1,907 | 3 | 0 | 2011-06-07T12:58:29.187000 | 2011-06-07T13:03:43.013000 |
6,265,517 | 6,265,711 | Need good language for math- and logic-heavy research programming | Can anyone name a language with all the following properties: Has algebraic data types Has good support for linear algebra Is fast(-er than python, at least) Has at least some functional programming ability (I don't need monads) Has been heard of, is not dead, and can interface on a C calling level | Scala According to Wikipedia it has algebraic datatypes. And it is fast. Scala is both functional and object oriented. And it's a young language with a growing userbase but still to some extent compatible with Java. There is a Scala library Scalala for linear algebra: A high performance numeric linear algebra library f... | Need good language for math- and logic-heavy research programming Can anyone name a language with all the following properties: Has algebraic data types Has good support for linear algebra Is fast(-er than python, at least) Has at least some functional programming ability (I don't need monads) Has been heard of, is not... | TITLE:
Need good language for math- and logic-heavy research programming
QUESTION:
Can anyone name a language with all the following properties: Has algebraic data types Has good support for linear algebra Is fast(-er than python, at least) Has at least some functional programming ability (I don't need monads) Has bee... | [
"programming-languages"
] | 5 | 1 | 223 | 3 | 0 | 2011-06-07T12:58:31.923000 | 2011-06-07T13:12:35.740000 |
6,265,552 | 6,265,562 | python check pattern in string | Possible Duplicate: Python - Check If Word Is In A String. i have a string which is a url e.g. my_url = "http://mysite.com/somefolder/somefile" I want check if "somefolder" is in the my_url file how do I do that? | Are you looking for this? if "/somefolder/" in my_url: #whatever | python check pattern in string Possible Duplicate: Python - Check If Word Is In A String. i have a string which is a url e.g. my_url = "http://mysite.com/somefolder/somefile" I want check if "somefolder" is in the my_url file how do I do that? | TITLE:
python check pattern in string
QUESTION:
Possible Duplicate: Python - Check If Word Is In A String. i have a string which is a url e.g. my_url = "http://mysite.com/somefolder/somefile" I want check if "somefolder" is in the my_url file how do I do that?
ANSWER:
Are you looking for this? if "/somefolder/" in my... | [
"python"
] | 0 | 5 | 3,530 | 2 | 0 | 2011-06-07T13:01:33.677000 | 2011-06-07T13:02:38.217000 |
6,265,555 | 6,303,047 | call avio_open function with non-english filename is invalid | i have been writing unicode based program with libav and i wanna make some file through libav with filename "中.mp4". this filename is not english, and when i call, function return positive integer(not fail). but there is "ѱ۰.mp4" instead of "中.mp4". (invalid file name.) what's the matter? char * szFilenameA = 0;
#ifde... | finally! it's because of charset. convert ansi filename to UTF8 and then it works fine. int ANSIToUTF8(char *pszCode, char *UTF8code) { WCHAR Unicode[100]={0,}; char utf8[100]={0,};
// read char Lenth int nUnicodeSize = MultiByteToWideChar(CP_ACP, 0, pszCode, strlen(pszCode), Unicode, sizeof(Unicode));
// read UTF-8 ... | call avio_open function with non-english filename is invalid i have been writing unicode based program with libav and i wanna make some file through libav with filename "中.mp4". this filename is not english, and when i call, function return positive integer(not fail). but there is "ѱ۰.mp4" instead of "中.mp4". (invalid ... | TITLE:
call avio_open function with non-english filename is invalid
QUESTION:
i have been writing unicode based program with libav and i wanna make some file through libav with filename "中.mp4". this filename is not english, and when i call, function return positive integer(not fail). but there is "ѱ۰.mp4" instead of ... | [
"c++",
"ffmpeg",
"libav",
"libavformat"
] | 0 | 2 | 1,438 | 1 | 0 | 2011-06-07T13:02:11.087000 | 2011-06-10T07:03:30.627000 |
6,265,557 | 6,265,677 | Updating application with new certificate | To make a long story short: I have developed an application for a company and I was about to update when I discovered that in the member center area on the Apple website the Development Certificate was gone, as well as the devices and other stuff, so I made a new one and uploaded the device ID again. So everything okay... | You can alway start from scratch, deleting all the provisioning profiles through your developer member page, recreating the profiles you need, importing them in Xcode and rebuilding the app with them. You cannot screw things that much, not being able to publish the app once again. Clear all the contents of Xcode, and o... | Updating application with new certificate To make a long story short: I have developed an application for a company and I was about to update when I discovered that in the member center area on the Apple website the Development Certificate was gone, as well as the devices and other stuff, so I made a new one and upload... | TITLE:
Updating application with new certificate
QUESTION:
To make a long story short: I have developed an application for a company and I was about to update when I discovered that in the member center area on the Apple website the Development Certificate was gone, as well as the devices and other stuff, so I made a ... | [
"iphone",
"xcode",
"certificate",
"app-store"
] | 2 | 1 | 1,497 | 1 | 0 | 2011-06-07T13:02:25.413000 | 2011-06-07T13:10:27.310000 |
6,265,564 | 6,265,627 | Dynamically construct Select clause of a Linq query | I'm using a LINQ to Entities, and I have a couple of queries for which I want to be able to specify the Select clause at runtime. I figured I'd have to do it by building an Expression and adding it to the IQueryable, but I'm not sure how to do this. Can anybody give me a hint? | I am not sure you could do what you want with expressions. The select clause specifies the type of the object in the IQueryable collection, that has to be defined at compile time. There is something called Dynamic Linq that can do what you want. | Dynamically construct Select clause of a Linq query I'm using a LINQ to Entities, and I have a couple of queries for which I want to be able to specify the Select clause at runtime. I figured I'd have to do it by building an Expression and adding it to the IQueryable, but I'm not sure how to do this. Can anybody give m... | TITLE:
Dynamically construct Select clause of a Linq query
QUESTION:
I'm using a LINQ to Entities, and I have a couple of queries for which I want to be able to specify the Select clause at runtime. I figured I'd have to do it by building an Expression and adding it to the IQueryable, but I'm not sure how to do this. ... | [
"c#",
"select",
"linq-to-entities",
"expression-trees"
] | 1 | 1 | 678 | 2 | 0 | 2011-06-07T13:02:40.280000 | 2011-06-07T13:07:11.710000 |
6,265,570 | 6,265,830 | How i can retrieve value from selected node on Tree Panel | I use following methods: var myobj = myTree.getSelectionModel().getSelection();
alert(myobj) // [Object object] Now, i don't know what i can do it with this object. I supposed this Object have my value? But i don't know how to use Object to retrieve values...! Thanks a lot:) | First. Looking at the API, I think the method you are talking about is // DefaultSelectionModel: var myobj = myTree.getSelectionModel().getSelectedNode();
// MultiSelectionModel: var myobj = myTree.getSelectionModel().getSelectedNodes(); which returns an object or array of type TreeNode. Second. I will advice you to u... | How i can retrieve value from selected node on Tree Panel I use following methods: var myobj = myTree.getSelectionModel().getSelection();
alert(myobj) // [Object object] Now, i don't know what i can do it with this object. I supposed this Object have my value? But i don't know how to use Object to retrieve values...! ... | TITLE:
How i can retrieve value from selected node on Tree Panel
QUESTION:
I use following methods: var myobj = myTree.getSelectionModel().getSelection();
alert(myobj) // [Object object] Now, i don't know what i can do it with this object. I supposed this Object have my value? But i don't know how to use Object to re... | [
"extjs",
"tree"
] | 1 | 3 | 6,369 | 1 | 0 | 2011-06-07T13:02:51.743000 | 2011-06-07T13:21:26.390000 |
6,265,574 | 6,265,611 | popup form using html/javascript/css | I have to open an html form in a popup. Popup should not be a window (that is usually created using window.open() ), instead it should be like one appeared in the link below (open in firefox) http://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt But the problem with this code is that, I cannot change the content ... | Please try jQuery UI dialog Here is the forms demo For mobile use, have a look at jQuery Mobile - Creating dialogs | popup form using html/javascript/css I have to open an html form in a popup. Popup should not be a window (that is usually created using window.open() ), instead it should be like one appeared in the link below (open in firefox) http://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt But the problem with this code ... | TITLE:
popup form using html/javascript/css
QUESTION:
I have to open an html form in a popup. Popup should not be a window (that is usually created using window.open() ), instead it should be like one appeared in the link below (open in firefox) http://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt But the probl... | [
"javascript",
"html",
"css"
] | 5 | 19 | 110,901 | 7 | 0 | 2011-06-07T13:03:06.520000 | 2011-06-07T13:05:59.963000 |
6,265,578 | 6,265,632 | Creating instances from strings over different namespaces and different assemblies | I am making a component based system (each object delegates all functionality to a variety of components which can be added at runtime) and want to be able to define my objects in XML files for ease. I know how to use Activator.CreateInstance to create my objects from strings, but I require full classnames and assembly... | It sounds like you want something like: Type targetType = (from assembly in candidateAssemblies from type in assembly.GetTypes() where type.Name == nameFromXml select type).FirstOrDefault(); Note that: If there are multiple matches, this will just return the first one. If there are no matches, this will return null You... | Creating instances from strings over different namespaces and different assemblies I am making a component based system (each object delegates all functionality to a variety of components which can be added at runtime) and want to be able to define my objects in XML files for ease. I know how to use Activator.CreateIns... | TITLE:
Creating instances from strings over different namespaces and different assemblies
QUESTION:
I am making a component based system (each object delegates all functionality to a variety of components which can be added at runtime) and want to be able to define my objects in XML files for ease. I know how to use A... | [
"c#",
"xml",
"reflection",
"object",
"components"
] | 0 | 1 | 252 | 1 | 0 | 2011-06-07T13:03:22.510000 | 2011-06-07T13:07:19.800000 |
6,265,592 | 6,265,665 | passing array on the heap and on the stack to function | I have a simple c++ question concerning passing an array to a function foo(). Assume I have two arrays A and B: double* A=new double[3]; and double B[3]; When I pass both to the function foo(double* A; double *B) which is intended to manipulates both arrays. However by executing foo(A,B) foo is acting on a copy of A an... | foo is acting on a copy of A and only the changes to B remain when leaving foo(). What exactly are you doing inside of foo? Changes to the objects themself should be visible outside of foo in both cases. If you are trying to change the value of pointer A, it won't be visible outside of foo - a copy of the pointer is pa... | passing array on the heap and on the stack to function I have a simple c++ question concerning passing an array to a function foo(). Assume I have two arrays A and B: double* A=new double[3]; and double B[3]; When I pass both to the function foo(double* A; double *B) which is intended to manipulates both arrays. Howeve... | TITLE:
passing array on the heap and on the stack to function
QUESTION:
I have a simple c++ question concerning passing an array to a function foo(). Assume I have two arrays A and B: double* A=new double[3]; and double B[3]; When I pass both to the function foo(double* A; double *B) which is intended to manipulates b... | [
"c++",
"arrays",
"memory-management",
"new-operator"
] | 1 | 2 | 1,578 | 2 | 0 | 2011-06-07T13:04:23.350000 | 2011-06-07T13:09:44.397000 |
6,265,595 | 6,265,668 | How can I perform a `git pull` without re-entering my SSH password? | Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull? Note that the repo is a private one on github. Or, alternatively, what would be the best practice to automate code deployment from a private Github repo? Additional details: EC2 instance running a public ... | Have a look at this link https://help.github.com/articles/working-with-ssh-key-passphrases/ But I don’t want to enter a long passphrase every time I use the key! Neither do I! Thankfully, there’s a nifty little tool called ssh-agent that can save your passphrase securely so you don’t have to re-enter it. If you’re on O... | How can I perform a `git pull` without re-entering my SSH password? Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull? Note that the repo is a private one on github. Or, alternatively, what would be the best practice to automate code deployment from a pri... | TITLE:
How can I perform a `git pull` without re-entering my SSH password?
QUESTION:
Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull? Note that the repo is a private one on github. Or, alternatively, what would be the best practice to automate code dep... | [
"linux",
"git",
"ssh",
"github"
] | 111 | 78 | 127,348 | 7 | 0 | 2011-06-07T13:04:40.913000 | 2011-06-07T13:10:01.490000 |
6,265,607 | 6,265,702 | linq to sql insert when record is already present | I have an object that has a property called ObjectID that maps to the primary key of a table in the DB. What happens if you do a linq-to-sql insert and attempt to do an insert with an object with an ObjectID already present in the DB? Thanks. | after test: if the entity you trying to insert new to the datacontext even if the primarykey value already exists it will insert a new entity with new ID if the entity you trying to insert is pulled from the same datacontext then it will throws this exception Cannot add an entity that already exists. anyway you can try... | linq to sql insert when record is already present I have an object that has a property called ObjectID that maps to the primary key of a table in the DB. What happens if you do a linq-to-sql insert and attempt to do an insert with an object with an ObjectID already present in the DB? Thanks. | TITLE:
linq to sql insert when record is already present
QUESTION:
I have an object that has a property called ObjectID that maps to the primary key of a table in the DB. What happens if you do a linq-to-sql insert and attempt to do an insert with an object with an ObjectID already present in the DB? Thanks.
ANSWER:
... | [
"c#",
"linq",
"linq-to-sql"
] | 0 | 0 | 233 | 1 | 0 | 2011-06-07T13:05:44.837000 | 2011-06-07T13:12:00.883000 |
6,265,616 | 6,265,740 | SQL database checklist | I need to create a Sql Database Checklist, I have some basics points like Each table must have a primary key Normalize data to third normal form Check for Integrity column the column value should be incremented properly. But can anyone help me to enhance this list? | Objects conform to a single naming convention Create foreign key relationships Apply appropriate index(es) Use of schema or other mechanisms for controlling read/write access, etc Consideration given to how long data should be kept before deletion or archive Version control over scripts for updating the database struct... | SQL database checklist I need to create a Sql Database Checklist, I have some basics points like Each table must have a primary key Normalize data to third normal form Check for Integrity column the column value should be incremented properly. But can anyone help me to enhance this list? | TITLE:
SQL database checklist
QUESTION:
I need to create a Sql Database Checklist, I have some basics points like Each table must have a primary key Normalize data to third normal form Check for Integrity column the column value should be incremented properly. But can anyone help me to enhance this list?
ANSWER:
Obje... | [
"sql"
] | 1 | 1 | 1,187 | 2 | 0 | 2011-06-07T13:06:11.340000 | 2011-06-07T13:15:10.143000 |
6,265,619 | 6,265,887 | f#/.net read Excel: use ApplicationClass | If I use Microsoft.Office.Interop.Excel.ApplicationClass to read an excel file as below, do I need to explictly close/quit the Excel.applicationClass? like let xlsread fileName = let app = Microsoft.Office.Interop.Excel.ApplicationClass(Visible = false) let book = app.Workbooks.Open(fileName)... | I checked an old code of mine, using Interop of Excel 2003, ApplicationClass does have a member called Quit. If you still don't find it, go to MSDN and check for the specific version of Office you use (it might differ between versions). | f#/.net read Excel: use ApplicationClass If I use Microsoft.Office.Interop.Excel.ApplicationClass to read an excel file as below, do I need to explictly close/quit the Excel.applicationClass? like let xlsread fileName = let app = Microsoft.Office.Interop.Excel.ApplicationClass(Visible = false) let book = app.Workbooks.... | TITLE:
f#/.net read Excel: use ApplicationClass
QUESTION:
If I use Microsoft.Office.Interop.Excel.ApplicationClass to read an excel file as below, do I need to explictly close/quit the Excel.applicationClass? like let xlsread fileName = let app = Microsoft.Office.Interop.Excel.ApplicationClass(Visible = false) let boo... | [
"c#",
".net",
"f#"
] | 0 | 2 | 715 | 2 | 0 | 2011-06-07T13:06:29.873000 | 2011-06-07T13:27:01.420000 |
6,265,624 | 6,273,490 | How to build clang/examples/PrintFunctionNames? | I need some simple example to start using clang. I downloaded llvm and clang and built: mkdir llvm-build cd llvm-build../llvm/configure make I tried to build PrintFunctionNames from clang examples but got an error message:../../../../Makefile.common:61:../../../../Makefile.config: No such file or directory../../../../M... | Go into llvm-build/tools/clang, and run "make BUILD_EXAMPLES=1". | How to build clang/examples/PrintFunctionNames? I need some simple example to start using clang. I downloaded llvm and clang and built: mkdir llvm-build cd llvm-build../llvm/configure make I tried to build PrintFunctionNames from clang examples but got an error message:../../../../Makefile.common:61:../../../../Makefil... | TITLE:
How to build clang/examples/PrintFunctionNames?
QUESTION:
I need some simple example to start using clang. I downloaded llvm and clang and built: mkdir llvm-build cd llvm-build../llvm/configure make I tried to build PrintFunctionNames from clang examples but got an error message:../../../../Makefile.common:61:.... | [
"build",
"clang"
] | 13 | 9 | 4,852 | 4 | 0 | 2011-06-07T13:07:03.207000 | 2011-06-08T02:08:39.830000 |
6,265,630 | 6,265,676 | how to close activity from event | I have the following code public class DevClick implements OnItemClickListener {
@Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {... } This is called from ListView from the activity. I want in that event that the caller activity will close. how can I get the activity from this even... | @Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { finish(); } just only call finish function for closing activity. | how to close activity from event I have the following code public class DevClick implements OnItemClickListener {
@Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {... } This is called from ListView from the activity. I want in that event that the caller activity will close. how can ... | TITLE:
how to close activity from event
QUESTION:
I have the following code public class DevClick implements OnItemClickListener {
@Override public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) {... } This is called from ListView from the activity. I want in that event that the caller activity wi... | [
"android"
] | 2 | 4 | 617 | 4 | 0 | 2011-06-07T13:07:19.563000 | 2011-06-07T13:10:26.710000 |
6,265,646 | 6,265,730 | How to list from higher numbers to lowers ones in php? | Say I have a variable like this: $votes That variable will store positive and negative numbers: -1, 0, 2, 3, etc...) How to code a function that arrange those numbers but higher ones to lower ones? | If it's a string, use explode, then sort. If it's already an array, just use sort: $votes = '-1, 0, 2, 3'; $votes = array_map( 'trim', explode( ',', $votes ) ); rsort( $votes, SORT_NUMERIC ); var_dump( $votes );
// or, if it's already an array: $votes = array( -1, 0, 2, 3 ); rsort( $votes, SORT_NUMERIC ); var_dump( $v... | How to list from higher numbers to lowers ones in php? Say I have a variable like this: $votes That variable will store positive and negative numbers: -1, 0, 2, 3, etc...) How to code a function that arrange those numbers but higher ones to lower ones? | TITLE:
How to list from higher numbers to lowers ones in php?
QUESTION:
Say I have a variable like this: $votes That variable will store positive and negative numbers: -1, 0, 2, 3, etc...) How to code a function that arrange those numbers but higher ones to lower ones?
ANSWER:
If it's a string, use explode, then sort... | [
"php"
] | 0 | 4 | 92 | 4 | 0 | 2011-06-07T13:08:26.373000 | 2011-06-07T13:13:50.367000 |
6,265,650 | 6,265,725 | Using a LINQ Where clause to filter by data in an associated table | I have two tables, Articles and Statuses that I have associated in a ctx.dbml file. Articles id:int title:varchar(255) status_id:int
Statuses id:int name:varchar(255) What I'd like to do is filter all of the articles of a certain status. Hypothetically speaking, something like: var filteredArticles = from article in c... | To do it like you want, you have to set up an association between the two tables. How to: Create an Association (Relationship) Between LINQ to SQL Classes (O/R Designer) Alternatively, you can just write the join manually. var activeArticles = from a in ctx.Articles join s in ctx.statuses on a.status_id equals s.id sel... | Using a LINQ Where clause to filter by data in an associated table I have two tables, Articles and Statuses that I have associated in a ctx.dbml file. Articles id:int title:varchar(255) status_id:int
Statuses id:int name:varchar(255) What I'd like to do is filter all of the articles of a certain status. Hypothetically... | TITLE:
Using a LINQ Where clause to filter by data in an associated table
QUESTION:
I have two tables, Articles and Statuses that I have associated in a ctx.dbml file. Articles id:int title:varchar(255) status_id:int
Statuses id:int name:varchar(255) What I'd like to do is filter all of the articles of a certain stat... | [
"c#",
"linq-to-sql",
"join",
"intellisense",
"model-associations"
] | 0 | 4 | 352 | 1 | 0 | 2011-06-07T13:08:37.793000 | 2011-06-07T13:13:38.183000 |
6,265,656 | 6,265,703 | being interrupted while joining other threads | How should I handle InterruptedException while joining other threads, assuming I don't actually anticipate being interrupted, and there is no sensible thing to do? Just swallow the exception? try { t.join(); u.join(); } catch (InterruptedException e) { // should not happen } Or should I put each join in its separate tr... | If something shouldn't happen, you probably want to know if it ever does happen - and the best way of making it obvious is often to throw a RuntimeException of some description (e.g. IllegalStateException ). If you're not anticipating the possibility of being interrupted, that suggests the system is in a state you're n... | being interrupted while joining other threads How should I handle InterruptedException while joining other threads, assuming I don't actually anticipate being interrupted, and there is no sensible thing to do? Just swallow the exception? try { t.join(); u.join(); } catch (InterruptedException e) { // should not happen ... | TITLE:
being interrupted while joining other threads
QUESTION:
How should I handle InterruptedException while joining other threads, assuming I don't actually anticipate being interrupted, and there is no sensible thing to do? Just swallow the exception? try { t.join(); u.join(); } catch (InterruptedException e) { // ... | [
"java",
"multithreading",
"join",
"exception",
"concurrency"
] | 3 | 2 | 903 | 1 | 0 | 2011-06-07T13:09:05.353000 | 2011-06-07T13:12:01.623000 |
6,265,659 | 6,277,164 | Call onunload function from iframe | I am working on a multiplayer chess game as a Facebook app. If one player leaves the game by closing the browser the other player should get a notification. So if one player closes the Browser, a unlink function should be called to unlink the player. This works fine with onunload outside Facebook. The problem is, that ... | This is probably not the answer you are looking for but "logging off" on unload will never work reliably. For an extreme example, consider the case where the browser crashes or is killed via the Windows task manager. So you better implement an additional mechanism to detect whether a user left. Typically this is done b... | Call onunload function from iframe I am working on a multiplayer chess game as a Facebook app. If one player leaves the game by closing the browser the other player should get a notification. So if one player closes the Browser, a unlink function should be called to unlink the player. This works fine with onunload outs... | TITLE:
Call onunload function from iframe
QUESTION:
I am working on a multiplayer chess game as a Facebook app. If one player leaves the game by closing the browser the other player should get a notification. So if one player closes the Browser, a unlink function should be called to unlink the player. This works fine ... | [
"javascript",
"facebook",
"iframe",
"dom-events",
"onunload"
] | 1 | 1 | 1,631 | 1 | 0 | 2011-06-07T13:09:18.740000 | 2011-06-08T10:08:45.760000 |
6,265,663 | 6,265,856 | lw in MIPS (also a bit C) | I have a homework question and it is troubling me. It goes like sll $t0, $s0, 2 // $t0 = $s0 << 2;
add $t1, $t0, $s2 // $t1 = $t + $s2;
lw $s3, $0($t1) I'm confused about the $0, does it have the same effect as 0? What value would the result give? It is a question asking me to translate mips into c, where $s0 is repr... | In MIPS, $0 or $zero is the 0th indexed and first register, and has value 0. See here. Although that looks like a typo, since lw uses a 16-bit offset, which isn't the value from a register but rather a constant (recall that a register is 32 bits). So it should actually be lw $s3, 0($t1). The reason the code performs d ... | lw in MIPS (also a bit C) I have a homework question and it is troubling me. It goes like sll $t0, $s0, 2 // $t0 = $s0 << 2;
add $t1, $t0, $s2 // $t1 = $t + $s2;
lw $s3, $0($t1) I'm confused about the $0, does it have the same effect as 0? What value would the result give? It is a question asking me to translate mips... | TITLE:
lw in MIPS (also a bit C)
QUESTION:
I have a homework question and it is troubling me. It goes like sll $t0, $s0, 2 // $t0 = $s0 << 2;
add $t1, $t0, $s2 // $t1 = $t + $s2;
lw $s3, $0($t1) I'm confused about the $0, does it have the same effect as 0? What value would the result give? It is a question asking me... | [
"c",
"assembly",
"mips"
] | 2 | 5 | 1,585 | 1 | 0 | 2011-06-07T13:09:35.330000 | 2011-06-07T13:24:27.653000 |
6,265,664 | 6,265,758 | What should be the pythonic way to implement following logic? | I would like to loop a list and remove element if it meets the requirement. At the same time, I would transform the removed element and add the transformation result to another list. Right now, I have implemented above logic by following code: delete_set = set([])
for item in my_list: if meet_requirement(item): anothe... | You could do this with comprehensions only. delete_set = set(I for I in my_list if meet_requirement(I)) another_list.extend(transform(I) for I in delete_set) # or extend(transform(I) for I in my_list if I in delete_set), if duplicates/order matter my_list = [I for I in my_list if I not in delete_set] | What should be the pythonic way to implement following logic? I would like to loop a list and remove element if it meets the requirement. At the same time, I would transform the removed element and add the transformation result to another list. Right now, I have implemented above logic by following code: delete_set = s... | TITLE:
What should be the pythonic way to implement following logic?
QUESTION:
I would like to loop a list and remove element if it meets the requirement. At the same time, I would transform the removed element and add the transformation result to another list. Right now, I have implemented above logic by following co... | [
"python"
] | 5 | 6 | 237 | 7 | 0 | 2011-06-07T13:09:38.073000 | 2011-06-07T13:16:30.177000 |
6,265,667 | 6,265,710 | jQuery works on my page, but firebug says $ is not defined error. Why and how to avoid it? | UPDATE: Finally I found the solution, it was totally my fake. There were an iframe tag on the site, and in the external file I didn't include jQuery. But I learned a lot from your answer and checked my code a lot of time.:) update END. Firebug console issues the following error message: $ is not defined ajaxlib.js()aja... | Try changing all $ characters with "jQuery". They are possibly conflicting with an other library you are including. as in; $(document).ready(function() {} ); to jQuery(document).ready(function() {} ); | jQuery works on my page, but firebug says $ is not defined error. Why and how to avoid it? UPDATE: Finally I found the solution, it was totally my fake. There were an iframe tag on the site, and in the external file I didn't include jQuery. But I learned a lot from your answer and checked my code a lot of time.:) updat... | TITLE:
jQuery works on my page, but firebug says $ is not defined error. Why and how to avoid it?
QUESTION:
UPDATE: Finally I found the solution, it was totally my fake. There were an iframe tag on the site, and in the external file I didn't include jQuery. But I learned a lot from your answer and checked my code a lo... | [
"jquery",
"html"
] | 2 | 2 | 2,511 | 2 | 0 | 2011-06-07T13:10:01.367000 | 2011-06-07T13:12:28.307000 |
6,265,683 | 6,265,712 | Global Class Methods? | I want to be able to call my php class via an http post. So I came up with this. $method = $_POST['method']; $data = $_POST['data']; $class_methods = get_class_methods('myclass'); if($method, $class_methods){ $save = $myclass::$method($data); echo $save; } Is there any global methods that exist on classes in general th... | If I understand you correctly, have a look at: http://php.net/manual/en/language.oop5.magic.php Constructs like: are also possible, and on PHP 5.3+ you can do: $return = $className::$method(); directly. | Global Class Methods? I want to be able to call my php class via an http post. So I came up with this. $method = $_POST['method']; $data = $_POST['data']; $class_methods = get_class_methods('myclass'); if($method, $class_methods){ $save = $myclass::$method($data); echo $save; } Is there any global methods that exist on... | TITLE:
Global Class Methods?
QUESTION:
I want to be able to call my php class via an http post. So I came up with this. $method = $_POST['method']; $data = $_POST['data']; $class_methods = get_class_methods('myclass'); if($method, $class_methods){ $save = $myclass::$method($data); echo $save; } Is there any global met... | [
"php",
"class"
] | 0 | 1 | 83 | 3 | 0 | 2011-06-07T13:10:41.450000 | 2011-06-07T13:12:38.833000 |
6,265,694 | 6,265,899 | What is meant by binding mode in WebSphere MQ? | I am working with WebSphere MQ FTE. While reading a document I came across a sentence that the bridge agent connects to local queue manager through binding mode. What is meant by binding mode in WebSphere MQ? | WebSphere MQ was originally created to be a local communication stack that resided on the same server as the applications that used it. In this mode, applications talk to it using Inter Process Communication (IPC). This is where two processes on the same server intercommunicate using shared memory, semaphores and other... | What is meant by binding mode in WebSphere MQ? I am working with WebSphere MQ FTE. While reading a document I came across a sentence that the bridge agent connects to local queue manager through binding mode. What is meant by binding mode in WebSphere MQ? | TITLE:
What is meant by binding mode in WebSphere MQ?
QUESTION:
I am working with WebSphere MQ FTE. While reading a document I came across a sentence that the bridge agent connects to local queue manager through binding mode. What is meant by binding mode in WebSphere MQ?
ANSWER:
WebSphere MQ was originally created t... | [
"binding",
"ibm-mq",
"websphere-mq-fte"
] | 8 | 19 | 15,383 | 1 | 0 | 2011-06-07T13:11:37.607000 | 2011-06-07T13:28:01.417000 |
6,265,696 | 6,265,999 | Adplus dump creation failed - access is denied | I'm trying to get a dump to debug some memory issues in ASP.NET processes (Windows 2003 R2 SP2 x64): adplus -hang -o f:\dumps -pn w3wp.exe -quiet There are nine w3wp.exe (all from different websites). Everytime I run adplus as above some of the dumps fail with this error: WriteFullMemory.Memory.Read(0x100ea0000, 0x1000... | This is because of inaccessible memory read failure. To avoid this you could use something like cdb/windbg and use.dump /mA command to generate full memory dump. The.dump /mA same as.dump /ma except that it will ignore inaccessible memory read failure and continue minidump generation..dump options The /mA option is equ... | Adplus dump creation failed - access is denied I'm trying to get a dump to debug some memory issues in ASP.NET processes (Windows 2003 R2 SP2 x64): adplus -hang -o f:\dumps -pn w3wp.exe -quiet There are nine w3wp.exe (all from different websites). Everytime I run adplus as above some of the dumps fail with this error: ... | TITLE:
Adplus dump creation failed - access is denied
QUESTION:
I'm trying to get a dump to debug some memory issues in ASP.NET processes (Windows 2003 R2 SP2 x64): adplus -hang -o f:\dumps -pn w3wp.exe -quiet There are nine w3wp.exe (all from different websites). Everytime I run adplus as above some of the dumps fail... | [
"windbg",
"adplus"
] | 2 | 2 | 3,165 | 2 | 0 | 2011-06-07T13:11:46.793000 | 2011-06-07T13:35:11.060000 |
6,265,697 | 6,268,349 | Ext Js: show childrent element when parent is hidden | I want to show children element as a part of parent element when parent is hide. In practical terms, I need to show div when parent is hide. | Ext-Js is a container, item system. So elements can only have one parent, if you really want to do this you can move the element to another parent that is visible on that action. Your better bet is to hide all items on the parent that you wish not to display, and not actually hide the parent | Ext Js: show childrent element when parent is hidden I want to show children element as a part of parent element when parent is hide. In practical terms, I need to show div when parent is hide. | TITLE:
Ext Js: show childrent element when parent is hidden
QUESTION:
I want to show children element as a part of parent element when parent is hide. In practical terms, I need to show div when parent is hide.
ANSWER:
Ext-Js is a container, item system. So elements can only have one parent, if you really want to do ... | [
"extjs",
"extjs4"
] | 2 | 4 | 440 | 1 | 0 | 2011-06-07T13:11:48.463000 | 2011-06-07T16:15:56.273000 |
6,265,700 | 6,265,726 | zend framework & google analytics data | How can I use zend framework to export google analytics data into my application? I've used other Zend_Service_GData before, but can't find any documentation how to apply it to google analytics? Is this possible? | There is no official library for google analytics, but you could have a look at: http://framework.zend.com/wiki/display/ZFPROP/Zend_Gdata_Analytics+-+Daniel+Hartmann It hasn't been updated in a while, but I've used it without problems before. | zend framework & google analytics data How can I use zend framework to export google analytics data into my application? I've used other Zend_Service_GData before, but can't find any documentation how to apply it to google analytics? Is this possible? | TITLE:
zend framework & google analytics data
QUESTION:
How can I use zend framework to export google analytics data into my application? I've used other Zend_Service_GData before, but can't find any documentation how to apply it to google analytics? Is this possible?
ANSWER:
There is no official library for google a... | [
"zend-framework",
"google-analytics"
] | 2 | 0 | 906 | 1 | 0 | 2011-06-07T13:11:55.937000 | 2011-06-07T13:13:40.333000 |
6,265,706 | 6,265,735 | Good jQuery Autocomplete that is not part of jQuery UI? | Is there a good alternative to jQuery UI autocomplete? I couldn't find one on the internet. jQuery UI is far too big for just using the autocomplete, and I don't want to roll yet another autocomplete on my own. Answer: jQuery UI custom build for just autocomplete is 23,052 bytes. SO uses the original Zaefferer version ... | See https://github.com/agarzola/jQueryAutocompletePlugin/blob/master/jquery.autocomplete.js | Good jQuery Autocomplete that is not part of jQuery UI? Is there a good alternative to jQuery UI autocomplete? I couldn't find one on the internet. jQuery UI is far too big for just using the autocomplete, and I don't want to roll yet another autocomplete on my own. Answer: jQuery UI custom build for just autocomplete ... | TITLE:
Good jQuery Autocomplete that is not part of jQuery UI?
QUESTION:
Is there a good alternative to jQuery UI autocomplete? I couldn't find one on the internet. jQuery UI is far too big for just using the autocomplete, and I don't want to roll yet another autocomplete on my own. Answer: jQuery UI custom build for ... | [
"javascript",
"jquery",
"autocomplete"
] | 6 | 3 | 8,084 | 7 | 0 | 2011-06-07T13:12:10.790000 | 2011-06-07T13:14:22.763000 |
6,265,717 | 6,265,845 | how to start up a desktop application in client side | In my web page, I have to start a desktop application on the client's computer if it's installed. Any idea how I can do this? If the application is MS Office or Adobe Reader, I know how to start them, but the application I want to start is a custom application. You can not find it on the internet. How can I open the ap... | The browser sandbox prohibits you from executing local resources, for good reason - to thwart a website destroying your box with malicious code. I've been researching the same functionality. The only solution I've found is to build an extension in Mozilla Firefox which can launch your app. Extensions live outside the s... | how to start up a desktop application in client side In my web page, I have to start a desktop application on the client's computer if it's installed. Any idea how I can do this? If the application is MS Office or Adobe Reader, I know how to start them, but the application I want to start is a custom application. You c... | TITLE:
how to start up a desktop application in client side
QUESTION:
In my web page, I have to start a desktop application on the client's computer if it's installed. Any idea how I can do this? If the application is MS Office or Adobe Reader, I know how to start them, but the application I want to start is a custom ... | [
"javascript"
] | 21 | 10 | 63,304 | 6 | 0 | 2011-06-07T13:13:05.013000 | 2011-06-07T13:22:59.580000 |
6,265,731 | 6,265,813 | Do Java sockets support full duplex? | Is it possible to have one thread write to the OutputStream of a Java Socket, while another reads from the socket's InputStream, without the threads having to synchronize on the socket? | Sure. The exact situation you're describing shouldn't be a problem (reading and writing simultaneously). Generally, the reading thread will block if there's nothing to read, and might timeout on the read operation if you've got a timeout specified. Since the input stream and the output stream are separate objects withi... | Do Java sockets support full duplex? Is it possible to have one thread write to the OutputStream of a Java Socket, while another reads from the socket's InputStream, without the threads having to synchronize on the socket? | TITLE:
Do Java sockets support full duplex?
QUESTION:
Is it possible to have one thread write to the OutputStream of a Java Socket, while another reads from the socket's InputStream, without the threads having to synchronize on the socket?
ANSWER:
Sure. The exact situation you're describing shouldn't be a problem (re... | [
"java",
"multithreading",
"sockets"
] | 56 | 48 | 15,295 | 2 | 0 | 2011-06-07T13:14:01.690000 | 2011-06-07T13:19:53.003000 |
6,265,732 | 6,265,767 | What is the preferred method of programmatically closing a C# WPF Application? | Which is the preferred method of closing a C# WPF Application? 1) calling Window.Close() within the Main Window 2) Calling Application.Current.Shutdown( 0 ) within the Main Window. Are the two semantically equivalent or is there a subtle distinction that I need to be aware of? | The first only closes the window, depending on your Application.ShutdownMode that may not even shutdown the application. How you exit the application depends solely on what you want to do, i for one tend to define the Application.MainWindow and set the ShutdownMode to OnMainWindowClose so all the small dialogues do not... | What is the preferred method of programmatically closing a C# WPF Application? Which is the preferred method of closing a C# WPF Application? 1) calling Window.Close() within the Main Window 2) Calling Application.Current.Shutdown( 0 ) within the Main Window. Are the two semantically equivalent or is there a subtle dis... | TITLE:
What is the preferred method of programmatically closing a C# WPF Application?
QUESTION:
Which is the preferred method of closing a C# WPF Application? 1) calling Window.Close() within the Main Window 2) Calling Application.Current.Shutdown( 0 ) within the Main Window. Are the two semantically equivalent or is ... | [
"c#",
"wpf",
"close-application"
] | 9 | 5 | 8,926 | 3 | 0 | 2011-06-07T13:14:07.093000 | 2011-06-07T13:16:58.430000 |
6,265,743 | 6,290,102 | Ruby's capybara-webkit installer cannot build native extension | When trying to install capybara-webkit gem install capybara-webkit I get this error: Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing capybara-webkit: ERROR: Failed to build gem native extension. C:/Ruby192/bin/ruby.exe extconf.rb Gem files w... | Al last I didn't solve the capybara-webkit installation, but a simple use of "bundle install --without test" did what I was trying to do (and what was my last aim): use the Blueprint CSS compressor script | Ruby's capybara-webkit installer cannot build native extension When trying to install capybara-webkit gem install capybara-webkit I get this error: Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing capybara-webkit: ERROR: Failed to build gem n... | TITLE:
Ruby's capybara-webkit installer cannot build native extension
QUESTION:
When trying to install capybara-webkit gem install capybara-webkit I get this error: Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing capybara-webkit: ERROR: Fai... | [
"ruby",
"webkit",
"installation",
"capybara"
] | 1 | 0 | 3,314 | 3 | 0 | 2011-06-07T13:15:33.333000 | 2011-06-09T08:34:01.503000 |
6,265,746 | 6,266,090 | Resize Form while keeping aspect ratio | I have a Window, in which i display a picture. I want the user to be able to resize this window, but keep it in the same aspect ratio than the image, so no big empty areas appear on the window. What i tried is something like this in the OnResize event: DragWidth:= Width; DragHeight:= Height;
//Calculate corresponding ... | Adding the following handler for the OnCanResize event seemed to work very well for me: procedure TForm1.FormCanResize(Sender: TObject; var NewWidth, NewHeight: Integer; var Resize: Boolean); var AspectRatio:double; begin AspectRatio:=Height/Width; NewHeight:=round(AspectRatio*NewWidth); end; You may of course want to ... | Resize Form while keeping aspect ratio I have a Window, in which i display a picture. I want the user to be able to resize this window, but keep it in the same aspect ratio than the image, so no big empty areas appear on the window. What i tried is something like this in the OnResize event: DragWidth:= Width; DragHeigh... | TITLE:
Resize Form while keeping aspect ratio
QUESTION:
I have a Window, in which i display a picture. I want the user to be able to resize this window, but keep it in the same aspect ratio than the image, so no big empty areas appear on the window. What i tried is something like this in the OnResize event: DragWidth:... | [
"delphi",
"events",
"forms"
] | 9 | 8 | 5,962 | 2 | 0 | 2011-06-07T13:15:44.030000 | 2011-06-07T13:40:27.657000 |
6,265,754 | 6,265,849 | Can I use the new Xcode 4.2 Developer Preview to publish regular apps now? | Making the long story short: if I download and install the new Xcode 4.2 Developer Preview on my Mac and start developing new iOS 5 apps, can I still using it for developing and releasing iOS 4.x apps? I do not have the possibility to install two different versions of this platform right now. Probably someone amongst y... | No, you can only submit to the app store with the official releases of the tools, not the betas. See also Jano's comment above, on the dev forums it has been confirmed that you can't use the beta tools. Unless you're chronically short on disc space, you can use disk tool to resize your current partition and do a new OS... | Can I use the new Xcode 4.2 Developer Preview to publish regular apps now? Making the long story short: if I download and install the new Xcode 4.2 Developer Preview on my Mac and start developing new iOS 5 apps, can I still using it for developing and releasing iOS 4.x apps? I do not have the possibility to install tw... | TITLE:
Can I use the new Xcode 4.2 Developer Preview to publish regular apps now?
QUESTION:
Making the long story short: if I download and install the new Xcode 4.2 Developer Preview on my Mac and start developing new iOS 5 apps, can I still using it for developing and releasing iOS 4.x apps? I do not have the possibi... | [
"iphone",
"xcode",
"xcode4",
"app-store"
] | 7 | 6 | 1,593 | 1 | 0 | 2011-06-07T13:16:10.477000 | 2011-06-07T13:23:50.030000 |
6,265,814 | 6,265,911 | How to trigger jquery.ajax() error callback based on server response, not HTTP 500? | By using jquery ajax function, I can do something like: $.ajax({
url: url, type: 'GET', async: true, dataType: 'json', data: data,
success: function(data) {
//Handle server response here
},
error: function(xhr, status, error){
//Handle failure here
}
}); I got two questions to ask based on above code: When will... | The error callback will be executed when the response from the server is not going to be what you were expecting. So for example in this situations it: HTTP 404/500 or any other HTTP error message has been received data of incorrect type was received (i.e. you have expected JSON, you have received something else). In y... | How to trigger jquery.ajax() error callback based on server response, not HTTP 500? By using jquery ajax function, I can do something like: $.ajax({
url: url, type: 'GET', async: true, dataType: 'json', data: data,
success: function(data) {
//Handle server response here
},
error: function(xhr, status, error){
//H... | TITLE:
How to trigger jquery.ajax() error callback based on server response, not HTTP 500?
QUESTION:
By using jquery ajax function, I can do something like: $.ajax({
url: url, type: 'GET', async: true, dataType: 'json', data: data,
success: function(data) {
//Handle server response here
},
error: function(xhr, st... | [
"javascript",
"ajax",
"spring",
"jquery"
] | 49 | 39 | 60,659 | 6 | 0 | 2011-06-07T13:19:54.850000 | 2011-06-07T13:28:52.480000 |
6,265,831 | 6,276,605 | Module specific resource configuration in application.ini | Can I config a resource to be different when a specific module is used? From what I have read in the documentation (example #12) this should be possible. But I have had no luck with it yet. In detail, I'm trying to set another path for translation files. resources.translate.adapter = "array" resources.translate.data = ... | I was missing a module Bootstrap file. Added /modules/mobile/Bootstrap.php Now things work, and the per module translation also (mentioned in comments on initial post). | Module specific resource configuration in application.ini Can I config a resource to be different when a specific module is used? From what I have read in the documentation (example #12) this should be possible. But I have had no luck with it yet. In detail, I'm trying to set another path for translation files. resourc... | TITLE:
Module specific resource configuration in application.ini
QUESTION:
Can I config a resource to be different when a specific module is used? From what I have read in the documentation (example #12) this should be possible. But I have had no luck with it yet. In detail, I'm trying to set another path for translat... | [
"php",
"zend-framework",
"zend-application",
"zend-framework-modules",
"zend-config"
] | 1 | 1 | 747 | 2 | 0 | 2011-06-07T13:21:29.003000 | 2011-06-08T09:18:45.890000 |
6,265,851 | 6,265,919 | typedef syntax with member function pointers | according to MSDN the typedef syntax is: typedef type-declaration synonym; Very easy: typedef int MY_INT; But how the heck does the member-function-pointer typedefs comply to this rule? typedef int (MyClass::*MyTypedef)( int); 100% confusion – the synonym ( MyTypedef ) is in the middle? Can someone please explain what ... | the synonym (MyTypedef) is in the middle?? Its not in the middle. Just forget member-function for a while, see how a function pointer is defined: int (*FuncPtr)(int); And this is how you would typedef it: typedef int (*FuncPtr)(int); Simple! The only difference is, in the typedef FuncPtr becomes a type, while in the po... | typedef syntax with member function pointers according to MSDN the typedef syntax is: typedef type-declaration synonym; Very easy: typedef int MY_INT; But how the heck does the member-function-pointer typedefs comply to this rule? typedef int (MyClass::*MyTypedef)( int); 100% confusion – the synonym ( MyTypedef ) is in... | TITLE:
typedef syntax with member function pointers
QUESTION:
according to MSDN the typedef syntax is: typedef type-declaration synonym; Very easy: typedef int MY_INT; But how the heck does the member-function-pointer typedefs comply to this rule? typedef int (MyClass::*MyTypedef)( int); 100% confusion – the synonym (... | [
"c++",
"typedef"
] | 38 | 49 | 46,453 | 9 | 0 | 2011-06-07T13:24:00.450000 | 2011-06-07T13:29:19.603000 |
6,265,857 | 6,265,989 | Casting a function pointer to a type that accepts more arguments | As far as I know, casting between incompatible function pointers, eg: void aUnaryFunction(int a1) { /*.... */ }
void doSomethingWithFn() { typedef void(*BinaryFn)(int, const char*); BinaryFn aBinaryFunction = (BinaryFn) &aUnaryFunction aBinaryFunction (3, "!!!"); } should never be done, as is 'undefined behaviour' acc... | The problem is that there isn't a single "way function calls work in C" - there's only the way that function calls work on a particular C implementation. As a concrete example, "callee clean-up" calling conventions (like x86 stdcall ) require the callee to know how many parameters were pushed on to the stack to perform... | Casting a function pointer to a type that accepts more arguments As far as I know, casting between incompatible function pointers, eg: void aUnaryFunction(int a1) { /*.... */ }
void doSomethingWithFn() { typedef void(*BinaryFn)(int, const char*); BinaryFn aBinaryFunction = (BinaryFn) &aUnaryFunction aBinaryFunction (3... | TITLE:
Casting a function pointer to a type that accepts more arguments
QUESTION:
As far as I know, casting between incompatible function pointers, eg: void aUnaryFunction(int a1) { /*.... */ }
void doSomethingWithFn() { typedef void(*BinaryFn)(int, const char*); BinaryFn aBinaryFunction = (BinaryFn) &aUnaryFunction ... | [
"c",
"casting",
"function-pointers"
] | 4 | 6 | 361 | 3 | 0 | 2011-06-07T13:24:29.453000 | 2011-06-07T13:34:34.973000 |
6,265,863 | 6,265,897 | An SQL Update Query Problem | I have two tables like that: Products(productID,categoryID,price) MarginOfProfit(categoryID,rate) Anytime we want to change prices of products of a category, we look their change rate and aplly it to original price. For Example: ProductID | CategoryID | Price 1 1 105 2 1 105
CategoryID | Rate 1 0.05 In this example, o... | It would be best to have an OriginalPrice column in your Products table instead of price after the mark-up. ProductID | CategoryID | OriginalPrice 1 1 100 2 1 100 Then you can do the mark-up upon SELECT (or make a view): SELECT *, (OriginalPrice * (1 + Rate)) AS Price FROM Products JOIN MarginOfProfit ON Products.Categ... | An SQL Update Query Problem I have two tables like that: Products(productID,categoryID,price) MarginOfProfit(categoryID,rate) Anytime we want to change prices of products of a category, we look their change rate and aplly it to original price. For Example: ProductID | CategoryID | Price 1 1 105 2 1 105
CategoryID | Ra... | TITLE:
An SQL Update Query Problem
QUESTION:
I have two tables like that: Products(productID,categoryID,price) MarginOfProfit(categoryID,rate) Anytime we want to change prices of products of a category, we look their change rate and aplly it to original price. For Example: ProductID | CategoryID | Price 1 1 105 2 1 10... | [
"php",
"mysql"
] | 1 | 2 | 142 | 3 | 0 | 2011-06-07T13:24:50.620000 | 2011-06-07T13:27:43.137000 |
6,265,864 | 6,266,045 | Why does a small change to this Scala code make such a huge difference to performance? | I'm running on a 32-bit Debian 6.0 (Squeeze) system (a 2.5 GHz Core 2 CPU), sun-java6 6.24-1 but with the Scala 2.8.1 packages from Wheezy. This code, compiled with scalac -optimise, takes over 30 seconds to run: object Performance {
import scala.annotation.tailrec
@tailrec def gcd(x:Int,y:Int):Int = { if (x == 0) y ... | The JVM doesn't optimize static initializers (which is what this is) to the same level that it optimizes method calls. Unfortunately, when you do a lot of work there, that hurts performance--this is a perfect example of that. This is also one reason why the old Application trait was considered problematic, and why ther... | Why does a small change to this Scala code make such a huge difference to performance? I'm running on a 32-bit Debian 6.0 (Squeeze) system (a 2.5 GHz Core 2 CPU), sun-java6 6.24-1 but with the Scala 2.8.1 packages from Wheezy. This code, compiled with scalac -optimise, takes over 30 seconds to run: object Performance {... | TITLE:
Why does a small change to this Scala code make such a huge difference to performance?
QUESTION:
I'm running on a 32-bit Debian 6.0 (Squeeze) system (a 2.5 GHz Core 2 CPU), sun-java6 6.24-1 but with the Scala 2.8.1 packages from Wheezy. This code, compiled with scalac -optimise, takes over 30 seconds to run: ob... | [
"performance",
"optimization",
"scala"
] | 57 | 53 | 1,819 | 2 | 0 | 2011-06-07T13:25:00.330000 | 2011-06-07T13:38:17.577000 |
6,265,874 | 6,265,935 | Raphael: Set Line Color | I am using the Raphael JS vector library and I cannot get a line (path) that I am drawing to change colors. Hopefully it's just something stupid I did. var blue_one = paper.path ("M205 205L300 300"); blue_one.attr ("stroke-width", "3"); blue_one.attr ("fill", "#0000FF"); I have also tried fill values of "#00F", "blue",... | This is what you want to set. blue_one.attr ("stroke", "#0000FF"); For a full listing of the properties, see the Specification or the Raphael Documentation | Raphael: Set Line Color I am using the Raphael JS vector library and I cannot get a line (path) that I am drawing to change colors. Hopefully it's just something stupid I did. var blue_one = paper.path ("M205 205L300 300"); blue_one.attr ("stroke-width", "3"); blue_one.attr ("fill", "#0000FF"); I have also tried fill v... | TITLE:
Raphael: Set Line Color
QUESTION:
I am using the Raphael JS vector library and I cannot get a line (path) that I am drawing to change colors. Hopefully it's just something stupid I did. var blue_one = paper.path ("M205 205L300 300"); blue_one.attr ("stroke-width", "3"); blue_one.attr ("fill", "#0000FF"); I have... | [
"javascript",
"raphael"
] | 6 | 17 | 10,835 | 2 | 0 | 2011-06-07T13:26:11.370000 | 2011-06-07T13:30:35.723000 |
6,265,878 | 6,273,685 | Dojo ValidationTextbox error tooltip remains on page after Dialog is closed with ESC key | I am using Dojo 1.5, theme Claro. I have a dojo dialog that contains a dojo form, a ValidationTextbox and a submit button. If the textbox has any kind of error, a tooltip showing a message is displayed next to it. Now, if the error tooltip is displayed, when I press the ESC key the dialog is closed, but the tooltip rem... | Normally the tooltip disappears after the focus has been moved to another node, i.e. fired on the blur event. In you case, I think it's because the blur event is not fired, since you used the ESC key to close the dialog. To solve this, you can manually call displayMessage of the dijit.form.ValidationTextBox to hide the... | Dojo ValidationTextbox error tooltip remains on page after Dialog is closed with ESC key I am using Dojo 1.5, theme Claro. I have a dojo dialog that contains a dojo form, a ValidationTextbox and a submit button. If the textbox has any kind of error, a tooltip showing a message is displayed next to it. Now, if the error... | TITLE:
Dojo ValidationTextbox error tooltip remains on page after Dialog is closed with ESC key
QUESTION:
I am using Dojo 1.5, theme Claro. I have a dojo dialog that contains a dojo form, a ValidationTextbox and a submit button. If the textbox has any kind of error, a tooltip showing a message is displayed next to it.... | [
"dojo"
] | 0 | 0 | 2,704 | 1 | 0 | 2011-06-07T13:26:29.297000 | 2011-06-08T02:48:18.547000 |
6,265,885 | 6,265,928 | Android, how to change activity field from LocationListener.onlocationchanged()? | How do I change an activity field from LocationListener.onlocationchanged()? I suppose I have to use a handler, but don't know how to do it, exactly... My code is like this: public class Main extends Activity { private Double lat, lon; private LocationManager locationManager;
public void onCreate(Bundle savedInstanceS... | Place the CurrentLocationGps class inside the Main class (making it an inner class ), this way you can access all the fields in Main activity. | Android, how to change activity field from LocationListener.onlocationchanged()? How do I change an activity field from LocationListener.onlocationchanged()? I suppose I have to use a handler, but don't know how to do it, exactly... My code is like this: public class Main extends Activity { private Double lat, lon; pri... | TITLE:
Android, how to change activity field from LocationListener.onlocationchanged()?
QUESTION:
How do I change an activity field from LocationListener.onlocationchanged()? I suppose I have to use a handler, but don't know how to do it, exactly... My code is like this: public class Main extends Activity { private Do... | [
"android"
] | 0 | 1 | 593 | 1 | 0 | 2011-06-07T13:26:55.660000 | 2011-06-07T13:30:08.607000 |
6,265,890 | 6,265,923 | Changing list of NAMES TYPED IN CAPITALS to Names Typed In Capitals with Java | Lets say I have file with sever hundred lines of text all in capital letters. How should I go about changing the words on each line to lower case with only the first letter staying as capital? TEXT ON FIST LINE TEXT ON SECOND LINE TEXT ON THIRD LINE to Text On Fist Line Text On Second Line Text On Third Line I was thin... | If you don't mind using apace commons, you can use WordUtils.capitalize() or WordUtils.capitalizeFully() | Changing list of NAMES TYPED IN CAPITALS to Names Typed In Capitals with Java Lets say I have file with sever hundred lines of text all in capital letters. How should I go about changing the words on each line to lower case with only the first letter staying as capital? TEXT ON FIST LINE TEXT ON SECOND LINE TEXT ON THI... | TITLE:
Changing list of NAMES TYPED IN CAPITALS to Names Typed In Capitals with Java
QUESTION:
Lets say I have file with sever hundred lines of text all in capital letters. How should I go about changing the words on each line to lower case with only the first letter staying as capital? TEXT ON FIST LINE TEXT ON SECON... | [
"java",
"string",
"capitalization"
] | 1 | 2 | 275 | 2 | 0 | 2011-06-07T13:27:10.653000 | 2011-06-07T13:29:39.167000 |
6,265,891 | 6,265,986 | MySQL syntax: What is this? | My exported SQL file contains the lines below: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; What do these lines mean, unlike CREATE TABLE... | They are variable assignments. The assignments are wrapped in executable comments in such a way that they are executed when MySQL is used and left alone if some other RDBMS is used. Furthermore, the 40101 indicates that the comments are not to be retained in the database i.e. if the lines are executed, they are only ex... | MySQL syntax: What is this? My exported SQL file contains the lines below: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; What do these lin... | TITLE:
MySQL syntax: What is this?
QUESTION:
My exported SQL file contains the lines below: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */;... | [
"mysql",
"sql"
] | 48 | 56 | 27,858 | 4 | 0 | 2011-06-07T13:27:12.527000 | 2011-06-07T13:34:23.097000 |
6,265,892 | 6,266,072 | PHP thumbnail image | I have creating PHP application which takes images with any height and width. It creates 2 different images as follows, 1: thumbnail image (small image) with size 130x130 2: preview image (big image) with 600x400. How can we decide the height and width of thumbnail & preview image from the height and width of input ima... | You need ratio: $src_ratio = $src_width/$src_height; //ratio of source $ratio = $width/$height; //ratio of preview if ($ratio < $src_ratio) $height = $width/$src_ratio; else $width = $height*$src_ratio+1; | PHP thumbnail image I have creating PHP application which takes images with any height and width. It creates 2 different images as follows, 1: thumbnail image (small image) with size 130x130 2: preview image (big image) with 600x400. How can we decide the height and width of thumbnail & preview image from the height an... | TITLE:
PHP thumbnail image
QUESTION:
I have creating PHP application which takes images with any height and width. It creates 2 different images as follows, 1: thumbnail image (small image) with size 130x130 2: preview image (big image) with 600x400. How can we decide the height and width of thumbnail & preview image ... | [
"php",
"thumbnails"
] | 1 | 1 | 532 | 3 | 0 | 2011-06-07T13:27:12.913000 | 2011-06-07T13:39:29.933000 |
6,265,894 | 6,265,963 | Will accessing user email cause app to be rejected | The Apple guidelines state: 17.1 Privacy Apps cannot transmit data about a user without obtaining the user's prior permission and providing the user with access to information about how and where the data will be used Apps that require users to share personal information, such as email address and date of birth, in ord... | I'm assuming that at some point the user has to enter his email address into a form in your app. Why not just have text explaining briefly what it will be used for, and that by entering it he is giving permission for it to be used? I'm pretty sure that covers the privacy guideline. | Will accessing user email cause app to be rejected The Apple guidelines state: 17.1 Privacy Apps cannot transmit data about a user without obtaining the user's prior permission and providing the user with access to information about how and where the data will be used Apps that require users to share personal informati... | TITLE:
Will accessing user email cause app to be rejected
QUESTION:
The Apple guidelines state: 17.1 Privacy Apps cannot transmit data about a user without obtaining the user's prior permission and providing the user with access to information about how and where the data will be used Apps that require users to share ... | [
"ios",
"appstore-approval"
] | 2 | 3 | 600 | 2 | 0 | 2011-06-07T13:27:16.940000 | 2011-06-07T13:32:18.120000 |
6,265,896 | 6,265,950 | Arithmetic Overflow vs. Arithmetic Carry | One of my lecture slides gives an example of arithmetic overflow and carry in a topic for conditional branching flags on an ARM chip, quoted below: V (overflow) - 7FFFFFFF+1 C (carry) - FFFFFFFF+1 Presumably for the sake of the example, the address can only hold 8 bytes. So to me, it seems likes adding 1 to 7FFFFFFF ... | Overflow flags get set when the register cannot properly represent the result as a signed value (you overflowed into the sign bit). Carry flags are set when the register cannot properly represent the result as an unsigned value (no sign bit required). | Arithmetic Overflow vs. Arithmetic Carry One of my lecture slides gives an example of arithmetic overflow and carry in a topic for conditional branching flags on an ARM chip, quoted below: V (overflow) - 7FFFFFFF+1 C (carry) - FFFFFFFF+1 Presumably for the sake of the example, the address can only hold 8 bytes. So to... | TITLE:
Arithmetic Overflow vs. Arithmetic Carry
QUESTION:
One of my lecture slides gives an example of arithmetic overflow and carry in a topic for conditional branching flags on an ARM chip, quoted below: V (overflow) - 7FFFFFFF+1 C (carry) - FFFFFFFF+1 Presumably for the sake of the example, the address can only h... | [
"math",
"hex"
] | 31 | 65 | 34,340 | 3 | 0 | 2011-06-07T13:27:40.107000 | 2011-06-07T13:31:31.917000 |
6,265,912 | 6,265,967 | javax.xml.bind's Base64 encoder/decoder eats last two characters of string | I need to convert some strings using Base64 encoding, and was delighted to see that I didn't have to roll my own converter--Java provides one with javax.xml.bind.DataConverter. However, it has some problems. Here's the output of my time with a Jython REPL: >>> import javax.xml.bind.DatatypeConverter as DC >>> import ja... | hello is not a base64 String, so the parsing fails. You must convert the string into a byte array (try String(text).getBytes('UTF-8') ) and then call DC.printBase64Binary() on the byte array to get the data in Base64. DC.parseBase64Binary() will then convert this Base64 encoded data back into the byte array (which you ... | javax.xml.bind's Base64 encoder/decoder eats last two characters of string I need to convert some strings using Base64 encoding, and was delighted to see that I didn't have to roll my own converter--Java provides one with javax.xml.bind.DataConverter. However, it has some problems. Here's the output of my time with a J... | TITLE:
javax.xml.bind's Base64 encoder/decoder eats last two characters of string
QUESTION:
I need to convert some strings using Base64 encoding, and was delighted to see that I didn't have to roll my own converter--Java provides one with javax.xml.bind.DataConverter. However, it has some problems. Here's the output o... | [
"java",
"encoding",
"base64",
"decoding"
] | 3 | 12 | 21,602 | 6 | 0 | 2011-06-07T13:28:52.003000 | 2011-06-07T13:32:50.053000 |
6,265,916 | 6,265,998 | Maven map a file | In Maven, is there a way to map one file to another file with a different name? I know there is a way to map a file to a different file with the same name under a certain directory with the following: /some/path/to/dir /some/path/to/file/xyz This will map /some/path/to/file/xyz to /some/path/to/dir/xyz. Instead I'd lik... | No directly. You can use Ant's copy task via the antrun maven plugin. See Mapping File Names maven-antrun-plugin 1.6 run | Maven map a file In Maven, is there a way to map one file to another file with a different name? I know there is a way to map a file to a different file with the same name under a certain directory with the following: /some/path/to/dir /some/path/to/file/xyz This will map /some/path/to/file/xyz to /some/path/to/dir/xyz... | TITLE:
Maven map a file
QUESTION:
In Maven, is there a way to map one file to another file with a different name? I know there is a way to map a file to a different file with the same name under a certain directory with the following: /some/path/to/dir /some/path/to/file/xyz This will map /some/path/to/file/xyz to /so... | [
"file",
"maven",
"mapping"
] | 1 | 0 | 816 | 1 | 0 | 2011-06-07T13:29:07.597000 | 2011-06-07T13:35:10.777000 |
6,265,924 | 6,265,982 | How Do I / Can I Upgrade Java from Eclipse? | I'm brand new to JAva/Eclipse/Android but gearing up! I've got everything installed and working but want to know how Java is upgraded. Can it be done through Eclipse? I noticed that the JDK install wants to create a new folder each time based on its version. I'll do whatever is needed but appreciate your input to get m... | Just install JDK the usual way. The new folder is not a problem. Once you've installed the JDK, you can instruct Eclipse to use it by Window > Preferences > Java > Installed JREs. You can add or edit the installed JREs over there. If you choose Edit, you just have to change the home directory and the name. | How Do I / Can I Upgrade Java from Eclipse? I'm brand new to JAva/Eclipse/Android but gearing up! I've got everything installed and working but want to know how Java is upgraded. Can it be done through Eclipse? I noticed that the JDK install wants to create a new folder each time based on its version. I'll do whatever ... | TITLE:
How Do I / Can I Upgrade Java from Eclipse?
QUESTION:
I'm brand new to JAva/Eclipse/Android but gearing up! I've got everything installed and working but want to know how Java is upgraded. Can it be done through Eclipse? I noticed that the JDK install wants to create a new folder each time based on its version.... | [
"java",
"android",
"eclipse"
] | 4 | 8 | 270 | 2 | 0 | 2011-06-07T13:29:52.073000 | 2011-06-07T13:34:09.487000 |
6,265,931 | 6,266,085 | Any way of avoiding this type inference problem? | If I have a function defined as let test = function | [] -> None | head::tail -> Some(head) fsi will allow me to define this and the compile will compile it; but it will fall over should I ever actually try to do test []. Now I know the reasoning, when I give it an empty set it can't infer the type and so the generic f... | There is a great article about value restriction on MSDN and additional notes about tricky aspects by Brian that explains this problem in details. When you write test [] the result has a type option<'a>, so the compiler needs to know the type to be used in place of 'a. You're not actually using values of type 'a, but t... | Any way of avoiding this type inference problem? If I have a function defined as let test = function | [] -> None | head::tail -> Some(head) fsi will allow me to define this and the compile will compile it; but it will fall over should I ever actually try to do test []. Now I know the reasoning, when I give it an empty... | TITLE:
Any way of avoiding this type inference problem?
QUESTION:
If I have a function defined as let test = function | [] -> None | head::tail -> Some(head) fsi will allow me to define this and the compile will compile it; but it will fall over should I ever actually try to do test []. Now I know the reasoning, when ... | [
"f#",
"type-inference"
] | 2 | 2 | 131 | 2 | 0 | 2011-06-07T13:30:16.787000 | 2011-06-07T13:40:14.517000 |
6,265,942 | 6,266,105 | php preg_replace subpattern | I would like to highlight the last slug in url like this: http://www.domain.org/ school.html Here's the pattern to capture the slug: $pattern = "/\/([^/]+)\.html$/"; How do I run preg_replace on url to replace the slug with slug? | You need to preserve the / and filename suffix then for replacement: = preg_replace("~(/)([^/]+)(\.html)$~", "$1 $2 $3", $urltext); | php preg_replace subpattern I would like to highlight the last slug in url like this: http://www.domain.org/ school.html Here's the pattern to capture the slug: $pattern = "/\/([^/]+)\.html$/"; How do I run preg_replace on url to replace the slug with slug? | TITLE:
php preg_replace subpattern
QUESTION:
I would like to highlight the last slug in url like this: http://www.domain.org/ school.html Here's the pattern to capture the slug: $pattern = "/\/([^/]+)\.html$/"; How do I run preg_replace on url to replace the slug with slug?
ANSWER:
You need to preserve the / and file... | [
"php",
"regex"
] | 1 | 2 | 1,831 | 2 | 0 | 2011-06-07T13:31:05.177000 | 2011-06-07T13:41:33.833000 |
6,265,974 | 6,266,056 | Checking returned data from php file with equal sign and get () method jquery | I have this: $(document).ready(function() {
$.get('getturn.php', function(data){ if (data!=='4') { alert (' change'); } if (data=='4') { alert ('no change');} }); }); getturn.php echoes 4 if the turn is equal to a session id, and it echoes the turn number if otherwise. The getturn.php does as it should, it echoes 4 or... | Have you done an alert(data); to see what is returned? I think you should try this slight modification: if (data == '4') { alert ('no change');} else { alert (' change'); } Based on this answer: How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ? | Checking returned data from php file with equal sign and get () method jquery I have this: $(document).ready(function() {
$.get('getturn.php', function(data){ if (data!=='4') { alert (' change'); } if (data=='4') { alert ('no change');} }); }); getturn.php echoes 4 if the turn is equal to a session id, and it echoes t... | TITLE:
Checking returned data from php file with equal sign and get () method jquery
QUESTION:
I have this: $(document).ready(function() {
$.get('getturn.php', function(data){ if (data!=='4') { alert (' change'); } if (data=='4') { alert ('no change');} }); }); getturn.php echoes 4 if the turn is equal to a session i... | [
"php",
"jquery",
"get"
] | 1 | 2 | 191 | 2 | 0 | 2011-06-07T13:33:39.560000 | 2011-06-07T13:39:00.837000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.