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,210,058 | 6,210,098 | When core data is changed, how to update the table view data? | Using NSXMLParser to get data from an xml file on internet with an update button to get update database and store it by using xcode template core data. However, when I updated all core data, console can only show right data until I quited the app and run it again. Any way to update all data correctly without quiting th... | Using CoreData the simplest thing to do is to use a NSFetchedResultsController. You can set your view controller to be the delegate for the NSFetchedResultsController, which will give you notifications when your data changes. You can then update your table appropriately. This tutorial might help: http://www.raywenderli... | When core data is changed, how to update the table view data? Using NSXMLParser to get data from an xml file on internet with an update button to get update database and store it by using xcode template core data. However, when I updated all core data, console can only show right data until I quited the app and run it ... | TITLE:
When core data is changed, how to update the table view data?
QUESTION:
Using NSXMLParser to get data from an xml file on internet with an update button to get update database and store it by using xcode template core data. However, when I updated all core data, console can only show right data until I quited t... | [
"core-data",
"nsxmlparser"
] | 1 | 2 | 1,373 | 1 | 0 | 2011-06-02T03:28:26.077000 | 2011-06-02T03:37:55.237000 |
6,210,065 | 6,210,081 | In App Purchase | in the App Store Review Guidelines is stated in section that "Apps using IAP to purchase physical goods or goods and services used outside of the application will be rejected." Looking also into iOS Developer Program License Agreement referenced in 11.12 of the App Store Review Guidelines I can see there in Attachment ... | Yes, that is correct. Note however, that if you use an alternative payment mechanism, Apple still wants their 30% cut. | In App Purchase in the App Store Review Guidelines is stated in section that "Apps using IAP to purchase physical goods or goods and services used outside of the application will be rejected." Looking also into iOS Developer Program License Agreement referenced in 11.12 of the App Store Review Guidelines I can see ther... | TITLE:
In App Purchase
QUESTION:
in the App Store Review Guidelines is stated in section that "Apps using IAP to purchase physical goods or goods and services used outside of the application will be rejected." Looking also into iOS Developer Program License Agreement referenced in 11.12 of the App Store Review Guideli... | [
"iphone",
"ios",
"in-app-purchase"
] | 7 | 9 | 5,557 | 4 | 0 | 2011-06-02T03:29:30.753000 | 2011-06-02T03:33:19.743000 |
6,210,070 | 6,210,091 | How to run CGI on Jboss? | (Oh, its Jboss not Apache. wow) I am learning CGI and wish to run a test cgi on Jboss web server as first step lol. I have searched a lot of resources online and tried a lot of ways, but it still be opened as a text file on browser. More facts: 1 I put script in a directory, and open it on browser e.g. www.xxxx.com/sta... | It's most probably to do with the fact that the directory your script is placed in doesn't not ExecCGI Option enabled. Typically done with something like Options +ExecCGI http://httpd.apache.org/docs/2.0/howto/cgi.html By default Apache nominates certain directories you can place CGI scripts in. | How to run CGI on Jboss? (Oh, its Jboss not Apache. wow) I am learning CGI and wish to run a test cgi on Jboss web server as first step lol. I have searched a lot of resources online and tried a lot of ways, but it still be opened as a text file on browser. More facts: 1 I put script in a directory, and open it on brow... | TITLE:
How to run CGI on Jboss?
QUESTION:
(Oh, its Jboss not Apache. wow) I am learning CGI and wish to run a test cgi on Jboss web server as first step lol. I have searched a lot of resources online and tried a lot of ways, but it still be opened as a text file on browser. More facts: 1 I put script in a directory, a... | [
"apache",
"cgi"
] | 0 | 0 | 1,576 | 1 | 0 | 2011-06-02T03:30:22.037000 | 2011-06-02T03:36:02.093000 |
6,210,080 | 6,219,422 | sampler1D not supported in nVidia GLSL? | In the GLSL spec, and other sources about GLSL, sampler types are available in 3 dimensions: sampler1D, sampler2D, and sampler3D. However when I try to compile GLSL programs using WebGL in Chrome (both regular, and also in Canary), sampler2D and sampler3D are accepted but sampler1D gives a syntax error. Code: uniform s... | No, your problem isn't related to "NVIDIA GLSL". WebGL is based on OpenGL ES 2.0, and OpenGL ES 2.0 doesn't have 1D textures, only 2D and 3D textures (as extensions), so you won't be able to use a sampler1D in WebGL. Solution? Just use a 2D texture with a height of 1 with a sampler2D. Note: If you use Desktop OpenGL (O... | sampler1D not supported in nVidia GLSL? In the GLSL spec, and other sources about GLSL, sampler types are available in 3 dimensions: sampler1D, sampler2D, and sampler3D. However when I try to compile GLSL programs using WebGL in Chrome (both regular, and also in Canary), sampler2D and sampler3D are accepted but sampler... | TITLE:
sampler1D not supported in nVidia GLSL?
QUESTION:
In the GLSL spec, and other sources about GLSL, sampler types are available in 3 dimensions: sampler1D, sampler2D, and sampler3D. However when I try to compile GLSL programs using WebGL in Chrome (both regular, and also in Canary), sampler2D and sampler3D are ac... | [
"graphics",
"glsl",
"textures",
"nvidia"
] | 8 | 11 | 5,914 | 2 | 0 | 2011-06-02T03:33:17.313000 | 2011-06-02T19:32:26.080000 |
6,210,082 | 6,210,095 | xsl: split and get the X position of param | xsl: I need to split and get the X position param, @class attribute 2nd param: Input XML: 567662 destacado destacado: Home Actualidad ES output XML that I NEED: 567662 destacado destacado: Home Actualidad ES i have this xsl: output XML that I HAVE with previous XSL, i don't know how i can get second param of CLASS ATTR... | You could use substring-before() and substring-after() to split the class attribute's value at the spaces. E.g. substring-before(substring-after(@class, ' '), ' ') would give the second token in @class. This assumes that your tokens are separated by single spaces (not general "whitespace"). In your code, you would put ... | xsl: split and get the X position of param xsl: I need to split and get the X position param, @class attribute 2nd param: Input XML: 567662 destacado destacado: Home Actualidad ES output XML that I NEED: 567662 destacado destacado: Home Actualidad ES i have this xsl: output XML that I HAVE with previous XSL, i don't kn... | TITLE:
xsl: split and get the X position of param
QUESTION:
xsl: I need to split and get the X position param, @class attribute 2nd param: Input XML: 567662 destacado destacado: Home Actualidad ES output XML that I NEED: 567662 destacado destacado: Home Actualidad ES i have this xsl: output XML that I HAVE with previo... | [
"xml",
"xslt",
"xpath",
"split",
"param"
] | 3 | 3 | 1,954 | 2 | 0 | 2011-06-02T03:33:24.887000 | 2011-06-02T03:36:56.220000 |
6,210,087 | 6,210,405 | How to use OpenGL-ES 2.0 in linux and Android | HI I am having a ubuntu 10.10 enable laptop. I have run examples of OpenGL-ES 2.0 on Ubuntu 10.10. now I want to run the codes in Android platform. How would I proceed. Maybe I have to run android on ubuntu 10.10 and then run in the android but I don't know how to do that. The thing is that I want to run the codes on A... | Just read the Android Documentation: it is all perfectly explained there for any Operating system. Just follow the steps and you will get there. One important point though, pick a minimum of API Level 8 for your project when you get there because the OpenGL ES bindings for 2.0 were only added then. | How to use OpenGL-ES 2.0 in linux and Android HI I am having a ubuntu 10.10 enable laptop. I have run examples of OpenGL-ES 2.0 on Ubuntu 10.10. now I want to run the codes in Android platform. How would I proceed. Maybe I have to run android on ubuntu 10.10 and then run in the android but I don't know how to do that. ... | TITLE:
How to use OpenGL-ES 2.0 in linux and Android
QUESTION:
HI I am having a ubuntu 10.10 enable laptop. I have run examples of OpenGL-ES 2.0 on Ubuntu 10.10. now I want to run the codes in Android platform. How would I proceed. Maybe I have to run android on ubuntu 10.10 and then run in the android but I don't kno... | [
"android",
"linux",
"opengl-es-2.0"
] | 1 | 3 | 2,668 | 2 | 0 | 2011-06-02T03:34:34.630000 | 2011-06-02T04:33:18.567000 |
6,210,096 | 6,210,164 | TextToSpeech API doesn't work when its called from OnStart | I'm using the TextToSpeech API in my code and it doesn't work when I try to call.speak() function from OnStart(), however it works when I call it from a button onClickListener(). Any idea why? Thank you. public class TtsDemoActivity extends Activity {
private TextToSpeech mTts; private OnClickListener buttonListener =... | You must wait until the TTS subsystem signals that it is ready: if it isn't ready when onStart is called, it will fail. If you are trying to speak as soon as it is ready call PlaySound from inside the OnInitListener: @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super... | TextToSpeech API doesn't work when its called from OnStart I'm using the TextToSpeech API in my code and it doesn't work when I try to call.speak() function from OnStart(), however it works when I call it from a button onClickListener(). Any idea why? Thank you. public class TtsDemoActivity extends Activity {
private ... | TITLE:
TextToSpeech API doesn't work when its called from OnStart
QUESTION:
I'm using the TextToSpeech API in my code and it doesn't work when I try to call.speak() function from OnStart(), however it works when I call it from a button onClickListener(). Any idea why? Thank you. public class TtsDemoActivity extends Ac... | [
"android",
"text-to-speech"
] | 0 | 1 | 1,221 | 2 | 0 | 2011-06-02T03:37:18.480000 | 2011-06-02T03:51:28.907000 |
6,210,099 | 6,210,221 | Java 5-compiled binaries on Java 1.3 runtime | May I know if there are any issues running a Java 5-compiled code (with Java 1.3 source/target compliance) on a Java 1.3 JVM? I know this is quite odd, but most of our customers are on Java 5 but we are restricted by a few still on Java 1.3 due to conditions beyond our control. Our CI tool uses Java 5 compiler but we s... | The only way to get the compiler to check that source in your app. only uses 1.3 methods is to specify a -bootclasspath pointing to a 1.3 rt.jar. Note you can get that from a 1.3 JRE, it does not require a 1.3 SDK/compiler. Of course, specify a -target of 1.3. | Java 5-compiled binaries on Java 1.3 runtime May I know if there are any issues running a Java 5-compiled code (with Java 1.3 source/target compliance) on a Java 1.3 JVM? I know this is quite odd, but most of our customers are on Java 5 but we are restricted by a few still on Java 1.3 due to conditions beyond our contr... | TITLE:
Java 5-compiled binaries on Java 1.3 runtime
QUESTION:
May I know if there are any issues running a Java 5-compiled code (with Java 1.3 source/target compliance) on a Java 1.3 JVM? I know this is quite odd, but most of our customers are on Java 5 but we are restricted by a few still on Java 1.3 due to condition... | [
"java",
"backwards-compatibility"
] | 3 | 3 | 487 | 2 | 0 | 2011-06-02T03:37:58.753000 | 2011-06-02T04:02:16.300000 |
6,210,105 | 6,210,134 | How can CoffeeScript be written in CoffeeScript? | So as a new web programmer (background is mostely in C,C++, and Python) with no javascript experience (or desire to experience it, based on what I have seen) I have been doing some precursory research on CoffeeScript and am really liking what I see. One cool little nuance I noticed was that CoffeeScript was written in ... | This is nothing new. C compilers have been written in C. Python has been written in Python. It's possible to use a compiler for Language X to compile a newer version of itself, with more features. It's called bootstrapping. Bootstrapping a language Writing a compiler in its own language How do you write a compiler for ... | How can CoffeeScript be written in CoffeeScript? So as a new web programmer (background is mostely in C,C++, and Python) with no javascript experience (or desire to experience it, based on what I have seen) I have been doing some precursory research on CoffeeScript and am really liking what I see. One cool little nuanc... | TITLE:
How can CoffeeScript be written in CoffeeScript?
QUESTION:
So as a new web programmer (background is mostely in C,C++, and Python) with no javascript experience (or desire to experience it, based on what I have seen) I have been doing some precursory research on CoffeeScript and am really liking what I see. One... | [
"compiler-construction",
"coffeescript",
"interpreter",
"bootstrapping"
] | 39 | 46 | 2,985 | 2 | 0 | 2011-06-02T03:39:09.223000 | 2011-06-02T03:45:46.990000 |
6,210,111 | 6,210,296 | Java Swing Help | I'm trying to create a grid of JButtons, with index values to the left and right of the button grid. Here is my code, but I'm getting a NullPointerException. What is the problem? public class Test { public static void main(String args[]) { JFrame myapp = new JFrame("test"); myapp.setLayout(new FlowLayout());
myapp.set... | Swing GUIs should be constructed on the EDT. That part is left as an exercise for the OP. import java.awt.*; import javax.swing.*;
public class Test { public static void main(String args[]) { JFrame myapp = new JFrame("test"); myapp.setLayout(new FlowLayout());
myapp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); my... | Java Swing Help I'm trying to create a grid of JButtons, with index values to the left and right of the button grid. Here is my code, but I'm getting a NullPointerException. What is the problem? public class Test { public static void main(String args[]) { JFrame myapp = new JFrame("test"); myapp.setLayout(new FlowLayou... | TITLE:
Java Swing Help
QUESTION:
I'm trying to create a grid of JButtons, with index values to the left and right of the button grid. Here is my code, but I'm getting a NullPointerException. What is the problem? public class Test { public static void main(String args[]) { JFrame myapp = new JFrame("test"); myapp.setLa... | [
"java",
"swing",
"jbutton"
] | 1 | 4 | 558 | 3 | 0 | 2011-06-02T03:40:17.680000 | 2011-06-02T04:16:48.667000 |
6,210,113 | 6,210,166 | Android: How to return to previous screen from Preferences (pressing Back button) | When calling my PreferenceActivity from a screen, and after pressing the Back button, the return screen is always the main screen (the activity that shows after app start) of the application. Is it possible to go back to the previous screen? I tried to solve it through overriding the onKeyDown (inside my PreferenceActi... | Assuming you use Activities/Intents as designed, there's actually no special code required. Pushing back will automatically stop the current activity, and go back to the activity which called it. See the Android Activity and Task guide. | Android: How to return to previous screen from Preferences (pressing Back button) When calling my PreferenceActivity from a screen, and after pressing the Back button, the return screen is always the main screen (the activity that shows after app start) of the application. Is it possible to go back to the previous scre... | TITLE:
Android: How to return to previous screen from Preferences (pressing Back button)
QUESTION:
When calling my PreferenceActivity from a screen, and after pressing the Back button, the return screen is always the main screen (the activity that shows after app start) of the application. Is it possible to go back to... | [
"android",
"preferences",
"back"
] | 1 | 2 | 3,127 | 1 | 0 | 2011-06-02T03:40:46.540000 | 2011-06-02T03:51:43.263000 |
6,210,116 | 6,210,137 | git deploying project - file permissions - (chmod) | I'm deploying my project with git to a remote server using a post-update hook. More specifically I'm following these steps. Everything on my local copy has the right permissions, however after deploying with git push production, files that are set to 777 change in the remote server to -rwxr-xr-x I've added to both (loc... | The core.filemode variable is only used when files are indexed. When git checks out files, the stored mode is used unconditionally, and files can only have a mode of 644 or 755. Modify your post-checkout hook to chmod the files. | git deploying project - file permissions - (chmod) I'm deploying my project with git to a remote server using a post-update hook. More specifically I'm following these steps. Everything on my local copy has the right permissions, however after deploying with git push production, files that are set to 777 change in the ... | TITLE:
git deploying project - file permissions - (chmod)
QUESTION:
I'm deploying my project with git to a remote server using a post-update hook. More specifically I'm following these steps. Everything on my local copy has the right permissions, however after deploying with git push production, files that are set to ... | [
"git",
"file-permissions",
"chmod"
] | 6 | 3 | 4,199 | 1 | 0 | 2011-06-02T03:41:11.250000 | 2011-06-02T03:46:08.457000 |
6,210,117 | 6,210,641 | How to send data to a specified connection while using node.js | I am using node.js building a TCP server, just like the example in the doc. The server establishes persistent connections and handle client requests. But I also need to send data to any specified connection, which means this action is not client driven. How to do that? | Your server could maintain a data structure of active connections by adding on the server "connection" event and removing on the stream "close" event. Then you can pick the desired connection from that data structure and write data to it whenever you want. Here is a simple example of a time server that sends the curren... | How to send data to a specified connection while using node.js I am using node.js building a TCP server, just like the example in the doc. The server establishes persistent connections and handle client requests. But I also need to send data to any specified connection, which means this action is not client driven. How... | TITLE:
How to send data to a specified connection while using node.js
QUESTION:
I am using node.js building a TCP server, just like the example in the doc. The server establishes persistent connections and handle client requests. But I also need to send data to any specified connection, which means this action is not ... | [
"javascript",
"http",
"node.js",
"tcp"
] | 5 | 8 | 2,285 | 1 | 0 | 2011-06-02T03:41:28.893000 | 2011-06-02T05:05:56.623000 |
6,210,119 | 6,210,401 | Disable viewstate for all Label controls in web.config? | Is it possible to disable viewstate for a specific type of controls in web.config? I know I can disable viewstate for all pages using, but what if I wanted to target just all Label controls? | One of the crud way, could be to iterate all controls recursively in the page and disable the view-state for label controls - obvious issue is that you need to do this early in page cycle and then in such case, you may miss the dynamically added controls. The more elegant solution would be to create a custom control in... | Disable viewstate for all Label controls in web.config? Is it possible to disable viewstate for a specific type of controls in web.config? I know I can disable viewstate for all pages using, but what if I wanted to target just all Label controls? | TITLE:
Disable viewstate for all Label controls in web.config?
QUESTION:
Is it possible to disable viewstate for a specific type of controls in web.config? I know I can disable viewstate for all pages using, but what if I wanted to target just all Label controls?
ANSWER:
One of the crud way, could be to iterate all c... | [
"c#",
"asp.net",
"viewstate"
] | 1 | 4 | 1,376 | 1 | 0 | 2011-06-02T03:41:46.163000 | 2011-06-02T04:33:01.637000 |
6,210,121 | 6,210,210 | How can I get an XML attribute by name instead of iterating over all the attributes? | I'm using vb script and MSXML2.DOMDocument to parse a xml document. Is it possible get a particular attribute by name instead of iterating over all the attributes? Today I am doing this For x = 0 To (curNode.Attributes.length - 1) sAttrName = curNode.Attributes.Item(x).nodeName if sAttrName = 'customer' then avalue=cur... | Try getAttribute(), as in curNode.getAttribute("customer"). I'm assuming that curNode is an oXMLDOMElement, though you didn't show its type. | How can I get an XML attribute by name instead of iterating over all the attributes? I'm using vb script and MSXML2.DOMDocument to parse a xml document. Is it possible get a particular attribute by name instead of iterating over all the attributes? Today I am doing this For x = 0 To (curNode.Attributes.length - 1) sAtt... | TITLE:
How can I get an XML attribute by name instead of iterating over all the attributes?
QUESTION:
I'm using vb script and MSXML2.DOMDocument to parse a xml document. Is it possible get a particular attribute by name instead of iterating over all the attributes? Today I am doing this For x = 0 To (curNode.Attribute... | [
"xml",
"vbscript"
] | 1 | 3 | 8,398 | 1 | 0 | 2011-06-02T03:42:26.803000 | 2011-06-02T04:00:37.863000 |
6,210,125 | 6,210,252 | Is it ok to run SQL CE 4.0 under .net 3.5? | I was wondering if anyone has run SQL CE 4.0 private deployment under a.net 3.5 application without issue. Thanks. | According to this walkthrough.... it will.... and I quote, "work perfectly". I started a small project myself and while I didn't finish it, I never ran into any show stopping bugs either. Do note however some of the updates to the comments below his blog entry. They point out some gotcha's (not related to.net 3.5 but h... | Is it ok to run SQL CE 4.0 under .net 3.5? I was wondering if anyone has run SQL CE 4.0 private deployment under a.net 3.5 application without issue. Thanks. | TITLE:
Is it ok to run SQL CE 4.0 under .net 3.5?
QUESTION:
I was wondering if anyone has run SQL CE 4.0 private deployment under a.net 3.5 application without issue. Thanks.
ANSWER:
According to this walkthrough.... it will.... and I quote, "work perfectly". I started a small project myself and while I didn't finish... | [
"sql-server-ce",
"sql-server-ce-4"
] | 2 | 3 | 682 | 1 | 0 | 2011-06-02T03:43:06.460000 | 2011-06-02T04:08:47.580000 |
6,210,127 | 6,210,171 | How to pull variables out of a string | I'm looking for a Java class that for a given string "the ${animal} jumped over the ${target}." is able to pull out the variable names, ie 'animal' and 'target'. I had hoped StrSubstitutor in Commons Lang had a method getVariables(String str): List... but no such luck. Yes I could write this myself, but I'm certain the... | You could just do a simple regex match if you really just want to pull out those values and avoid the dependency of an entire library: public List getVariableNames(String source) { List vs = new ArrayList (); Pattern p = Pattern.compile("\\$\\{(\\w+)\\}"); Matcher m = p.matcher(source); while (m.find()) { vs.add(m.grou... | How to pull variables out of a string I'm looking for a Java class that for a given string "the ${animal} jumped over the ${target}." is able to pull out the variable names, ie 'animal' and 'target'. I had hoped StrSubstitutor in Commons Lang had a method getVariables(String str): List... but no such luck. Yes I could ... | TITLE:
How to pull variables out of a string
QUESTION:
I'm looking for a Java class that for a given string "the ${animal} jumped over the ${target}." is able to pull out the variable names, ie 'animal' and 'target'. I had hoped StrSubstitutor in Commons Lang had a method getVariables(String str): List... but no such ... | [
"java",
"variables",
"configuration",
"properties"
] | 2 | 1 | 271 | 2 | 0 | 2011-06-02T03:43:20.440000 | 2011-06-02T03:53:25.337000 |
6,210,129 | 6,210,179 | float not working in mysql database | i am using $_GET['var'] to get a variable then compare it with a variable in my database. the variable is 1.1 the var is set to "float" on the database so i know it can handle decimals but when i compare them with the code below i get nothing. include 'connect.php';
$sql=mysql_query("SELECT * FROM table WHERE stuff='$... | From what I know float type isn't precise. It doesn't show you that actual value so 1.1 that you saved may not be the actual value stored. Trying setting your field as decimal and give it a length of say, 10,1 where 10 is the maximum number of digits (the precision) and 1 is the number of digits to the right of the dec... | float not working in mysql database i am using $_GET['var'] to get a variable then compare it with a variable in my database. the variable is 1.1 the var is set to "float" on the database so i know it can handle decimals but when i compare them with the code below i get nothing. include 'connect.php';
$sql=mysql_query... | TITLE:
float not working in mysql database
QUESTION:
i am using $_GET['var'] to get a variable then compare it with a variable in my database. the variable is 1.1 the var is set to "float" on the database so i know it can handle decimals but when i compare them with the code below i get nothing. include 'connect.php';... | [
"php",
"database",
"floating-point",
"compare"
] | 0 | 7 | 4,333 | 5 | 0 | 2011-06-02T03:43:54.947000 | 2011-06-02T03:54:42.153000 |
6,210,139 | 6,224,602 | Creating a Google HTTP Transport Object for Android HTTP Request | I'm creating an Android app and trying to use Google Places API through Google APIs Client. I've been following this example: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html I'm having problems creating a HTTP Transport Object to use in creating the HTTP Request Factory. Everything compiles fine... | In order to run the Places API in an Android environment using the Google APIs Client, you'll need to have the following dependencies in your Android project: M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar M2_REPO/com/google/api/clie... | Creating a Google HTTP Transport Object for Android HTTP Request I'm creating an Android app and trying to use Google Places API through Google APIs Client. I've been following this example: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html I'm having problems creating a HTTP Transport Object to u... | TITLE:
Creating a Google HTTP Transport Object for Android HTTP Request
QUESTION:
I'm creating an Android app and trying to use Google Places API through Google APIs Client. I've been following this example: http://ddewaele.blogspot.com/2011/05/introducing-google-places-api.html I'm having problems creating a HTTP Tra... | [
"android",
"web-services",
"httpwebrequest",
"google-api-java-client"
] | 2 | 2 | 5,763 | 1 | 0 | 2011-06-02T03:46:25.260000 | 2011-06-03T08:14:15.317000 |
6,210,149 | 6,210,184 | find out object item names in as3 | let's say you're passing an object to a function {title:"my title", data:"corresponding data"} how can I get the function to know what the names of the items/sub-objects are ( title and data ) without specifying them? | You can use a for loop as follows: for (var key:String in obj) { var value:String = obj[key]; trace(key + ": " + value); } Or use the introspection API. The Flex 3 Help page on Performing Object Introspection has a good overview of these. | find out object item names in as3 let's say you're passing an object to a function {title:"my title", data:"corresponding data"} how can I get the function to know what the names of the items/sub-objects are ( title and data ) without specifying them? | TITLE:
find out object item names in as3
QUESTION:
let's say you're passing an object to a function {title:"my title", data:"corresponding data"} how can I get the function to know what the names of the items/sub-objects are ( title and data ) without specifying them?
ANSWER:
You can use a for loop as follows: for (v... | [
"actionscript-3"
] | 0 | 2 | 1,238 | 2 | 0 | 2011-06-02T03:49:02.733000 | 2011-06-02T03:55:26.627000 |
6,210,152 | 6,210,223 | CLLocation, getting new locations | In More iPhone Programming book, the author does: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if ([newLocation.timestamp timeIntervalSince1970] < [NSDate timeIntervalSinceReferenceDate] - 60) locationCoordinate = newLocation... | I don't know what is going on here, its confusing statement, I have use something like this - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ NSDate* eventDate = newLocation.timestamp; NSTimeInterval howRecent = [eventDate timeInte... | CLLocation, getting new locations In More iPhone Programming book, the author does: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if ([newLocation.timestamp timeIntervalSince1970] < [NSDate timeIntervalSinceReferenceDate] - 60... | TITLE:
CLLocation, getting new locations
QUESTION:
In More iPhone Programming book, the author does: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { if ([newLocation.timestamp timeIntervalSince1970] < [NSDate timeIntervalSinceR... | [
"iphone",
"nsdate",
"cllocationmanager"
] | 0 | 0 | 506 | 2 | 0 | 2011-06-02T03:49:45.637000 | 2011-06-02T04:02:40.343000 |
6,210,154 | 6,210,181 | Accessing vector in class | If I have a vector as a private member in my class, what's the best way to access it? For example, take the following simple class class MCL{ private: std::vector my_vec;
public: // Include constructor here and other member functions } What's the best way to access my_vec? Specifically, I would like to use a getter fu... | return it by const reference, or just by reference if you want to allow changing. const std::vector & getVector() const { return vector; } usage: const std::vector &v = myClass.getVector(); | Accessing vector in class If I have a vector as a private member in my class, what's the best way to access it? For example, take the following simple class class MCL{ private: std::vector my_vec;
public: // Include constructor here and other member functions } What's the best way to access my_vec? Specifically, I wou... | TITLE:
Accessing vector in class
QUESTION:
If I have a vector as a private member in my class, what's the best way to access it? For example, take the following simple class class MCL{ private: std::vector my_vec;
public: // Include constructor here and other member functions } What's the best way to access my_vec? S... | [
"c++",
"class",
"vector"
] | 0 | 2 | 7,180 | 3 | 0 | 2011-06-02T03:50:19.033000 | 2011-06-02T03:54:51.577000 |
6,210,156 | 6,210,170 | cannot send mail using php mail function | Im trying to use PHP mail on my local computer, but its just not working. I am using the standard script from the php website: PHP error I'm getting SMTP server response: 550 Error sending message: Error: FROM address is invalid actual PHP $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $heade... | I have had this error before, and I believe all you have to do is change the email webmaster@example.com to a real email. Make sure you send it to a real email as well. | cannot send mail using php mail function Im trying to use PHP mail on my local computer, but its just not working. I am using the standard script from the php website: PHP error I'm getting SMTP server response: 550 Error sending message: Error: FROM address is invalid actual PHP $to = 'nobody@example.com'; $subject = ... | TITLE:
cannot send mail using php mail function
QUESTION:
Im trying to use PHP mail on my local computer, but its just not working. I am using the standard script from the php website: PHP error I'm getting SMTP server response: 550 Error sending message: Error: FROM address is invalid actual PHP $to = 'nobody@example... | [
"php",
"email",
"smtp"
] | 4 | 2 | 11,527 | 3 | 0 | 2011-06-02T03:50:40.470000 | 2011-06-02T03:53:20.053000 |
6,210,157 | 6,210,379 | Java function to detect valid webpage | I am trying to write a Java program that will load pages pointed to by valid links and report other links as broken. My problem is that the Java URL will download the appropriate page if the url is valid, and the search-engine results for the url if the url is invalid. Is there a Java function that detects if the url r... | You can get the HTTP response code for a URL like so: public static int getResponseCode(URL url) throws IOException { URLConnection conn = url.openConnection(); if (!(conn instanceof HttpURLConnection)) { throw new IllegalArgumentException("not an HTTP url: " + url); } HttpURLConnection httpConn = (HttpURLConnection) c... | Java function to detect valid webpage I am trying to write a Java program that will load pages pointed to by valid links and report other links as broken. My problem is that the Java URL will download the appropriate page if the url is valid, and the search-engine results for the url if the url is invalid. Is there a J... | TITLE:
Java function to detect valid webpage
QUESTION:
I am trying to write a Java program that will load pages pointed to by valid links and report other links as broken. My problem is that the Java URL will download the appropriate page if the url is valid, and the search-engine results for the url if the url is inv... | [
"java"
] | 1 | 1 | 109 | 2 | 0 | 2011-06-02T03:50:48.003000 | 2011-06-02T04:29:53.913000 |
6,210,172 | 6,210,666 | Barebones Facebook Connection with flashbuilder 4.5 (mobile app) | I am looking for a barebones facebook connection from pure actionscript to use in a mobile. Does anyone know of any examples. Been having a hard time finding what I want in Google Thanks! | You cant connect to facebook with only actionscript - flash does not implement OAuth which you need to get a valid access token. You have to either get an access token through PHP, or Javascript. If you are making a mobile web-app you can check out http://blog.yoz.sk/2010/04/facebook-now-with-oauth-and-open-graph/ Joze... | Barebones Facebook Connection with flashbuilder 4.5 (mobile app) I am looking for a barebones facebook connection from pure actionscript to use in a mobile. Does anyone know of any examples. Been having a hard time finding what I want in Google Thanks! | TITLE:
Barebones Facebook Connection with flashbuilder 4.5 (mobile app)
QUESTION:
I am looking for a barebones facebook connection from pure actionscript to use in a mobile. Does anyone know of any examples. Been having a hard time finding what I want in Google Thanks!
ANSWER:
You cant connect to facebook with only a... | [
"facebook",
"actionscript",
"mobile"
] | 0 | 0 | 516 | 1 | 0 | 2011-06-02T03:53:50.500000 | 2011-06-02T05:10:13.860000 |
6,210,174 | 6,210,300 | How to use AntiXss in my Project? | I want to use AntiXss library function in my web application. I have a web application which contain asp.net pages with Jquery code in code behind. Whole asp.net pages run through Jquery js pages. I want to apply the encoding function to some fields, but the problem is how to apply and where to apply the encoding uncti... | The basic idea behind preventing XSS attacks is that all input data (from user or say external application) should be treated as untrusted/un-safe and hence must be either validated while accepting and/or encoded while reproducing in output (html, js etc). AFAIK, AntiXss is an server side library, so you cannot use it ... | How to use AntiXss in my Project? I want to use AntiXss library function in my web application. I have a web application which contain asp.net pages with Jquery code in code behind. Whole asp.net pages run through Jquery js pages. I want to apply the encoding function to some fields, but the problem is how to apply and... | TITLE:
How to use AntiXss in my Project?
QUESTION:
I want to use AntiXss library function in my web application. I have a web application which contain asp.net pages with Jquery code in code behind. Whole asp.net pages run through Jquery js pages. I want to apply the encoding function to some fields, but the problem i... | [
"c#",
"jquery",
"asp.net",
"antixsslibrary"
] | 5 | 6 | 11,468 | 1 | 0 | 2011-06-02T03:54:06.720000 | 2011-06-02T04:18:23.057000 |
6,210,182 | 6,210,194 | How to get char[] to work with std::map | EDIT after answered: < should be provided for std::map. For more information about best practice, go for James McNellis's answer. The code included in this question is poorly written. It is just because I am playing with SPOJ and the input data is strictly valid. The std::string approach is what I chose at first, but i... | You need to implement the < operator class id { public: char v [30]; bool operator<(const id &rhs) const{ return strcmp(v,rhs.v) < 0; } }; EDIT: As a side note your code is a very poor way of doing things. See some of the answers for an explanation why. | How to get char[] to work with std::map EDIT after answered: < should be provided for std::map. For more information about best practice, go for James McNellis's answer. The code included in this question is poorly written. It is just because I am playing with SPOJ and the input data is strictly valid. The std::string ... | TITLE:
How to get char[] to work with std::map
QUESTION:
EDIT after answered: < should be provided for std::map. For more information about best practice, go for James McNellis's answer. The code included in this question is poorly written. It is just because I am playing with SPOJ and the input data is strictly valid... | [
"c++",
"arrays",
"stl",
"dictionary"
] | 1 | 3 | 385 | 3 | 0 | 2011-06-02T03:54:52.367000 | 2011-06-02T03:57:16.443000 |
6,210,183 | 6,210,200 | Why is it bad to pause/abort threads? | My model of how threads work is that some ThreadManager gives each thread a turn. When it's a thread's turn, it gets to execute a few lines of code. To pause a thread, couldn't one just have the ThreadManager (momentarily) stop allowing that thread to have a turn? To abort a thread, couldn't the ThreadManager just neve... | Quote from MSDN about pausing threads: You have no way of knowing what code a thread is executing when you suspend it. If you suspend a thread while it holds locks during a security permission evaluation, other threads in the AppDomain might be blocked. If you suspend a thread while it is executing a class constructor,... | Why is it bad to pause/abort threads? My model of how threads work is that some ThreadManager gives each thread a turn. When it's a thread's turn, it gets to execute a few lines of code. To pause a thread, couldn't one just have the ThreadManager (momentarily) stop allowing that thread to have a turn? To abort a thread... | TITLE:
Why is it bad to pause/abort threads?
QUESTION:
My model of how threads work is that some ThreadManager gives each thread a turn. When it's a thread's turn, it gets to execute a few lines of code. To pause a thread, couldn't one just have the ThreadManager (momentarily) stop allowing that thread to have a turn?... | [
"c#",
".net",
"multithreading",
"thread-safety",
"parallel-processing"
] | 7 | 12 | 345 | 2 | 0 | 2011-06-02T03:54:56.850000 | 2011-06-02T03:58:14.577000 |
6,210,191 | 6,210,324 | mkmap crashing when trying to get distance from user location to pin on map | For some reason whenever i click on my pin the app crashes. there are no errors or warnings in my code. It only happens when i try to get the distance from userLocation to the pin. find my mistake? @implementation FirstViewController // Implement viewDidLoad to do additional setup after loading the view, typically from... | Just setting showsUserLocation to YES isn't sufficient. The map view needs to fetch that data. This is an asynchronous process and the data will be updated only after a while. The delegate is notified of this update via mapView:didUpdateUseLocation: method. You should implement that method and make a call to showPin on... | mkmap crashing when trying to get distance from user location to pin on map For some reason whenever i click on my pin the app crashes. there are no errors or warnings in my code. It only happens when i try to get the distance from userLocation to the pin. find my mistake? @implementation FirstViewController // Impleme... | TITLE:
mkmap crashing when trying to get distance from user location to pin on map
QUESTION:
For some reason whenever i click on my pin the app crashes. there are no errors or warnings in my code. It only happens when i try to get the distance from userLocation to the pin. find my mistake? @implementation FirstViewCon... | [
"iphone",
"distance",
"mkannotation",
"mkpinannotationview",
"userlocation"
] | 0 | 2 | 1,141 | 1 | 0 | 2011-06-02T03:56:28.163000 | 2011-06-02T04:21:32.073000 |
6,210,198 | 6,210,358 | Should one table reference every other table | I'm working on an application that routinely gathers information from a large number of websites and saves it to a mysql database with a table for each site. The idea is to create a sort of customizable news feed. stackoverflow_table(id, url, title, date) reddit_table(id, title, url, author, date) github_commit_table(i... | I've actually been working on a similar site. Not for other sites, but a kind of Facebook-like site for a niche community with newsfeeds from various sources. I've been pondering this question very heavily the past couple of weeks. One issue, probably not gamebreaking, but still an issue for me, is that since your fore... | Should one table reference every other table I'm working on an application that routinely gathers information from a large number of websites and saves it to a mysql database with a table for each site. The idea is to create a sort of customizable news feed. stackoverflow_table(id, url, title, date) reddit_table(id, ti... | TITLE:
Should one table reference every other table
QUESTION:
I'm working on an application that routinely gathers information from a large number of websites and saves it to a mysql database with a table for each site. The idea is to create a sort of customizable news feed. stackoverflow_table(id, url, title, date) r... | [
"mysql",
"database",
"database-design"
] | 1 | 1 | 282 | 3 | 0 | 2011-06-02T03:58:07.913000 | 2011-06-02T04:26:22.790000 |
6,210,203 | 6,210,395 | How do I use a style when putting a textView into code manually in Android? | I'm trying to make my game work in all layouts equally well, and in order to facilitate this, I'm using styles which are size dependent. The problem is, this breaks down with the function that I've coded directly, due to its high repetitiveness. So, what can I do to apply one of my styles to these text views that I'm c... | Try this: TableRow row=new TableRow(this); TableLayout tlayout=new TableLayout(this); text1.setText(R.string.name); text1.setTextAppearance(this, R.style.medText); row.addView(text1); text2.setText(R.string.level); text2.setTextAppearance(this, R.style.medText); row.addView(text2); text3.setText(R.string.score); text3.... | How do I use a style when putting a textView into code manually in Android? I'm trying to make my game work in all layouts equally well, and in order to facilitate this, I'm using styles which are size dependent. The problem is, this breaks down with the function that I've coded directly, due to its high repetitiveness... | TITLE:
How do I use a style when putting a textView into code manually in Android?
QUESTION:
I'm trying to make my game work in all layouts equally well, and in order to facilitate this, I'm using styles which are size dependent. The problem is, this breaks down with the function that I've coded directly, due to its h... | [
"android",
"android-xml",
"textview"
] | 0 | 1 | 771 | 2 | 0 | 2011-06-02T03:58:36.913000 | 2011-06-02T04:31:56.767000 |
6,210,205 | 6,210,212 | Is it okay to use functions to stay organized in C? | I'm a relatively new C programmer, and I've noticed that many conventions from other higher-level OOP languages don't exactly hold true on C. Is it okay to use short functions to have your coding stay organized (even though it will likely be called only once)? An example of this would be 10-15 lines in something like v... | I would have to say, not only is it OK, but it's generally encouraged. Just don't overly fragment the train of thought by creating myriads of tiny functions. Try to ensure that each function performs a single cohesive, well... function, with a clean interface (too many parameters can be a hint that the function is perf... | Is it okay to use functions to stay organized in C? I'm a relatively new C programmer, and I've noticed that many conventions from other higher-level OOP languages don't exactly hold true on C. Is it okay to use short functions to have your coding stay organized (even though it will likely be called only once)? An exam... | TITLE:
Is it okay to use functions to stay organized in C?
QUESTION:
I'm a relatively new C programmer, and I've noticed that many conventions from other higher-level OOP languages don't exactly hold true on C. Is it okay to use short functions to have your coding stay organized (even though it will likely be called o... | [
"c",
"conventions"
] | 15 | 21 | 546 | 8 | 0 | 2011-06-02T03:59:20.610000 | 2011-06-02T04:01:20.810000 |
6,210,222 | 6,229,822 | Executing rake tasks on an exploded war on tomcat without jruby being installed | My rails project is deployed to tomcat with the help of warbler, but I need to be able to run rake tasks on that server. | Stay tuned. I hope to have this capability in Warbler 1.4. Jake Goulding, a community member, has been doing some great work on this. Until then, a typical approach would be to ensure all your Rake and database scripts are present in the war file, then just unpack it somewhere, cd to WEB-INF inside the unpacked war, an... | Executing rake tasks on an exploded war on tomcat without jruby being installed My rails project is deployed to tomcat with the help of warbler, but I need to be able to run rake tasks on that server. | TITLE:
Executing rake tasks on an exploded war on tomcat without jruby being installed
QUESTION:
My rails project is deployed to tomcat with the help of warbler, but I need to be able to run rake tasks on that server.
ANSWER:
Stay tuned. I hope to have this capability in Warbler 1.4. Jake Goulding, a community member... | [
"jruby",
"warbler"
] | 2 | 3 | 897 | 1 | 0 | 2011-06-02T04:02:33.313000 | 2011-06-03T16:18:52.220000 |
6,210,231 | 6,210,343 | Why is parameter to string.indexOf method is an int in Java | I am wondering why the parameter to indexOf method an int, when the description says a char. public int indexOf(int ch) Returns the index within this string of the first occurrence of the specified **character** http://download.oracle.com/javase/1,5.0/docs/api/java/lang/String.html#indexOf%28int%29 Also, both of these ... | The real reason is that indexOf(int) expects a Unicode codepoint, not a 16-bit UTF-16 "character". Unicode code points are actually up to 21 bits in length. (The UTF-16 representation of a longer codepoint is actually 2 16-bit "character" values. These values are known as leading and trailing surrogates; D800 16 to DBF... | Why is parameter to string.indexOf method is an int in Java I am wondering why the parameter to indexOf method an int, when the description says a char. public int indexOf(int ch) Returns the index within this string of the first occurrence of the specified **character** http://download.oracle.com/javase/1,5.0/docs/api... | TITLE:
Why is parameter to string.indexOf method is an int in Java
QUESTION:
I am wondering why the parameter to indexOf method an int, when the description says a char. public int indexOf(int ch) Returns the index within this string of the first occurrence of the specified **character** http://download.oracle.com/jav... | [
"java",
"data-structures",
"primitive-types"
] | 13 | 18 | 3,919 | 4 | 0 | 2011-06-02T04:04:52.597000 | 2011-06-02T04:24:00.887000 |
6,210,233 | 6,210,287 | SQL server recovery mechanism | I have a service application in C# which queries data from one database and inserts it into another SQL database. Sometimes, the MSSQLSERVER service crashed for unknown reason and my application will crash as well. I want to do a SQL recovery mechanism that where I check to make sure the sqlconnection state is fine bef... | I think that the approach you chose is not very good. If your application is some kind of scheduled job, let it crash. No database - no work can be done. This is ok to crash in this case. Next time it runs and db is up it will do its thing. You can also implement retries. If your application is a windows service inside... | SQL server recovery mechanism I have a service application in C# which queries data from one database and inserts it into another SQL database. Sometimes, the MSSQLSERVER service crashed for unknown reason and my application will crash as well. I want to do a SQL recovery mechanism that where I check to make sure the s... | TITLE:
SQL server recovery mechanism
QUESTION:
I have a service application in C# which queries data from one database and inserts it into another SQL database. Sometimes, the MSSQLSERVER service crashed for unknown reason and my application will crash as well. I want to do a SQL recovery mechanism that where I check ... | [
"c#",
"sql",
"service"
] | 1 | 0 | 329 | 3 | 0 | 2011-06-02T04:05:05.560000 | 2011-06-02T04:15:31.220000 |
6,210,244 | 6,213,245 | ASP.NET Map GIS Control | I need a Map GIS control that I can use on my ASP.NET web pages. Basically the control should be able to read a shape file(which has 3-4 layers). Then it should let you zoom in and out and select certain objects. Based on the selections, I should be able to do some calculation. For instance, if I use a certain state, I... | Free open source: SharpMap Commercial. ESRI have a number of options. Their Silverlight control is free. They have ASP.Net controls but I suspect they will be >1K US $ | ASP.NET Map GIS Control I need a Map GIS control that I can use on my ASP.NET web pages. Basically the control should be able to read a shape file(which has 3-4 layers). Then it should let you zoom in and out and select certain objects. Based on the selections, I should be able to do some calculation. For instance, if ... | TITLE:
ASP.NET Map GIS Control
QUESTION:
I need a Map GIS control that I can use on my ASP.NET web pages. Basically the control should be able to read a shape file(which has 3-4 layers). Then it should let you zoom in and out and select certain objects. Based on the selections, I should be able to do some calculation.... | [
"asp.net",
"gis"
] | 1 | 0 | 3,801 | 1 | 0 | 2011-06-02T04:06:47.947000 | 2011-06-02T10:23:07.597000 |
6,210,250 | 6,211,982 | How to set the CCTransitionPageTurn orientation to vertical? | I used the code as follow to implement the effect of replace scenes: [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:0.5f scene:alterScene backwards:NO]]; Then, the effect that is reversed to appear as if the incoming scene is being turned from left over the outgoing scene. I want... | Modify cocos2d/CCActionPageTurn3D.m to exchange x for y. /* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2009 Sindesso Pty Ltd http://www.sindesso.com/ * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "So... | How to set the CCTransitionPageTurn orientation to vertical? I used the code as follow to implement the effect of replace scenes: [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:0.5f scene:alterScene backwards:NO]]; Then, the effect that is reversed to appear as if the incoming sc... | TITLE:
How to set the CCTransitionPageTurn orientation to vertical?
QUESTION:
I used the code as follow to implement the effect of replace scenes: [[CCDirector sharedDirector] replaceScene:[CCTransitionPageTurn transitionWithDuration:0.5f scene:alterScene backwards:NO]]; Then, the effect that is reversed to appear as ... | [
"iphone",
"cocos2d-iphone",
"scene"
] | 3 | 5 | 919 | 1 | 0 | 2011-06-02T04:08:35.163000 | 2011-06-02T08:05:47.010000 |
6,210,254 | 6,210,263 | Jquery $(this) node and its use | I am trying to understand some jquery code that uses a $(this) node. What is it used for and when can it be used? $("li").hover(border, noBorder); function border() { $(this).css("border", "1px solid black"); } | Please read jQuery's this:demystified by Remy Sharp There are really two main contexts of 'this' in jQuery. The first refers to a to a DOM element, and the second to a jQuery object. As a DOM Element $('a.newTarget').each(function () { // <- our anonymous callback // check the DOM attribute 'host' on this if (this.host... | Jquery $(this) node and its use I am trying to understand some jquery code that uses a $(this) node. What is it used for and when can it be used? $("li").hover(border, noBorder); function border() { $(this).css("border", "1px solid black"); } | TITLE:
Jquery $(this) node and its use
QUESTION:
I am trying to understand some jquery code that uses a $(this) node. What is it used for and when can it be used? $("li").hover(border, noBorder); function border() { $(this).css("border", "1px solid black"); }
ANSWER:
Please read jQuery's this:demystified by Remy Shar... | [
"jquery"
] | 0 | 5 | 1,439 | 4 | 0 | 2011-06-02T04:08:59.130000 | 2011-06-02T04:11:50.623000 |
6,210,256 | 6,278,411 | Trouble creating a dynamic jQuery selector | I am trying to create a dynamic selector and dump view the resulting object in the console log: console.log($('input:first[type=hidden][id$='+ temp +']').parent()); translation: get the parent of the first input which is hidden and where the id ends with 'temp' temp is a var that is passed into the function where this ... | (Stated above in an edit): OK - figured it out... I passed the value into from the page as a string instead of an int (encapsulated in quotes). not sure why that made the difference, but it did. thank you all for your quick reply and support!! Update, I have run into this problem in passing other values too, passing an... | Trouble creating a dynamic jQuery selector I am trying to create a dynamic selector and dump view the resulting object in the console log: console.log($('input:first[type=hidden][id$='+ temp +']').parent()); translation: get the parent of the first input which is hidden and where the id ends with 'temp' temp is a var t... | TITLE:
Trouble creating a dynamic jQuery selector
QUESTION:
I am trying to create a dynamic selector and dump view the resulting object in the console log: console.log($('input:first[type=hidden][id$='+ temp +']').parent()); translation: get the parent of the first input which is hidden and where the id ends with 'tem... | [
"jquery",
"jquery-selectors"
] | 0 | 0 | 381 | 1 | 0 | 2011-06-02T04:09:50.373000 | 2011-06-08T12:05:21.910000 |
6,210,259 | 6,210,331 | Access data from my table of sqlserver in asp.net | i am designing a project in.net 4.0 using mvc3. my table name "logindata" is stored in sql server 2008. i want to access rows of that table in my project model class. So please suggest me what connction string i should use and where i should specify table name to access data from that table.? | I highly suggest reading the LINQ to SQL tutorial by Scott Guthrie LINQ to SQL is a very efficient and simple method for retrieving database data and placing it into easily-accessible pre-configured, adjustable business objects. I think you will find it a good first step. Part 1: Introduction to LINQ to SQL Part 2: Def... | Access data from my table of sqlserver in asp.net i am designing a project in.net 4.0 using mvc3. my table name "logindata" is stored in sql server 2008. i want to access rows of that table in my project model class. So please suggest me what connction string i should use and where i should specify table name to access... | TITLE:
Access data from my table of sqlserver in asp.net
QUESTION:
i am designing a project in.net 4.0 using mvc3. my table name "logindata" is stored in sql server 2008. i want to access rows of that table in my project model class. So please suggest me what connction string i should use and where i should specify ta... | [
"asp.net",
"asp.net-mvc-3"
] | 0 | 2 | 280 | 1 | 0 | 2011-06-02T04:10:53.290000 | 2011-06-02T04:22:57.910000 |
6,210,260 | 6,210,271 | What is the correct SQL (MYSQL) for finding the value that occurs the most? | What is the correct SQL (MYSQL) for finding the value that occurs the most? Here's what I thought it might have been: SELECT TOP 1 `my_field` FROM `my_table` GROUP BY COUNT(`my_field`) ORDER BY DESC | To get the most commonly occuring value: SELECT `column` FROM `table` GROUP BY `column` ORDER BY count(`column`) DESC LIMIT 1 | What is the correct SQL (MYSQL) for finding the value that occurs the most? What is the correct SQL (MYSQL) for finding the value that occurs the most? Here's what I thought it might have been: SELECT TOP 1 `my_field` FROM `my_table` GROUP BY COUNT(`my_field`) ORDER BY DESC | TITLE:
What is the correct SQL (MYSQL) for finding the value that occurs the most?
QUESTION:
What is the correct SQL (MYSQL) for finding the value that occurs the most? Here's what I thought it might have been: SELECT TOP 1 `my_field` FROM `my_table` GROUP BY COUNT(`my_field`) ORDER BY DESC
ANSWER:
To get the most co... | [
"mysql",
"sql"
] | 1 | 2 | 544 | 1 | 0 | 2011-06-02T04:10:53.387000 | 2011-06-02T04:13:01.997000 |
6,210,262 | 6,210,393 | Which callback does ActiveRecord use to record timestamp? | I'm just wondering here whether any of you guys know when ActiveRecord use it's "magic" to record the timestamp (e.g. created_at, updated_at). What i mean when is, at which callback? (if AR use callback at all). I'm asking this because I want to create an auto-updating column (that record sequential number for each obj... | I don't know where AR does it, but the proper place for what you describe sounds like before_create | Which callback does ActiveRecord use to record timestamp? I'm just wondering here whether any of you guys know when ActiveRecord use it's "magic" to record the timestamp (e.g. created_at, updated_at). What i mean when is, at which callback? (if AR use callback at all). I'm asking this because I want to create an auto-u... | TITLE:
Which callback does ActiveRecord use to record timestamp?
QUESTION:
I'm just wondering here whether any of you guys know when ActiveRecord use it's "magic" to record the timestamp (e.g. created_at, updated_at). What i mean when is, at which callback? (if AR use callback at all). I'm asking this because I want t... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"activerecord"
] | 0 | 2 | 1,028 | 2 | 0 | 2011-06-02T04:11:47.580000 | 2011-06-02T04:31:48.017000 |
6,210,264 | 6,237,381 | Improving performance of drawing Tiled bitmaps in wpf | I'm looking for a way to improve the performance of some drawing I am doing. Currently it is a 32x32 grid of tiles that I am drawing. Using the following code to draw onto the drawing context for (int x = startX; x < endX; x++) { for (int y = startY; y < endY; y++) { dg.Children.Add( new ImageDrawing(_mapTiles[GameWorl... | I added DrawingGroup.Freeze() before drawing, and it seemed to help with the performance. | Improving performance of drawing Tiled bitmaps in wpf I'm looking for a way to improve the performance of some drawing I am doing. Currently it is a 32x32 grid of tiles that I am drawing. Using the following code to draw onto the drawing context for (int x = startX; x < endX; x++) { for (int y = startY; y < endY; y++) ... | TITLE:
Improving performance of drawing Tiled bitmaps in wpf
QUESTION:
I'm looking for a way to improve the performance of some drawing I am doing. Currently it is a 32x32 grid of tiles that I am drawing. Using the following code to draw onto the drawing context for (int x = startX; x < endX; x++) { for (int y = start... | [
"c#",
"wpf"
] | 2 | 1 | 1,768 | 3 | 0 | 2011-06-02T04:11:52.767000 | 2011-06-04T14:45:32.687000 |
6,210,266 | 6,210,317 | Display js array acquired via JSON to webpage | Sorry if causing troubles again =x With the help from you guys especially Scott Harwell, I managed to get my php array passed to js array with the following code: var horse_array =; However, now I encounter problem in displaying the content of array. I could not load it into my html tag with id="horse1_r". The followin... | If you want to return the contents of the Javascript object, you can return it to a string: $('#horse1_r').html(JSON.stringify(horse_array)); | Display js array acquired via JSON to webpage Sorry if causing troubles again =x With the help from you guys especially Scott Harwell, I managed to get my php array passed to js array with the following code: var horse_array =; However, now I encounter problem in displaying the content of array. I could not load it int... | TITLE:
Display js array acquired via JSON to webpage
QUESTION:
Sorry if causing troubles again =x With the help from you guys especially Scott Harwell, I managed to get my php array passed to js array with the following code: var horse_array =; However, now I encounter problem in displaying the content of array. I cou... | [
"jquery",
"html",
"arrays",
"json"
] | 0 | 1 | 391 | 3 | 0 | 2011-06-02T04:12:11.483000 | 2011-06-02T04:20:06.307000 |
6,210,270 | 6,210,471 | How to prevent access via URL to controller's method in Rails 3? | I would like add Javascript/jQuery code to my Rails 3 application that will get data from the server and update the page accordingly. I thought to use jQuery's $.get() method: $.get("/get_data_about_page?page=5", function(data) { alert("Returned data: [" + data + "]"); }); However, I don't want users to access get_data... | Realistically you can't stop someone from scraping it if they're determined... You could set a variable in the session when the main page is loaded and then protect the AJAX action so that it only responds if the session variable is set - this would prevent naive use of the URL but it's not foolproof. | How to prevent access via URL to controller's method in Rails 3? I would like add Javascript/jQuery code to my Rails 3 application that will get data from the server and update the page accordingly. I thought to use jQuery's $.get() method: $.get("/get_data_about_page?page=5", function(data) { alert("Returned data: [" ... | TITLE:
How to prevent access via URL to controller's method in Rails 3?
QUESTION:
I would like add Javascript/jQuery code to my Rails 3 application that will get data from the server and update the page accordingly. I thought to use jQuery's $.get() method: $.get("/get_data_about_page?page=5", function(data) { alert("... | [
"javascript",
"jquery",
"ruby-on-rails",
"ajax",
"ruby-on-rails-3"
] | 1 | 2 | 271 | 1 | 0 | 2011-06-02T04:12:51.017000 | 2011-06-02T04:42:01.300000 |
6,210,272 | 6,210,318 | How does a Git repository works with a develop and master branch? | I'm new to Git and this is really confusing. I wanted to start off developing a web application on Git and so far I've been dealing with troubles that have kept me behind. I've read this blog post on a successful branching model for Git. I was really interested in setting up something similar to this. It says that the ... | A branch is not a directory. It is a commit label that moves along with commits, like tag is a commit label that stays with a particular commit. You will not have anything "inside" the master branch, rather master and develop will both initially label the same commit. Create the develop branch like so: git branch devel... | How does a Git repository works with a develop and master branch? I'm new to Git and this is really confusing. I wanted to start off developing a web application on Git and so far I've been dealing with troubles that have kept me behind. I've read this blog post on a successful branching model for Git. I was really int... | TITLE:
How does a Git repository works with a develop and master branch?
QUESTION:
I'm new to Git and this is really confusing. I wanted to start off developing a web application on Git and so far I've been dealing with troubles that have kept me behind. I've read this blog post on a successful branching model for Git... | [
"git"
] | 26 | 34 | 30,882 | 2 | 0 | 2011-06-02T04:13:04.837000 | 2011-06-02T04:20:30.503000 |
6,210,276 | 6,210,342 | jQuery Tabs UI: change two different data attributes on tab change | I'm able to swap an image in a div on each tab change according to a data attribute in each tab's html. But I also want to change another div for the photographer's credit, and I'm not doing something right, even though it should be easy. jsfiddle here: http://jsfiddle.net/8muBm/56/ $("#tabs").tabs({ select: function($... | I think your $(this) is pointing to the div "headerwrapper" tag. Try: $("#tabs").tabs({ select: function($event, ui) { /* Extract the image from the active tab: */ var img = $(ui.panel).data("image");
/* Animate the header out, set the background css, then animate back in: */
$("#headerwrapper").animate({ opacity: 't... | jQuery Tabs UI: change two different data attributes on tab change I'm able to swap an image in a div on each tab change according to a data attribute in each tab's html. But I also want to change another div for the photographer's credit, and I'm not doing something right, even though it should be easy. jsfiddle here:... | TITLE:
jQuery Tabs UI: change two different data attributes on tab change
QUESTION:
I'm able to swap an image in a div on each tab change according to a data attribute in each tab's html. But I also want to change another div for the photographer's credit, and I'm not doing something right, even though it should be ea... | [
"jquery",
"jquery-ui-tabs"
] | 1 | 2 | 1,241 | 1 | 0 | 2011-06-02T04:13:41.320000 | 2011-06-02T04:23:56.457000 |
6,210,282 | 6,210,337 | how to make json web service in asp.net? | I m making web service for the first time. and i need to make that using json in c#. I m not getting how to code the methods that fetch data from database Any suggessions. | You can use the below code to return the JSON serialized string: [WebMethod(Description = "Your Description")] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string FunctionName() { // Return JSON data JavaScriptSerializer js = new JavaScriptSerializer(); string retJSON = js.Serialize(Object); return retJS... | how to make json web service in asp.net? I m making web service for the first time. and i need to make that using json in c#. I m not getting how to code the methods that fetch data from database Any suggessions. | TITLE:
how to make json web service in asp.net?
QUESTION:
I m making web service for the first time. and i need to make that using json in c#. I m not getting how to code the methods that fetch data from database Any suggessions.
ANSWER:
You can use the below code to return the JSON serialized string: [WebMethod(Desc... | [
"c#",
"web-services",
"json"
] | 5 | 13 | 20,837 | 3 | 0 | 2011-06-02T04:15:10.973000 | 2011-06-02T04:23:19.360000 |
6,210,286 | 6,210,345 | Threadpooling hangs the web page | I am generating 1000's of PDFs from crystal report. Generating PDF one by one(sequentially) takes time which degrades performance. To improve performance i am using ThreadPooling which is generating PDFs much faster way but when the PDF generation completes. My webpage controls dont fire events i.e i have a radio butto... | You should not rely on the thread pool in ASP.NET. There are a number of reasons for this. The main one is that ASP.NET can, and will, recycle the application pool servicing your page at any time, including between page requests, while your PDFs are generating. If that happens, your PDF generation will stop midway thro... | Threadpooling hangs the web page I am generating 1000's of PDFs from crystal report. Generating PDF one by one(sequentially) takes time which degrades performance. To improve performance i am using ThreadPooling which is generating PDFs much faster way but when the PDF generation completes. My webpage controls dont fir... | TITLE:
Threadpooling hangs the web page
QUESTION:
I am generating 1000's of PDFs from crystal report. Generating PDF one by one(sequentially) takes time which degrades performance. To improve performance i am using ThreadPooling which is generating PDFs much faster way but when the PDF generation completes. My webpage... | [
"c#",
"asp.net"
] | 0 | 1 | 70 | 1 | 0 | 2011-06-02T04:15:30.500000 | 2011-06-02T04:24:25.353000 |
6,210,301 | 6,210,783 | Custom View Scrolling issues Android | I've been designing an application that requires the use of a scrollbar on a custom view. The problem that I have run into is that my custom view's height will constantly change when new items are added by the user. I suspect that this isn't a very unusual problem, but to complicate things, I'm not actually adding new ... | Your layout doesn't work properly because the DeckEditCardView doesn't measure itself. You must override the View.onMeasure() method in the DeckEditCardView class and set measured size depending on view's content. In your layout xml file you must specify wrap_content as a height of the DeckEditCardView. | Custom View Scrolling issues Android I've been designing an application that requires the use of a scrollbar on a custom view. The problem that I have run into is that my custom view's height will constantly change when new items are added by the user. I suspect that this isn't a very unusual problem, but to complicate... | TITLE:
Custom View Scrolling issues Android
QUESTION:
I've been designing an application that requires the use of a scrollbar on a custom view. The problem that I have run into is that my custom view's height will constantly change when new items are added by the user. I suspect that this isn't a very unusual problem,... | [
"java",
"android",
"android-custom-view"
] | 1 | 1 | 1,711 | 1 | 0 | 2011-06-02T04:18:32.620000 | 2011-06-02T05:27:44.897000 |
6,210,305 | 6,210,316 | View contents of a dll | I am looking for a tool to view contents of a C# dll, preferably a free one..Net Reflector used to be free but not anymore. It is an awesome tool and you can easily see all code down to the line. PE Explorer is another one I looked at but the Disassembler in it does not seem to output C# code. If you know any other too... | Telerik just came out with one: http://www.telerik.com/products/decompiling.aspx They said that it will ALWAYS be free. They released it in response to.Net Reflector's change to a pay model. Right now it is in an open beta (free to download now) and it works great Edit: as of June 2014, "free" means you must use their ... | View contents of a dll I am looking for a tool to view contents of a C# dll, preferably a free one..Net Reflector used to be free but not anymore. It is an awesome tool and you can easily see all code down to the line. PE Explorer is another one I looked at but the Disassembler in it does not seem to output C# code. If... | TITLE:
View contents of a dll
QUESTION:
I am looking for a tool to view contents of a C# dll, preferably a free one..Net Reflector used to be free but not anymore. It is an awesome tool and you can easily see all code down to the line. PE Explorer is another one I looked at but the Disassembler in it does not seem to ... | [
"c#",
"dll",
"view"
] | 25 | 19 | 60,872 | 2 | 0 | 2011-06-02T04:18:54.493000 | 2011-06-02T04:19:54.743000 |
6,210,309 | 6,210,374 | filenotfound issues in eclipse on Mac OSX | Hi I have a java class which is working fine in windows but not in Mac OSX snow leopard. I am using Eclipse on both operating systems. On Mac OSX its throwing file not found exception. Basically I am trying to read a file using BufferedReader and FileReader and I put my file in \resources\ import java.io.BufferedReader... | Mac uses forward slashes: "resources/abc". (This will actually work on Windows as well. Only the command line interpreter requires backslashes.) | filenotfound issues in eclipse on Mac OSX Hi I have a java class which is working fine in windows but not in Mac OSX snow leopard. I am using Eclipse on both operating systems. On Mac OSX its throwing file not found exception. Basically I am trying to read a file using BufferedReader and FileReader and I put my file in... | TITLE:
filenotfound issues in eclipse on Mac OSX
QUESTION:
Hi I have a java class which is working fine in windows but not in Mac OSX snow leopard. I am using Eclipse on both operating systems. On Mac OSX its throwing file not found exception. Basically I am trying to read a file using BufferedReader and FileReader an... | [
"eclipse",
"macos",
"filenotfoundexception"
] | 0 | 1 | 2,796 | 1 | 0 | 2011-06-02T04:19:28.380000 | 2011-06-02T04:28:52.293000 |
6,210,320 | 6,221,719 | Apache 2.2 mod_rewrite help | I am trying to get Apache 2.2 mod_rewrite to get clean urls. I have links such as Page Name Page Name2 Page Name3 and url comes out to be http://example.com/user/index.php?view=pageName I would like to clean the url in the address bar it to this http://example.com/user/pageName Edit: This is what's in my httpd.conf if ... | Fixed: Had to change HTML URL style to be used as such Page Name Then in.htaccess RewriteEngine On RewriteOptions Inherit ReWriteBase /user/ RewriteRule ^([a-zA-Z0-9]+)/?$ index.php?view=$1 [QSA,L] Also had to disable mod_cache.so from apache's httpd.conf as it interfere with rewrite if there are any caches left behind... | Apache 2.2 mod_rewrite help I am trying to get Apache 2.2 mod_rewrite to get clean urls. I have links such as Page Name Page Name2 Page Name3 and url comes out to be http://example.com/user/index.php?view=pageName I would like to clean the url in the address bar it to this http://example.com/user/pageName Edit: This is... | TITLE:
Apache 2.2 mod_rewrite help
QUESTION:
I am trying to get Apache 2.2 mod_rewrite to get clean urls. I have links such as Page Name Page Name2 Page Name3 and url comes out to be http://example.com/user/index.php?view=pageName I would like to clean the url in the address bar it to this http://example.com/user/page... | [
"php",
"apache",
"mod-rewrite",
"clean-urls"
] | 0 | 0 | 744 | 3 | 0 | 2011-06-02T04:20:41.200000 | 2011-06-03T00:05:17.663000 |
6,210,321 | 6,210,569 | Question on "smart" replacing in mathematica | How do I tell mathematica to do this replacement smartly? (or how do I get smarter at telling mathematica to do what i want) expr = b + c d + ec + 2 a; expr /. a + b:> 1
Out = 2 a + b + c d + ec I expect the answer to be a + cd + ec + 1. And before someone suggests, I don't want to do a:> 1 - b, because for aesthetic ... | You can use a customised version of FullSimplify by supplying your own transformations to FullSimplify and let it figure out the details: In[1]:= MySimplify[expr_,equivs_]:= FullSimplify[expr, TransformationFunctions -> Prepend[ Function[x,x-#]&/@Flatten@Map[{#,-#}&,equivs/.Equal->Subtract], Automatic ] ] In[2]:= MySim... | Question on "smart" replacing in mathematica How do I tell mathematica to do this replacement smartly? (or how do I get smarter at telling mathematica to do what i want) expr = b + c d + ec + 2 a; expr /. a + b:> 1
Out = 2 a + b + c d + ec I expect the answer to be a + cd + ec + 1. And before someone suggests, I don't... | TITLE:
Question on "smart" replacing in mathematica
QUESTION:
How do I tell mathematica to do this replacement smartly? (or how do I get smarter at telling mathematica to do what i want) expr = b + c d + ec + 2 a; expr /. a + b:> 1
Out = 2 a + b + c d + ec I expect the answer to be a + cd + ec + 1. And before someone... | [
"wolfram-mathematica"
] | 9 | 19 | 3,636 | 2 | 0 | 2011-06-02T04:20:49.810000 | 2011-06-02T04:54:40.077000 |
6,210,326 | 6,211,314 | What is a .dbml.layout file for? | What is a.dbml.layout file for? Is it important? Or, maybe, it just stores the placing of blocks in the designer and can be deleted? I've got this question because I want to edit the.dbml file manually and need to know if I must edit.dbml.layout accordingly or can just delete it to get it recreated automatically. Lucki... | The layout file is just to show you how your model classes are laid out in the designer. I don't believe it has any information about the actual schema etc. If your experimentation shows that it's being regenerated for you and you don't mind losing any custom layouts you've created to make the diagram simpler to unders... | What is a .dbml.layout file for? What is a.dbml.layout file for? Is it important? Or, maybe, it just stores the placing of blocks in the designer and can be deleted? I've got this question because I want to edit the.dbml file manually and need to know if I must edit.dbml.layout accordingly or can just delete it to get ... | TITLE:
What is a .dbml.layout file for?
QUESTION:
What is a.dbml.layout file for? Is it important? Or, maybe, it just stores the placing of blocks in the designer and can be deleted? I've got this question because I want to edit the.dbml file manually and need to know if I must edit.dbml.layout accordingly or can just... | [
".net",
"visual-studio",
"database-design",
"linq-to-sql"
] | 5 | 6 | 3,604 | 2 | 0 | 2011-06-02T04:21:52.200000 | 2011-06-02T06:43:19.923000 |
6,210,333 | 6,210,377 | mysql return multiple results with group by | Please note this is regarding a homework problem, the homework is done and works to the spec, but it's slow so I'm trying to lessen how many SQL calls I make. And I'm still learning my SQL-fu. My table looks like: Ticker |Name |Industry A |Agilent Technologies |Information Technology AA |Alcoa Inc |Materials AAPL |Appl... | Unfortunately, you are probably doing it the best way if you need to have separate result sets for each industry. However, if you want to do a little manipulation in your code, you could return the entire table ordered by the industry then the ticker. Then in your code you could read until the industry changed and then... | mysql return multiple results with group by Please note this is regarding a homework problem, the homework is done and works to the spec, but it's slow so I'm trying to lessen how many SQL calls I make. And I'm still learning my SQL-fu. My table looks like: Ticker |Name |Industry A |Agilent Technologies |Information Te... | TITLE:
mysql return multiple results with group by
QUESTION:
Please note this is regarding a homework problem, the homework is done and works to the spec, but it's slow so I'm trying to lessen how many SQL calls I make. And I'm still learning my SQL-fu. My table looks like: Ticker |Name |Industry A |Agilent Technologi... | [
"mysql"
] | 2 | 1 | 2,199 | 2 | 0 | 2011-06-02T04:22:59.687000 | 2011-06-02T04:29:39.420000 |
6,210,336 | 6,215,105 | Dynamics CRM: Scheduling workflows | In my CRM I've applications which should be checked and processed by a workflow once a minute. I was wondering if there anyway to automate this stuff using some sort of cron task or scheduling. I'm relatively new to CRM. What should I do to make the stuff above, using standard CRM tools, or third party plugins? Sultan. | CRM doesn't have a good way of handling this. Here are the options generally available inside CRM: Create a workflow that runs, checks what you need it to do, waits for a period of time and calls itself recursively. If the interval you needed to check at was longer than a minute, this might work, however, CRM has loop ... | Dynamics CRM: Scheduling workflows In my CRM I've applications which should be checked and processed by a workflow once a minute. I was wondering if there anyway to automate this stuff using some sort of cron task or scheduling. I'm relatively new to CRM. What should I do to make the stuff above, using standard CRM too... | TITLE:
Dynamics CRM: Scheduling workflows
QUESTION:
In my CRM I've applications which should be checked and processed by a workflow once a minute. I was wondering if there anyway to automate this stuff using some sort of cron task or scheduling. I'm relatively new to CRM. What should I do to make the stuff above, usin... | [
"cron",
"dynamics-crm",
"scheduling"
] | 2 | 5 | 1,279 | 1 | 0 | 2011-06-02T04:23:19.360000 | 2011-06-02T13:23:12.157000 |
6,210,352 | 6,210,362 | problem with declaring variable in php? | i have a variables like $srange0, $srange1, $srange2 $srange3. i am using to declare some value to each value using for loop. for($i=0;$i<=3;$i++){ $srange.$i = $i; } but its not working? is there any alternative solution for this | for($i=0;$i<=3;$i++){ $var = 'srange'.$i; $$var = $i; } But, whenever I see variables like that, I'd use an array instead. | problem with declaring variable in php? i have a variables like $srange0, $srange1, $srange2 $srange3. i am using to declare some value to each value using for loop. for($i=0;$i<=3;$i++){ $srange.$i = $i; } but its not working? is there any alternative solution for this | TITLE:
problem with declaring variable in php?
QUESTION:
i have a variables like $srange0, $srange1, $srange2 $srange3. i am using to declare some value to each value using for loop. for($i=0;$i<=3;$i++){ $srange.$i = $i; } but its not working? is there any alternative solution for this
ANSWER:
for($i=0;$i<=3;$i++){ ... | [
"php",
"variables",
"global-variables"
] | 2 | 6 | 73 | 4 | 0 | 2011-06-02T04:25:59.937000 | 2011-06-02T04:27:27.647000 |
6,210,353 | 6,210,542 | NSFetchedResultsController and multiple relationships | I have a UITableView which displays historical data. This is broken up into one section per day. Each day can have multiple things happening (eg. during a certain day I slept, ate some food, did some exercise, etc). Each "thing" is represented by a different entity. So going off the previous example, I have Day, Sleep,... | This is just a guess, but I think the following would work: EDIT - I have just verified with a simple case, that this does work Have all of your event entities (Sleep, Food, Exercise) inherit from a base class entity (you could call it something like "Event") and then use the following when you are setting up your NSFe... | NSFetchedResultsController and multiple relationships I have a UITableView which displays historical data. This is broken up into one section per day. Each day can have multiple things happening (eg. during a certain day I slept, ate some food, did some exercise, etc). Each "thing" is represented by a different entity.... | TITLE:
NSFetchedResultsController and multiple relationships
QUESTION:
I have a UITableView which displays historical data. This is broken up into one section per day. Each day can have multiple things happening (eg. during a certain day I slept, ate some food, did some exercise, etc). Each "thing" is represented by a... | [
"iphone",
"objective-c",
"nsfetchedresultscontroller"
] | 0 | 0 | 189 | 1 | 0 | 2011-06-02T04:26:00.433000 | 2011-06-02T04:51:34.667000 |
6,210,359 | 6,210,428 | Certain text not showing on my webpage, jQuery script to blame? | I'm trying to create a nice simple checkout form with a jquery script I got on the web and I seem to be facing a weird problem that could be due to a couple of things and I'm clueless as to how to fix this. Maybe you can solve this... Below is my website in development: [link removed] If you look at the form (the light... | If you dig into the HTML, you can see the z-index is -30 Vanille-café and the below it has a z-index of -60. I'm having a looking into the JS to see if I can work out where the z-indexes are being changed, maybe you know? | Certain text not showing on my webpage, jQuery script to blame? I'm trying to create a nice simple checkout form with a jquery script I got on the web and I seem to be facing a weird problem that could be due to a couple of things and I'm clueless as to how to fix this. Maybe you can solve this... Below is my website i... | TITLE:
Certain text not showing on my webpage, jQuery script to blame?
QUESTION:
I'm trying to create a nice simple checkout form with a jquery script I got on the web and I seem to be facing a weird problem that could be due to a couple of things and I'm clueless as to how to fix this. Maybe you can solve this... Bel... | [
"jquery",
"html"
] | 0 | 1 | 78 | 3 | 0 | 2011-06-02T04:26:57.080000 | 2011-06-02T04:36:51.090000 |
6,210,381 | 6,260,174 | Factory girl problems accessing certain attributes | I have a user model and an operator model which belongs to user. I created some factories that associate them(in my feature, a user account is created when an operator signs up) so I made this step: def create_operator_with_user(operator_name) user = Factory(:user) puts "MY PASS: #{user.password}" operator = Factory(:o... | It seems that I was trying to access a protected attribute of authlogic, that's why I couldn't access the password even if I tried getting the user object again. My solution was to use a global variable instead (@user) so I could access it in other steps. | Factory girl problems accessing certain attributes I have a user model and an operator model which belongs to user. I created some factories that associate them(in my feature, a user account is created when an operator signs up) so I made this step: def create_operator_with_user(operator_name) user = Factory(:user) put... | TITLE:
Factory girl problems accessing certain attributes
QUESTION:
I have a user model and an operator model which belongs to user. I created some factories that associate them(in my feature, a user account is created when an operator signs up) so I made this step: def create_operator_with_user(operator_name) user = ... | [
"ruby-on-rails",
"authentication",
"authlogic",
"factory-bot"
] | 0 | 0 | 397 | 2 | 0 | 2011-06-02T04:30:02.680000 | 2011-06-07T02:50:00.150000 |
6,210,389 | 6,210,721 | Android OpenGL Coordinates Question | I am trying to understand the basic concepts around the co-ordinates system in OpenGL so I have been making a test application from guides online. Presently I have drawn a simple Square to the screen, using simple Co-ordinates of: -1.0f, 1.0f, 0.0f, // 0, Top Left -1.0f, -1.0f, 0.0f, // 1, Bottom Left 1.0f, -1.0f, 0.0f... | I'll try to answer the best I can. There wouldn't be any reason to change the width to height ratio or 45 degree angle. Doing it the way you have it keeps the things from being stretched horizontally or vertically in an unusual way. Because you are using a perspective view, you have 3D space with depth as apposed to an... | Android OpenGL Coordinates Question I am trying to understand the basic concepts around the co-ordinates system in OpenGL so I have been making a test application from guides online. Presently I have drawn a simple Square to the screen, using simple Co-ordinates of: -1.0f, 1.0f, 0.0f, // 0, Top Left -1.0f, -1.0f, 0.0f,... | TITLE:
Android OpenGL Coordinates Question
QUESTION:
I am trying to understand the basic concepts around the co-ordinates system in OpenGL so I have been making a test application from guides online. Presently I have drawn a simple Square to the screen, using simple Co-ordinates of: -1.0f, 1.0f, 0.0f, // 0, Top Left -... | [
"android",
"opengl-es"
] | 1 | 2 | 1,076 | 1 | 0 | 2011-06-02T04:31:26.813000 | 2011-06-02T05:17:46.337000 |
6,210,390 | 6,210,445 | How to set selectedIndex of select element using display text? | How to set selectedIndex of select element using display text as reference? Example: Chicken Crocodile Monkey Is there any other way to do this without a loop? You know, I'm thinking of a built-in JavaScript code or something. Also, I don't use jQuery... | Try this: function SelectAnimal() { var sel = document.getElementById('Animals'); var val = document.getElementById('AnimalToFind').value; for(var i = 0, j = sel.options.length; i < j; ++i) { if(sel.options[i].innerHTML === val) { sel.selectedIndex = i; break; } } } | How to set selectedIndex of select element using display text? How to set selectedIndex of select element using display text as reference? Example: Chicken Crocodile Monkey Is there any other way to do this without a loop? You know, I'm thinking of a built-in JavaScript code or something. Also, I don't use jQuery... | TITLE:
How to set selectedIndex of select element using display text?
QUESTION:
How to set selectedIndex of select element using display text as reference? Example: Chicken Crocodile Monkey Is there any other way to do this without a loop? You know, I'm thinking of a built-in JavaScript code or something. Also, I don'... | [
"javascript",
"selectedindex"
] | 46 | 64 | 244,087 | 7 | 0 | 2011-06-02T04:31:29.313000 | 2011-06-02T04:39:30.933000 |
6,210,399 | 6,210,574 | how do i build gcc on a mac? | I'd like to build the latest version of gcc on a mac. I have the latest xcode but I'm looking for some of the c++0x features that are in more recent versions (the lambda functions, etc). Are there any good step-by-step tutorials on doing this? | One option is to install MacPorts and install the gcc46 package: sudo port install gcc46 Another option is to download the source code and build it as follows: tar xzvf gcc-4.6.0.tar.gz cd gcc-4.6.0./configure make Note that GCC 4.6.0 requires as prerequisites GMP 4.2+, MPFR 2.3.1+, and MPC 0.8.0+. If./configure fails,... | how do i build gcc on a mac? I'd like to build the latest version of gcc on a mac. I have the latest xcode but I'm looking for some of the c++0x features that are in more recent versions (the lambda functions, etc). Are there any good step-by-step tutorials on doing this? | TITLE:
how do i build gcc on a mac?
QUESTION:
I'd like to build the latest version of gcc on a mac. I have the latest xcode but I'm looking for some of the c++0x features that are in more recent versions (the lambda functions, etc). Are there any good step-by-step tutorials on doing this?
ANSWER:
One option is to ins... | [
"c++",
"macos",
"gcc",
"c++11"
] | 13 | 5 | 10,244 | 4 | 0 | 2011-06-02T04:32:29.983000 | 2011-06-02T04:55:10.270000 |
6,210,407 | 6,210,429 | Defining for loop iterator before the for loop? | Recently I'd been criticized for structuring my for loops like so: var i:MovieClip; for each(i in array) { // be awesome } Or, var i:uint = 0; for(i; i<10; i++) { // be more awesome } This reads better for me personally, yet I'm being attacked for it. Is there any difference? | Old Answer Yes: The way you're doing it, the variable lives on after the loop ends. Making sure the variable doesn't exist outside of the scope of the loop ensures that you never accidentally refer to it outside the loop. Update: At least that's how most languages do it. However, in ActionScript the for loop variable i... | Defining for loop iterator before the for loop? Recently I'd been criticized for structuring my for loops like so: var i:MovieClip; for each(i in array) { // be awesome } Or, var i:uint = 0; for(i; i<10; i++) { // be more awesome } This reads better for me personally, yet I'm being attacked for it. Is there any differe... | TITLE:
Defining for loop iterator before the for loop?
QUESTION:
Recently I'd been criticized for structuring my for loops like so: var i:MovieClip; for each(i in array) { // be awesome } Or, var i:uint = 0; for(i; i<10; i++) { // be more awesome } This reads better for me personally, yet I'm being attacked for it. Is... | [
"actionscript-3",
"variables",
"loops"
] | 0 | 5 | 126 | 2 | 0 | 2011-06-02T04:33:54.313000 | 2011-06-02T04:36:57.037000 |
6,210,413 | 6,210,540 | Can anyone suggest a good papers or articles on the architecture of graphics drivers? | I'm wondering about how exactly OpenGL and DirectX drivers work. From what I know, they basically take in calls in their various APIs, and output a stream of bytecode instructions that head off to the GPU to be executed. I know GPU chipmakers are extremely secretive about the details of their specifications. Are there ... | AMD has released some specification documents that you may find interesting. The Gallium3D folks are building on top of that to produce open drivers for recent Radeon cards. You can check out the source. | Can anyone suggest a good papers or articles on the architecture of graphics drivers? I'm wondering about how exactly OpenGL and DirectX drivers work. From what I know, they basically take in calls in their various APIs, and output a stream of bytecode instructions that head off to the GPU to be executed. I know GPU ch... | TITLE:
Can anyone suggest a good papers or articles on the architecture of graphics drivers?
QUESTION:
I'm wondering about how exactly OpenGL and DirectX drivers work. From what I know, they basically take in calls in their various APIs, and output a stream of bytecode instructions that head off to the GPU to be execu... | [
"opengl",
"graphics",
"directx",
"3d"
] | 1 | 1 | 133 | 1 | 0 | 2011-06-02T04:34:09.047000 | 2011-06-02T04:51:17.610000 |
6,210,417 | 6,211,638 | Date as variable name | I'd like to use the date as a variable name. I understand I'll need to append a character to the front and also that it's not a good way to store data (it's purely for report aesthetics). I've tried %eval() but can't solve it. %let var_date = '_'||today(); data date; %eval(&var_date) =.; run; I'd like the variable name... | This does what I'm looking for. Is this maintainable? data date1; date = put(today(),date9.); text = ''; do i = 1 to 5; output; end; run; proc transpose data = date1 out = date2; by i; id date; var text; run; | Date as variable name I'd like to use the date as a variable name. I understand I'll need to append a character to the front and also that it's not a good way to store data (it's purely for report aesthetics). I've tried %eval() but can't solve it. %let var_date = '_'||today(); data date; %eval(&var_date) =.; run; I'd ... | TITLE:
Date as variable name
QUESTION:
I'd like to use the date as a variable name. I understand I'll need to append a character to the front and also that it's not a good way to store data (it's purely for report aesthetics). I've tried %eval() but can't solve it. %let var_date = '_'||today(); data date; %eval(&var_d... | [
"variables",
"date",
"sas"
] | 1 | 0 | 2,102 | 3 | 0 | 2011-06-02T04:34:51.510000 | 2011-06-02T07:21:51.650000 |
6,210,420 | 6,210,468 | Checking for duplicate data in SQL Server | Please don't ask me why but there is a lot of duplicate data where every field is duplicated. For example alex, 1 alex, 1 liza, 32 hary, 34 I will need to eliminate from this table one of the alex, 1 rows I know this algorithm will be very ineffecient, but it does not matter. I will need to remove duplicate data. What ... | Method A. You can get a deduped version of your data using SELECT field1, field2,... INTO Deduped FROM Source GROUP BY field1, field2,... for example, for your sample data, SELECT name, number FROM Source GROUP BY name, number yields alex 1 hary 34 liza 32 then simply delete the old table, and rename the new one. Of co... | Checking for duplicate data in SQL Server Please don't ask me why but there is a lot of duplicate data where every field is duplicated. For example alex, 1 alex, 1 liza, 32 hary, 34 I will need to eliminate from this table one of the alex, 1 rows I know this algorithm will be very ineffecient, but it does not matter. I... | TITLE:
Checking for duplicate data in SQL Server
QUESTION:
Please don't ask me why but there is a lot of duplicate data where every field is duplicated. For example alex, 1 alex, 1 liza, 32 hary, 34 I will need to eliminate from this table one of the alex, 1 rows I know this algorithm will be very ineffecient, but it ... | [
"sql",
"sql-server",
"sql-server-2008"
] | 4 | 2 | 1,083 | 5 | 0 | 2011-06-02T04:35:09.057000 | 2011-06-02T04:41:53.820000 |
6,210,433 | 6,210,583 | How to move directories using jdk7 | Using jdk7, I am trying to use the java.nio.file.Files class to move an empty directory, let's say Bar, into another empty directory, let's say Foo Path source = Paths.get("Bar"); Path target = Paths.get("Foo"); try { Files.move( source, target, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printSta... | I didn't realize jdk7 java.nio.file.Files is a necessity, so here is the edited solution. Please see if it works coz I have never used the new Files class before. Path source = Paths.get("Bar"); Path target = Paths.get("Foo", "Bar"); try { Files.move( source, target, StandardCopyOption.REPLACE_EXISTING); } catch (IOExc... | How to move directories using jdk7 Using jdk7, I am trying to use the java.nio.file.Files class to move an empty directory, let's say Bar, into another empty directory, let's say Foo Path source = Paths.get("Bar"); Path target = Paths.get("Foo"); try { Files.move( source, target, StandardCopyOption.REPLACE_EXISTING); }... | TITLE:
How to move directories using jdk7
QUESTION:
Using jdk7, I am trying to use the java.nio.file.Files class to move an empty directory, let's say Bar, into another empty directory, let's say Foo Path source = Paths.get("Bar"); Path target = Paths.get("Foo"); try { Files.move( source, target, StandardCopyOption.RE... | [
"java",
"nio",
"java-7",
"java.nio.file"
] | 4 | 4 | 3,489 | 3 | 0 | 2011-06-02T04:37:36.833000 | 2011-06-02T04:56:17.780000 |
6,210,439 | 6,223,215 | Print Microsoft Office and PDF files in Java | I am looking for APIs for Java that can print Microsoft Office and PDF files. I would also like to provide print specifications, even if there is no software for opening these files on the system. Commercial libraries are fine. Can you recommend any? | For Printing of PDF here is the Best solution for free!!Use the PDFBox.. import java.awt.print.PrinterJob;
import javax.print.PrintService; import javax.print.PrintServiceLookup;
import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.util.PDFTextStripper;
public class PrintPDF {
private static final ... | Print Microsoft Office and PDF files in Java I am looking for APIs for Java that can print Microsoft Office and PDF files. I would also like to provide print specifications, even if there is no software for opening these files on the system. Commercial libraries are fine. Can you recommend any? | TITLE:
Print Microsoft Office and PDF files in Java
QUESTION:
I am looking for APIs for Java that can print Microsoft Office and PDF files. I would also like to provide print specifications, even if there is no software for opening these files on the system. Commercial libraries are fine. Can you recommend any?
ANSWE... | [
"java",
"api",
"pdf",
"printing",
"ms-office"
] | 5 | 4 | 5,442 | 5 | 0 | 2011-06-02T04:38:29.980000 | 2011-06-03T05:12:13.677000 |
6,210,442 | 6,210,503 | Is there a way to securely delete files on aws? | We store some sensitive stuff on S3 and on our instance filesystems on AWS. Is there a way to securely wipe it? | The short answer is no, there is no wipe utility. If you delete the file permanently, the file is gone and it cannot be recovered (unless you have snapshots or other items that might keep the file stored). However, there is not a way to wipe the disk. Don't forget, though, that AWS uses server virtualization so that yo... | Is there a way to securely delete files on aws? We store some sensitive stuff on S3 and on our instance filesystems on AWS. Is there a way to securely wipe it? | TITLE:
Is there a way to securely delete files on aws?
QUESTION:
We store some sensitive stuff on S3 and on our instance filesystems on AWS. Is there a way to securely wipe it?
ANSWER:
The short answer is no, there is no wipe utility. If you delete the file permanently, the file is gone and it cannot be recovered (un... | [
"amazon-web-services"
] | 11 | 14 | 16,483 | 1 | 0 | 2011-06-02T04:39:06.277000 | 2011-06-02T04:46:06.290000 |
6,210,448 | 6,211,006 | CEdit Text Retrieval in mfc | I am using CEdit with the property of Multiline.My objective is to retrieve the individual line and place it in my CStringArray. While retrieving the line using GetLine, I have to know the string length of that line. How to get this? I tried the function GetLineLength() but that will return the size of the entire line ... | But you need to know the length of the whole line, don't you? I would not define the buffer as an array of TCHARs, but as a CString, then do GetBuffer() on it. Check the example in CEdit::GetLineCount It seems to do more or less what you need. Edit I've just written the following test, and it works perfectly for me: in... | CEdit Text Retrieval in mfc I am using CEdit with the property of Multiline.My objective is to retrieve the individual line and place it in my CStringArray. While retrieving the line using GetLine, I have to know the string length of that line. How to get this? I tried the function GetLineLength() but that will return ... | TITLE:
CEdit Text Retrieval in mfc
QUESTION:
I am using CEdit with the property of Multiline.My objective is to retrieve the individual line and place it in my CStringArray. While retrieving the line using GetLine, I have to know the string length of that line. How to get this? I tried the function GetLineLength() but... | [
"mfc",
"cstring",
"cedit"
] | 1 | 1 | 2,546 | 1 | 0 | 2011-06-02T04:39:33.523000 | 2011-06-02T06:00:39.920000 |
6,210,449 | 6,210,518 | Library providing various hash algorithms (MD5, SHA1, SHA256, etc) in Java? | Is there a simple library out there for Java in a Maven repository that will give me simple, one-liner hash methods for the popular hash functions such as MD5, SHA1, SHA256, and SHA512? I'd really hate to have to reinvent the wheel to do this. | The DigestUtils class of Apache Commons Codec is suitable for the purpose of simplifying the use of the MessageDigest class, which appears to be what you are attempting to use in the first place. | Library providing various hash algorithms (MD5, SHA1, SHA256, etc) in Java? Is there a simple library out there for Java in a Maven repository that will give me simple, one-liner hash methods for the popular hash functions such as MD5, SHA1, SHA256, and SHA512? I'd really hate to have to reinvent the wheel to do this. | TITLE:
Library providing various hash algorithms (MD5, SHA1, SHA256, etc) in Java?
QUESTION:
Is there a simple library out there for Java in a Maven repository that will give me simple, one-liner hash methods for the popular hash functions such as MD5, SHA1, SHA256, and SHA512? I'd really hate to have to reinvent the ... | [
"java",
"md5",
"sha1",
"sha256",
"sha512"
] | 11 | 14 | 20,637 | 2 | 0 | 2011-06-02T04:39:44.537000 | 2011-06-02T04:47:52.467000 |
6,210,457 | 6,210,579 | How to share html component amount different page | In ASP.NET, I have a master page, and five other pages which are under master page. In all five pages, I need to implement a button, after clicking it, will generate different download results. My original implementation is, in all five page, will all have a "Button", so in code behind will have corresponding event met... | Yes you can, on master page you can have a Download Button and on it click check the URL, which will help you to identify the request has come from which page. Then you can write code on the basis of current page being displayed. | How to share html component amount different page In ASP.NET, I have a master page, and five other pages which are under master page. In all five pages, I need to implement a button, after clicking it, will generate different download results. My original implementation is, in all five page, will all have a "Button", s... | TITLE:
How to share html component amount different page
QUESTION:
In ASP.NET, I have a master page, and five other pages which are under master page. In all five pages, I need to implement a button, after clicking it, will generate different download results. My original implementation is, in all five page, will all ... | [
"c#",
"asp.net",
"code-behind"
] | 1 | 2 | 100 | 3 | 0 | 2011-06-02T04:40:47.973000 | 2011-06-02T04:55:57.160000 |
6,210,474 | 6,210,511 | NSArray becoming invalid after assignment | This is a strange problem, but two of my NSArrays are becoming invalid right after assignment. I went into debug and verified this during assignment. The screenshot shows it all. I must be missing a silly error somewhere - can someone please help! Link to Screenshot Thank You! | You need to send the -retain message to the array on assignment, like this: ivar = [[NSArray arrayWithObjects:@"a", @"b", @"c", nil] retain]; The reason why they are going out of scope is because -arrayWithObjects: returns an autoreleased object. It is for this reason that you must send it the -retain message. Also, do... | NSArray becoming invalid after assignment This is a strange problem, but two of my NSArrays are becoming invalid right after assignment. I went into debug and verified this during assignment. The screenshot shows it all. I must be missing a silly error somewhere - can someone please help! Link to Screenshot Thank You! | TITLE:
NSArray becoming invalid after assignment
QUESTION:
This is a strange problem, but two of my NSArrays are becoming invalid right after assignment. I went into debug and verified this during assignment. The screenshot shows it all. I must be missing a silly error somewhere - can someone please help! Link to Scre... | [
"objective-c",
"memory-management",
"nsarray"
] | 0 | 2 | 133 | 2 | 0 | 2011-06-02T04:42:36.207000 | 2011-06-02T04:47:17.357000 |
6,210,482 | 6,210,654 | How to manage memory/usage of a NSMutableArray of NSMutableArrays | I am currently trying to write a class to create faux grid system to keep track of a NSMutableArray of game entities using a NSMutableArray of NSMutableArrays. Given my limited experience with Objective-C programming, I am unsure of how certain things work. Here is the init method: #define MAX_BALL_ROWCOUNT 6 #define M... | When the dealloc of a NSArray or NSMutableArray is called, all its contents gets a release message. So when you release ballList, if there there is no other owner (I guess in this case there is none) then its dealloc is called and you don't need to release the other arrays here. Your loop traversal is fine. Though for ... | How to manage memory/usage of a NSMutableArray of NSMutableArrays I am currently trying to write a class to create faux grid system to keep track of a NSMutableArray of game entities using a NSMutableArray of NSMutableArrays. Given my limited experience with Objective-C programming, I am unsure of how certain things wo... | TITLE:
How to manage memory/usage of a NSMutableArray of NSMutableArrays
QUESTION:
I am currently trying to write a class to create faux grid system to keep track of a NSMutableArray of game entities using a NSMutableArray of NSMutableArrays. Given my limited experience with Objective-C programming, I am unsure of how... | [
"objective-c",
"memory-management",
"multidimensional-array",
"nsmutablearray",
"storage"
] | 2 | 0 | 574 | 2 | 0 | 2011-06-02T04:44:08.800000 | 2011-06-02T05:07:38.497000 |
6,210,495 | 6,210,539 | How to combine vectors of different length in a cell array into matrix in MATLAB | How to efficiently combined cell array vectors with different length into a matrix, filling the vectors to max length with 0s or NaNs? It would be a nice option for cell2mat(). For example, if I have C = {1:3; 1:5; 1:4}; I'd like to get either M = [1 2 3 0 0 1 2 3 4 5 1 2 3 4 0]; or M = [1 2 3 NaN NaN 1 2 3 4 5 1 2 3 4... | EDIT: For a cell of row vectors as in your case, this will pad vectors with zeros to form a matrix out=cell2mat(cellfun(@(x)cat(2,x,zeros(1,maxLength-length(x))),C,'UniformOutput',false))
out =
1 2 3 0 0 1 2 3 4 5 1 2 3 4 0 A similar question was asked earlier today, and although the question was worded slightly diff... | How to combine vectors of different length in a cell array into matrix in MATLAB How to efficiently combined cell array vectors with different length into a matrix, filling the vectors to max length with 0s or NaNs? It would be a nice option for cell2mat(). For example, if I have C = {1:3; 1:5; 1:4}; I'd like to get ei... | TITLE:
How to combine vectors of different length in a cell array into matrix in MATLAB
QUESTION:
How to efficiently combined cell array vectors with different length into a matrix, filling the vectors to max length with 0s or NaNs? It would be a nice option for cell2mat(). For example, if I have C = {1:3; 1:5; 1:4}; ... | [
"matlab",
"matrix",
"cell-array"
] | 4 | 3 | 15,948 | 1 | 0 | 2011-06-02T04:45:08.640000 | 2011-06-02T04:51:02.820000 |
6,210,497 | 6,210,537 | arrayWithContentsOfFile can't read plist file | i have a plist with an array that contain 2 strings see image: http://imageshack.us/photo/my-images/263/myplist.png/ and in my viewDidLoad i add this: NSString *file = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
NSArray *array = [NSArray arrayWithContentsOfFile:file];
NSLog(@"array = %@", array);... | Most likely, your plist is a dictionary that contains an array (Xcode 4 doesn't allow to create plists with an array as the root object). Try something like this: NSString *file = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:file]; NSAr... | arrayWithContentsOfFile can't read plist file i have a plist with an array that contain 2 strings see image: http://imageshack.us/photo/my-images/263/myplist.png/ and in my viewDidLoad i add this: NSString *file = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
NSArray *array = [NSArray arrayWithConte... | TITLE:
arrayWithContentsOfFile can't read plist file
QUESTION:
i have a plist with an array that contain 2 strings see image: http://imageshack.us/photo/my-images/263/myplist.png/ and in my viewDidLoad i add this: NSString *file = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
NSArray *array = [NSAr... | [
"iphone",
"nsarray",
"plist",
"nsbundle"
] | 6 | 13 | 9,165 | 5 | 0 | 2011-06-02T04:45:44.770000 | 2011-06-02T04:50:15.867000 |
6,210,499 | 6,217,828 | JBoss 5.0 EAR: Locate @Service ejb local interface from struts 1 action in nested war with jndi lookup | I have a war (using struts 1) nested in an ear with session ejbs. If I lookup normal session beans from the war with lookup("earname/beanname/local") everything works. If I lookup a @Service ejb the same way it fails from the war with a NamingException. To make sure I was doing the lookup correctly I looked up one @Ser... | After going through the jmx-console like Nicholas recommended I was able to track down my mistake. It turns out my two lookups were in fact different. The war was using the service name that I wanted, everything else (which was working) was using the class name of the implementation of the @Local interface. To further ... | JBoss 5.0 EAR: Locate @Service ejb local interface from struts 1 action in nested war with jndi lookup I have a war (using struts 1) nested in an ear with session ejbs. If I lookup normal session beans from the war with lookup("earname/beanname/local") everything works. If I lookup a @Service ejb the same way it fails ... | TITLE:
JBoss 5.0 EAR: Locate @Service ejb local interface from struts 1 action in nested war with jndi lookup
QUESTION:
I have a war (using struts 1) nested in an ear with session ejbs. If I lookup normal session beans from the war with lookup("earname/beanname/local") everything works. If I lookup a @Service ejb the ... | [
"java",
"jakarta-ee",
"jboss",
"struts",
"ejb"
] | 0 | 0 | 439 | 1 | 0 | 2011-06-02T04:45:51.120000 | 2011-06-02T17:16:49.820000 |
6,210,506 | 6,210,563 | Insert client input into MySQL database with C | How do I write a C program which gets the client input for MySQL server? I'm using Fedora as my OS. Here is my code: #include #include main() { char name[25]; MYSQL *conn; conn=mysql_init(NULL); mysql_real_connect(conn,"localhost","root","","testdb",0,NULL,0); printf("Enter your name:"); scanf("%s",name); mysql_query(c... | Try sprintf'ing the name into your query, something like this: int len = query_len + name_len + 1; char * insert_query = (char *) malloc(len); snprintf(insert_query, len, "INSERT INTO Users VALUES('%s')", name); However, you'll need to take some care when checking the buffer lengths and especially escaping the name str... | Insert client input into MySQL database with C How do I write a C program which gets the client input for MySQL server? I'm using Fedora as my OS. Here is my code: #include #include main() { char name[25]; MYSQL *conn; conn=mysql_init(NULL); mysql_real_connect(conn,"localhost","root","","testdb",0,NULL,0); printf("Ente... | TITLE:
Insert client input into MySQL database with C
QUESTION:
How do I write a C program which gets the client input for MySQL server? I'm using Fedora as my OS. Here is my code: #include #include main() { char name[25]; MYSQL *conn; conn=mysql_init(NULL); mysql_real_connect(conn,"localhost","root","","testdb",0,NUL... | [
"mysql",
"sql",
"c"
] | 3 | 1 | 2,591 | 1 | 0 | 2011-06-02T04:46:46.663000 | 2011-06-02T04:54:19.560000 |
6,210,510 | 6,210,559 | Pushing File into Android Device | I have developed an application which read text file. In Emulator I have push the file in \Data\Data\PackageName\File.txt and its working fine. But when I try to push file in Device its generate the error Read Only File System. I have try to remount directory as writable but the same error. Please help me how can I pus... | The folder you are trying is locked on non-rooted phones i.e no write permission and I guess the device you are trying on is not a rooted one. since emulator is sort of developer device which is said to be rooted that's why you can push file to that location. So depending on your requirement you have to either use Asse... | Pushing File into Android Device I have developed an application which read text file. In Emulator I have push the file in \Data\Data\PackageName\File.txt and its working fine. But when I try to push file in Device its generate the error Read Only File System. I have try to remount directory as writable but the same er... | TITLE:
Pushing File into Android Device
QUESTION:
I have developed an application which read text file. In Emulator I have push the file in \Data\Data\PackageName\File.txt and its working fine. But when I try to push file in Device its generate the error Read Only File System. I have try to remount directory as writab... | [
"push",
"android"
] | 1 | 2 | 1,069 | 2 | 0 | 2011-06-02T04:47:10.540000 | 2011-06-02T04:53:12.977000 |
6,210,519 | 6,210,806 | Get the Username in a Gmail Contextual Gadget | I am writing a Gmail Contextual Gadget, and in order to authenticate the user correctly on the server, i need to know their full email address (john@googleapps.com). I can retrieve the domain (googleapps.com) but not the username. Using the content extractors I can get the 'To' field on the email, the only problem is i... | You need to implement SSO (single sign-on) within the contextual gadget. When the contextual gadget loads it passes the opensocialid of the user. You have to maintain a correlation between the user emailid and user opensocialid in your local database and do the identification by opensocialid lookup. Read here for more ... | Get the Username in a Gmail Contextual Gadget I am writing a Gmail Contextual Gadget, and in order to authenticate the user correctly on the server, i need to know their full email address (john@googleapps.com). I can retrieve the domain (googleapps.com) but not the username. Using the content extractors I can get the ... | TITLE:
Get the Username in a Gmail Contextual Gadget
QUESTION:
I am writing a Gmail Contextual Gadget, and in order to authenticate the user correctly on the server, i need to know their full email address (john@googleapps.com). I can retrieve the domain (googleapps.com) but not the username. Using the content extract... | [
"javascript",
"jquery",
"gmail-contextual-gadgets"
] | 6 | 2 | 2,007 | 2 | 0 | 2011-06-02T04:48:03.257000 | 2011-06-02T05:30:36.330000 |
6,210,524 | 6,237,196 | JSF Pages goes away | I'm working with JSF and PrimeFaces and I am using Facelets as view technology. But I got an issue for which I can't find out the cause of the problem and the solution. This is the Facelets template: I'm using and in content-content. When I try to add for example to content-top, then I lose content-content from my inde... | Problem resolved by removing form id Hope that help's someone | JSF Pages goes away I'm working with JSF and PrimeFaces and I am using Facelets as view technology. But I got an issue for which I can't find out the cause of the problem and the solution. This is the Facelets template: I'm using and in content-content. When I try to add for example to content-top, then I lose content-... | TITLE:
JSF Pages goes away
QUESTION:
I'm working with JSF and PrimeFaces and I am using Facelets as view technology. But I got an issue for which I can't find out the cause of the problem and the solution. This is the Facelets template: I'm using and in content-content. When I try to add for example to content-top, th... | [
"jsf",
"netbeans",
"facelets",
"primefaces"
] | 1 | 0 | 175 | 1 | 0 | 2011-06-02T04:48:45.343000 | 2011-06-04T14:10:53.660000 |
6,210,528 | 6,210,848 | Gcc-4.2 failed with exit code 1 Error | I am getting this error when i am trying to build my app. In the simulator it works fine but when coming to build for ipa it gives the following error: Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 What is causing this error? Edited Ld build/halalgauge.build/Release-ip... | If you inspect the linker invocation, you’ll see the following: -dead_strip all_load -lstdc++ The linker interprets that all_load as a file that must be linked, hence the error: arm-apple-darwin10-gcc-4.2.1: all_load: No such file or directory You need to specify -all_load (with an hyphen) instead of all_load in the li... | Gcc-4.2 failed with exit code 1 Error I am getting this error when i am trying to build my app. In the simulator it works fine but when coming to build for ipa it gives the following error: Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 What is causing this error? Edite... | TITLE:
Gcc-4.2 failed with exit code 1 Error
QUESTION:
I am getting this error when i am trying to build my app. In the simulator it works fine but when coming to build for ipa it gives the following error: Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 What is causing... | [
"iphone",
"xcode",
"gcc",
"build"
] | 1 | 2 | 11,090 | 4 | 0 | 2011-06-02T04:49:17.423000 | 2011-06-02T05:36:18.167000 |
6,210,529 | 6,210,665 | Client side showing , hiding is risky | I have a div which contains a button.I am initially setting div display:none & depending upon the user rights i am showing it to user using javascript. PageMethods.GetRights(onsuccess);
function onsuccess(result){ if(result.isaccessible) { $("#mydiv").show(); } } Is Showing,Hiding at client risky. I dont want to use u... | Anyone could view this div if they changed the display to "block" with an html inspector. If you are wanting this information to remain private I would suggest a different way of doing this. The first, and the best way, is to skip the JavaScript and use the server to check the user's rights and display the div. The sec... | Client side showing , hiding is risky I have a div which contains a button.I am initially setting div display:none & depending upon the user rights i am showing it to user using javascript. PageMethods.GetRights(onsuccess);
function onsuccess(result){ if(result.isaccessible) { $("#mydiv").show(); } } Is Showing,Hiding... | TITLE:
Client side showing , hiding is risky
QUESTION:
I have a div which contains a button.I am initially setting div display:none & depending upon the user rights i am showing it to user using javascript. PageMethods.GetRights(onsuccess);
function onsuccess(result){ if(result.isaccessible) { $("#mydiv").show(); } }... | [
"javascript",
"asp.net"
] | 0 | 1 | 84 | 3 | 0 | 2011-06-02T04:49:45.253000 | 2011-06-02T05:10:11.383000 |
6,210,552 | 6,210,656 | Listing changes made by a particular user in svn using windows command prompt | I have the same requirement as asked in the question List all files changed by a particular user in subversion. I want to display all the changes made by a particular user in SVN (by date)using windows command prompt, so that we can include it in a batch file. Are there any ways to do it? | If you have and can use Powershell: svn log -v http://mb-unit.googlecode.com/svn/trunk | Select-String "author" In a batch file you can do like: @powershell -command "svn log -v http://mb-unit.googlecode.com/svn/trunk | Select-String 'author'" Tools like grep, findstr ( common on Windows ) can also be used. ALso, even ... | Listing changes made by a particular user in svn using windows command prompt I have the same requirement as asked in the question List all files changed by a particular user in subversion. I want to display all the changes made by a particular user in SVN (by date)using windows command prompt, so that we can include i... | TITLE:
Listing changes made by a particular user in svn using windows command prompt
QUESTION:
I have the same requirement as asked in the question List all files changed by a particular user in subversion. I want to display all the changes made by a particular user in SVN (by date)using windows command prompt, so tha... | [
"svn"
] | 0 | 1 | 305 | 1 | 0 | 2011-06-02T04:52:50.077000 | 2011-06-02T05:08:02.150000 |
6,210,556 | 6,210,616 | Clickable image using Javascript and Facebook graph API | I have this piece of code: function fbFetch(){ //Set Url of JSON data from the facebook graph api. make sure callback is set with a '?' to overcome the cross domain problems with JSON var url = "http://graph.facebook.com/10150171084863204/photos?limit=3&type=small&callback=?";
//Use jQuery getJSON method to fetch the ... | simple as this. now you can integrate this idea o anyplace. Whether it be the FB api or somewhere else. | Clickable image using Javascript and Facebook graph API I have this piece of code: function fbFetch(){ //Set Url of JSON data from the facebook graph api. make sure callback is set with a '?' to overcome the cross domain problems with JSON var url = "http://graph.facebook.com/10150171084863204/photos?limit=3&type=small... | TITLE:
Clickable image using Javascript and Facebook graph API
QUESTION:
I have this piece of code: function fbFetch(){ //Set Url of JSON data from the facebook graph api. make sure callback is set with a '?' to overcome the cross domain problems with JSON var url = "http://graph.facebook.com/10150171084863204/photos?... | [
"javascript",
"json",
"facebook",
"facebook-graph-api",
"photo"
] | 0 | 1 | 791 | 1 | 0 | 2011-06-02T04:52:58.450000 | 2011-06-02T05:01:24.787000 |
6,210,560 | 6,210,632 | how to retrieve and output images from multiple columns with php and mysql? | UPDATE: I have have ten columns in my SQL table: id, imgid, urlid, image1, image2, image3, image4, image5, and comment. Id, imgid, and urlid are int type. Image[1-5] are mediumblob type. Url and comment are text type. Imgid is the number of images uploaded (which should be 5), urlid is the number of urls submitted (whi... | first, you use a DATAbase, store data in it not files. (you should store the link/path to the files in the DB not the images itself, this only blows up your database and makes it slow) see Storing Images in DB - Yea or Nay? for more info on this topic. but if you want to do it this way then you will have to output the ... | how to retrieve and output images from multiple columns with php and mysql? UPDATE: I have have ten columns in my SQL table: id, imgid, urlid, image1, image2, image3, image4, image5, and comment. Id, imgid, and urlid are int type. Image[1-5] are mediumblob type. Url and comment are text type. Imgid is the number of ima... | TITLE:
how to retrieve and output images from multiple columns with php and mysql?
QUESTION:
UPDATE: I have have ten columns in my SQL table: id, imgid, urlid, image1, image2, image3, image4, image5, and comment. Id, imgid, and urlid are int type. Image[1-5] are mediumblob type. Url and comment are text type. Imgid is... | [
"php",
"mysql",
"image",
"upload",
"blob"
] | 2 | 1 | 1,956 | 1 | 0 | 2011-06-02T04:53:28.367000 | 2011-06-02T05:05:06.720000 |
6,210,564 | 6,210,610 | Can I control slider value programmatically? | I have used following code for (UIView *view in [volumeView subviews]){ if ([[[view class] description] isEqualToString:@"MPVolumeSlider"]) { volumeViewSlider = (UISlider *) view; } }
//[volumeViewSlider setBackgroundColor:[UIColor colorWithRed:1.00 green:0.0 blue:0.0 alpha:1.0]]; UIImage *stetchLeftTrack = [[UIImage ... | You can certainly make use of the UISlider instance method - (void)setValue:(float)value animated:(BOOL)animated This will reduce the slider value with or without animation. UPDATE Check this link on Controlling Master Volume | Can I control slider value programmatically? I have used following code for (UIView *view in [volumeView subviews]){ if ([[[view class] description] isEqualToString:@"MPVolumeSlider"]) { volumeViewSlider = (UISlider *) view; } }
//[volumeViewSlider setBackgroundColor:[UIColor colorWithRed:1.00 green:0.0 blue:0.0 alpha... | TITLE:
Can I control slider value programmatically?
QUESTION:
I have used following code for (UIView *view in [volumeView subviews]){ if ([[[view class] description] isEqualToString:@"MPVolumeSlider"]) { volumeViewSlider = (UISlider *) view; } }
//[volumeViewSlider setBackgroundColor:[UIColor colorWithRed:1.00 green:... | [
"iphone",
"mpvolumeview"
] | 0 | 2 | 1,918 | 1 | 0 | 2011-06-02T04:54:19.667000 | 2011-06-02T05:00:38.170000 |
6,210,566 | 6,216,308 | How to automate creating models in django? | My models are generated from the shapefiles by using ogrinspect. But, after the creation of the model, lets say the user want to add an additional attribute. For this, the new attribute should be reflected in two tables. One should contain the name of the attribute, the other the attribute as a column. The name of the ... | You may be able to use South to manage changes changes to your models. Whenever the model is changed you can run schemamigration --auto to create a migration and then migrate to apply it. This will create the tables in your model. If you expect the models in your application to be changing a lot - particularly if it ca... | How to automate creating models in django? My models are generated from the shapefiles by using ogrinspect. But, after the creation of the model, lets say the user want to add an additional attribute. For this, the new attribute should be reflected in two tables. One should contain the name of the attribute, the other ... | TITLE:
How to automate creating models in django?
QUESTION:
My models are generated from the shapefiles by using ogrinspect. But, after the creation of the model, lets say the user want to add an additional attribute. For this, the new attribute should be reflected in two tables. One should contain the name of the att... | [
"django",
"django-models"
] | 3 | 2 | 131 | 2 | 0 | 2011-06-02T04:54:28.373000 | 2011-06-02T15:01:12.343000 |
6,210,570 | 6,210,669 | Send multiple pieces of data through .ajax() for processing in PHP script | I'm trying to send two separate groups of information through.ajax() to a PHP script for processing and running into problems. In this scenario, the user enters a page and 1) a timer starts counting seconds and 2) the user has to fill out a series of inputs for a form. I'd like to send both groups of information (the c... | Assuming structure_process.php accepts both pieces of data together, you can use serializeArray() instead of serialize(), append your extra piece of data, and then use jQuery.param() to convert the array to a string that jQuery.ajax() will accept. $('#process_structure').click(function () { var postData = $('#inputs_st... | Send multiple pieces of data through .ajax() for processing in PHP script I'm trying to send two separate groups of information through.ajax() to a PHP script for processing and running into problems. In this scenario, the user enters a page and 1) a timer starts counting seconds and 2) the user has to fill out a serie... | TITLE:
Send multiple pieces of data through .ajax() for processing in PHP script
QUESTION:
I'm trying to send two separate groups of information through.ajax() to a PHP script for processing and running into problems. In this scenario, the user enters a page and 1) a timer starts counting seconds and 2) the user has t... | [
"jquery",
"ajax",
"timer"
] | 0 | 1 | 568 | 1 | 0 | 2011-06-02T04:54:43.917000 | 2011-06-02T05:10:21.027000 |
6,210,575 | 6,211,357 | Is it crazy to use Azure for Intranet Site containing sensitive data | is it absolute insanity to start hosting new intranet web apps in Azure using an on-premise sql instance and ADFS 2.0 (via Azure Connect)? My concern is that instead of the site being behind a firewall, being hosted in Azure has the side effect of anyone who discovers the URL can hack away at it. Thoughts??? thanks | There's good news on the ADFS 2.0 front. Authentication with ADFS 2.0 requires the client's browser to be able to communicate with the application server and the ADFS 2.0 server. There's no direct connection between Azure and ADFS 2.0. If you make sure that your ADFS 2.0 server is only accessible from your corporate ne... | Is it crazy to use Azure for Intranet Site containing sensitive data is it absolute insanity to start hosting new intranet web apps in Azure using an on-premise sql instance and ADFS 2.0 (via Azure Connect)? My concern is that instead of the site being behind a firewall, being hosted in Azure has the side effect of any... | TITLE:
Is it crazy to use Azure for Intranet Site containing sensitive data
QUESTION:
is it absolute insanity to start hosting new intranet web apps in Azure using an on-premise sql instance and ADFS 2.0 (via Azure Connect)? My concern is that instead of the site being behind a firewall, being hosted in Azure has the ... | [
"azure"
] | 5 | 4 | 3,324 | 2 | 0 | 2011-06-02T04:55:20.597000 | 2011-06-02T06:48:47.380000 |
6,210,580 | 6,210,950 | best approch among EXE and MSI | I have an application that needs to be delivered as a package. What are the best among EXE and MSI Installers, and why? Is there any open source tool to decompile the EXE or MSI? | Many installers these days use MSI internally although they're distributed as EXE. You need an EXE to ensure all the prerequisites are installed:.NET framework, for example; and it installs the prerequisites if they're not. Then it extracts the MSI package which handles the rest of the installation. MSI provides some a... | best approch among EXE and MSI I have an application that needs to be delivered as a package. What are the best among EXE and MSI Installers, and why? Is there any open source tool to decompile the EXE or MSI? | TITLE:
best approch among EXE and MSI
QUESTION:
I have an application that needs to be delivered as a package. What are the best among EXE and MSI Installers, and why? Is there any open source tool to decompile the EXE or MSI?
ANSWER:
Many installers these days use MSI internally although they're distributed as EXE. ... | [
"winforms",
"installation",
"windows-installer",
"exe"
] | 4 | 3 | 849 | 6 | 0 | 2011-06-02T04:56:07.550000 | 2011-06-02T05:51:52.393000 |
6,210,581 | 6,210,914 | Making left-most-derivations of a input string. How to predict which production to use from? | Let's say I have the following grammar: Expr -> Expr plus Expr (1) | Expr minus Expr (2) | num (3) When doing a left-most-derivation, after "expanding" Expr, how should one know what production to use? For instance, if I want to parse 1 + 2 - 3 I'd start off with: Expr => Expr minus Expr but this would only happen beca... | Because parsing CFG's is essentially non-deterministic, there is no general way to "know" beforehand which of the possible rules is the correct one. Basically at the simplest level it really is trial and error. Just like a disjunction boolean expression if(a OR b OR c), the individual terms will be evaluated one by one... | Making left-most-derivations of a input string. How to predict which production to use from? Let's say I have the following grammar: Expr -> Expr plus Expr (1) | Expr minus Expr (2) | num (3) When doing a left-most-derivation, after "expanding" Expr, how should one know what production to use? For instance, if I want t... | TITLE:
Making left-most-derivations of a input string. How to predict which production to use from?
QUESTION:
Let's say I have the following grammar: Expr -> Expr plus Expr (1) | Expr minus Expr (2) | num (3) When doing a left-most-derivation, after "expanding" Expr, how should one know what production to use? For ins... | [
"context-free-grammar",
"compiler-construction"
] | 2 | 1 | 584 | 1 | 0 | 2011-06-02T04:56:13.130000 | 2011-06-02T05:47:25.780000 |
6,210,584 | 6,276,200 | How to make OpenCV work under Windows? | I could not start an OpenCV application under Windows. Given the following simple OpenCV program: #include #include #include #include #include "cv.h" #include "highgui.h"
char imagename[100] = "sudoku.jpg";
IplImage* img;
int main(int argc, char** argv) { cvInitSystem(argc, argv);
cvNamedWindow("Example4", CV_WINDO... | I have posted the same question at opencv forum and I got an answer. The problem was that I used either the lib or the bin opencv directory for linking and the PATH. Using the install guide it turned out to me that I have to use the lib directory for the linking and bin directory for the PATH. The combined usage of dll... | How to make OpenCV work under Windows? I could not start an OpenCV application under Windows. Given the following simple OpenCV program: #include #include #include #include #include "cv.h" #include "highgui.h"
char imagename[100] = "sudoku.jpg";
IplImage* img;
int main(int argc, char** argv) { cvInitSystem(argc, arg... | TITLE:
How to make OpenCV work under Windows?
QUESTION:
I could not start an OpenCV application under Windows. Given the following simple OpenCV program: #include #include #include #include #include "cv.h" #include "highgui.h"
char imagename[100] = "sudoku.jpg";
IplImage* img;
int main(int argc, char** argv) { cvIn... | [
"windows",
"opencv",
"compilation",
"hyperlink"
] | 1 | 2 | 2,800 | 2 | 0 | 2011-05-30T14:30:51.707000 | 2011-06-08T08:36:54.137000 |
6,210,591 | 6,210,603 | From a filepath string, get only the directory path of the parent directory | so I am trying to learn some string functions in PHP and came across a scenario I cannot figure out. I want to take a string like such: /var/www/html and remove everything after the last forward slash (including the forward slash) so I end up with /var/www What would be the best way to go about this? | Try using dirname. It may handle special cases for you that you may not have anticipated if you went with a string manipulation route. | From a filepath string, get only the directory path of the parent directory so I am trying to learn some string functions in PHP and came across a scenario I cannot figure out. I want to take a string like such: /var/www/html and remove everything after the last forward slash (including the forward slash) so I end up w... | TITLE:
From a filepath string, get only the directory path of the parent directory
QUESTION:
so I am trying to learn some string functions in PHP and came across a scenario I cannot figure out. I want to take a string like such: /var/www/html and remove everything after the last forward slash (including the forward sl... | [
"php",
"string",
"directory",
"path"
] | 2 | 4 | 55 | 2 | 0 | 2011-06-02T04:57:49.157000 | 2011-06-02T04:59:41.840000 |
6,210,598 | 6,210,652 | Is an empty block optimized away? C# | I am developing a game server in C# and a specific packet gets sent to my server 3 to 5 times per second per player. We will call that packet PacketA. I don't do anything with it except make sure that I receive it. Since this packet gets sent the most, I want to place it first in the switch block so I don't have to mak... | The switch statement in C# is optimized in a way that allows for a very quick evaluation of where to go. It doesn't read down through the list of options exactly. Instead it creates a jump list that it optimized for identifying which case to execute. Here is a link with more information about it: http://www.dotnetperls... | Is an empty block optimized away? C# I am developing a game server in C# and a specific packet gets sent to my server 3 to 5 times per second per player. We will call that packet PacketA. I don't do anything with it except make sure that I receive it. Since this packet gets sent the most, I want to place it first in th... | TITLE:
Is an empty block optimized away? C#
QUESTION:
I am developing a game server in C# and a specific packet gets sent to my server 3 to 5 times per second per player. We will call that packet PacketA. I don't do anything with it except make sure that I receive it. Since this packet gets sent the most, I want to pl... | [
"c#",
"compiler-optimization"
] | 2 | 6 | 454 | 2 | 0 | 2011-06-02T04:59:04.930000 | 2011-06-02T05:07:08.730000 |
6,210,602 | 6,210,973 | grails and version control specific to plugins | I am using 1.3.7 on a windows system, the plugins are placed in a different folder and I have made a few changes in the code related to the plugins. I now need to check in this project into svn, how do i go about doing it? specifically how do i check in he plugins? When a team mate of mine checks out this project, wher... | The plugins you have made need to be made inline. i.e. they will be in your grails-app folder. To make a plugin inline create a folder say "custom-plugins" in your grails-app folder and copy the modified plugin there. Now in your BuildConfig.groovy add following lines grails.plugin.location.'plugin-name'="custom-plugin... | grails and version control specific to plugins I am using 1.3.7 on a windows system, the plugins are placed in a different folder and I have made a few changes in the code related to the plugins. I now need to check in this project into svn, how do i go about doing it? specifically how do i check in he plugins? When a ... | TITLE:
grails and version control specific to plugins
QUESTION:
I am using 1.3.7 on a windows system, the plugins are placed in a different folder and I have made a few changes in the code related to the plugins. I now need to check in this project into svn, how do i go about doing it? specifically how do i check in h... | [
"version-control",
"grails"
] | 2 | 2 | 210 | 1 | 0 | 2011-06-02T04:59:36.517000 | 2011-06-02T05:55:04.997000 |
6,210,604 | 6,210,733 | Reload the page just once if a div is above certain position | I want to reload the page only once if a given div is positioned higher than position:absolute; top:15%. I think this could be done with jQuery's.css method, something like: if ('#mydive').css('top') > '15%' { //reload the page } Could someone suggest a simple solution, preferably jQuery or pure JavaScript? | If what you meant is the top of the document, you can probably try: var percent =.15; // 15% if ($('#yourdiv').offset().top > ($(document).height() * percent)) { window.location.reload(); }
// if by pixels var pixels = 10; // 10px if ($('#yourdiv').offset().top > pixels) { window.location.reload(); } | Reload the page just once if a div is above certain position I want to reload the page only once if a given div is positioned higher than position:absolute; top:15%. I think this could be done with jQuery's.css method, something like: if ('#mydive').css('top') > '15%' { //reload the page } Could someone suggest a simpl... | TITLE:
Reload the page just once if a div is above certain position
QUESTION:
I want to reload the page only once if a given div is positioned higher than position:absolute; top:15%. I think this could be done with jQuery's.css method, something like: if ('#mydive').css('top') > '15%' { //reload the page } Could someo... | [
"javascript",
"jquery",
"if-statement",
"reload",
"css-position"
] | 1 | 2 | 3,271 | 4 | 0 | 2011-06-02T04:59:42.303000 | 2011-06-02T05:18:59.527000 |
6,210,611 | 6,210,692 | How to get current Button text color in Android? | I cant figure out how to get the current color of the text of a Button. I know its probably this but cant quite figure out the parameters. public static int getTextColor (Context context, TypedArray attrs, int def)... Basically Im trying to do this if(text is RED) {make text BLACK} else {make text RED} I know how to se... | try this ColorStateList mList = mButton.getTextColors(); int color = mList.getDefaultColor();
switch(color) { case Color.RED: mButton.setTextColor(Color.BLACK); break;
case Color.BLACK: mButton.setTextColor(Color.RED); break;
} | How to get current Button text color in Android? I cant figure out how to get the current color of the text of a Button. I know its probably this but cant quite figure out the parameters. public static int getTextColor (Context context, TypedArray attrs, int def)... Basically Im trying to do this if(text is RED) {make ... | TITLE:
How to get current Button text color in Android?
QUESTION:
I cant figure out how to get the current color of the text of a Button. I know its probably this but cant quite figure out the parameters. public static int getTextColor (Context context, TypedArray attrs, int def)... Basically Im trying to do this if(t... | [
"android",
"button"
] | 5 | 14 | 6,577 | 1 | 0 | 2011-06-02T05:00:52.557000 | 2011-06-02T05:14:15.153000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.