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,308,369 | 6,308,515 | CSS form buttons | I'm looking for a good way to implement reusable buttons in CSS on my forms. The requirements: - Separate image and text (text is in many languages) - Rollover effects - Plays nicely cross browser - No javascript (if possible) - Rounded corners Whats the best way to do this? Years ago I was using the sliding doors tech... | I would use css sprites for this. You can find out about them here: http://css-tricks.com/css-sprites/ It is basically a way to make one large image that has all states of buttons(normal, hover, selected). The benefit is it is one http request and you don't see a flicker the first time a hover occurs. If you use this r... | CSS form buttons I'm looking for a good way to implement reusable buttons in CSS on my forms. The requirements: - Separate image and text (text is in many languages) - Rollover effects - Plays nicely cross browser - No javascript (if possible) - Rounded corners Whats the best way to do this? Years ago I was using the s... | TITLE:
CSS form buttons
QUESTION:
I'm looking for a good way to implement reusable buttons in CSS on my forms. The requirements: - Separate image and text (text is in many languages) - Rollover effects - Plays nicely cross browser - No javascript (if possible) - Rounded corners Whats the best way to do this? Years ago... | [
"button",
"css"
] | 0 | 1 | 639 | 5 | 0 | 2011-06-10T15:14:53.590000 | 2011-06-10T15:25:25.670000 |
6,308,373 | 6,310,348 | How do I invoke the '!=' method on an object? | I just started playing with scala and have been using the "Scala By Example" by Michel Schinz ( http://www.scala-lang.org/node/198 ) as a starting point. In the segment on traits, I've attempted to use reflection/method invocation to test traits and wanted to test all the comparison operator. I hit the issue with name ... | Try calling equals and negating the result. == and!= benefit from a little compiler magic in Scala (e.g., you can call null.==(4) without getting a NullPointerException ). | How do I invoke the '!=' method on an object? I just started playing with scala and have been using the "Scala By Example" by Michel Schinz ( http://www.scala-lang.org/node/198 ) as a starting point. In the segment on traits, I've attempted to use reflection/method invocation to test traits and wanted to test all the c... | TITLE:
How do I invoke the '!=' method on an object?
QUESTION:
I just started playing with scala and have been using the "Scala By Example" by Michel Schinz ( http://www.scala-lang.org/node/198 ) as a starting point. In the segment on traits, I've attempted to use reflection/method invocation to test traits and wanted... | [
"scala",
"scala-2.8"
] | 3 | 5 | 213 | 1 | 0 | 2011-06-10T15:15:18.903000 | 2011-06-10T18:03:30.680000 |
6,308,376 | 6,308,509 | PHP Navigation + jQuery animation - Page Reload | i have a site with a simple PHP-Navigation (using $_GET-Variables). HTML-code for navigation links (they are floated right): Test 1 Test 2 Test 3 Simple PHP-codeblock to include pages: if(!isset($_GET['main'])) { $page = "home"; } else { $page = $_GET['main']; } include($page.".php"); Both codeblocs are on index.php. T... | You can use event.preventDefault() to stop the browser from following the link and use a complete callback function in animate to load the linked-to page after the animation is done. | PHP Navigation + jQuery animation - Page Reload i have a site with a simple PHP-Navigation (using $_GET-Variables). HTML-code for navigation links (they are floated right): Test 1 Test 2 Test 3 Simple PHP-codeblock to include pages: if(!isset($_GET['main'])) { $page = "home"; } else { $page = $_GET['main']; } include($... | TITLE:
PHP Navigation + jQuery animation - Page Reload
QUESTION:
i have a site with a simple PHP-Navigation (using $_GET-Variables). HTML-code for navigation links (they are floated right): Test 1 Test 2 Test 3 Simple PHP-codeblock to include pages: if(!isset($_GET['main'])) { $page = "home"; } else { $page = $_GET['m... | [
"php",
"jquery",
"navigation",
"reload"
] | 0 | 0 | 1,282 | 1 | 0 | 2011-06-10T15:15:32.583000 | 2011-06-10T15:24:56.933000 |
6,308,382 | 6,309,148 | Start a new line (paragraph) on a Label or TextView | I'd like to start a new line paragraph on a label and on a TextView but I can't find a way to do it via Interface Builder. Can you help me please? Thanks in advance | Two steps: In Interface Builder you have to set the "number of lines" option to 0 Use Cmd+Return (or Alt-Return) to make a carriage return | Start a new line (paragraph) on a Label or TextView I'd like to start a new line paragraph on a label and on a TextView but I can't find a way to do it via Interface Builder. Can you help me please? Thanks in advance | TITLE:
Start a new line (paragraph) on a Label or TextView
QUESTION:
I'd like to start a new line paragraph on a label and on a TextView but I can't find a way to do it via Interface Builder. Can you help me please? Thanks in advance
ANSWER:
Two steps: In Interface Builder you have to set the "number of lines" option... | [
"iphone",
"ios",
"ipad",
"xcode4"
] | 15 | 24 | 11,715 | 1 | 0 | 2011-06-10T15:15:52.400000 | 2011-06-10T16:12:53.640000 |
6,308,383 | 6,308,456 | Sql Server With Scope | I was wondering if there was any way to make the scope of a with statement more than just for the first statement after the with, for example WITH cr AS (SELECT TOP 1 * FROM @rq ORDER BY h, f) SELECT * FROM cr DELETE cr FROM @rq by the time the line DELETE cr FROM @rq is reached SQL SERVER no longer remembers what cr i... | For now, you'd need to store the results of the CTE query in a table variable or temp table. There is an open Microsoft Connect item requesting such functionality if you'd like to vote it up. | Sql Server With Scope I was wondering if there was any way to make the scope of a with statement more than just for the first statement after the with, for example WITH cr AS (SELECT TOP 1 * FROM @rq ORDER BY h, f) SELECT * FROM cr DELETE cr FROM @rq by the time the line DELETE cr FROM @rq is reached SQL SERVER no long... | TITLE:
Sql Server With Scope
QUESTION:
I was wondering if there was any way to make the scope of a with statement more than just for the first statement after the with, for example WITH cr AS (SELECT TOP 1 * FROM @rq ORDER BY h, f) SELECT * FROM cr DELETE cr FROM @rq by the time the line DELETE cr FROM @rq is reached ... | [
"sql",
"t-sql",
"sql-server-2008"
] | 0 | 1 | 111 | 2 | 0 | 2011-06-10T15:15:55.337000 | 2011-06-10T15:21:26.070000 |
6,308,386 | 6,309,320 | Has anyone secured a .net wcf RESTful service using basic/digest authentication? | I have to secure a WCF RESTful service i'm thinking of doing it in one of two following ways... 1: By implementing the feature suggested in this article 2: By simply passing a username and password in either the url or the post variables What im wondering is has anyone done this? Is this the way to do it? If I use the ... | Passing PII information on the querystring is a definite no-no. WCF supports basic authentication out of the box. You would need to combine this with transport security (SSL) to ensure the data is safely encrypted over the wire. This is absolutely the lowest common denominator form of authentication on the web and will... | Has anyone secured a .net wcf RESTful service using basic/digest authentication? I have to secure a WCF RESTful service i'm thinking of doing it in one of two following ways... 1: By implementing the feature suggested in this article 2: By simply passing a username and password in either the url or the post variables W... | TITLE:
Has anyone secured a .net wcf RESTful service using basic/digest authentication?
QUESTION:
I have to secure a WCF RESTful service i'm thinking of doing it in one of two following ways... 1: By implementing the feature suggested in this article 2: By simply passing a username and password in either the url or th... | [
"asp.net",
"wcf"
] | 0 | 0 | 507 | 1 | 0 | 2011-06-10T15:16:06.913000 | 2011-06-10T16:25:38.420000 |
6,308,392 | 6,309,149 | Oracle: Inconsistent Datatype Issue | I am getting inconsistent datatype error message and I am not sure why. I need some guidance to figure this out. I am creating two types as: My universe table have following columns with column type: Column Name Data Type
PON VARCHAR2(25 BYTE) RPON VARCHAR2(25 BYTE) SUPPLIER_NAME VARCHAR2(255 BYTE) SUB_SUPPLIER_NAME V... | I first wrote an answer trying to reproduce your error but you've changed your question quite a bit so I'm starting again from scratch. First a few remarks: By your own account you're quite new to PL/SQL yet you're using pretty advanced features: dynamic SQL, pipelined functions, SQL Objects. Let's try to begin with so... | Oracle: Inconsistent Datatype Issue I am getting inconsistent datatype error message and I am not sure why. I need some guidance to figure this out. I am creating two types as: My universe table have following columns with column type: Column Name Data Type
PON VARCHAR2(25 BYTE) RPON VARCHAR2(25 BYTE) SUPPLIER_NAME VA... | TITLE:
Oracle: Inconsistent Datatype Issue
QUESTION:
I am getting inconsistent datatype error message and I am not sure why. I need some guidance to figure this out. I am creating two types as: My universe table have following columns with column type: Column Name Data Type
PON VARCHAR2(25 BYTE) RPON VARCHAR2(25 BYTE... | [
"oracle",
"plsql",
"ora-00932",
"ora-06512"
] | 1 | 4 | 4,201 | 2 | 0 | 2011-06-10T15:16:35.890000 | 2011-06-10T16:13:01.957000 |
6,308,393 | 6,308,418 | How do I prefix a String to each element in an array of Strings? | I would like to know if there is, in Java, a function that can prefix a defined String to the beginning of every String of an array of Strings. For example, my_function({"apple", "orange", "ant"}, "eat an ") would return {"eat an apple", "eat an orange", "eat an ant"} Currently, I coded this function, but I wonder if i... | Nope. Since it should be about a three-line function, you're probably better of just sticking with the one you coded. Update With Java 8, the syntax is simple enough I'm not even sure if it's worth creating a function for: List eatFoods = foodNames.stream().map(s -> "eat an " + s).collect(Collectors.toList()); | How do I prefix a String to each element in an array of Strings? I would like to know if there is, in Java, a function that can prefix a defined String to the beginning of every String of an array of Strings. For example, my_function({"apple", "orange", "ant"}, "eat an ") would return {"eat an apple", "eat an orange", ... | TITLE:
How do I prefix a String to each element in an array of Strings?
QUESTION:
I would like to know if there is, in Java, a function that can prefix a defined String to the beginning of every String of an array of Strings. For example, my_function({"apple", "orange", "ant"}, "eat an ") would return {"eat an apple",... | [
"java",
"arrays",
"string",
"append"
] | 5 | 14 | 23,468 | 4 | 0 | 2011-06-10T15:16:39.403000 | 2011-06-10T15:18:53.073000 |
6,308,404 | 6,308,648 | Can't make a 301 redirect to home when parameters | Hi guys I need to redirect all addresses that have the promoG601.aspx in the url to the home page so I created the following rule RewriteRule promoG601.aspx(.*) http://% {HTTP_HOST}/ [L,R=301] If I send promoG601.aspx it takes me to www.domain.com correctly but if I do promoG601.aspx?tid=b then it takes me to www.domai... | The only thing I found that worked was to add a? to the end: RewriteRule promoG601.aspx(.*) http://%{HTTP_HOST}/? [L,R=301] Worked for me but I would have thought there would be a better way of doing it. Just found that the querystring is added by default: use the? to discard the querystring which is otherwise preserve... | Can't make a 301 redirect to home when parameters Hi guys I need to redirect all addresses that have the promoG601.aspx in the url to the home page so I created the following rule RewriteRule promoG601.aspx(.*) http://% {HTTP_HOST}/ [L,R=301] If I send promoG601.aspx it takes me to www.domain.com correctly but if I do ... | TITLE:
Can't make a 301 redirect to home when parameters
QUESTION:
Hi guys I need to redirect all addresses that have the promoG601.aspx in the url to the home page so I created the following rule RewriteRule promoG601.aspx(.*) http://% {HTTP_HOST}/ [L,R=301] If I send promoG601.aspx it takes me to www.domain.com corr... | [
".htaccess"
] | 0 | 1 | 106 | 1 | 0 | 2011-06-10T15:17:29.253000 | 2011-06-10T15:33:52.807000 |
6,308,408 | 6,308,610 | Why does delayed_jobs loop when it errors? | I have had several occassions where delayed_jobs will be taking care of delivering 4 thousand emails, and if something errors in those emails ( for instance, if there's a nil a call ), then it will restart the entire process and attempt to send yet another 4000 emails. This will go on indefinately until I manually kill... | A delayed job is usually just a method that gets executed by a worker in a background process as opposed to during the main thread of your application (request lifecycle for a Rails app). If you read the documentation for delayed_job under "Gory Details" it states: On failure, the job is scheduled again in 5 seconds + ... | Why does delayed_jobs loop when it errors? I have had several occassions where delayed_jobs will be taking care of delivering 4 thousand emails, and if something errors in those emails ( for instance, if there's a nil a call ), then it will restart the entire process and attempt to send yet another 4000 emails. This wi... | TITLE:
Why does delayed_jobs loop when it errors?
QUESTION:
I have had several occassions where delayed_jobs will be taking care of delivering 4 thousand emails, and if something errors in those emails ( for instance, if there's a nil a call ), then it will restart the entire process and attempt to send yet another 40... | [
"ruby-on-rails",
"delayed-job"
] | 5 | 11 | 1,850 | 2 | 0 | 2011-06-10T15:17:54.207000 | 2011-06-10T15:31:33.300000 |
6,308,413 | 6,309,208 | Create TableRows dynamically | I'm trying to create "cells" dynamically, they need an image and 3 TextViews. I chose to use the TableLayout and my cells are TableRows. I've tried this: http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/ But cells do not appear (yes, I changed the color of ... | You can use a WebView and then your table can be created/manipulated using HTML/js (there are excellent jQuery plugins). I've tried a couple of times using TableLayout and then I've switched to the WebView/HTML solution. It really depends on the design of your app. | Create TableRows dynamically I'm trying to create "cells" dynamically, they need an image and 3 TextViews. I chose to use the TableLayout and my cells are TableRows. I've tried this: http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/ But cells do not appear ... | TITLE:
Create TableRows dynamically
QUESTION:
I'm trying to create "cells" dynamically, they need an image and 3 TextViews. I chose to use the TableLayout and my cells are TableRows. I've tried this: http://www.warriorpoint.com/blog/2009/07/01/android-creating-tablerow-rows-inside-a-tablelayout-programatically/ But ce... | [
"android",
"layout",
"dynamic",
"mobile",
"tablerow"
] | 0 | 0 | 334 | 1 | 0 | 2011-06-10T15:18:16.410000 | 2011-06-10T16:17:43.160000 |
6,308,414 | 6,308,752 | Can't change property value in IE using JS | I've a little snippet code that doesn't work in IE only, tested in FF, Safari, Chrome, Rockmelt and all working. JS: document.forma.score.value = 12; html: | You may have encountered a well known name/id mixup problem. Make sure that you have unique id's and that no id attribute value in your document is equal to name attribute values in that document. On the other hand, I've jsfiddled a small test. That worked in IE7-9. If it's IE6: that in this day and age should be an ob... | Can't change property value in IE using JS I've a little snippet code that doesn't work in IE only, tested in FF, Safari, Chrome, Rockmelt and all working. JS: document.forma.score.value = 12; html: | TITLE:
Can't change property value in IE using JS
QUESTION:
I've a little snippet code that doesn't work in IE only, tested in FF, Safari, Chrome, Rockmelt and all working. JS: document.forma.score.value = 12; html:
ANSWER:
You may have encountered a well known name/id mixup problem. Make sure that you have unique id... | [
"javascript",
"html",
"internet-explorer"
] | 0 | 1 | 291 | 2 | 0 | 2011-06-10T15:18:20.870000 | 2011-06-10T15:41:45.763000 |
6,308,419 | 6,308,656 | How can I commit from diff machines? | Let's imagine this scenario Running Dropbox in my Windows Work PC, my Windows Home PC and my Mac laptop, and all have different local folders and Git 1.7.4 is installed in all enumerating them: Machine 1: Windows Work PC Machine 2: Windows Home PC Machine 3: Mac Laptop I create a new folder in Dropbox and let's assume ... | You said: git add. git push could master You'll need a commit in between those (and I'm assuming your remote is named "could"), but yeah, in principle, what you've got there is a git repository that's kept in sync via dropbox on all the machines that share that dropbox directory. In principle you could go from one mach... | How can I commit from diff machines? Let's imagine this scenario Running Dropbox in my Windows Work PC, my Windows Home PC and my Mac laptop, and all have different local folders and Git 1.7.4 is installed in all enumerating them: Machine 1: Windows Work PC Machine 2: Windows Home PC Machine 3: Mac Laptop I create a ne... | TITLE:
How can I commit from diff machines?
QUESTION:
Let's imagine this scenario Running Dropbox in my Windows Work PC, my Windows Home PC and my Mac laptop, and all have different local folders and Git 1.7.4 is installed in all enumerating them: Machine 1: Windows Work PC Machine 2: Windows Home PC Machine 3: Mac La... | [
"git",
"dropbox"
] | 2 | 1 | 88 | 2 | 0 | 2011-06-10T15:19:05.750000 | 2011-06-10T15:34:10.617000 |
6,308,425 | 6,308,556 | iOS 5 Best Practice (Release/retain?) | As a beginning iPhone programmer, what is the best practice for writing apps to be used either with iOS 5 or older versions? Specifically, should I continue using the release/retain of data, or should I ignore that? Does it matter? | It's up to you. You can write apps using ARC (Automatic Reference Counting), and Xcode will write "glue code" to allow your ARC enabled apps to run on iOS 4, no modifications required. However, certain things wont work, and most noticeably many libraries you might wish to use will (sometimes) throw up innumerable error... | iOS 5 Best Practice (Release/retain?) As a beginning iPhone programmer, what is the best practice for writing apps to be used either with iOS 5 or older versions? Specifically, should I continue using the release/retain of data, or should I ignore that? Does it matter? | TITLE:
iOS 5 Best Practice (Release/retain?)
QUESTION:
As a beginning iPhone programmer, what is the best practice for writing apps to be used either with iOS 5 or older versions? Specifically, should I continue using the release/retain of data, or should I ignore that? Does it matter?
ANSWER:
It's up to you. You can... | [
"iphone",
"ios",
"ios5",
"memory-management",
"automatic-ref-counting"
] | 109 | 98 | 57,641 | 7 | 0 | 2011-06-10T15:19:16.380000 | 2011-06-10T15:28:14.693000 |
6,308,428 | 6,309,125 | Routing Error No route matches "/users/new" | My name is Juan I'm from Spain and this is my first post. Thank you. I following the Ruby on Rails tutorial of Michael Hartl in the chapter 8. My problem is that to create the form for signup users in this chapter. He say that action go to "action=/users" but my code I can see it with the firebug the action go to: acti... | Updated Ok. I've checked the code of the tutorial. The source of the problem is the object you pass to form_for. Please, check if your users_controller's new action has this line: @user = User.new This line creates a new AR object, but doesn't save it to the DB. So when you pass it to form_for, Rails knows it should ge... | Routing Error No route matches "/users/new" My name is Juan I'm from Spain and this is my first post. Thank you. I following the Ruby on Rails tutorial of Michael Hartl in the chapter 8. My problem is that to create the form for signup users in this chapter. He say that action go to "action=/users" but my code I can se... | TITLE:
Routing Error No route matches "/users/new"
QUESTION:
My name is Juan I'm from Spain and this is my first post. Thank you. I following the Ruby on Rails tutorial of Michael Hartl in the chapter 8. My problem is that to create the form for signup users in this chapter. He say that action go to "action=/users" bu... | [
"ruby-on-rails"
] | 1 | 3 | 3,855 | 2 | 0 | 2011-06-10T15:19:30.077000 | 2011-06-10T16:11:07.917000 |
6,308,431 | 6,308,601 | Problem with two NSDate | I have a problem with this code: NSDate *today = [[NSDate alloc] init]; if (dateOne == today) { dataLabel.textColor = [UIColor redColor]; NSLog(@"inside if");} NSLog(@"today:%@", oggi); NSLog(@"dateOne:%@", dateOne); the result of console is 2011-06-10 17:19:00.170 Project[678:707] today:2011-06-10 15:19:00 +0000 2011-... | I understand you are trying to determine if a given NSDate is today. To do this you don't have to take in consideration hours, minutes, etc. in your comparison. How about this: NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *components = [calendar components:(NSYearCalendarUnit|NSMonthCalendarUni... | Problem with two NSDate I have a problem with this code: NSDate *today = [[NSDate alloc] init]; if (dateOne == today) { dataLabel.textColor = [UIColor redColor]; NSLog(@"inside if");} NSLog(@"today:%@", oggi); NSLog(@"dateOne:%@", dateOne); the result of console is 2011-06-10 17:19:00.170 Project[678:707] today:2011-06... | TITLE:
Problem with two NSDate
QUESTION:
I have a problem with this code: NSDate *today = [[NSDate alloc] init]; if (dateOne == today) { dataLabel.textColor = [UIColor redColor]; NSLog(@"inside if");} NSLog(@"today:%@", oggi); NSLog(@"dateOne:%@", dateOne); the result of console is 2011-06-10 17:19:00.170 Project[678:... | [
"objective-c",
"xcode",
"if-statement",
"io",
"nsdate"
] | 2 | 9 | 900 | 2 | 0 | 2011-06-10T15:19:41.420000 | 2011-06-10T15:31:03.567000 |
6,308,435 | 6,308,703 | Enclosing external jQuery script | I have an external JavaScript file that will be used on pages with lots of other scripts. My script involves a lot of jQuery that listens for events, and by design, I have many global vars declared. I've been reading best practice articles, and a lot is said about 'polluting the global namespace' and inadvertent script... | Generally what this boils down to is encapsulating your objects into a "namespace". I use quotes there because the term is not an official semantic in JavaScript, but rather one that is achieved through basic object encapsulation. There are several ways to do this, and it ultimately comes down to personal preference. O... | Enclosing external jQuery script I have an external JavaScript file that will be used on pages with lots of other scripts. My script involves a lot of jQuery that listens for events, and by design, I have many global vars declared. I've been reading best practice articles, and a lot is said about 'polluting the global ... | TITLE:
Enclosing external jQuery script
QUESTION:
I have an external JavaScript file that will be used on pages with lots of other scripts. My script involves a lot of jQuery that listens for events, and by design, I have many global vars declared. I've been reading best practice articles, and a lot is said about 'pol... | [
"javascript",
"jquery",
"reliability",
"side-effects"
] | 3 | 1 | 3,232 | 6 | 0 | 2011-06-10T15:19:50.617000 | 2011-06-10T15:37:30.403000 |
6,308,438 | 6,309,461 | comments amongst parameters in BASH | I want to include command-parameters-inline comments, e.g.: sed -i.bak -r \ # comment 1 -e 'sed_commands' \ # comment 2 -e 'sed_commands' \ # comment 3 -e 'sed_commands' \ /path/to/file The above code doesn't work. Is there a different way for embedding comments in the parameters line? | If you really want comment arguments, can try this: ls $( echo '-l' #for the long list echo '-F' #show file types too echo '-t' #sort by time ) This will be equivalent to: ls -l -F -t echo is an shell built-in, so does not execute external commands, so it is fast enough. But, it is crazy anyway. or makeargs() { while r... | comments amongst parameters in BASH I want to include command-parameters-inline comments, e.g.: sed -i.bak -r \ # comment 1 -e 'sed_commands' \ # comment 2 -e 'sed_commands' \ # comment 3 -e 'sed_commands' \ /path/to/file The above code doesn't work. Is there a different way for embedding comments in the parameters lin... | TITLE:
comments amongst parameters in BASH
QUESTION:
I want to include command-parameters-inline comments, e.g.: sed -i.bak -r \ # comment 1 -e 'sed_commands' \ # comment 2 -e 'sed_commands' \ # comment 3 -e 'sed_commands' \ /path/to/file The above code doesn't work. Is there a different way for embedding comments in ... | [
"bash",
"comments"
] | 7 | 11 | 3,288 | 7 | 0 | 2011-06-10T15:19:58.893000 | 2011-06-10T16:37:39.447000 |
6,308,441 | 6,308,630 | Javascript onbeforeunload close browser window | I have this tiny script for now that checks if any change is made on the form. If there is a change then I set a flag to 'Y'. I call this function on onBeforeunload="changeConfirm()" places in the body tag. I know I can't stop the user from closing down the window, but how do I make this scenario work where he made a c... | Try this: function confirmChanges() { if(Flag == 'Y') { if(confirm('Changes made. Dont want to save?')){ return false; }else{ return true; } } else { alert("No changes were made " + Flag); } } | Javascript onbeforeunload close browser window I have this tiny script for now that checks if any change is made on the form. If there is a change then I set a flag to 'Y'. I call this function on onBeforeunload="changeConfirm()" places in the body tag. I know I can't stop the user from closing down the window, but how... | TITLE:
Javascript onbeforeunload close browser window
QUESTION:
I have this tiny script for now that checks if any change is made on the form. If there is a change then I set a flag to 'Y'. I call this function on onBeforeunload="changeConfirm()" places in the body tag. I know I can't stop the user from closing down t... | [
"javascript",
"jsp"
] | 0 | 1 | 2,315 | 2 | 0 | 2011-06-10T15:20:13.613000 | 2011-06-10T15:32:42.877000 |
6,308,443 | 6,309,474 | Parsing HTML - is regex the only option in this case? | A user will supply HTML, it may be valid or invalid (malformed). I need to be able to determine such things as: Is there a style tag in the body Is there a div that has a style attribute that makes use of width or background-image. I have tried using the DOMDocument class but it can only do 1 and not 2 with xPath. I ha... | XPath can do both (1) and (2): To test if there's a style tag in the body: //body//style To test if there's a div with a style attribute using width or background-image: //div[contains(@style,'width:') or contains(@style,'background-image:')] And, as you were curious about in your comments, seeing if a style tag contai... | Parsing HTML - is regex the only option in this case? A user will supply HTML, it may be valid or invalid (malformed). I need to be able to determine such things as: Is there a style tag in the body Is there a div that has a style attribute that makes use of width or background-image. I have tried using the DOMDocument... | TITLE:
Parsing HTML - is regex the only option in this case?
QUESTION:
A user will supply HTML, it may be valid or invalid (malformed). I need to be able to determine such things as: Is there a style tag in the body Is there a div that has a style attribute that makes use of width or background-image. I have tried usi... | [
"php",
"html",
"regex",
"parsing"
] | 0 | 2 | 239 | 4 | 0 | 2011-06-10T15:20:15.150000 | 2011-06-10T16:38:46.313000 |
6,308,457 | 6,308,731 | shadowed parameter | why is the second constructor shadowing the first? class RC2{ private; bool keyset; public: RC2(uint32_t t1 = 64){ keyset = false; }
RC2(const std::string KEY, uint32_t t1 = 64){ RC2(t1); //setkey(KEY); } }; is giving me: error: declaration of 'RC2 t1' shadows a parameter i would think that there is no way for the com... | Because RC2(t1); is a local variable declaration shadowing argument t1, not a call to the other constructor. The following code is also valid: int main(int argc,char* args[]) { int(a); a = 2; return a; } Note! Before C++11, there was no way to call another constructor on the same class from an constructor in C++. If yo... | shadowed parameter why is the second constructor shadowing the first? class RC2{ private; bool keyset; public: RC2(uint32_t t1 = 64){ keyset = false; }
RC2(const std::string KEY, uint32_t t1 = 64){ RC2(t1); //setkey(KEY); } }; is giving me: error: declaration of 'RC2 t1' shadows a parameter i would think that there is... | TITLE:
shadowed parameter
QUESTION:
why is the second constructor shadowing the first? class RC2{ private; bool keyset; public: RC2(uint32_t t1 = 64){ keyset = false; }
RC2(const std::string KEY, uint32_t t1 = 64){ RC2(t1); //setkey(KEY); } }; is giving me: error: declaration of 'RC2 t1' shadows a parameter i would t... | [
"c++",
"class",
"parameters",
"shadow"
] | 5 | 9 | 14,950 | 2 | 0 | 2011-06-10T15:21:26.263000 | 2011-06-10T15:39:53.947000 |
6,308,459 | 6,308,481 | Lifetime of static variable on windows service | I am wondering what would be the life time of a static variable in windows service. I have a windows service and static variable to save the messages flowing inside the service. will I get the messages saved on the static variable after the service is restarted? | No, static variables will revert to their original values upon application restart, and a service restart is an application restart. | Lifetime of static variable on windows service I am wondering what would be the life time of a static variable in windows service. I have a windows service and static variable to save the messages flowing inside the service. will I get the messages saved on the static variable after the service is restarted? | TITLE:
Lifetime of static variable on windows service
QUESTION:
I am wondering what would be the life time of a static variable in windows service. I have a windows service and static variable to save the messages flowing inside the service. will I get the messages saved on the static variable after the service is res... | [
"wcf"
] | 1 | 1 | 1,759 | 2 | 0 | 2011-06-10T15:21:31.590000 | 2011-06-10T15:23:16.467000 |
6,308,486 | 6,308,590 | Having trouble using jQuery to toggle a slide down nav element | I have a nav bar that when I over over an element the next list displays. But when my mouse leaves the original nav the list dissappears. I want the list to stay when it is overed upon. Can you please help? http://jsfiddle.net/GxshD/ | Because your event handler is attached to your li.drop element, you need to encapsulate your child menu in that element like so... Recruiter Tools Featured Tools All Tools | Having trouble using jQuery to toggle a slide down nav element I have a nav bar that when I over over an element the next list displays. But when my mouse leaves the original nav the list dissappears. I want the list to stay when it is overed upon. Can you please help? http://jsfiddle.net/GxshD/ | TITLE:
Having trouble using jQuery to toggle a slide down nav element
QUESTION:
I have a nav bar that when I over over an element the next list displays. But when my mouse leaves the original nav the list dissappears. I want the list to stay when it is overed upon. Can you please help? http://jsfiddle.net/GxshD/
ANSW... | [
"jquery"
] | 0 | 1 | 128 | 4 | 0 | 2011-06-10T15:23:36.207000 | 2011-06-10T15:30:45.610000 |
6,308,493 | 6,308,581 | using html forms in jsp file | I have a very simple question....I have multiple jsp files like login.jsp, Registration.jsp, forgetpassword.jsp each having their owm forms to take input from user. So, my question is.....Is it OK to have these many files or should I include all my html forms in a single file like user_auth.jsp and use javascript [Whic... | I don't think that anybody would argue that you should have all of those forms in a single file. Most web pages will have some sort of form on them, it's just how it goes. I would stick with your current model. | using html forms in jsp file I have a very simple question....I have multiple jsp files like login.jsp, Registration.jsp, forgetpassword.jsp each having their owm forms to take input from user. So, my question is.....Is it OK to have these many files or should I include all my html forms in a single file like user_auth... | TITLE:
using html forms in jsp file
QUESTION:
I have a very simple question....I have multiple jsp files like login.jsp, Registration.jsp, forgetpassword.jsp each having their owm forms to take input from user. So, my question is.....Is it OK to have these many files or should I include all my html forms in a single f... | [
"html",
"jsp",
"struts"
] | 0 | 1 | 291 | 1 | 0 | 2011-06-10T15:23:48.220000 | 2011-06-10T15:29:55.920000 |
6,308,497 | 6,308,539 | perl if line matches regex, ignore line and move onto next line in file | How would you do the following in perl: for $line (@lines) { if ($line =~ m/ImportantLineNotToBeChanged/){ #break out of the for loop, move onto the next line of the file being processed #start the loop again } if ($line =~ s/SUMMER/WINTER/g){ print "."; } } Updated to show more code, this is what I'm trying to do: sub... | Just use next for my $line (@lines) { next if ($line =~ m/ImportantLineNotToBeChanged/); if ($line =~ s/SUMMER/WINTER/g){ print "."; } } | perl if line matches regex, ignore line and move onto next line in file How would you do the following in perl: for $line (@lines) { if ($line =~ m/ImportantLineNotToBeChanged/){ #break out of the for loop, move onto the next line of the file being processed #start the loop again } if ($line =~ s/SUMMER/WINTER/g){ prin... | TITLE:
perl if line matches regex, ignore line and move onto next line in file
QUESTION:
How would you do the following in perl: for $line (@lines) { if ($line =~ m/ImportantLineNotToBeChanged/){ #break out of the for loop, move onto the next line of the file being processed #start the loop again } if ($line =~ s/SUMM... | [
"perl",
"line"
] | 7 | 16 | 59,028 | 4 | 0 | 2011-06-10T15:23:55.687000 | 2011-06-10T15:27:23.580000 |
6,308,502 | 6,308,607 | Problem with cleaning up a thread pool | I have a server in Java which is multithreading, and I've created a thread pool for it. Now everything goes well and my server accepts and reads data from the clients that connect to it, but I don't know really how to clean up the sockets after the connections are closed. So here is my code: public static void main(Str... | Once you call shutdown() the thread pool will close off each thread once all the tasks are complete. You should call onstop() from whatever code knows the pool should be shutdown. This depends on what the rest of your application does and why you would stop the pool before the application has finished. | Problem with cleaning up a thread pool I have a server in Java which is multithreading, and I've created a thread pool for it. Now everything goes well and my server accepts and reads data from the clients that connect to it, but I don't know really how to clean up the sockets after the connections are closed. So here ... | TITLE:
Problem with cleaning up a thread pool
QUESTION:
I have a server in Java which is multithreading, and I've created a thread pool for it. Now everything goes well and my server accepts and reads data from the clients that connect to it, but I don't know really how to clean up the sockets after the connections ar... | [
"java",
"multithreading",
"sockets"
] | 2 | 0 | 4,640 | 1 | 0 | 2011-06-10T15:24:08.043000 | 2011-06-10T15:31:26.483000 |
6,308,504 | 6,308,560 | Send ssh commands with a script | I want to to check a Nortel Router by running./script: #!/bin/ksh print "IP:" read ip; ping ${ip}; ssh -l default ${ip} "sho mod; en; sho int; sho node-e; sho node-a"; I can ssh normaly with ssh -l [user] [ip]. But not with ssh -l [user] [ip] '[cmd1], [cmd2]' it says automatically "Conection to [ip] closed." | There's application called expect which can do that kind of interaction / terminal simulation for you. Otherwise, you could write a script using fabric or even straight in python using paramiko Running commands this way would be better of course, but if your router doesn't accept commands this way, you'll need to simul... | Send ssh commands with a script I want to to check a Nortel Router by running./script: #!/bin/ksh print "IP:" read ip; ping ${ip}; ssh -l default ${ip} "sho mod; en; sho int; sho node-e; sho node-a"; I can ssh normaly with ssh -l [user] [ip]. But not with ssh -l [user] [ip] '[cmd1], [cmd2]' it says automatically "Conec... | TITLE:
Send ssh commands with a script
QUESTION:
I want to to check a Nortel Router by running./script: #!/bin/ksh print "IP:" read ip; ping ${ip}; ssh -l default ${ip} "sho mod; en; sho int; sho node-e; sho node-a"; I can ssh normaly with ssh -l [user] [ip]. But not with ssh -l [user] [ip] '[cmd1], [cmd2]' it says au... | [
"networking",
"scripting",
"ssh",
"ksh"
] | 1 | 1 | 537 | 1 | 0 | 2011-06-10T15:24:37.323000 | 2011-06-10T15:28:21.233000 |
6,308,508 | 6,308,629 | Entity Framework 4.1, Table Per Type Inheritance and Lookup Tables | Using table per type inheritance is it possible to have the same data with the same key in more than one of the derived types? e.g. Base Type: [Table("BaseType")] public abstract class BaseType { public int Id { get; set; } public string Description { get; set; } } Derived Type A: [Table("DerivedTypeA")] public class D... | If I understand you correctly, you're describing a multiple-inheritance situation, which isn't supported in C#. DerivedA cannot be DerivedB or vice-versa because they are siblings. This article helps define the issue and presents a pattern which might help you: http://www.codeproject.com/KB/architecture/smip.aspx | Entity Framework 4.1, Table Per Type Inheritance and Lookup Tables Using table per type inheritance is it possible to have the same data with the same key in more than one of the derived types? e.g. Base Type: [Table("BaseType")] public abstract class BaseType { public int Id { get; set; } public string Description { g... | TITLE:
Entity Framework 4.1, Table Per Type Inheritance and Lookup Tables
QUESTION:
Using table per type inheritance is it possible to have the same data with the same key in more than one of the derived types? e.g. Base Type: [Table("BaseType")] public abstract class BaseType { public int Id { get; set; } public stri... | [
"entity-framework",
"ef-code-first",
"table-per-type"
] | 0 | 0 | 560 | 1 | 0 | 2011-06-10T15:24:52.053000 | 2011-06-10T15:32:42.483000 |
6,308,524 | 6,308,591 | Mysql - return all results from table A and selectively join with table B | I have two tables: default: +----+--------+ | id | colour | +----+--------+ | 1 | red | | 2 | green | | 3 | yellow | +----+--------+ custom: +--------+--------------+---------+ | linkId | customcolour | ownerId | +--------+--------------+---------+ | 1 | bright red | 1 | | 2 | garden green | 2 | +--------+-------------... | You need to move your WHERE criteria into the join SELECT a.colour, b.customcolour FROM default a LEFT JOIN custom b ON a.id = b.linkId AND (b.ownerId IS NULL OR b.ownerId = 1) GROUP BY a.id ORDER BY a.colur | Mysql - return all results from table A and selectively join with table B I have two tables: default: +----+--------+ | id | colour | +----+--------+ | 1 | red | | 2 | green | | 3 | yellow | +----+--------+ custom: +--------+--------------+---------+ | linkId | customcolour | ownerId | +--------+--------------+--------... | TITLE:
Mysql - return all results from table A and selectively join with table B
QUESTION:
I have two tables: default: +----+--------+ | id | colour | +----+--------+ | 1 | red | | 2 | green | | 3 | yellow | +----+--------+ custom: +--------+--------------+---------+ | linkId | customcolour | ownerId | +--------+-----... | [
"mysql",
"join"
] | 0 | 1 | 253 | 1 | 0 | 2011-06-10T15:26:26.560000 | 2011-06-10T15:30:46.167000 |
6,308,530 | 6,308,643 | PHP code works until I make it a function | I have this code here which gives me the result I'm looking for, a nicely formatted tree of values. $todos = $this->db->get('todos'); //store the resulting records $tree = array(); //empty array for storage $result = $todos->result_array(); //store results as arrays
foreach ($result as $item){ $id = $item['recordId'];... | Right now the function is making a local copy of {$tree}, editing it and then discarding that copy when the function closes. You have two options: 1) return the local copy of {$tree} and assign it to the global copy. function adj_tree($tree, $item){ $id = $item['recordId']; $parent = $item['actionParent']; $tree[$id] =... | PHP code works until I make it a function I have this code here which gives me the result I'm looking for, a nicely formatted tree of values. $todos = $this->db->get('todos'); //store the resulting records $tree = array(); //empty array for storage $result = $todos->result_array(); //store results as arrays
foreach ($... | TITLE:
PHP code works until I make it a function
QUESTION:
I have this code here which gives me the result I'm looking for, a nicely formatted tree of values. $todos = $this->db->get('todos'); //store the resulting records $tree = array(); //empty array for storage $result = $todos->result_array(); //store results as ... | [
"php",
"arrays",
"function"
] | 3 | 2 | 143 | 3 | 0 | 2011-06-10T15:26:51.823000 | 2011-06-10T15:33:40.520000 |
6,308,567 | 6,308,579 | Is jQuery considered to be outdated? | This may be an open and close case but may open some debate. I was speaking with my friend recently who said to me "jQuery is so 2008" Now while I don't pretend to know a whole lot about this language (Or JavaScript for that matter), I have used both for projects that I have done in the past. So my question is, is this... | Your friend is speaking out of total ignorance, and probably just uses whatever was invented within the past 6 months in order to feel "hip" and "cool". jQuery is still widely used. jQuery is still frequently updated (in fact there was a major release just last month). jQuery is not "outdated". (In 2008, jQuery was on ... | Is jQuery considered to be outdated? This may be an open and close case but may open some debate. I was speaking with my friend recently who said to me "jQuery is so 2008" Now while I don't pretend to know a whole lot about this language (Or JavaScript for that matter), I have used both for projects that I have done in... | TITLE:
Is jQuery considered to be outdated?
QUESTION:
This may be an open and close case but may open some debate. I was speaking with my friend recently who said to me "jQuery is so 2008" Now while I don't pretend to know a whole lot about this language (Or JavaScript for that matter), I have used both for projects t... | [
"jquery"
] | 1 | 8 | 1,523 | 2 | 0 | 2011-06-10T15:28:34.583000 | 2011-06-10T15:29:42.883000 |
6,308,569 | 6,308,596 | How do you skip over a list comprehension in Python's debugger (pdb)? | In pdb the next instruction does not step over list comprehensions, instead it steps through each iteration. Is there a way to step over them so debugging will continue at the next line after the list comprehension? I've had to resort to listing the code, setting a breakpoint at the next line, and then continuing execu... | You can use the until command. Output of help until in pdb: unt(il) Continue execution until the line with a number greater than the current one is reached or until the current frame returns | How do you skip over a list comprehension in Python's debugger (pdb)? In pdb the next instruction does not step over list comprehensions, instead it steps through each iteration. Is there a way to step over them so debugging will continue at the next line after the list comprehension? I've had to resort to listing the ... | TITLE:
How do you skip over a list comprehension in Python's debugger (pdb)?
QUESTION:
In pdb the next instruction does not step over list comprehensions, instead it steps through each iteration. Is there a way to step over them so debugging will continue at the next line after the list comprehension? I've had to reso... | [
"python",
"list-comprehension",
"pdb"
] | 53 | 70 | 6,310 | 2 | 0 | 2011-06-10T15:28:42.783000 | 2011-06-10T15:30:52.523000 |
6,308,570 | 6,308,632 | Javascript If statement to run some html code | I've got a little bit of javascript embedded in my html (using a.aspx file). I want to perform some sort of if statement which then determines whether or not some sort of chart is displayed. This chart is displayed using html, and I'm assuming the if statement should be written in javascript. However, I don't really kn... | You don't really "run" an HTML code. HTML is a markup language and it is mostly used to format and arrange elements that are displayed in the web browser. The problem you are probably trying to solve is: Display or hide an element based on some condition. A JavaScript code like this is what you want. if (condition) { d... | Javascript If statement to run some html code I've got a little bit of javascript embedded in my html (using a.aspx file). I want to perform some sort of if statement which then determines whether or not some sort of chart is displayed. This chart is displayed using html, and I'm assuming the if statement should be wri... | TITLE:
Javascript If statement to run some html code
QUESTION:
I've got a little bit of javascript embedded in my html (using a.aspx file). I want to perform some sort of if statement which then determines whether or not some sort of chart is displayed. This chart is displayed using html, and I'm assuming the if state... | [
"javascript",
".net",
"asp.net",
"html",
"if-statement"
] | 5 | 4 | 23,967 | 3 | 0 | 2011-06-10T15:28:53.337000 | 2011-06-10T15:32:46.030000 |
6,308,582 | 6,309,171 | MVC Deserialization Error | Okay. This is my company's customer portal, it's an MVC 2 project. We have a back end SAP system that the portal draws data from. But it does not directly hit SAP, it sends an xml request to a VB app that gets the data and sends it back in an xml response. There is an interface IRequest that all the various requests im... | Quoting your exception Check that the type being serialized has the same contract as the type being deserialized and the same assembly is used Check the version of the library on both ends that CustomerPortal.Domain.RepGroupRequest resides in to make sure they are the same version exactly. | MVC Deserialization Error Okay. This is my company's customer portal, it's an MVC 2 project. We have a back end SAP system that the portal draws data from. But it does not directly hit SAP, it sends an xml request to a VB app that gets the data and sends it back in an xml response. There is an interface IRequest that a... | TITLE:
MVC Deserialization Error
QUESTION:
Okay. This is my company's customer portal, it's an MVC 2 project. We have a back end SAP system that the portal draws data from. But it does not directly hit SAP, it sends an xml request to a VB app that gets the data and sends it back in an xml response. There is an interfa... | [
"c#",
"asp.net-mvc-2",
"netdatacontractserializer"
] | 1 | 1 | 1,216 | 1 | 0 | 2011-06-10T15:29:57.640000 | 2011-06-10T16:14:39.987000 |
6,308,583 | 6,308,659 | Count set bits in float in Java | This is an interview question: how to count set bits in float in Java? I guess I should not know the bit representation of float to answer this question. Can I just convert a float to a byte array somehow? I can use the Java serialization but it looks like overkill. | The Float class has an: public static int floatToIntBits(float value) method that returns a representation of the specified floating-point value according to the IEEE 754 floating-point "single format" bit layout. So you can get the bits with this method, then count which ones are set. http://download.oracle.com/javase... | Count set bits in float in Java This is an interview question: how to count set bits in float in Java? I guess I should not know the bit representation of float to answer this question. Can I just convert a float to a byte array somehow? I can use the Java serialization but it looks like overkill. | TITLE:
Count set bits in float in Java
QUESTION:
This is an interview question: how to count set bits in float in Java? I guess I should not know the bit representation of float to answer this question. Can I just convert a float to a byte array somehow? I can use the Java serialization but it looks like overkill.
AN... | [
"java",
"floating-point",
"bit-manipulation"
] | 3 | 5 | 892 | 3 | 0 | 2011-06-10T15:30:00.733000 | 2011-06-10T15:34:14.627000 |
6,308,594 | 6,308,620 | How can I copy data from one column to another in the same table? | Is it possible to copy data from column A to column B for all records in a table in SQL? | How about this UPDATE table SET columnB = columnA; This will update every row. | How can I copy data from one column to another in the same table? Is it possible to copy data from column A to column B for all records in a table in SQL? | TITLE:
How can I copy data from one column to another in the same table?
QUESTION:
Is it possible to copy data from column A to column B for all records in a table in SQL?
ANSWER:
How about this UPDATE table SET columnB = columnA; This will update every row. | [
"sql"
] | 416 | 754 | 489,164 | 4 | 0 | 2011-06-10T15:30:50.290000 | 2011-06-10T15:32:13.613000 |
6,308,600 | 6,308,959 | Simple DataGrid Binding to Remote SQL Server 2005/8 Database | How can we Use a DataGrid in WPF to show/update/add/delete records in a Table? I have watched/read and tried many tutorials, but I can't find a single, easy to understand tutorial on how to bind data with a remote database. I can't seem to find anything like this. | Well, if you want to use Linq2Sql (less difficult to learn than EntityFramework) try a tutorial like this one: http://www.codeproject.com/KB/WPF/WPFDataGrid.aspx or http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx And you will do fine. | Simple DataGrid Binding to Remote SQL Server 2005/8 Database How can we Use a DataGrid in WPF to show/update/add/delete records in a Table? I have watched/read and tried many tutorials, but I can't find a single, easy to understand tutorial on how to bind data with a remote database. I can't seem to find anything like ... | TITLE:
Simple DataGrid Binding to Remote SQL Server 2005/8 Database
QUESTION:
How can we Use a DataGrid in WPF to show/update/add/delete records in a Table? I have watched/read and tried many tutorials, but I can't find a single, easy to understand tutorial on how to bind data with a remote database. I can't seem to f... | [
"c#",
".net",
"sql",
"wpf",
"data-binding"
] | 0 | 1 | 1,214 | 2 | 0 | 2011-06-10T15:31:03.207000 | 2011-06-10T15:57:29.117000 |
6,308,605 | 6,308,682 | more than one database per model | class Service < ActiveRecord::Base
establish_connection(:adapter => "mysql",:host => "myip",:username => "myusername",:password => "mypassword",:database => "mydatabase" )
end This works Service.all #connects to mydatabase But i need something like that. Service.use(mydatabase1).all #connects to mydatabase1 Service.u... | Try taking a look as this question over here. How to best handle per-Model database connections with ActiveRecord? They define the databases in the database.yml file like normal and call this in the model: class AnotherDatabase < ActiveRecord::Base self.abstract_class = true establish_connection "anotherbase_#{RAILS_EN... | more than one database per model class Service < ActiveRecord::Base
establish_connection(:adapter => "mysql",:host => "myip",:username => "myusername",:password => "mypassword",:database => "mydatabase" )
end This works Service.all #connects to mydatabase But i need something like that. Service.use(mydatabase1).all #... | TITLE:
more than one database per model
QUESTION:
class Service < ActiveRecord::Base
establish_connection(:adapter => "mysql",:host => "myip",:username => "myusername",:password => "mypassword",:database => "mydatabase" )
end This works Service.all #connects to mydatabase But i need something like that. Service.use(... | [
"ruby-on-rails"
] | 2 | 4 | 528 | 1 | 0 | 2011-06-10T15:31:20.930000 | 2011-06-10T15:35:58.557000 |
6,308,612 | 6,308,685 | Reasoning behind not using non-implemented Interfaces to hold constants? | In his book Effective Java, Joshua Bloch recommends against using Interfaces to hold constants, The constant interface pattern is a poor use of interfaces. That a class uses some constants internally is an implementation detail. Implementing a constant interface causes this implementation detail to leak into the class’... | I don't think a class with a private constructor is any better than using an interface. What the quote says is that using implements ConstantInterface is not best pratice because this interface becomes part of the API. However, you can use static import or qualified names like SomeInteface.FOO of the values from the in... | Reasoning behind not using non-implemented Interfaces to hold constants? In his book Effective Java, Joshua Bloch recommends against using Interfaces to hold constants, The constant interface pattern is a poor use of interfaces. That a class uses some constants internally is an implementation detail. Implementing a con... | TITLE:
Reasoning behind not using non-implemented Interfaces to hold constants?
QUESTION:
In his book Effective Java, Joshua Bloch recommends against using Interfaces to hold constants, The constant interface pattern is a poor use of interfaces. That a class uses some constants internally is an implementation detail. ... | [
"java",
"interface",
"constants"
] | 5 | 3 | 571 | 4 | 0 | 2011-06-10T15:31:34.453000 | 2011-06-10T15:36:05.750000 |
6,308,616 | 6,308,640 | C# return a string from another void | I'm pretty sure this is an easy one. I simply want to return a string from another void. public static void LinkWorker(string baseURLString) { // do some stuff here HTMLWork(baseURLStringCycle) --> this is where i need xstring returned foreach(string xyString in xstring.split('\n')) { } }
public static void HTMLWork(s... | You do not want a void method, you want a method returning type string. public static string HTMLWork(string baseURLStringCycle) { //... return xString; } | C# return a string from another void I'm pretty sure this is an easy one. I simply want to return a string from another void. public static void LinkWorker(string baseURLString) { // do some stuff here HTMLWork(baseURLStringCycle) --> this is where i need xstring returned foreach(string xyString in xstring.split('\n'))... | TITLE:
C# return a string from another void
QUESTION:
I'm pretty sure this is an easy one. I simply want to return a string from another void. public static void LinkWorker(string baseURLString) { // do some stuff here HTMLWork(baseURLStringCycle) --> this is where i need xstring returned foreach(string xyString in xs... | [
"c#"
] | 0 | 9 | 24,658 | 8 | 0 | 2011-06-10T15:31:45.607000 | 2011-06-10T15:33:26.107000 |
6,308,633 | 6,308,684 | Is there a way to do two different functions? | For an example, if I want the user to do both click and keypress that will give the same output. I would not like to have two of the same codes. If I had something like $('#next').click(function(){ // code goes here }); I would like to also implement this $(document).keydown(function(e){ if (e.keyCode == 37) { alert( "... | function myFunc() { alert("left pressed"); }
$("#next").click(myFunc);
$(document).keypress(function(e) { if(e.keyCode == 37) myFunc(); }); You could also have myFunc() handle both events like so.. function myFunc(e) { // First we check to see if this event has a keyCode property // If so, then we need to check the v... | Is there a way to do two different functions? For an example, if I want the user to do both click and keypress that will give the same output. I would not like to have two of the same codes. If I had something like $('#next').click(function(){ // code goes here }); I would like to also implement this $(document).keydow... | TITLE:
Is there a way to do two different functions?
QUESTION:
For an example, if I want the user to do both click and keypress that will give the same output. I would not like to have two of the same codes. If I had something like $('#next').click(function(){ // code goes here }); I would like to also implement this ... | [
"jquery",
"javascript"
] | 4 | 5 | 96 | 4 | 0 | 2011-06-10T15:32:55.610000 | 2011-06-10T15:36:04.220000 |
6,308,653 | 6,308,695 | Why is the base class method called if the derived class overrides the method? | consider the following program: class Base { public: virtual void foo() const { cout << "Base::foo()" << endl; } };
class Derived: public Base { public: virtual void foo() { cout << "Derived::foo()" << endl; } };
void func(Base& obj) { obj.foo(); }
void main() { Derived d; func(d); // Base::foo() is printed } If I r... | In the derived class, the function signature is this: virtual void foo(); //Derived::foo which doesn't mention const. Its a non-const member function, while the Base::foo is a const member function. They're two different functions, because const is a part of the function signature. virtual void foo() const; //Base::foo... | Why is the base class method called if the derived class overrides the method? consider the following program: class Base { public: virtual void foo() const { cout << "Base::foo()" << endl; } };
class Derived: public Base { public: virtual void foo() { cout << "Derived::foo()" << endl; } };
void func(Base& obj) { obj... | TITLE:
Why is the base class method called if the derived class overrides the method?
QUESTION:
consider the following program: class Base { public: virtual void foo() const { cout << "Base::foo()" << endl; } };
class Derived: public Base { public: virtual void foo() { cout << "Derived::foo()" << endl; } };
void fun... | [
"c++",
"inheritance"
] | 6 | 7 | 4,193 | 5 | 0 | 2011-06-10T15:34:01.190000 | 2011-06-10T15:36:49.273000 |
6,308,657 | 6,309,489 | NSNotification does not reach all Observers | I use NSNotification for a particular set of events. I have three views such that I have an "ADD" button on view 1 and clicking that makes me navigate from view 1 to view 2 to view 3 and again back to view 1. 1->2->3->1 I use NSNotification s to push a view controller if the ADD button on view 1 is clicked, and I updat... | Navigating back to 1 using navigation controller will remove 2 and 3. So in dealloc, add a log saying that the particular controller has stopped listening. You shall see that the listener is being deallocated after which it won't listen to notifications. Updated the sample to send a notification on return. | NSNotification does not reach all Observers I use NSNotification for a particular set of events. I have three views such that I have an "ADD" button on view 1 and clicking that makes me navigate from view 1 to view 2 to view 3 and again back to view 1. 1->2->3->1 I use NSNotification s to push a view controller if the ... | TITLE:
NSNotification does not reach all Observers
QUESTION:
I use NSNotification for a particular set of events. I have three views such that I have an "ADD" button on view 1 and clicking that makes me navigate from view 1 to view 2 to view 3 and again back to view 1. 1->2->3->1 I use NSNotification s to push a view ... | [
"objective-c",
"ios",
"cocoa-touch",
"uiviewcontroller",
"nsnotifications"
] | 3 | 3 | 1,157 | 2 | 0 | 2011-06-10T15:34:10.747000 | 2011-06-10T16:39:52.207000 |
6,308,667 | 6,308,716 | iPhone web-app parse html with PHP or JavaScript? | I'm making a web-app for iPhone/iPod touch. And need to load in a external HTML file and parse some data out of that HTML file. I can do this on the server (on a separate page) and echo the data with json. Then I load that page with AJAX after the web-app is loaded. But I can also load the complete HTML file with AJAX ... | Loading the JSON from an AJAX call would be faster than parsing an HTML file in JavaScript (Since JSON is "near-native" in JS). NOTE: To qualify this answer, it would be faster for the client (iPhone/iPod). | iPhone web-app parse html with PHP or JavaScript? I'm making a web-app for iPhone/iPod touch. And need to load in a external HTML file and parse some data out of that HTML file. I can do this on the server (on a separate page) and echo the data with json. Then I load that page with AJAX after the web-app is loaded. But... | TITLE:
iPhone web-app parse html with PHP or JavaScript?
QUESTION:
I'm making a web-app for iPhone/iPod touch. And need to load in a external HTML file and parse some data out of that HTML file. I can do this on the server (on a separate page) and echo the data with json. Then I load that page with AJAX after the web-... | [
"php",
"javascript",
"ajax",
"html-parsing",
"iphone-web-app"
] | 0 | 1 | 343 | 1 | 0 | 2011-06-10T15:34:51.090000 | 2011-06-10T15:38:50.580000 |
6,308,668 | 6,309,126 | Writing to a remote MSMQ | Okay, here is a very simple and fundamental question. If I have an application on windows machine A that wants to write to a queue on windows machine B, do I need to have MSMQ installed on machine A (even though there is no queue there)? I am just beginning to use queues for my applications and trying to figure some fu... | Yes, you need MSMQ installed locally to write to a remote queue. If you're writing to a private queue, take a look at this page which has useful information on how to format the queue name. If you're writing to a remote Transactional queue, then you need to make sure you specify that correctly (point 5) This is the art... | Writing to a remote MSMQ Okay, here is a very simple and fundamental question. If I have an application on windows machine A that wants to write to a queue on windows machine B, do I need to have MSMQ installed on machine A (even though there is no queue there)? I am just beginning to use queues for my applications and... | TITLE:
Writing to a remote MSMQ
QUESTION:
Okay, here is a very simple and fundamental question. If I have an application on windows machine A that wants to write to a queue on windows machine B, do I need to have MSMQ installed on machine A (even though there is no queue there)? I am just beginning to use queues for m... | [
".net",
"windows",
"msmq"
] | 26 | 49 | 31,846 | 4 | 0 | 2011-06-10T15:34:56.503000 | 2011-06-10T16:11:13.890000 |
6,308,675 | 6,308,879 | How to track which network ports any program is trying to use? | I want to see what kind of connections any program is doing, which port and see the program exe path etc. I'm trying to achieve some sort of firewall notification system, it would pop up a window for me to tell that this and that port needs to be opened in order the program could work properly. How do i get started on ... | You'll need to hook the socket API for each process you're willing to provide this functionality, or write a filter using WFP and a client application that receive the informations from your filter and shows a notification window. | How to track which network ports any program is trying to use? I want to see what kind of connections any program is doing, which port and see the program exe path etc. I'm trying to achieve some sort of firewall notification system, it would pop up a window for me to tell that this and that port needs to be opened in ... | TITLE:
How to track which network ports any program is trying to use?
QUESTION:
I want to see what kind of connections any program is doing, which port and see the program exe path etc. I'm trying to achieve some sort of firewall notification system, it would pop up a window for me to tell that this and that port need... | [
"c++",
"windows",
"winapi",
"networking",
"network-programming"
] | 1 | 1 | 349 | 3 | 0 | 2011-06-10T15:35:22.753000 | 2011-06-10T15:51:22.580000 |
6,308,687 | 6,308,702 | PHP number format | I have this string: 000000000000100 and need to convert it to: 1,00 So, the rules are: Divide the number by 100 and use a comma as decimal separator Strip leading zeros Keep two decimals | From the PHP Manual page on number_format: string number_format ( float $number, int $decimals = 0, string $dec_point = '.', string $thousands_sep = ',' ) If you want numbers like 123456 be formatted as 1234,45, use: echo number_format($number / 100, 2, ",", ""); If you need a dot as thousands separator ( 1.234,56 ): e... | PHP number format I have this string: 000000000000100 and need to convert it to: 1,00 So, the rules are: Divide the number by 100 and use a comma as decimal separator Strip leading zeros Keep two decimals | TITLE:
PHP number format
QUESTION:
I have this string: 000000000000100 and need to convert it to: 1,00 So, the rules are: Divide the number by 100 and use a comma as decimal separator Strip leading zeros Keep two decimals
ANSWER:
From the PHP Manual page on number_format: string number_format ( float $number, int $de... | [
"php",
"number-formatting"
] | 6 | 21 | 21,721 | 2 | 0 | 2011-06-10T15:36:10.443000 | 2011-06-10T15:37:29.937000 |
6,308,708 | 6,308,799 | Making only portion of screen modal with jQuery UI | Is there any way to create a modal 'scope' for jQuery dialogs? As a somewhat contrived example, I've got a page: Console I want to create some modal dialogs for the mainContent area. When the dialog is open, I want to not allow interaction with the mainContent area, but still allow interaction with the toolbar and foot... | Simple solution would be to have a hidden div that would act as an overlay. It would always have the same dimensions and positioning as your "mainContent" div. Then show that div over the top of your content by using the z-index. Then place your modal on top of the overlay. Net effect, everything will be covered in mai... | Making only portion of screen modal with jQuery UI Is there any way to create a modal 'scope' for jQuery dialogs? As a somewhat contrived example, I've got a page: Console I want to create some modal dialogs for the mainContent area. When the dialog is open, I want to not allow interaction with the mainContent area, bu... | TITLE:
Making only portion of screen modal with jQuery UI
QUESTION:
Is there any way to create a modal 'scope' for jQuery dialogs? As a somewhat contrived example, I've got a page: Console I want to create some modal dialogs for the mainContent area. When the dialog is open, I want to not allow interaction with the ma... | [
"javascript",
"jquery-ui",
"modal-dialog"
] | 7 | 3 | 2,045 | 1 | 0 | 2011-06-10T15:38:11.693000 | 2011-06-10T15:45:45.720000 |
6,308,710 | 6,308,743 | Setting properties with {} braces when instantiating | Anyone knows why the following will not compile? The setter for ID is supposed to be private for both classes, so why can we instantiate ClassA but not ClassB? public class ClassA { public string ID { get; private set; }
public void test() { var instanceA = new ClassA() { ID = "42" }; var instanceB = new ClassB() { ID... | test() is a member of ClassA, so it has access to the private members (and the setter) of A. It does not have access to the private members or setters of ClassB, hence the error on instanceB but not instanceA. For more on accessibility of private members, I encourage you to see this answer on a related question. | Setting properties with {} braces when instantiating Anyone knows why the following will not compile? The setter for ID is supposed to be private for both classes, so why can we instantiate ClassA but not ClassB? public class ClassA { public string ID { get; private set; }
public void test() { var instanceA = new Clas... | TITLE:
Setting properties with {} braces when instantiating
QUESTION:
Anyone knows why the following will not compile? The setter for ID is supposed to be private for both classes, so why can we instantiate ClassA but not ClassB? public class ClassA { public string ID { get; private set; }
public void test() { var in... | [
"c#",
"instantiation"
] | 4 | 10 | 4,787 | 3 | 0 | 2011-06-10T15:38:24.437000 | 2011-06-10T15:41:00.083000 |
6,308,714 | 6,309,042 | Windows LoadMenu error: "The specified resource name cannot be found in the image file." | I'm writing a program that, among other things, needs to display a context menu on right-click. I'm trapping WM_NOTIFY, the identifier of the control being clicked on, and NM_RCLICK. That all works great. The problem comes in when I'm processing that right-click: case NM_RCLICK: { HMENU Popup = LoadMenu(0, MAKEINTRESOU... | The first parameter to LoadMenu must be a handle to your executable image where the resource resides. The handle is the first HINSTANCE that you get in WinMain. Alternatively you can obtain it by a call to GetModuleHandle(0). | Windows LoadMenu error: "The specified resource name cannot be found in the image file." I'm writing a program that, among other things, needs to display a context menu on right-click. I'm trapping WM_NOTIFY, the identifier of the control being clicked on, and NM_RCLICK. That all works great. The problem comes in when ... | TITLE:
Windows LoadMenu error: "The specified resource name cannot be found in the image file."
QUESTION:
I'm writing a program that, among other things, needs to display a context menu on right-click. I'm trapping WM_NOTIFY, the identifier of the control being clicked on, and NM_RCLICK. That all works great. The prob... | [
"c++",
"windows",
"resources",
"contextmenu"
] | 1 | 1 | 4,756 | 1 | 0 | 2011-06-10T15:38:39.603000 | 2011-06-10T16:04:35.143000 |
6,308,738 | 6,308,790 | iOS SDK: Conjoined Text Fields | I don't know if I'm completely missing the boat here or what, but I can't figure out how to achieve conjoined email/password text fields like on the flow login screen. Any help is appreciated! FYI: I'm using XCode 3.2.5 | It's a custom table view cell with a label and a text field in a grouped table view probably with a single section and two rows one of which is for username and other for password. The logo could be the table view's header. | iOS SDK: Conjoined Text Fields I don't know if I'm completely missing the boat here or what, but I can't figure out how to achieve conjoined email/password text fields like on the flow login screen. Any help is appreciated! FYI: I'm using XCode 3.2.5 | TITLE:
iOS SDK: Conjoined Text Fields
QUESTION:
I don't know if I'm completely missing the boat here or what, but I can't figure out how to achieve conjoined email/password text fields like on the flow login screen. Any help is appreciated! FYI: I'm using XCode 3.2.5
ANSWER:
It's a custom table view cell with a label... | [
"iphone",
"ios",
"xcode",
"interface-builder"
] | 5 | 4 | 1,764 | 3 | 0 | 2011-06-10T15:40:25.083000 | 2011-06-10T15:44:50.590000 |
6,308,744 | 6,309,372 | How do I deploy a VBA Excel Add-In (foo.xlam) using an msi installer? | I am a C# developer who is bundling a colleague's VBA Excel Add-In (.xlam file) with my msi installer (built using a VS Deployment project if that matters). The.xlam is placed in the application folder (C:\Program Files (x86)\MyCompany\TheProduct) directory. Users are forced to navigate to Excel Options > Add-Ins > Man... | Windows Installer doesn't have direct support for this. So either you use some custom actions or you buy a tool which offers direct support for installing Office add-ins. | How do I deploy a VBA Excel Add-In (foo.xlam) using an msi installer? I am a C# developer who is bundling a colleague's VBA Excel Add-In (.xlam file) with my msi installer (built using a VS Deployment project if that matters). The.xlam is placed in the application folder (C:\Program Files (x86)\MyCompany\TheProduct) di... | TITLE:
How do I deploy a VBA Excel Add-In (foo.xlam) using an msi installer?
QUESTION:
I am a C# developer who is bundling a colleague's VBA Excel Add-In (.xlam file) with my msi installer (built using a VS Deployment project if that matters). The.xlam is placed in the application folder (C:\Program Files (x86)\MyComp... | [
"excel",
"windows-installer",
"vba"
] | 5 | 1 | 8,592 | 4 | 0 | 2011-06-10T15:41:03.893000 | 2011-06-10T16:31:00.673000 |
6,308,757 | 6,309,152 | What happens during a display mode change? | What happens during a display mode change (resolution, depth) on an ordinary computer? (classical stationarys and laptops) It might not be so trivial since video cards are so different, but one thing is common to all of them: The screen goes black (understandable since the signal is turned off) It takes many seconds fo... | The only thing that actually changes are the settings of the so called RAMDAC (a Digital Analog Converter directly attached to the video RAM), well today with digital connections it's more like a RAMTX (a DVI/HDMI/DisplayPort Transmitter attached to the video RAM). DOS graphics programmer veterans probably remember the... | What happens during a display mode change? What happens during a display mode change (resolution, depth) on an ordinary computer? (classical stationarys and laptops) It might not be so trivial since video cards are so different, but one thing is common to all of them: The screen goes black (understandable since the sig... | TITLE:
What happens during a display mode change?
QUESTION:
What happens during a display mode change (resolution, depth) on an ordinary computer? (classical stationarys and laptops) It might not be so trivial since video cards are so different, but one thing is common to all of them: The screen goes black (understand... | [
"windows",
"opengl",
"graphics",
"direct3d"
] | 14 | 13 | 574 | 1 | 0 | 2011-06-10T15:42:16.957000 | 2011-06-10T16:13:22.533000 |
6,308,772 | 6,309,130 | How to center align a view? | I need to lay a variable number of views (may just be one) next to each other like in LinearLayout. But I want the whole arrangement to be center aligned. The views should be next to each other. But the whole arrangement should be equidistant from the left and right edge of the screen or the containing parent. How can ... | You will have to wrap your views inside a LinearLayout and your linear layout inside something else: etc... Make sure all your views use android:layout_width="wrap_content". If you are working with RelativeLayout, it will be: | How to center align a view? I need to lay a variable number of views (may just be one) next to each other like in LinearLayout. But I want the whole arrangement to be center aligned. The views should be next to each other. But the whole arrangement should be equidistant from the left and right edge of the screen or the... | TITLE:
How to center align a view?
QUESTION:
I need to lay a variable number of views (may just be one) next to each other like in LinearLayout. But I want the whole arrangement to be center aligned. The views should be next to each other. But the whole arrangement should be equidistant from the left and right edge of... | [
"android",
"android-layout"
] | 10 | 23 | 32,245 | 3 | 0 | 2011-06-10T15:43:23.557000 | 2011-06-10T16:11:15.757000 |
6,308,778 | 6,308,822 | MS Access query - select most recent date | I have a query I'm designing which grabs data from multiple different tables. In MS Access 2010, how would I create one of the query columns so that it returns the most recent date out of a series of dates, for each user in the table: Sample data from table: userid: | appointment: 000001 | 05/10/2009 000001 | 05/10/201... | SELECT userid, Max(appointment) AS most_recent FROM YourTable GROUP BY userid; | MS Access query - select most recent date I have a query I'm designing which grabs data from multiple different tables. In MS Access 2010, how would I create one of the query columns so that it returns the most recent date out of a series of dates, for each user in the table: Sample data from table: userid: | appointme... | TITLE:
MS Access query - select most recent date
QUESTION:
I have a query I'm designing which grabs data from multiple different tables. In MS Access 2010, how would I create one of the query columns so that it returns the most recent date out of a series of dates, for each user in the table: Sample data from table: u... | [
"date",
"ms-access"
] | 4 | 5 | 16,602 | 2 | 0 | 2011-06-10T15:43:50.817000 | 2011-06-10T15:47:23.993000 |
6,308,782 | 6,308,793 | Convert JNI types to Native types | While there is documentation regarding turning a jstring to a native string ( string nativeString = env->GetStringUTFChars(jStringVariable, NULL); ) I can't find an example which will convert a jboolean to a bool or a jint to an int. Can anyone suggest how this is achieved? | You just need to cast jint to int using C style casts. Same for jboolean to bool (if you're using C99 bool type) or to uint8_t (if you're using std int types) or to unsigned char. Open $NDK_ROOT/platforms/android-8/arch-arm/usr/include/jni.h and you'll see jint, jboolean etc are just typedef s. | Convert JNI types to Native types While there is documentation regarding turning a jstring to a native string ( string nativeString = env->GetStringUTFChars(jStringVariable, NULL); ) I can't find an example which will convert a jboolean to a bool or a jint to an int. Can anyone suggest how this is achieved? | TITLE:
Convert JNI types to Native types
QUESTION:
While there is documentation regarding turning a jstring to a native string ( string nativeString = env->GetStringUTFChars(jStringVariable, NULL); ) I can't find an example which will convert a jboolean to a bool or a jint to an int. Can anyone suggest how this is ach... | [
"java-native-interface",
"android-ndk"
] | 55 | 66 | 66,429 | 6 | 0 | 2011-06-10T15:44:09.507000 | 2011-06-10T15:45:18.100000 |
6,308,794 | 6,308,904 | @Html.ValidationMessageFor() custom validationMessage always shown | I am trying to use a different message for @Html.ValidationMessageFor() in ASP.NET MVC3. This works fine but it seems to make the message be always displayed, e.g. if I do this: @Html.ValidationMessageFor(model => model.TimesheetEntry.Product) then the error is only shown when I submit the form and it is invalid. Howev... | Have you tried the CSS from this question?.field-validation-valid { display: none; }.validation-summary-valid { display: none; } | @Html.ValidationMessageFor() custom validationMessage always shown I am trying to use a different message for @Html.ValidationMessageFor() in ASP.NET MVC3. This works fine but it seems to make the message be always displayed, e.g. if I do this: @Html.ValidationMessageFor(model => model.TimesheetEntry.Product) then the ... | TITLE:
@Html.ValidationMessageFor() custom validationMessage always shown
QUESTION:
I am trying to use a different message for @Html.ValidationMessageFor() in ASP.NET MVC3. This works fine but it seems to make the message be always displayed, e.g. if I do this: @Html.ValidationMessageFor(model => model.TimesheetEntry.... | [
"forms",
"asp.net-mvc-3"
] | 31 | 50 | 29,725 | 4 | 0 | 2011-06-10T15:45:20.420000 | 2011-06-10T15:53:07.100000 |
6,308,801 | 6,308,923 | Replace DOM element with a DOM element and children, of which exists in an eternal .html(?) file | Rewriting an html element's content, or itself is easy via jquery, but is it possible to replace an element with an element that exists on another page/file? My point is that i don't want this info that i'm trying to retrieve to be on the page by default as it would clog up the file and bloat the file size... To provid... | Try this: jQuery.get('myFile.html', function(data) { jQuery('#myElement').html(data); }); Or to replace the element itselft: jQuery.get('myFile.html', function(data) { jQuery('#myElement').replaceWith(data); }); | Replace DOM element with a DOM element and children, of which exists in an eternal .html(?) file Rewriting an html element's content, or itself is easy via jquery, but is it possible to replace an element with an element that exists on another page/file? My point is that i don't want this info that i'm trying to retrie... | TITLE:
Replace DOM element with a DOM element and children, of which exists in an eternal .html(?) file
QUESTION:
Rewriting an html element's content, or itself is easy via jquery, but is it possible to replace an element with an element that exists on another page/file? My point is that i don't want this info that i'... | [
"jquery",
"append"
] | 0 | 1 | 1,427 | 1 | 0 | 2011-06-10T15:45:54.617000 | 2011-06-10T15:54:50.287000 |
6,308,803 | 6,308,837 | Sending $(this) in a callback | I have this jQuery click event $('#sidebar.nav a span').click(function () { var sidebar_nav = $(this); $("#main").load("type_change.php?id="+id, successCallback); And then i have the callback to do the binding var successCallback = function(responseText, textStatus, XMLHttpRequest) { //doing all the binding in here } I... | You could use $.proxy: $("#main").load("type_change.php?id="+id, $.proxy(successCallback, $(this))); This will set this inside successCallback to whatever you pass as second parameter. If you want this still to refer to $("#main"), then you could change the callback to accept one more parameter: var successCallback = f... | Sending $(this) in a callback I have this jQuery click event $('#sidebar.nav a span').click(function () { var sidebar_nav = $(this); $("#main").load("type_change.php?id="+id, successCallback); And then i have the callback to do the binding var successCallback = function(responseText, textStatus, XMLHttpRequest) { //doi... | TITLE:
Sending $(this) in a callback
QUESTION:
I have this jQuery click event $('#sidebar.nav a span').click(function () { var sidebar_nav = $(this); $("#main").load("type_change.php?id="+id, successCallback); And then i have the callback to do the binding var successCallback = function(responseText, textStatus, XMLHt... | [
"jquery"
] | 7 | 7 | 244 | 4 | 0 | 2011-06-10T15:45:55.613000 | 2011-06-10T15:48:24.327000 |
6,308,807 | 6,309,426 | Rendering different templates for the same XML element, at same level | XML: el1 el2 el1 el2 Trying to generate to apply two different templates for the same element. Main template: At root level Render something more render something here render something else here If I add mode to the first template, both don't render. Also tried: with the different template to apply as: Only one of the ... | At root level After first template First template Second template | Rendering different templates for the same XML element, at same level XML: el1 el2 el1 el2 Trying to generate to apply two different templates for the same element. Main template: At root level Render something more render something here render something else here If I add mode to the first template, both don't render.... | TITLE:
Rendering different templates for the same XML element, at same level
QUESTION:
XML: el1 el2 el1 el2 Trying to generate to apply two different templates for the same element. Main template: At root level Render something more render something here render something else here If I add mode to the first template, ... | [
"xml",
"templates",
"xslt",
"apply-templates"
] | 2 | 5 | 4,262 | 2 | 0 | 2011-06-10T15:46:05.397000 | 2011-06-10T16:34:35.660000 |
6,308,808 | 6,308,866 | Force show soft keyboard from within an AlertDialog | I have the following code which I think should work to force the keyboard to be shown when the Alert Dialog is shown. public void showTypeBox(){ edit = new EditText(this); edit.setPadding(10, 0, 0, 10);
AlertDialog dialog = new AlertDialog.Builder(this).setTitle("Type word to search for:").setPositiveButton("Search", ... | You're trying to show the keyboard before the EditText is laid out and visible. Try this: Handler delayedRun = new Handler(); delayedRun.post(new Runnable() { @Override public void run() { edit.requestFocus(); InputMethodManager mgr = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); mgr... | Force show soft keyboard from within an AlertDialog I have the following code which I think should work to force the keyboard to be shown when the Alert Dialog is shown. public void showTypeBox(){ edit = new EditText(this); edit.setPadding(10, 0, 0, 10);
AlertDialog dialog = new AlertDialog.Builder(this).setTitle("Typ... | TITLE:
Force show soft keyboard from within an AlertDialog
QUESTION:
I have the following code which I think should work to force the keyboard to be shown when the Alert Dialog is shown. public void showTypeBox(){ edit = new EditText(this); edit.setPadding(10, 0, 0, 10);
AlertDialog dialog = new AlertDialog.Builder(t... | [
"java",
"android",
"keyboard"
] | 2 | 5 | 1,250 | 1 | 0 | 2011-06-10T15:46:06.410000 | 2011-06-10T15:50:42.943000 |
6,308,809 | 6,308,981 | Why Java SHA1 does not Initial Vector? | I am trying to use java in built method (MessageDigest) to implement SHA1. However, in examples I have not find any method parameters to declare Initial Vector. Can anybody help me about this???? Thanks in advance...... | I am in no way an expert in cryptography, but logically thinking, what woud IV be needed for in digest? The point of digest is to produce seemingly random result for each input message but, as with any other hash, it must be the same for the same input. IV on the other hand are used to modify encryption algorithm to ha... | Why Java SHA1 does not Initial Vector? I am trying to use java in built method (MessageDigest) to implement SHA1. However, in examples I have not find any method parameters to declare Initial Vector. Can anybody help me about this???? Thanks in advance...... | TITLE:
Why Java SHA1 does not Initial Vector?
QUESTION:
I am trying to use java in built method (MessageDigest) to implement SHA1. However, in examples I have not find any method parameters to declare Initial Vector. Can anybody help me about this???? Thanks in advance......
ANSWER:
I am in no way an expert in crypto... | [
"java",
"security"
] | 0 | 5 | 927 | 1 | 0 | 2011-06-10T15:46:10.877000 | 2011-06-10T15:59:05.310000 |
6,308,817 | 6,309,303 | Wpf treeview selectedItem databinding | I have a view where I've got an object bound to a treeview. The object has a number of collections (of different types) so I'm using hiearchical templates with a CompositeCollection to display them in the treeview. I've then got a textbox that is bound to the treeview's selectedItem. Here I'm serialising the selectedIt... | I do not think you need to do two-way databinding on the SelectedItem itself, you should expose a property in the class of your bound object which returns the serialized string and upon set modifies the object appropriately. This should be easier than dealing with the object as a whole. | Wpf treeview selectedItem databinding I have a view where I've got an object bound to a treeview. The object has a number of collections (of different types) so I'm using hiearchical templates with a CompositeCollection to display them in the treeview. I've then got a textbox that is bound to the treeview's selectedIte... | TITLE:
Wpf treeview selectedItem databinding
QUESTION:
I have a view where I've got an object bound to a treeview. The object has a number of collections (of different types) so I'm using hiearchical templates with a CompositeCollection to display them in the treeview. I've then got a textbox that is bound to the tree... | [
"wpf",
"treeview",
"2-way-object-databinding"
] | 0 | 0 | 885 | 2 | 0 | 2011-06-10T15:46:33.400000 | 2011-06-10T16:24:39.847000 |
6,308,819 | 6,308,861 | How to ignore numbers when doing string.startswith() in python? | I have a directory with a large number of files. The file names are similar to the following: the(number)one(number), where (number) can be any number. There are also files with the name: the(number), where (number) can be any number. I was wondering how I can count the number of files with the additional "one(number)"... | Use a regex matching 'one\d+' using the re module. import re for n in list: if re.search(r"one\d+", n): add one to a counter If you want to make it very accurate, you can even do: for n in list: if re.search(r"^the\d+one\d+$", n): add one to a counter Which will even take care of any possible non digit chars between "t... | How to ignore numbers when doing string.startswith() in python? I have a directory with a large number of files. The file names are similar to the following: the(number)one(number), where (number) can be any number. There are also files with the name: the(number), where (number) can be any number. I was wondering how I... | TITLE:
How to ignore numbers when doing string.startswith() in python?
QUESTION:
I have a directory with a large number of files. The file names are similar to the following: the(number)one(number), where (number) can be any number. There are also files with the name: the(number), where (number) can be any number. I w... | [
"python"
] | 0 | 8 | 542 | 3 | 0 | 2011-06-10T15:46:46.470000 | 2011-06-10T15:50:07.590000 |
6,308,824 | 6,308,912 | Should node.js changes be instantaneous? | Seeing how node.js is ultimately javascript, shouldn't changes to any files be seen when trying to run the app command? I've forked the yuidocjs repo on github and am trying to work my way through my local build, but for some reason my minor changes do not get picked up. I'm new to node.js so I'm not really sure what t... | In node.js when you require a file the source code gets interpreted. It's considered good practice to require all code when you start the server so all the code gets interpreted once. The code does not get re-interpreted whenever you run it though. So changes are not instantaneous. To help you out, try supervisor which... | Should node.js changes be instantaneous? Seeing how node.js is ultimately javascript, shouldn't changes to any files be seen when trying to run the app command? I've forked the yuidocjs repo on github and am trying to work my way through my local build, but for some reason my minor changes do not get picked up. I'm new... | TITLE:
Should node.js changes be instantaneous?
QUESTION:
Seeing how node.js is ultimately javascript, shouldn't changes to any files be seen when trying to run the app command? I've forked the yuidocjs repo on github and am trying to work my way through my local build, but for some reason my minor changes do not get ... | [
"node.js"
] | 2 | 3 | 542 | 2 | 0 | 2011-06-10T15:47:38.633000 | 2011-06-10T15:53:46.953000 |
6,308,827 | 6,309,196 | merging two stored procedures | So this is what i thought of doing but now the error i am getting is: Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP BY clause and not sure which part it means - the overall code i am trying to get open cases based on two different levels one is to return cases based on dat... | If I understood you right, you need something like: CREATE PROCEDURE new_proc AS BEGIN DECLARE @tmp_proc1 TABLE (// list all fields your first procedure returns ); DECLARE @tmp_proc2 TABLE (// list fields that your second SP returns); INSERT INTO @tmp_proc1 EXECUTE Your_First_Procedure; INSERT INTO @tmp_proc2 EXECUTE Y... | merging two stored procedures So this is what i thought of doing but now the error i am getting is: Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP BY clause and not sure which part it means - the overall code i am trying to get open cases based on two different levels one i... | TITLE:
merging two stored procedures
QUESTION:
So this is what i thought of doing but now the error i am getting is: Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP BY clause and not sure which part it means - the overall code i am trying to get open cases based on two diff... | [
"sql-server",
"stored-procedures"
] | 1 | 0 | 3,521 | 2 | 0 | 2011-06-10T15:47:53.117000 | 2011-06-10T16:16:47.227000 |
6,308,839 | 6,310,140 | How can I tell when my instrumented application is in front? | My instrumentation is launching an activity to instrument it, but I can't seem to find an elegant way to tell when it's safe to start sending it my MotionEvent 's. At the moment, I'm continually sending it MotionEvent 's, and catching the SecurityException 's that get thrown when the wrong application receives them. Th... | You might be able to leverage the standard Android lifecycle methods that get called on your Activity. You could set an 'infront' flag in onResume(), and clear it in onPause(). Then your instrumentation test just checks that flag to know when it's safe to send MotionEvents. If you don't want to pollute your app by putt... | How can I tell when my instrumented application is in front? My instrumentation is launching an activity to instrument it, but I can't seem to find an elegant way to tell when it's safe to start sending it my MotionEvent 's. At the moment, I'm continually sending it MotionEvent 's, and catching the SecurityException 's... | TITLE:
How can I tell when my instrumented application is in front?
QUESTION:
My instrumentation is launching an activity to instrument it, but I can't seem to find an elegant way to tell when it's safe to start sending it my MotionEvent 's. At the moment, I'm continually sending it MotionEvent 's, and catching the Se... | [
"android",
"instrumentation"
] | 0 | 1 | 187 | 1 | 0 | 2011-06-10T15:48:26.820000 | 2011-06-10T17:44:12.117000 |
6,308,845 | 6,308,919 | Youtube videos in jQuery dialogs always on top of other content | I am having some troubles embedding videos in a jQuery dialog. It displays and plays all well but it is always in front of other dialogs. When I pass another dialog over the one with the video the video stays on top of everything... Can anyone help? | Your issue has nothing to do with jQuery or JavaScript. It has to do with the z-index of a Flash object. I've used this solution before with success... http://manisheriar.com/blog/flash_objects_and_z_index Put your Flash content into a wrapper div called flash Add to your object tag Add wmode="transparent" into the emb... | Youtube videos in jQuery dialogs always on top of other content I am having some troubles embedding videos in a jQuery dialog. It displays and plays all well but it is always in front of other dialogs. When I pass another dialog over the one with the video the video stays on top of everything... Can anyone help? | TITLE:
Youtube videos in jQuery dialogs always on top of other content
QUESTION:
I am having some troubles embedding videos in a jQuery dialog. It displays and plays all well but it is always in front of other dialogs. When I pass another dialog over the one with the video the video stays on top of everything... Can a... | [
"css",
"flash",
"youtube",
"z-index",
"video-embedding"
] | 2 | 1 | 1,880 | 1 | 0 | 2011-06-10T15:48:50.870000 | 2011-06-10T15:54:34.583000 |
6,308,846 | 6,308,884 | C# how to add focus to button issue | I have a windows form application which has a text box and 3 buttons. Now i need to add focus to a button for 1 second, and then add focus to the other button for a second.. like wise to adding focus to all these 3 buttons for 1 second each. How do i do this. I have tried everything but nothing worked. Can someone help... | Not sure why you would want to do that but maybe you can use a Timer and set it's interval to 1000ms and on it's Tick rotate focus as you want. Mind you, it's very user-unfriendly. | C# how to add focus to button issue I have a windows form application which has a text box and 3 buttons. Now i need to add focus to a button for 1 second, and then add focus to the other button for a second.. like wise to adding focus to all these 3 buttons for 1 second each. How do i do this. I have tried everything ... | TITLE:
C# how to add focus to button issue
QUESTION:
I have a windows form application which has a text box and 3 buttons. Now i need to add focus to a button for 1 second, and then add focus to the other button for a second.. like wise to adding focus to all these 3 buttons for 1 second each. How do i do this. I have... | [
"c#",
"button",
"focus"
] | 0 | 0 | 3,285 | 2 | 0 | 2011-06-10T15:48:51.807000 | 2011-06-10T15:51:39.390000 |
6,308,849 | 6,308,874 | PHP GET url iframe | I have: and: If I go to my page, nothing displays unless I end the URL with?goto=. Example: http://example.com/windows8/apps/Flake/index.php?goto=http://google.com How can I make it so that if the user didn't type in?goto=http://google.com, the page displays like a backup website? | If you want to provide a default value for $goto, do it like this: However, you should be aware that by doing this, you allow everyone to construct URLs that point to your server but output to the browser HTML (and more importantly, scripts) that is not under your control (it comes from whatever URL goto points to). Th... | PHP GET url iframe I have: and: If I go to my page, nothing displays unless I end the URL with?goto=. Example: http://example.com/windows8/apps/Flake/index.php?goto=http://google.com How can I make it so that if the user didn't type in?goto=http://google.com, the page displays like a backup website? | TITLE:
PHP GET url iframe
QUESTION:
I have: and: If I go to my page, nothing displays unless I end the URL with?goto=. Example: http://example.com/windows8/apps/Flake/index.php?goto=http://google.com How can I make it so that if the user didn't type in?goto=http://google.com, the page displays like a backup website?
... | [
"php",
"url",
"iframe",
"get"
] | 0 | 5 | 1,105 | 2 | 0 | 2011-06-10T15:49:06.883000 | 2011-06-10T15:50:58.820000 |
6,308,851 | 6,309,066 | LINQ Group by with multiple properties in VB.Net | I spent a lot of time on this problem. I am able to do simple Group By LINQ queries (on one property) but for multiple fields I'm a little stuck... Here is a LINQPad sample of what I want to do: dim lFinal={new with {.Year=2010,.Month=6,.Value1=0,.Value2=0}, new with {.Year=2010,.Month=6,.Value1=2,.Value2=1}, new with ... | Not 100% sure but group by probably uses the Equals() and/or GetHashCode implementation, so when you do the implicit creation: = Group el By Key = new with {el.Year,el.Month} the implicit object doesn't know to check both year and month (just because it has the properties doesn't mean it checks them when comparing to o... | LINQ Group by with multiple properties in VB.Net I spent a lot of time on this problem. I am able to do simple Group By LINQ queries (on one property) but for multiple fields I'm a little stuck... Here is a LINQPad sample of what I want to do: dim lFinal={new with {.Year=2010,.Month=6,.Value1=0,.Value2=0}, new with {.Y... | TITLE:
LINQ Group by with multiple properties in VB.Net
QUESTION:
I spent a lot of time on this problem. I am able to do simple Group By LINQ queries (on one property) but for multiple fields I'm a little stuck... Here is a LINQPad sample of what I want to do: dim lFinal={new with {.Year=2010,.Month=6,.Value1=0,.Value... | [
"vb.net",
"linq",
"list",
"group-by"
] | 9 | 3 | 22,132 | 3 | 0 | 2011-06-10T15:49:15.427000 | 2011-06-10T16:06:49.417000 |
6,308,853 | 6,308,875 | Is it possible to make custom Culture / Region combinations? | I would like to support something like a NL-Us culture. Is this possible? | Yes, it is. You need to start with CultureAndRegionInfoBuilder - the link above is a full howto on MSDN. | Is it possible to make custom Culture / Region combinations? I would like to support something like a NL-Us culture. Is this possible? | TITLE:
Is it possible to make custom Culture / Region combinations?
QUESTION:
I would like to support something like a NL-Us culture. Is this possible?
ANSWER:
Yes, it is. You need to start with CultureAndRegionInfoBuilder - the link above is a full howto on MSDN. | [
"c#",
".net",
"localization"
] | 0 | 3 | 497 | 2 | 0 | 2011-06-10T15:49:21.483000 | 2011-06-10T15:51:08.207000 |
6,308,857 | 6,308,958 | Detect when the Shader is done mixing the audio | so this the code with it i am able to mix several tracks with a Shader done in pixel bender. the problem here i don't know when the mixing is finish or all the sound reache their end to be able to save the bytearray into a file any Event or something like that help plz? package { import flash.display.*; import flash.me... | You can tell when a shader has completed it's job using the ShaderEvent.COMPLETE listener. Like so: shaderJob.addEventListener(ShaderEvent.COMPLETE, onShaderComplete);
private function onShaderComplete(e:Event):void { //Do Something here } See this link for more details. One thing about your code though. You're doing ... | Detect when the Shader is done mixing the audio so this the code with it i am able to mix several tracks with a Shader done in pixel bender. the problem here i don't know when the mixing is finish or all the sound reache their end to be able to save the bytearray into a file any Event or something like that help plz? p... | TITLE:
Detect when the Shader is done mixing the audio
QUESTION:
so this the code with it i am able to mix several tracks with a Shader done in pixel bender. the problem here i don't know when the mixing is finish or all the sound reache their end to be able to save the bytearray into a file any Event or something lik... | [
"actionscript-3",
"pixel-bender"
] | 1 | 0 | 255 | 1 | 0 | 2011-06-10T15:49:36.580000 | 2011-06-10T15:57:19.890000 |
6,308,867 | 6,308,927 | Database Queries in Open Source PHP Projects? | Downloaded a few open source php scripts such as Wordpress and Moodle to study the way they structure there code etc. However when looking through both of these scripts I am always unable to find there database queries (select, insert, update)? Why are they so hidden and how do I find them? | They may actually be generated through an ORM layer. Which is an object that generates a query through the object methods. | Database Queries in Open Source PHP Projects? Downloaded a few open source php scripts such as Wordpress and Moodle to study the way they structure there code etc. However when looking through both of these scripts I am always unable to find there database queries (select, insert, update)? Why are they so hidden and ho... | TITLE:
Database Queries in Open Source PHP Projects?
QUESTION:
Downloaded a few open source php scripts such as Wordpress and Moodle to study the way they structure there code etc. However when looking through both of these scripts I am always unable to find there database queries (select, insert, update)? Why are the... | [
"php",
"database",
"project"
] | 1 | 4 | 204 | 4 | 0 | 2011-06-10T15:50:44.073000 | 2011-06-10T15:55:15.963000 |
6,308,882 | 6,308,977 | Variable undefined in JS | I have some code I copied from an example and I am not certain I understand it, and it is giving me an error that didn't happen when I first used is. On this page: http://www.comehike.com/hikes/uncancel_hike.php?hike_id=30 I get the error: x is not defined on line 84 I am not too certain what x is supposed to be there.... | In your code here x is a parameter that will be passed into the function deleteHike and should be defined, or left null if you do not want a parameter, not knowing what deleteHike does here. Your code will wire up an event when the page is loaded to the element myLink. When that element is clicked even info from the br... | Variable undefined in JS I have some code I copied from an example and I am not certain I understand it, and it is giving me an error that didn't happen when I first used is. On this page: http://www.comehike.com/hikes/uncancel_hike.php?hike_id=30 I get the error: x is not defined on line 84 I am not too certain what x... | TITLE:
Variable undefined in JS
QUESTION:
I have some code I copied from an example and I am not certain I understand it, and it is giving me an error that didn't happen when I first used is. On this page: http://www.comehike.com/hikes/uncancel_hike.php?hike_id=30 I get the error: x is not defined on line 84 I am not ... | [
"javascript"
] | 0 | 2 | 93 | 2 | 0 | 2011-06-10T15:51:37.453000 | 2011-06-10T15:58:53.343000 |
6,308,913 | 6,308,935 | Test method or try-catch? | I was hoping that someone could tell me the best practice for the scenario I am running into with testing my code via junit4. My pseudocode is as follows: public class TestClass {
private String readFromFile(String filePath) { use BufferedReader, get content file input append BufferedReader to StringBuffer return stri... | If it throws an exception and you're not expecting it to, then it's an exceptional situation. If the file cannot be read and the test cannot be performed, it's an error, it's not something related to the tests themselves. Add throws to the readFromFile method and to the test methods using it. | Test method or try-catch? I was hoping that someone could tell me the best practice for the scenario I am running into with testing my code via junit4. My pseudocode is as follows: public class TestClass {
private String readFromFile(String filePath) { use BufferedReader, get content file input append BufferedReader t... | TITLE:
Test method or try-catch?
QUESTION:
I was hoping that someone could tell me the best practice for the scenario I am running into with testing my code via junit4. My pseudocode is as follows: public class TestClass {
private String readFromFile(String filePath) { use BufferedReader, get content file input appen... | [
"java",
"junit4"
] | 0 | 2 | 122 | 1 | 0 | 2011-06-10T15:53:51.287000 | 2011-06-10T15:55:56.177000 |
6,308,915 | 6,308,938 | Member fields, order of construction | In C++, when doing something like what you see below, is the order of construction guaranteed? Logger::Logger(): kFilePath_("../logs/runtime.log"), logFile_(kFilePath_) { //... } | Yes, the order of construction is always guaranteed. It is not, however, guaranteed to be the same as the order in which the objects appear in the initializer list. Member variables are constructed in the order in which they are declared in the body of the class. For example: struct A { }; struct B { };
struct S { A a... | Member fields, order of construction In C++, when doing something like what you see below, is the order of construction guaranteed? Logger::Logger(): kFilePath_("../logs/runtime.log"), logFile_(kFilePath_) { //... } | TITLE:
Member fields, order of construction
QUESTION:
In C++, when doing something like what you see below, is the order of construction guaranteed? Logger::Logger(): kFilePath_("../logs/runtime.log"), logFile_(kFilePath_) { //... }
ANSWER:
Yes, the order of construction is always guaranteed. It is not, however, guar... | [
"c++",
"initialization"
] | 8 | 29 | 4,521 | 2 | 0 | 2011-06-10T15:54:04.320000 | 2011-06-10T15:56:06.313000 |
6,308,917 | 6,309,011 | Execute python command in django admin panel | Is it possible to execute python command in admin panel or in django view?I. e. if I would like to sync database in my app using a button. | Write a custom admin view featuring a form, and when the form is submitted in the view call django.core.management.call_command Remark regarding using a form: As your request will change things at the server-side, a post must be preferred over a get. | Execute python command in django admin panel Is it possible to execute python command in admin panel or in django view?I. e. if I would like to sync database in my app using a button. | TITLE:
Execute python command in django admin panel
QUESTION:
Is it possible to execute python command in admin panel or in django view?I. e. if I would like to sync database in my app using a button.
ANSWER:
Write a custom admin view featuring a form, and when the form is submitted in the view call django.core.manag... | [
"python",
"django"
] | 3 | 3 | 2,963 | 1 | 0 | 2011-06-10T15:54:22.153000 | 2011-06-10T16:01:41.447000 |
6,308,931 | 6,309,019 | Java singleton with inheritance | I have a set of singleton classes and I want to avoid boilerplate code. Here is what I have now: public class Mammal { protected Mammal() {} }
public class Cat extends Mammal { static protected Cat instance = null; static public Cat getInstance() { if (null == instance) { instance = new Cat(); } return instance; }
pr... | You can't since constructors are neither inherited nor overridable. The new Mammal() in your desired example creates only a Mammal, not one of its subclasses. I suggest you look at the Factory pattern, or go to something like Spring, which is intended for just this situation. | Java singleton with inheritance I have a set of singleton classes and I want to avoid boilerplate code. Here is what I have now: public class Mammal { protected Mammal() {} }
public class Cat extends Mammal { static protected Cat instance = null; static public Cat getInstance() { if (null == instance) { instance = new... | TITLE:
Java singleton with inheritance
QUESTION:
I have a set of singleton classes and I want to avoid boilerplate code. Here is what I have now: public class Mammal { protected Mammal() {} }
public class Cat extends Mammal { static protected Cat instance = null; static public Cat getInstance() { if (null == instance... | [
"java",
"inheritance",
"singleton",
"code-formatting"
] | 8 | 3 | 3,811 | 3 | 0 | 2011-06-10T15:55:24.967000 | 2011-06-10T16:02:26.173000 |
6,308,933 | 6,308,972 | Concatenate row-wise across specific columns of dataframe | I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the data frame into a desired form. > str(data) 'data.frame': 680420 obs. of 10 variables: $ A: chr "2011-01-26" "2011-01-26" "2011-02-09" "2011-02-09"... $ B: chr "2011-01-26" "2011-01-27" "2011-02-09" "2011-02... | Try data$id <- paste(data$F, data$E, data$D, data$C, sep="_") instead. The beauty of vectorized code is that you do not need row-by-row loops, or loop-equivalent *apply functions. Edit Even better is data <- within(data, id <- paste(F, E, D, C, sep="")) | Concatenate row-wise across specific columns of dataframe I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the data frame into a desired form. > str(data) 'data.frame': 680420 obs. of 10 variables: $ A: chr "2011-01-26" "2011-01-26" "2011-02-09" "2011-02-09"..... | TITLE:
Concatenate row-wise across specific columns of dataframe
QUESTION:
I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the data frame into a desired form. > str(data) 'data.frame': 680420 obs. of 10 variables: $ A: chr "2011-01-26" "2011-01-26" "2011-02-... | [
"r",
"apply",
"paste",
"string-concatenation",
"sapply"
] | 39 | 69 | 73,984 | 3 | 0 | 2011-06-10T15:55:36.847000 | 2011-06-10T15:58:20.910000 |
6,308,950 | 6,309,323 | Capture Yahoo finance stock data symbols for daily break out, leaders, etc? | I am trying to figure out if there is a way to capture using free Yahoo Finance stock data: 1. Daily 'leaders' with stock symbols, ETFs, options, etc. 2. Any breakout symbols using any classic tecnical analysis indicatoras? 3. Can this be done in real time? Does any one know of a way to do this using programmatic or au... | Last time I used Yahoo's data was about a year ago and they didn't have an API, so I had to request all the data by modifying the URL. You can find all of the information on my blog. Daily 'leaders' with stock symbols, ETFs, options, etc. As far as I know, there is no query which would result in "daily leaders", but if... | Capture Yahoo finance stock data symbols for daily break out, leaders, etc? I am trying to figure out if there is a way to capture using free Yahoo Finance stock data: 1. Daily 'leaders' with stock symbols, ETFs, options, etc. 2. Any breakout symbols using any classic tecnical analysis indicatoras? 3. Can this be done ... | TITLE:
Capture Yahoo finance stock data symbols for daily break out, leaders, etc?
QUESTION:
I am trying to figure out if there is a way to capture using free Yahoo Finance stock data: 1. Daily 'leaders' with stock symbols, ETFs, options, etc. 2. Any breakout symbols using any classic tecnical analysis indicatoras? 3.... | [
"c#",
"stocks",
"stockquotes",
"yahoo-finance"
] | 1 | 3 | 6,455 | 2 | 0 | 2011-06-10T15:56:40.420000 | 2011-06-10T16:25:54.447000 |
6,308,962 | 6,310,366 | Using Javascript to hide/show all text | I have an ASP page that retrieves text from a database but the formatting looks awkward because there's a lot of text and it stretches the page until the end. I'm looking for a solution in javascript that will condense this text into a few lines and have an option to show all once a button is clicked. I'm completely ne... | Note that your asp will, more or less, not be in contact with your Javascript. They are very separate things. That being said, you can have a flag in the C# code and then grab that value in Javascript <%= num; %>, check if it's true, and commit your code. (or better yet check on post back) What you are trying to do sou... | Using Javascript to hide/show all text I have an ASP page that retrieves text from a database but the formatting looks awkward because there's a lot of text and it stretches the page until the end. I'm looking for a solution in javascript that will condense this text into a few lines and have an option to show all once... | TITLE:
Using Javascript to hide/show all text
QUESTION:
I have an ASP page that retrieves text from a database but the formatting looks awkward because there's a lot of text and it stretches the page until the end. I'm looking for a solution in javascript that will condense this text into a few lines and have an optio... | [
"javascript",
"asp.net"
] | 0 | 0 | 190 | 2 | 0 | 2011-06-10T15:57:41.330000 | 2011-06-10T18:06:42.703000 |
6,308,963 | 6,309,008 | Downloading speed limitation in MVC.NET | I have MVC.NET 2.0 project. It allows clients to download files which are stored on server. I use FileContentResult class for these purposes. How do I can add limitation of maximum downloading speed for unregistered users? | There is not automagic way to accomplish this. You will have to take control of the response stream and throttle it. As a quick example, you can look at this URI (notice it is not necessarily THE answer to your problem, but an example): http://www.codeproject.com/KB/IP/Bandwidth_throttling.aspx Translated, this means i... | Downloading speed limitation in MVC.NET I have MVC.NET 2.0 project. It allows clients to download files which are stored on server. I use FileContentResult class for these purposes. How do I can add limitation of maximum downloading speed for unregistered users? | TITLE:
Downloading speed limitation in MVC.NET
QUESTION:
I have MVC.NET 2.0 project. It allows clients to download files which are stored on server. I use FileContentResult class for these purposes. How do I can add limitation of maximum downloading speed for unregistered users?
ANSWER:
There is not automagic way to ... | [
"asp.net-mvc"
] | 0 | 2 | 214 | 2 | 0 | 2011-06-10T15:57:45.810000 | 2011-06-10T16:01:35.630000 |
6,308,967 | 6,309,240 | Javascript - Problem comparing dates | The code below is giving me trouble. When I select July 1st 11:00pm for fromDate, result 3 is being set to Thu Jun 02 2011 11:52:26. I check the values of fromDate and toDate in chrome and they seem fine but result 3 is getting set to a wacky date. Any solutions? function(value, element, params) { fromDate = new Date(s... | result3.setDate(fromDate.getDate()+1) only sets the day of the month of your Date object. Since result3 creates a new Date object, this means that result3 is not having its time set correctly. If you want to set result3 to fromDate plus one day, you'll have to do something like this: var DAY_IN_MILLISECONDS = 1000 * 60... | Javascript - Problem comparing dates The code below is giving me trouble. When I select July 1st 11:00pm for fromDate, result 3 is being set to Thu Jun 02 2011 11:52:26. I check the values of fromDate and toDate in chrome and they seem fine but result 3 is getting set to a wacky date. Any solutions? function(value, ele... | TITLE:
Javascript - Problem comparing dates
QUESTION:
The code below is giving me trouble. When I select July 1st 11:00pm for fromDate, result 3 is being set to Thu Jun 02 2011 11:52:26. I check the values of fromDate and toDate in chrome and they seem fine but result 3 is getting set to a wacky date. Any solutions? f... | [
"javascript"
] | 0 | 1 | 104 | 1 | 0 | 2011-06-10T15:57:55.003000 | 2011-06-10T16:20:24.917000 |
6,308,970 | 6,309,406 | How can I replicate a div a certain number of times based on a select-box value? | I am trying to make a script that, when I choose in the dropdown 4, the div is repeated 4 times. repeat Now the problem is repeat the number of times that the user choose in dropdown. demo | Listening to the "onchange" event on the select element will give you the feedback you need to modify the document structure. Fiddle example HTML JavaScript var select_element = document.createElement("select"); var option_element;
for (var i = 0; i < 10; i++) { option_element = document.createElement("option"); optio... | How can I replicate a div a certain number of times based on a select-box value? I am trying to make a script that, when I choose in the dropdown 4, the div is repeated 4 times. repeat Now the problem is repeat the number of times that the user choose in dropdown. demo | TITLE:
How can I replicate a div a certain number of times based on a select-box value?
QUESTION:
I am trying to make a script that, when I choose in the dropdown 4, the div is repeated 4 times. repeat Now the problem is repeat the number of times that the user choose in dropdown. demo
ANSWER:
Listening to the "oncha... | [
"javascript",
"jquery",
"loops"
] | 1 | 3 | 6,532 | 4 | 0 | 2011-06-10T15:58:15.560000 | 2011-06-10T16:33:27.897000 |
6,308,983 | 6,309,038 | Weird SQL behavior with INSERT and WHERE NOT EXISTS | I have this query, which should insert an amount if an amount equals or higher for the same ID doesn't already exists in the table. I tried this under MySQL 5.1 and MSSQL 2k5: MySQL INSERT IGNORE INTO test (id, amount) SELECT 6, 50 FROM test WHERE NOT EXISTS (SELECT 1 FROM test WHERE amount >= 50 AND id = 6) LIMIT 1 MS... | It fails because the select statement selects values of 6 and 50 based on the number of rows returned. Since your table is empty - no rows are returned to have these values. Modify it to INSERT INTO test (id, amount) SELECT 6, 50 WHERE NOT EXISTS (SELECT TOP 1 1 FROM test WHERE amount >= 50 AND id = 6) | Weird SQL behavior with INSERT and WHERE NOT EXISTS I have this query, which should insert an amount if an amount equals or higher for the same ID doesn't already exists in the table. I tried this under MySQL 5.1 and MSSQL 2k5: MySQL INSERT IGNORE INTO test (id, amount) SELECT 6, 50 FROM test WHERE NOT EXISTS (SELECT 1... | TITLE:
Weird SQL behavior with INSERT and WHERE NOT EXISTS
QUESTION:
I have this query, which should insert an amount if an amount equals or higher for the same ID doesn't already exists in the table. I tried this under MySQL 5.1 and MSSQL 2k5: MySQL INSERT IGNORE INTO test (id, amount) SELECT 6, 50 FROM test WHERE NO... | [
"sql",
"insert"
] | 0 | 2 | 684 | 4 | 0 | 2011-06-10T15:59:26.683000 | 2011-06-10T16:04:21.510000 |
6,308,985 | 6,309,027 | Running jQuery function after all media is loaded | I have a simple jQuery script which pushes the footer to the bottom of the page, even if the content is not long enough: $(document).ready(function(){ positionFooter(); function positionFooter(){ //get the div's padding var padding_top = $("#footer").css("padding-top").replace("px", ""); //get the current page height -... | try $(window).load() You may also want to check the jQuery documentation on the different document loading events: http://api.jquery.com/category/events/document-loading/ Hope it helps | Running jQuery function after all media is loaded I have a simple jQuery script which pushes the footer to the bottom of the page, even if the content is not long enough: $(document).ready(function(){ positionFooter(); function positionFooter(){ //get the div's padding var padding_top = $("#footer").css("padding-top").... | TITLE:
Running jQuery function after all media is loaded
QUESTION:
I have a simple jQuery script which pushes the footer to the bottom of the page, even if the content is not long enough: $(document).ready(function(){ positionFooter(); function positionFooter(){ //get the div's padding var padding_top = $("#footer").c... | [
"javascript",
"jquery",
"events",
"resize"
] | 2 | 8 | 8,653 | 5 | 0 | 2011-06-10T15:59:42.913000 | 2011-06-10T16:02:53.270000 |
6,308,991 | 6,309,050 | ASP.NET MVC Use Hyphens in parameter when the raw value has hyphens | I'm writing an MVC app where I want the URL's to be SEO friendly and parameter lookup to be by name rather than id. So for example, instead of having something like this: /Products/Category/23 I'll have something like this: /Products/Category/Books And, it seems that the best practice recommendations are to replace spa... | I am not sure what you mean by "safely handle this for all scenarios". The methodology is sound as long as you always removed spaces in your key (which is a string rather than a numeric - guessing you have a numeric key for your actual derived key (primary key) and a friendly key for the URI?). I would have to know wha... | ASP.NET MVC Use Hyphens in parameter when the raw value has hyphens I'm writing an MVC app where I want the URL's to be SEO friendly and parameter lookup to be by name rather than id. So for example, instead of having something like this: /Products/Category/23 I'll have something like this: /Products/Category/Books And... | TITLE:
ASP.NET MVC Use Hyphens in parameter when the raw value has hyphens
QUESTION:
I'm writing an MVC app where I want the URL's to be SEO friendly and parameter lookup to be by name rather than id. So for example, instead of having something like this: /Products/Category/23 I'll have something like this: /Products/... | [
"asp.net-mvc-3",
"routes"
] | 0 | 0 | 530 | 1 | 0 | 2011-06-10T16:00:17.900000 | 2011-06-10T16:05:22.877000 |
6,308,993 | 6,309,043 | Static/dynamic libraries vs .so libaries? | I come from a windows w/ visual-studio background for native development and I am now going to compile native code for use on android. I am not sure how the unix-like libraries (.so?) work. Are they static (like a.lib on windows) or dynamically loaded like a DLL? For example, in visual studio, I add the.lib file to my ... | On Linux, the.so files are the equivalent(*) of the.dll files on Windows, in the sense that they are loaded dynamically to the executable when it is executed. Note however that you don't need a.lib file when linking your application. The linker will find the information directly in the.so file. *: There are differences... | Static/dynamic libraries vs .so libaries? I come from a windows w/ visual-studio background for native development and I am now going to compile native code for use on android. I am not sure how the unix-like libraries (.so?) work. Are they static (like a.lib on windows) or dynamically loaded like a DLL? For example, i... | TITLE:
Static/dynamic libraries vs .so libaries?
QUESTION:
I come from a windows w/ visual-studio background for native development and I am now going to compile native code for use on android. I am not sure how the unix-like libraries (.so?) work. Are they static (like a.lib on windows) or dynamically loaded like a D... | [
"c",
"visual-studio",
"gcc",
"dll"
] | 3 | 5 | 2,113 | 3 | 0 | 2011-06-10T16:00:33.453000 | 2011-06-10T16:04:39.753000 |
6,308,994 | 6,309,222 | How to change images of other objects? | I am using a program called Greenfoot to do my java projects. there is two "actors" in Greenfoot that move around randomly. I would like to make it so that when one actor touches the other, it has a percent of changing the other actor to the same image. How do I accomplish this? | Are you looking for an Object Collision. If yes then please read this: http://www.greenfoot.org/doc/manual.html#collisions | How to change images of other objects? I am using a program called Greenfoot to do my java projects. there is two "actors" in Greenfoot that move around randomly. I would like to make it so that when one actor touches the other, it has a percent of changing the other actor to the same image. How do I accomplish this? | TITLE:
How to change images of other objects?
QUESTION:
I am using a program called Greenfoot to do my java projects. there is two "actors" in Greenfoot that move around randomly. I would like to make it so that when one actor touches the other, it has a percent of changing the other actor to the same image. How do I ... | [
"java",
"greenfoot"
] | 0 | 1 | 1,444 | 2 | 0 | 2011-06-10T16:00:33.843000 | 2011-06-10T16:19:06.827000 |
6,308,996 | 6,309,106 | problem with match namespace in xslt | It's a problem with match elements which have specific node. The xml: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 and the XSLT is: The result is: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 Why the "description of profile" is also output? It has "base" namespace. Thanks in advance. | The simple answer is: Because you never tell the XSLT processor to ignore it. You provide a template that processes prf:*, but you do not forbid the processing of base:. Given nothing else, the XSLT processor applies default behavior ( built-in rules, also here ) to any nodes it encounters that are not handled by any c... | problem with match namespace in xslt It's a problem with match elements which have specific node. The xml: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 and the XSLT is: The result is: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 Why the "description of profile" is also output? It has "ba... | TITLE:
problem with match namespace in xslt
QUESTION:
It's a problem with match elements which have specific node. The xml: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 and the XSLT is: The result is: description of profile PhoneKeyPad SampleModel 3 1x1 128x240 Why the "description of profile" is also ... | [
"xslt",
"namespaces"
] | 0 | 4 | 2,047 | 1 | 0 | 2011-06-10T16:00:38.123000 | 2011-06-10T16:09:34.800000 |
6,309,005 | 6,309,137 | How to apply CSS to elements that have multiple classes? | Is there a way to apply a style to elements that contain multiple classes? Example foo foo bar bar I only want to modify the styling of the element that contains class "foo bar". The XPath information would be something like //div[contains(@class,"foo") and contains(@class,"bar")]. Any ideas for pure CSS, w/o having to... | Solutions.foo.bar {... } [class="foo bar"] {... } // explicit class name [class~="foo"][class~="bar"] {... } // inclusive class name | How to apply CSS to elements that have multiple classes? Is there a way to apply a style to elements that contain multiple classes? Example foo foo bar bar I only want to modify the styling of the element that contains class "foo bar". The XPath information would be something like //div[contains(@class,"foo") and conta... | TITLE:
How to apply CSS to elements that have multiple classes?
QUESTION:
Is there a way to apply a style to elements that contain multiple classes? Example foo foo bar bar I only want to modify the styling of the element that contains class "foo bar". The XPath information would be something like //div[contains(@clas... | [
"css",
"css-selectors"
] | 0 | 1 | 1,226 | 2 | 0 | 2011-06-10T16:01:15.753000 | 2011-06-10T16:11:56.137000 |
6,309,023 | 6,309,120 | mysql select for checking if a entry exist | i had a large databse and had to chec if a email is in a special group I had to tables. first tabel called user CREATE TABLE user ( uid int(10) NOT NULL AUTO_INCREMENT, kid int(3) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (uid), KEY kid (kid) ) ENGINE=MyISAM and a table named group CREATE TABLE `group` ( `... | Rather than using a comma separated list of tables, try using a JOIN (in this case, INNER JOIN is your best bet since you want to check if records exist in both tables) with an ON clause. I have formatted your query and my changes are in capitals to make them stand out. select a.email, b.vuid from user a INNER JOIN gro... | mysql select for checking if a entry exist i had a large databse and had to chec if a email is in a special group I had to tables. first tabel called user CREATE TABLE user ( uid int(10) NOT NULL AUTO_INCREMENT, kid int(3) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (uid), KEY kid (kid) ) ENGINE=MyISAM and a... | TITLE:
mysql select for checking if a entry exist
QUESTION:
i had a large databse and had to chec if a email is in a special group I had to tables. first tabel called user CREATE TABLE user ( uid int(10) NOT NULL AUTO_INCREMENT, kid int(3) NOT NULL, Email varchar(255) DEFAULT NULL, PRIMARY KEY (uid), KEY kid (kid) ) E... | [
"php",
"mysql"
] | 1 | 2 | 198 | 3 | 0 | 2011-06-10T16:02:44.780000 | 2011-06-10T16:10:43.533000 |
6,309,029 | 6,309,168 | Nested file input doesn't work in Firefox | I have the following HTML: Styled like such: #inner { cursor: pointer; position:absolute; opacity: 0; } #outer { position: relative; overflow: hidden; direction: ltr; } It looks like just a standard file input element, as the #inner input element is hidden and wrapped by the #outer one. My desired behavior is to see "Y... | The reason for the difference in behaviour is most likely that the code is invalid. See HTML 4: 17.4 The INPUT element: "Start tag: required, End tag: forbidden " So, you can't nest an input tag inside another. Different browsers handle invalid markup differently, so they can for example ignore that one is inside the o... | Nested file input doesn't work in Firefox I have the following HTML: Styled like such: #inner { cursor: pointer; position:absolute; opacity: 0; } #outer { position: relative; overflow: hidden; direction: ltr; } It looks like just a standard file input element, as the #inner input element is hidden and wrapped by the #o... | TITLE:
Nested file input doesn't work in Firefox
QUESTION:
I have the following HTML: Styled like such: #inner { cursor: pointer; position:absolute; opacity: 0; } #outer { position: relative; overflow: hidden; direction: ltr; } It looks like just a standard file input element, as the #inner input element is hidden and... | [
"html",
"css",
"cross-browser",
"nested",
"file-io"
] | 0 | 1 | 568 | 1 | 0 | 2011-06-10T16:03:19.590000 | 2011-06-10T16:14:35.560000 |
6,309,032 | 6,309,100 | Wanting to sort a hash in ruby by value first, and key second | Possible Duplicate: Sorting a hash in Ruby by its value first then its key. I need to order a hash so that the value is the first priority, and then when the values are the same it orders by the key. I am currently sorting using this code, but I don't see how to do sort_by with a second element. Hash[@card_value_counts... | Array has a cool feature: comparing two arrays with the <=> method will compare them element-by-element. You can exploit this for multi-value sorting: sorted_hash = Hash[original_hash.sort_by { |k,v| [-1 * v, -1 * k] }] UPDATE: Maybe you know this already, but I assumed you're using Ruby 1.9. In earlier versions, Hashe... | Wanting to sort a hash in ruby by value first, and key second Possible Duplicate: Sorting a hash in Ruby by its value first then its key. I need to order a hash so that the value is the first priority, and then when the values are the same it orders by the key. I am currently sorting using this code, but I don't see ho... | TITLE:
Wanting to sort a hash in ruby by value first, and key second
QUESTION:
Possible Duplicate: Sorting a hash in Ruby by its value first then its key. I need to order a hash so that the value is the first priority, and then when the values are the same it orders by the key. I am currently sorting using this code, ... | [
"ruby-on-rails",
"ruby"
] | 0 | 6 | 2,247 | 1 | 0 | 2011-06-10T16:03:41.220000 | 2011-06-10T16:09:02.347000 |
6,309,045 | 6,309,124 | Windows Command Line : START Command Switch /I meaning? | From ss64.com: /I: Ignore any changes to the current environment. What does that mean? If you could give examples of usage and what it effects or doesn't effect, that would be great (none provided on website and have google searched with no luck). | If you modified the current environment by defining a variable; set foo=bar start app.exe App.exe would see %foo% as being "bar" set foo=bar start /i app.exe App.exe would see %foo% as being undefined. | Windows Command Line : START Command Switch /I meaning? From ss64.com: /I: Ignore any changes to the current environment. What does that mean? If you could give examples of usage and what it effects or doesn't effect, that would be great (none provided on website and have google searched with no luck). | TITLE:
Windows Command Line : START Command Switch /I meaning?
QUESTION:
From ss64.com: /I: Ignore any changes to the current environment. What does that mean? If you could give examples of usage and what it effects or doesn't effect, that would be great (none provided on website and have google searched with no luck)... | [
"windows",
"command-line",
"switch-statement"
] | 2 | 4 | 3,752 | 3 | 0 | 2011-06-10T16:04:49.163000 | 2011-06-10T16:10:59.613000 |
6,309,046 | 6,309,190 | SVN to Git to Gitolite and Lots of Files | Ok, so I've read just about every resource possible on converting from SVN to Git. I am attempting to abandon our SVN server completely and move forward with Gitolite, which is already setup and ready to go. I used svn2git (the ruby script), but ran into some issues that have been documented here on SO. I'm moving abou... | A lot of times it's not worth it to import the history. Just manually import the important branches and tags. Refer to the old svn when needed. Been through this twice and would not recommend it to anyone. | SVN to Git to Gitolite and Lots of Files Ok, so I've read just about every resource possible on converting from SVN to Git. I am attempting to abandon our SVN server completely and move forward with Gitolite, which is already setup and ready to go. I used svn2git (the ruby script), but ran into some issues that have be... | TITLE:
SVN to Git to Gitolite and Lots of Files
QUESTION:
Ok, so I've read just about every resource possible on converting from SVN to Git. I am attempting to abandon our SVN server completely and move forward with Gitolite, which is already setup and ready to go. I used svn2git (the ruby script), but ran into some i... | [
"svn",
"git",
"gitolite"
] | 1 | 1 | 1,008 | 2 | 0 | 2011-06-10T16:05:05.097000 | 2011-06-10T16:16:16.647000 |
6,309,070 | 6,309,173 | Can I use a SELECT subquery inside an INSERT query? | I've tried following the syntax suggested here, but it doesn't work for my query. Here's what I currently have: INSERT INTO dot (entrant_id, year, entry_code, title, retail_category, campaign_type, client_company, client_city, client_state, field_date_active, height, width, depth, weight, oversize_fee, volt_110, attach... | INSERT INTO dot (entrant_id, year, entry_code,...) SELECT 288, 2011, MAX(entry_code),... FROM dot WHERE year=2011 | Can I use a SELECT subquery inside an INSERT query? I've tried following the syntax suggested here, but it doesn't work for my query. Here's what I currently have: INSERT INTO dot (entrant_id, year, entry_code, title, retail_category, campaign_type, client_company, client_city, client_state, field_date_active, height, ... | TITLE:
Can I use a SELECT subquery inside an INSERT query?
QUESTION:
I've tried following the syntax suggested here, but it doesn't work for my query. Here's what I currently have: INSERT INTO dot (entrant_id, year, entry_code, title, retail_category, campaign_type, client_company, client_city, client_state, field_dat... | [
"mysql",
"subquery"
] | 1 | 2 | 487 | 3 | 0 | 2011-06-10T16:06:59.730000 | 2011-06-10T16:14:54.577000 |
6,309,072 | 6,309,193 | Dealing with IMAP mailbox name case sensitivty | I have a python script using imaplib that connects to a gmail account and sorts emails based on '+' tags found in the email address. For example: emails sent to myaccount+root.foo.bar@gmail.com get moved to root\foo\bar. My logic goes as follows: extract tags -> attempt to create folders -> copy message to folder. Ocas... | So Google complains that the folder already exists, but then gives an error when you try to move something into it? Terrific. IMAP has a "LIST" command to list available mailboxes (folders): https://www.rfc-editor.org/rfc/rfc3501#section-6.3.8 How to access that depends on your IMAP client library. Here are a couple of... | Dealing with IMAP mailbox name case sensitivty I have a python script using imaplib that connects to a gmail account and sorts emails based on '+' tags found in the email address. For example: emails sent to myaccount+root.foo.bar@gmail.com get moved to root\foo\bar. My logic goes as follows: extract tags -> attempt to... | TITLE:
Dealing with IMAP mailbox name case sensitivty
QUESTION:
I have a python script using imaplib that connects to a gmail account and sorts emails based on '+' tags found in the email address. For example: emails sent to myaccount+root.foo.bar@gmail.com get moved to root\foo\bar. My logic goes as follows: extract ... | [
"python",
"imap",
"imaplib",
"gmail-imap"
] | 2 | 2 | 752 | 1 | 0 | 2011-06-10T16:07:11.600000 | 2011-06-10T16:16:27.590000 |
6,309,074 | 6,309,156 | PHP Sessions not working in Internet Explorer, cookies are working great though | Im having trouble with sessions in IE. I have tested in IE 7-8, but it does not work in any of them. I can see that i am logged in, and then redirected, but the session is dropped somehow. It works great in Firefox, Chrome and Safari. If i use the "remember me" function i made, then it also works in IE?! So it cant be ... | Are you using a php header redirect immediatly after setting the session? That has been an issue for me sometimes. Can be solved by doing a redirect with javascript on page load. | PHP Sessions not working in Internet Explorer, cookies are working great though Im having trouble with sessions in IE. I have tested in IE 7-8, but it does not work in any of them. I can see that i am logged in, and then redirected, but the session is dropped somehow. It works great in Firefox, Chrome and Safari. If i ... | TITLE:
PHP Sessions not working in Internet Explorer, cookies are working great though
QUESTION:
Im having trouble with sessions in IE. I have tested in IE 7-8, but it does not work in any of them. I can see that i am logged in, and then redirected, but the session is dropped somehow. It works great in Firefox, Chrome... | [
"php",
"internet-explorer",
"session",
"session-cookies"
] | 0 | 0 | 1,339 | 1 | 0 | 2011-06-10T16:07:16.110000 | 2011-06-10T16:13:49.807000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.