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,182,315 | 6,182,519 | How can I do Base64 encoding in Node.js? | Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that final() from crypto can only output hexadecimal, binary or ASCII data. For example: var cipher = crypto.createCipheriv('des-ede3-cbc', encryption_key, iv); var ciph = cipher.update(plaintext, 'utf8', 'hex'); ciph += cipher.final('hex');
... | Buffers can be used for taking a string or piece of data and doing Base64 encoding of the result. For example: > console.log(Buffer.from("Hello World").toString('base64')); SGVsbG8gV29ybGQ= > console.log(Buffer.from("SGVsbG8gV29ybGQ=", 'base64').toString('ascii')) Hello World The Buffer constructor is a global object, ... | How can I do Base64 encoding in Node.js? Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that final() from crypto can only output hexadecimal, binary or ASCII data. For example: var cipher = crypto.createCipheriv('des-ede3-cbc', encryption_key, iv); var ciph = cipher.update(plaintext, 'utf8... | TITLE:
How can I do Base64 encoding in Node.js?
QUESTION:
Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that final() from crypto can only output hexadecimal, binary or ASCII data. For example: var cipher = crypto.createCipheriv('des-ede3-cbc', encryption_key, iv); var ciph = cipher.updat... | [
"node.js",
"encoding",
"base64"
] | 1,239 | 2,731 | 1,065,609 | 8 | 0 | 2011-05-31T02:09:42.377000 | 2011-05-31T02:46:02.100000 |
6,182,317 | 6,188,092 | xdebug installation not working | so I added the following line to php.ini: zend_extension="Z:\wamp2\bin\php\php5.3.0\ext\php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug is indeed located in that directory with that filename I set report_zend_debug = 0 restarted wamp, etc bu... | If you are using PHP as an Apache module, you will need to get xdebug TS (Thread Safe). If you are using PHP as a CGI process, you will need to get xdebug (NTS - Not Thread Safe). You will also need to match the builds: PHP 5.3 VC6 will require xdebug VC6 PHP 5.3 VC9 will require xdebug VC9 Note that your PHP version 5... | xdebug installation not working so I added the following line to php.ini: zend_extension="Z:\wamp2\bin\php\php5.3.0\ext\php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug is indeed located in that directory with that filename I set report_zend_... | TITLE:
xdebug installation not working
QUESTION:
so I added the following line to php.ini: zend_extension="Z:\wamp2\bin\php\php5.3.0\ext\php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug is indeed located in that directory with that filename ... | [
"php",
"apache",
"installation",
"wamp",
"xdebug"
] | 2 | 11 | 17,502 | 3 | 0 | 2011-05-31T02:10:39.197000 | 2011-05-31T13:10:57.540000 |
6,182,318 | 6,184,394 | 400 Bad Request with Symfony2 and html5boilerplate redirect rules | I've recently moved over to using the Symfony2 PHP framework, and wanted to include all of the awesomeness of the html5boilerplate from the outset, however having a few problems with merging the.htaccess files for both. The top three are from boilerplate; redirecting from www.example.com to example.com, example.com/tes... | I tried with your config and had no problem to reach my Symfony2 setup. Try to redirect your requests to app_dev.php instead of app.php so you can track the real error. Or am I missunderstanding your question? | 400 Bad Request with Symfony2 and html5boilerplate redirect rules I've recently moved over to using the Symfony2 PHP framework, and wanted to include all of the awesomeness of the html5boilerplate from the outset, however having a few problems with merging the.htaccess files for both. The top three are from boilerplate... | TITLE:
400 Bad Request with Symfony2 and html5boilerplate redirect rules
QUESTION:
I've recently moved over to using the Symfony2 PHP framework, and wanted to include all of the awesomeness of the html5boilerplate from the outset, however having a few problems with merging the.htaccess files for both. The top three ar... | [
"apache",
".htaccess",
"vhosts",
"boilerplate"
] | 3 | 2 | 1,844 | 2 | 0 | 2011-05-31T02:10:42.057000 | 2011-05-31T07:39:42.083000 |
6,182,324 | 6,182,425 | (modified) jQuery slideshow not working | I have a jQuery slideshow code that works fine with the following HTML structure: Though now I wanted to modify it so that it'll work with the same structure, but instead of just plain images, the images are now links. That is, the "meat" of the slideshow markup is now: The jQuery code that makes the slideshow work is ... | try to use as a relative selector tag: it may help jQuery('#slideshowImages a:first').addClass('active'); jQuery('#slideshowImages a:last').addClass('lastImg'); var $active = jQuery('#slideshowImages a.active'); var $previous = $active.prev().length? $active.prev(): jQuery('#slideshowImages a.lastImg'); $active.animate... | (modified) jQuery slideshow not working I have a jQuery slideshow code that works fine with the following HTML structure: Though now I wanted to modify it so that it'll work with the same structure, but instead of just plain images, the images are now links. That is, the "meat" of the slideshow markup is now: The jQuer... | TITLE:
(modified) jQuery slideshow not working
QUESTION:
I have a jQuery slideshow code that works fine with the following HTML structure: Though now I wanted to modify it so that it'll work with the same structure, but instead of just plain images, the images are now links. That is, the "meat" of the slideshow markup... | [
"javascript",
"jquery",
"html",
"css",
"slideshow"
] | 1 | 1 | 364 | 1 | 0 | 2011-05-31T02:11:08.890000 | 2011-05-31T02:28:32.167000 |
6,182,328 | 6,182,426 | Rails 3 logout route in sessions controller | I have methodically been working thru the Agile Web Development with Rails book. No problems so far until I came across the development of logout using the sessions controller. I am simply trying to get the destroy method to work in the session controller. Here is what I have: sessions_controller.rb def destroy session... | I believe delete 'logout' =>:destroy should be get 'logout' =>:destroy or post 'logout' =>:destroy depending on how you are handling the behavior. Most likely you want get. | Rails 3 logout route in sessions controller I have methodically been working thru the Agile Web Development with Rails book. No problems so far until I came across the development of logout using the sessions controller. I am simply trying to get the destroy method to work in the session controller. Here is what I have... | TITLE:
Rails 3 logout route in sessions controller
QUESTION:
I have methodically been working thru the Agile Web Development with Rails book. No problems so far until I came across the development of logout using the sessions controller. I am simply trying to get the destroy method to work in the session controller. H... | [
"ruby-on-rails",
"routes"
] | 2 | 4 | 7,655 | 3 | 0 | 2011-05-31T02:12:03.617000 | 2011-05-31T02:28:45.053000 |
6,182,330 | 6,206,566 | In emacs lisp, is there a way to search text that will match a string that overlaps the current point? | I'm not exactly a lisp expert, so please forgive a fairly newbie question. I'm writing a fairly simple elisp function, trying to find a short string on the same line as the current cursor position. The relevant part of the code as written now is: (let ((matchpos (search-forward myword (line-end-position) t))) (if match... | I would suggest that you move the cursor to the right the number of characters that corresponds to the length of the string you search for (possibly minus one, depending on if you would like to match something immediately to the right of the point). Something like: (goto-char (min (end-of-line-position) (+ (point) (len... | In emacs lisp, is there a way to search text that will match a string that overlaps the current point? I'm not exactly a lisp expert, so please forgive a fairly newbie question. I'm writing a fairly simple elisp function, trying to find a short string on the same line as the current cursor position. The relevant part o... | TITLE:
In emacs lisp, is there a way to search text that will match a string that overlaps the current point?
QUESTION:
I'm not exactly a lisp expert, so please forgive a fairly newbie question. I'm writing a fairly simple elisp function, trying to find a short string on the same line as the current cursor position. T... | [
"search",
"emacs",
"elisp"
] | 3 | 1 | 1,734 | 3 | 0 | 2011-05-31T02:12:19.827000 | 2011-06-01T19:26:40.507000 |
6,182,337 | 6,182,507 | How to receive input from a segmented control | I am trying to receive the user selection from a segmented control and then save it to NSUserDefaults, i.e., if the first segment is selected then it saves the int "1" to NSUserDefaults, but if the second segment is selected then it saves the int "2" to NSUserDefaults. | The easiest way is to use a binding. Bind the selected index of the control to the shared user defaults controller, and set the model key path to the preference key you want to use. Edit to add: I see that you didn't specify Mac or iOS. If it's Mac, binding is definitely the easy way, whereas binding is not available o... | How to receive input from a segmented control I am trying to receive the user selection from a segmented control and then save it to NSUserDefaults, i.e., if the first segment is selected then it saves the int "1" to NSUserDefaults, but if the second segment is selected then it saves the int "2" to NSUserDefaults. | TITLE:
How to receive input from a segmented control
QUESTION:
I am trying to receive the user selection from a segmented control and then save it to NSUserDefaults, i.e., if the first segment is selected then it saves the int "1" to NSUserDefaults, but if the second segment is selected then it saves the int "2" to NS... | [
"cocoa-touch",
"ios",
"nsuserdefaults",
"uisegmentedcontrol"
] | 4 | 4 | 9,195 | 4 | 0 | 2011-05-31T02:13:48.770000 | 2011-05-31T02:44:33.693000 |
6,182,344 | 6,182,413 | Grant a specific user to modify a specific table rows | For security reason, I don't like the auditor has the privilege to modify all the rows of the table. So I tried: GRANT UPDATE audit_comment ON cgis TO auditor IDENTIFIED BY 'audit@TE'; But it failed ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ... | You cannot specify privileges on rows, just on columns. Check the syntax here You need something like GRANT UPDATE (audit_comment) ON db_name.cgis TO 'auditor'@'host_name' | Grant a specific user to modify a specific table rows For security reason, I don't like the auditor has the privilege to modify all the rows of the table. So I tried: GRANT UPDATE audit_comment ON cgis TO auditor IDENTIFIED BY 'audit@TE'; But it failed ERROR 1064 (42000): You have an error in your SQL syntax; check the... | TITLE:
Grant a specific user to modify a specific table rows
QUESTION:
For security reason, I don't like the auditor has the privilege to modify all the rows of the table. So I tried: GRANT UPDATE audit_comment ON cgis TO auditor IDENTIFIED BY 'audit@TE'; But it failed ERROR 1064 (42000): You have an error in your SQL... | [
"mysql"
] | 0 | 0 | 3,925 | 3 | 0 | 2011-05-31T02:14:46.487000 | 2011-05-31T02:26:33.063000 |
6,182,346 | 6,182,357 | What regex will match either 2 digits, or 3 digits starting with 0? | Must be: all digits. 2 or 3 positions. if 3 positions, first character must be '0'. Cheers, Berryl | That would be along the lines of: ^0?\d{2}$ What you're asking for (paraphrased) is any two digits with an optional 0 of the front. The anchors ( ^ and $ ) may not be necessary depending on the regex function being called - I've included them to ensure that a string like ABC011DEF won't match. | What regex will match either 2 digits, or 3 digits starting with 0? Must be: all digits. 2 or 3 positions. if 3 positions, first character must be '0'. Cheers, Berryl | TITLE:
What regex will match either 2 digits, or 3 digits starting with 0?
QUESTION:
Must be: all digits. 2 or 3 positions. if 3 positions, first character must be '0'. Cheers, Berryl
ANSWER:
That would be along the lines of: ^0?\d{2}$ What you're asking for (paraphrased) is any two digits with an optional 0 of the f... | [
".net",
"regex"
] | 2 | 10 | 15,431 | 2 | 0 | 2011-05-31T02:14:59.340000 | 2011-05-31T02:16:24.920000 |
6,182,356 | 6,182,386 | What is %2C in a URL? | In a URL, what does the %2C encoding mean and what are its uses? | Check out http://www.asciitable.com/ Look at the Hx, (Hex) column; 2C maps to, Any unusual encoding can be checked this way +----+-----+----+-----+----+-----+----+-----+ | Hx | Chr | Hx | Chr | Hx | Chr | Hx | Chr | +----+-----+----+-----+----+-----+----+-----+ | 00 | NUL | 20 | SPC | 40 | @ | 60 | ` | | 01 | SOH | 21 ... | What is %2C in a URL? In a URL, what does the %2C encoding mean and what are its uses? | TITLE:
What is %2C in a URL?
QUESTION:
In a URL, what does the %2C encoding mean and what are its uses?
ANSWER:
Check out http://www.asciitable.com/ Look at the Hx, (Hex) column; 2C maps to, Any unusual encoding can be checked this way +----+-----+----+-----+----+-----+----+-----+ | Hx | Chr | Hx | Chr | Hx | Chr | H... | [
"url",
"urlencode"
] | 586 | 817 | 691,311 | 8 | 0 | 2011-05-31T02:16:21.183000 | 2011-05-31T02:20:52.697000 |
6,182,361 | 6,182,422 | Stop html headings from making a line before and after them? | The html heading tags force a line before and after them but I was wondering if there was a way to stop it from doing that, so I can keep my heading in line with the other things I want on the same line on either side of it? Foo Bar I wan't those to be on the same line but right now it would show up like Foo Bar Is the... | BoltClock is right... which means you can do this: h1 { display:inline; } | Stop html headings from making a line before and after them? The html heading tags force a line before and after them but I was wondering if there was a way to stop it from doing that, so I can keep my heading in line with the other things I want on the same line on either side of it? Foo Bar I wan't those to be on the... | TITLE:
Stop html headings from making a line before and after them?
QUESTION:
The html heading tags force a line before and after them but I was wondering if there was a way to stop it from doing that, so I can keep my heading in line with the other things I want on the same line on either side of it? Foo Bar I wan't ... | [
"html",
"css"
] | 0 | 3 | 1,848 | 2 | 0 | 2011-05-31T02:17:01 | 2011-05-31T02:27:50.313000 |
6,182,363 | 6,182,384 | CSS selector for element with a specific child :hover'ed | Given this HTML: A B Is it possible to write a CSS selector that sets properties on.root when the mouse hovers over.a? To be clear, I do NOT mean this: ul.root li.a:hover { } This would apply properties to the child when it's hovered over. I want to apply the properties to the root when the child is hovered. I could fa... | This is not possible with CSS alone because, as mentioned in numerous other questions ( such as... ), there's no CSS parent selector. You'll have to do it with JavaScript. | CSS selector for element with a specific child :hover'ed Given this HTML: A B Is it possible to write a CSS selector that sets properties on.root when the mouse hovers over.a? To be clear, I do NOT mean this: ul.root li.a:hover { } This would apply properties to the child when it's hovered over. I want to apply the pro... | TITLE:
CSS selector for element with a specific child :hover'ed
QUESTION:
Given this HTML: A B Is it possible to write a CSS selector that sets properties on.root when the mouse hovers over.a? To be clear, I do NOT mean this: ul.root li.a:hover { } This would apply properties to the child when it's hovered over. I wan... | [
"css",
"css-selectors"
] | 1 | 3 | 606 | 1 | 0 | 2011-05-31T02:17:27.253000 | 2011-05-31T02:19:14.970000 |
6,182,369 | 6,182,595 | Exec a shell command in Go | I'm looking to execute a shell command in Go and get the resulting output as a string in my program. I saw the Rosetta Code version: package main import "fmt" import "exec"
func main() { cmd, err:= exec.Run("/bin/ls", []string{"/bin/ls"}, []string{}, "", exec.DevNull, exec.PassThrough, exec.PassThrough) if (err!= nil)... | This answer does not represent the current state of the Go standard library. Please take a look at @Lourenco's answer for an up-to-date method! Your example does not actually read the data from stdout. This works for me. package main
import ( "fmt" "exec" "os" "bytes" "io" )
func main() { app:= "/bin/ls" cmd, err:= e... | Exec a shell command in Go I'm looking to execute a shell command in Go and get the resulting output as a string in my program. I saw the Rosetta Code version: package main import "fmt" import "exec"
func main() { cmd, err:= exec.Run("/bin/ls", []string{"/bin/ls"}, []string{}, "", exec.DevNull, exec.PassThrough, exec.... | TITLE:
Exec a shell command in Go
QUESTION:
I'm looking to execute a shell command in Go and get the resulting output as a string in my program. I saw the Rosetta Code version: package main import "fmt" import "exec"
func main() { cmd, err:= exec.Run("/bin/ls", []string{"/bin/ls"}, []string{}, "", exec.DevNull, exec.... | [
"go",
"shellexecute"
] | 129 | 13 | 218,375 | 9 | 0 | 2011-05-31T02:18:08.470000 | 2011-05-31T03:01:11.243000 |
6,182,372 | 6,189,985 | How can I have a button run an Applescript? | I am using Xcode and Interface Builder. My Xcode project is based off the Applescript template. I have a button in interface builder. I want tell application "Terminal" activate do script "list" in front window end tell to run when the button is clicked. Btw it's Xcode 3.2.4 | It seems like you need some basic tutorials to learn this. It's not something that can be explained easily. I found one here but you should search there because I know there's more tutorials. | How can I have a button run an Applescript? I am using Xcode and Interface Builder. My Xcode project is based off the Applescript template. I have a button in interface builder. I want tell application "Terminal" activate do script "list" in front window end tell to run when the button is clicked. Btw it's Xcode 3.2.4 | TITLE:
How can I have a button run an Applescript?
QUESTION:
I am using Xcode and Interface Builder. My Xcode project is based off the Applescript template. I have a button in interface builder. I want tell application "Terminal" activate do script "list" in front window end tell to run when the button is clicked. Btw... | [
"xcode",
"button",
"interface-builder",
"terminal",
"applescript"
] | 1 | 1 | 3,057 | 1 | 0 | 2011-05-31T02:18:13.327000 | 2011-05-31T15:34:03.567000 |
6,182,380 | 6,182,492 | How to convert text to unicode in Rails? | In my database, I have the following entry id | name | info 1 John Smith Çö ¿¬¼ As you can tell, the info column displays wrong -- it's actually Korean, though. In Chrome, when I switch the browser encoding from UTF-8 to Korean ('euc-kr', I think), I actually manage to view the text as such: id | name | info 1 John Smi... | Wow. I'm beating myself over the head now. After hours of trying to resolve this, I finally figured it out myself a few minutes after I posted a question here. The solution consists of three simple steps: STEP 1: I almost had it right. I shouldn't be converting from euc-kr to utf-8, but the other way around, as such: I... | How to convert text to unicode in Rails? In my database, I have the following entry id | name | info 1 John Smith Çö ¿¬¼ As you can tell, the info column displays wrong -- it's actually Korean, though. In Chrome, when I switch the browser encoding from UTF-8 to Korean ('euc-kr', I think), I actually manage to view the ... | TITLE:
How to convert text to unicode in Rails?
QUESTION:
In my database, I have the following entry id | name | info 1 John Smith Çö ¿¬¼ As you can tell, the info column displays wrong -- it's actually Korean, though. In Chrome, when I switch the browser encoding from UTF-8 to Korean ('euc-kr', I think), I actually m... | [
"ruby-on-rails",
"ruby",
"utf-8",
"character-encoding"
] | 3 | 4 | 2,670 | 2 | 0 | 2011-05-31T02:19:01.477000 | 2011-05-31T02:41:33.853000 |
6,182,390 | 6,182,408 | Javascript setTimeout issue | I have a bar that shows up (in rails) from a flash hash. I want it to explode with jquery, so I added this code: Works fine except in a couple of seconds it appears again and then something extremely strange happens - the path to googleapis is shown and the page becomes barely responsive. What gives? | This is the proper way of using setTimeout running it the way you had is like using eval(), you should avoid passing a string in setTimeout() you could also pass your function like this: setTimeout(derp,500); | Javascript setTimeout issue I have a bar that shows up (in rails) from a flash hash. I want it to explode with jquery, so I added this code: Works fine except in a couple of seconds it appears again and then something extremely strange happens - the path to googleapis is shown and the page becomes barely responsive. Wh... | TITLE:
Javascript setTimeout issue
QUESTION:
I have a bar that shows up (in rails) from a flash hash. I want it to explode with jquery, so I added this code: Works fine except in a couple of seconds it appears again and then something extremely strange happens - the path to googleapis is shown and the page becomes bar... | [
"javascript",
"jquery",
"jquery-ui"
] | 1 | 1 | 213 | 1 | 0 | 2011-05-31T02:21:52.783000 | 2011-05-31T02:25:48.790000 |
6,182,395 | 6,182,442 | how to produce a sweave document without angle bracket ">" in front of code chunks? | How can I produce a Sweave (or pgfSweave) document without angle brackets ">" in front of code chunks? I want people to be able to cut and paste my code directly from the pdf output. Here's a snippet of my document with a code chunk: Notice that because our incidence matrix consists of 0’s and 1’s, the off-diagonal ent... | I think options(prompt = " ") at the top of your script will do it. prompt (in options() ) controls the text string used for the prompt in an interactive session and I'm assuming it will do the same for a document processed through Sweave. EDIT: Thanks to Ben Bolker for pointing out that options(prompt = " ", continue ... | how to produce a sweave document without angle bracket ">" in front of code chunks? How can I produce a Sweave (or pgfSweave) document without angle brackets ">" in front of code chunks? I want people to be able to cut and paste my code directly from the pdf output. Here's a snippet of my document with a code chunk: No... | TITLE:
how to produce a sweave document without angle bracket ">" in front of code chunks?
QUESTION:
How can I produce a Sweave (or pgfSweave) document without angle brackets ">" in front of code chunks? I want people to be able to cut and paste my code directly from the pdf output. Here's a snippet of my document wit... | [
"r",
"latex",
"sweave"
] | 8 | 17 | 666 | 2 | 0 | 2011-05-31T02:23:03.587000 | 2011-05-31T02:30:26.293000 |
6,182,402 | 6,182,476 | C# Cultures: Localize DayOfWeek? | How do I localize a DayOfWeek other than today? The following works just fine for the current day: DateTime.Now.ToString("dddd", new CultureInfo("it-IT")); But how can I localize all days of the week?? Edit: A possible (and probably very, very wrong) solution I came up with could be to create DateTime values for an ent... | How about DateTimeFormatInfo.CurrentInfo.GetDayName( dayOfWeek ) or DateTimeFormatInfo.CurrentInfo.GetAbbreviatedDayName( dayOfWeek ) Simply takes a DayOfWeek enumeration and returns string that is the name in the current culture. Edit: If you're looking for a specific culture it would be var cultureInfo = new CultureI... | C# Cultures: Localize DayOfWeek? How do I localize a DayOfWeek other than today? The following works just fine for the current day: DateTime.Now.ToString("dddd", new CultureInfo("it-IT")); But how can I localize all days of the week?? Edit: A possible (and probably very, very wrong) solution I came up with could be to ... | TITLE:
C# Cultures: Localize DayOfWeek?
QUESTION:
How do I localize a DayOfWeek other than today? The following works just fine for the current day: DateTime.Now.ToString("dddd", new CultureInfo("it-IT")); But how can I localize all days of the week?? Edit: A possible (and probably very, very wrong) solution I came up... | [
"c#",
"culture",
"dayofweek"
] | 39 | 91 | 20,943 | 2 | 0 | 2011-05-31T02:24:49.750000 | 2011-05-31T02:37:41.903000 |
6,182,407 | 6,184,187 | How to resolve Notice: Undefined variable: form ...? | when I have created my page indexSuccess.php, i used an instruction like: render();?> it gives me an error when executing like: Notice: Undefined variable: form in C:\wamp\www\MyProject\apps\frontend\modules\addAnnonce\templates\indexSuccess.php on line 84
Fatal error: Call to a member function render() on a non-objec... | When you auto-generate a doctrine model, the form is created as a partial and embedded in the new & edit templates. If you check your newSuccess, createSuccess, editSuccess, updateSuccess actions, you will find the assignment of the form variable as mentioned by prodigitalson, so this error wont appear there. However, ... | How to resolve Notice: Undefined variable: form ...? when I have created my page indexSuccess.php, i used an instruction like: render();?> it gives me an error when executing like: Notice: Undefined variable: form in C:\wamp\www\MyProject\apps\frontend\modules\addAnnonce\templates\indexSuccess.php on line 84
Fatal err... | TITLE:
How to resolve Notice: Undefined variable: form ...?
QUESTION:
when I have created my page indexSuccess.php, i used an instruction like: render();?> it gives me an error when executing like: Notice: Undefined variable: form in C:\wamp\www\MyProject\apps\frontend\modules\addAnnonce\templates\indexSuccess.php on ... | [
"php",
"forms",
"symfony1",
"render"
] | 0 | 0 | 2,877 | 2 | 0 | 2011-05-31T02:25:34.327000 | 2011-05-31T07:17:47.630000 |
6,182,419 | 6,182,497 | Hex to byte[] in C# 2.0 | Assume there is a string hexString = "0x12" or "0x45" etc. How can I convert the string to another byte[] as below. Thanks. byte[] myByte = new byte[2]; myByte[0] = 0x1; myByte[1] = 0x2; or myByte[0] = 0x4; myByte[1] = 0x5; When I try to concatenate the substring as below, myByte[0] = '0x' + '4'; // Show compile error.... | Are looking for something like this? string hex = "0123456789abcdef";
string input = "0x45"; Debug.Assert(Regex.Match(input, "^0x[0-9a-f]{2}$").Success);
byte[] result = new byte[2]; result[0] = (byte)hex.IndexOf(input[2]); result[1] = (byte)hex.IndexOf(input[3]);
// result[0] == 0x04 // result[1] == 0x05 | Hex to byte[] in C# 2.0 Assume there is a string hexString = "0x12" or "0x45" etc. How can I convert the string to another byte[] as below. Thanks. byte[] myByte = new byte[2]; myByte[0] = 0x1; myByte[1] = 0x2; or myByte[0] = 0x4; myByte[1] = 0x5; When I try to concatenate the substring as below, myByte[0] = '0x' + '4'... | TITLE:
Hex to byte[] in C# 2.0
QUESTION:
Assume there is a string hexString = "0x12" or "0x45" etc. How can I convert the string to another byte[] as below. Thanks. byte[] myByte = new byte[2]; myByte[0] = 0x1; myByte[1] = 0x2; or myByte[0] = 0x4; myByte[1] = 0x5; When I try to concatenate the substring as below, myBy... | [
"c#",
"c#-2.0",
"arrays"
] | 0 | 1 | 607 | 2 | 0 | 2011-05-31T02:27:33.180000 | 2011-05-31T02:42:51.377000 |
6,182,421 | 6,183,980 | Undefined method/NoMethodError in Rails 3 | When i access http://localhost:3000/users, it gives me NoMethodError in Users#index. The error is as follows: NoMethodError in Users#index
Showing /Applications/XAMPP/xamppfiles/htdocs/rails_projects/TUTORIALS/todo/app/views/users/index.html.erb where line #2 raised:
undefined method `name' for nil:NilClass Extracted... | This is incorrect: <% @users.each do |user| %> hello!! <% @user.name %> <% end %> It should be: <% @users.each do |user| %> hello!! <%= user.name %> <% end %> In your code the object @user does not exist, that's why you get the error. In the iteration each user in @users is put into the user object one-by-one. Another ... | Undefined method/NoMethodError in Rails 3 When i access http://localhost:3000/users, it gives me NoMethodError in Users#index. The error is as follows: NoMethodError in Users#index
Showing /Applications/XAMPP/xamppfiles/htdocs/rails_projects/TUTORIALS/todo/app/views/users/index.html.erb where line #2 raised:
undefine... | TITLE:
Undefined method/NoMethodError in Rails 3
QUESTION:
When i access http://localhost:3000/users, it gives me NoMethodError in Users#index. The error is as follows: NoMethodError in Users#index
Showing /Applications/XAMPP/xamppfiles/htdocs/rails_projects/TUTORIALS/todo/app/views/users/index.html.erb where line #2... | [
"ruby-on-rails-3",
"methods"
] | 2 | 1 | 1,615 | 2 | 0 | 2011-05-31T02:27:44.640000 | 2011-05-31T06:54:30.510000 |
6,182,430 | 6,182,479 | Is it possible to use a variable when naming an object? | Thanks for reading my question. I apologize if this seems like an easily searchable question, but searching for anything with variable, object, and java turns up anything and everything. Here is what I would like to do: BankCheck = check(variable int here) = BankCheck(params here); So that I can create check1000, then ... | Not, that's not possible but you have two options 1.- Create and array to hold a variable number of checks: BankCheck[] checks = new BankCheck[100]; That will let you store 100 checks. You can also use a list: List checks = new ArrayList (); Which works almost the same, except you don't have a fixed number of checks. 2... | Is it possible to use a variable when naming an object? Thanks for reading my question. I apologize if this seems like an easily searchable question, but searching for anything with variable, object, and java turns up anything and everything. Here is what I would like to do: BankCheck = check(variable int here) = BankC... | TITLE:
Is it possible to use a variable when naming an object?
QUESTION:
Thanks for reading my question. I apologize if this seems like an easily searchable question, but searching for anything with variable, object, and java turns up anything and everything. Here is what I would like to do: BankCheck = check(variable... | [
"java",
"oop"
] | 1 | 2 | 75 | 5 | 0 | 2011-05-31T02:29:04.670000 | 2011-05-31T02:37:52.153000 |
6,182,446 | 6,182,648 | What Intent is triggered by clicking the notification after an app is installed by the Market? | What are the details of the Intent that is triggered when the user clicks on the notification created by Android Market after a new app is installed? Is it LAUNCHER or MAIN or something else? I am asking because my app is a Service not an Activity (it is a keyboard) so it doesn't need a LAUNCHER handler. However I want... | It is the standard one: If you want to display a welcome message but also have no app icon then you might be able to register a BroadcastReceiver with that intent filter and then start your welcome screen from that (maybe launch a URL or actually include an Activity that shows the welcome info?). Let me know if that wo... | What Intent is triggered by clicking the notification after an app is installed by the Market? What are the details of the Intent that is triggered when the user clicks on the notification created by Android Market after a new app is installed? Is it LAUNCHER or MAIN or something else? I am asking because my app is a S... | TITLE:
What Intent is triggered by clicking the notification after an app is installed by the Market?
QUESTION:
What are the details of the Intent that is triggered when the user clicks on the notification created by Android Market after a new app is installed? Is it LAUNCHER or MAIN or something else? I am asking bec... | [
"android",
"google-play"
] | 1 | 1 | 147 | 1 | 0 | 2011-05-31T02:31:35.817000 | 2011-05-31T03:09:40.407000 |
6,182,458 | 6,182,478 | How do I extract a Postgres timestamp field using java? | My data is in format: 2010-12-01 09:59:00.423 getDate in Java only returns the date portion. Is there a way to also extract the time? | The SQL DATE type indeed only contains the date portion, not the time. But your column is apparently of TIMESTAMP type, so to get the full timestamp, use ResultSet#getTimestamp() instead. Date date = resultSet.getTimestamp("columnname"); //... It returns java.sql.Timestamp which is a subclass of java.util.Date, so the ... | How do I extract a Postgres timestamp field using java? My data is in format: 2010-12-01 09:59:00.423 getDate in Java only returns the date portion. Is there a way to also extract the time? | TITLE:
How do I extract a Postgres timestamp field using java?
QUESTION:
My data is in format: 2010-12-01 09:59:00.423 getDate in Java only returns the date portion. Is there a way to also extract the time?
ANSWER:
The SQL DATE type indeed only contains the date portion, not the time. But your column is apparently of... | [
"java",
"postgresql",
"jdbc"
] | 11 | 25 | 19,257 | 1 | 0 | 2011-05-31T02:34:41.060000 | 2011-05-31T02:37:48.040000 |
6,182,464 | 6,182,568 | how to return two values(1.Collection, 2.Single Boolean value) from a method in java with less expense? | I have one Main class and VOCollection Class. in main class there is a method called getStatus(), from this method only i am getting some status(true,false), if the status is true, i need to return a collection. at present i have two ideas, but both are expensive. return map, it's expensive because setting Boolean for ... | There are a number of ways to do this: Return null to indicate that there is nothing present like java.util.Map.get() Create a custom class to return both parameters. (See other answer) Use a 1 element array for one of the return values. boolean method(List[] result) { result[0] = answer; return flag; } Use a library l... | how to return two values(1.Collection, 2.Single Boolean value) from a method in java with less expense? I have one Main class and VOCollection Class. in main class there is a method called getStatus(), from this method only i am getting some status(true,false), if the status is true, i need to return a collection. at p... | TITLE:
how to return two values(1.Collection, 2.Single Boolean value) from a method in java with less expense?
QUESTION:
I have one Main class and VOCollection Class. in main class there is a method called getStatus(), from this method only i am getting some status(true,false), if the status is true, i need to return ... | [
"java",
"methods",
"boolean",
"return"
] | 2 | 5 | 4,355 | 6 | 0 | 2011-05-31T02:35:57.487000 | 2011-05-31T02:55:36.907000 |
6,182,485 | 6,185,370 | bash/sed/awk: change first alphabet in string to uppercase | Let say I have this list: 39dd809b7a36 d83f42ab46a9 9664e29ac67c 66cf165f7e32 51b9394bc3f0 I want to convert the first occurrence of alphabet to uppercase, for example 39dd809b7a36 -> 39Dd809b7a36 bash/awk/sed solution should be ok. Thanks for the help. | Pure Bash 4.0+ using parameter substitution: string=( "39dd809b7a36" "d83f42ab46a9" "9664e29ac67c" "66cf165f7e32" "51b9394bc3f0" )
for str in ${string[@]}; do # get the leading digits by removing everything # starting from the first letter: head="${str%%[a-z]*}" # and the rest of the string starting with the first let... | bash/sed/awk: change first alphabet in string to uppercase Let say I have this list: 39dd809b7a36 d83f42ab46a9 9664e29ac67c 66cf165f7e32 51b9394bc3f0 I want to convert the first occurrence of alphabet to uppercase, for example 39dd809b7a36 -> 39Dd809b7a36 bash/awk/sed solution should be ok. Thanks for the help. | TITLE:
bash/sed/awk: change first alphabet in string to uppercase
QUESTION:
Let say I have this list: 39dd809b7a36 d83f42ab46a9 9664e29ac67c 66cf165f7e32 51b9394bc3f0 I want to convert the first occurrence of alphabet to uppercase, for example 39dd809b7a36 -> 39Dd809b7a36 bash/awk/sed solution should be ok. Thanks for... | [
"bash",
"sed",
"awk"
] | 2 | 1 | 1,667 | 4 | 0 | 2011-05-31T02:39:59.223000 | 2011-05-31T09:11:40.013000 |
6,182,488 | 6,182,636 | Median of 5 sorted arrays | I am trying to find the solution for median of 5 sorted arrays. This was an interview questions. The solution I could think of was merge the 5 arrays and then find the median [O(l+m+n+o+p)]. I know that for 2 sorted arrays of same size we can do it in log(2n). [by comparing the median of both arrays and then throwing o... | (This is a generalization of your idea for two arrays.) If you start by looking at the five medians of the five arrays, obviously the overall median must be between the smallest and the largest of the five medians. Proof goes something like this: If a is the min of the medians, and b is the max of the medians, then eac... | Median of 5 sorted arrays I am trying to find the solution for median of 5 sorted arrays. This was an interview questions. The solution I could think of was merge the 5 arrays and then find the median [O(l+m+n+o+p)]. I know that for 2 sorted arrays of same size we can do it in log(2n). [by comparing the median of both ... | TITLE:
Median of 5 sorted arrays
QUESTION:
I am trying to find the solution for median of 5 sorted arrays. This was an interview questions. The solution I could think of was merge the 5 arrays and then find the median [O(l+m+n+o+p)]. I know that for 2 sorted arrays of same size we can do it in log(2n). [by comparing t... | [
"arrays",
"algorithm",
"logic"
] | 46 | 30 | 21,257 | 5 | 0 | 2011-05-31T02:41:12.107000 | 2011-05-31T03:07:58.480000 |
6,182,489 | 6,183,502 | Setting up a server | One of my real weak points in programming is networking, so I admit that I may be a little over my head with this project. Please feel free to tell me if what I'm trying to do doesn't make any sense What I am trying to do, basically, is run a program on my laptop (Node.JS, probably) that handles requests from a website... | You can run a server on your local machine, and you will specify your local IP address for the script, like 192.168.0.x. But for this server to ever receive a connection, your client must connect to your external IP address. It is the IP address that you get from your Internet provider when you connect to Internet. If ... | Setting up a server One of my real weak points in programming is networking, so I admit that I may be a little over my head with this project. Please feel free to tell me if what I'm trying to do doesn't make any sense What I am trying to do, basically, is run a program on my laptop (Node.JS, probably) that handles req... | TITLE:
Setting up a server
QUESTION:
One of my real weak points in programming is networking, so I admit that I may be a little over my head with this project. Please feel free to tell me if what I'm trying to do doesn't make any sense What I am trying to do, basically, is run a program on my laptop (Node.JS, probably... | [
"installation",
"rpc"
] | 1 | 2 | 147 | 1 | 0 | 2011-05-31T02:41:13.197000 | 2011-05-31T05:50:22.587000 |
6,182,494 | 6,182,534 | How can I add an "Email This" button that will NOT use mailto: | I want a button that does not just use a mailto: link. I want it to make either a popup, overlay or new window which has a simple form which allows anyone to email the link of the page they are on to another friend, with the subject and content pre-filled but editable. Something similar to how you can do it on google m... | What you are asking for is only possible with server side code. Your server will need to have access to a mail server so that it can compose and send on behalf of your user. This has most definitely been prebuilt, but you will need to let us know what server side language you are using before someone can point you to a... | How can I add an "Email This" button that will NOT use mailto: I want a button that does not just use a mailto: link. I want it to make either a popup, overlay or new window which has a simple form which allows anyone to email the link of the page they are on to another friend, with the subject and content pre-filled b... | TITLE:
How can I add an "Email This" button that will NOT use mailto:
QUESTION:
I want a button that does not just use a mailto: link. I want it to make either a popup, overlay or new window which has a simple form which allows anyone to email the link of the page they are on to another friend, with the subject and co... | [
"php",
"html",
"email",
"forms",
"share"
] | 0 | 3 | 1,613 | 2 | 0 | 2011-05-31T02:41:41.700000 | 2011-05-31T02:48:28.343000 |
6,182,498 | 6,192,308 | jinja2: How to make it fail Silently like djangotemplate | Well i don't find the answer I'm sure that it's very simple, but i just don't find out how to make it work like Django when it doesn't find a variable i tried to use Undefined and create my own undefined but it give me problems of attribute error etc. def silently(*args, **kwargs): return u''
class UndefinedSilently(U... | You are trying to go arbitrarily deep into your undefined data. menu_links is undefined, so Jinja2 creates a new instance of your UndefinedSilently class. It then calls the __getattr__ method of this object to get the items attribute. This returns a blank unicode string. Which Python then tries to call (the () of menu_... | jinja2: How to make it fail Silently like djangotemplate Well i don't find the answer I'm sure that it's very simple, but i just don't find out how to make it work like Django when it doesn't find a variable i tried to use Undefined and create my own undefined but it give me problems of attribute error etc. def silentl... | TITLE:
jinja2: How to make it fail Silently like djangotemplate
QUESTION:
Well i don't find the answer I'm sure that it's very simple, but i just don't find out how to make it work like Django when it doesn't find a variable i tried to use Undefined and create my own undefined but it give me problems of attribute erro... | [
"python",
"django-templates",
"jinja2"
] | 6 | 10 | 2,408 | 2 | 0 | 2011-05-31T02:42:56.820000 | 2011-05-31T19:08:52.750000 |
6,182,517 | 6,182,551 | scope when surrounding 'new' statement with try/catch in c# | This is a question of what the 'best practice' is for declaring new variables, and I've seen this situation a few times now. I have a class whose constructor reads a config file, eg: ConfigMgr config = new ConfigMgr(args[0]); Of course, if you run the console app without that argument, an exception results. If I surrou... | There is no reason why you cannot do this: ConfigMgr config = null; try { config = new ConfigMgr(args[0]); } catch ( /* catch a specific exception!! */ ) { //log it: Console.WriteLine("Config file not specified or incorrect in format. Exiting.");
//escape from here, because you don't want to continue: throw; }
string... | scope when surrounding 'new' statement with try/catch in c# This is a question of what the 'best practice' is for declaring new variables, and I've seen this situation a few times now. I have a class whose constructor reads a config file, eg: ConfigMgr config = new ConfigMgr(args[0]); Of course, if you run the console ... | TITLE:
scope when surrounding 'new' statement with try/catch in c#
QUESTION:
This is a question of what the 'best practice' is for declaring new variables, and I've seen this situation a few times now. I have a class whose constructor reads a config file, eg: ConfigMgr config = new ConfigMgr(args[0]); Of course, if yo... | [
"c#",
".net",
"constructor",
"try-catch",
"scope"
] | 0 | 3 | 380 | 2 | 0 | 2011-05-31T02:45:51.387000 | 2011-05-31T02:51:36.537000 |
6,182,521 | 6,182,561 | Does Firefox 4 have issues with GZip? | Many people recommend that you use the following code in.htaccess for GZip: AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4.0[678] no-gzip BrowserMatch ... | Mozilla/4!= Firefox 4 In fact, Firefox 4 uses Mozilla/5 as part of its user-agent. For historical compatibility reasons ( see this ), most (all?) web browsers identify themselves as Mozilla (other tokens in the user agent can be used to tell Safari from Firefox from IE, etc) | Does Firefox 4 have issues with GZip? Many people recommend that you use the following code in.htaccess for GZip: AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^... | TITLE:
Does Firefox 4 have issues with GZip?
QUESTION:
Many people recommend that you use the following code in.htaccess for GZip: AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/h... | [
"firefox",
".htaccess",
"gzip"
] | 1 | 3 | 347 | 2 | 0 | 2011-05-31T02:46:03.817000 | 2011-05-31T02:53:30.243000 |
6,182,522 | 6,182,581 | Delegates: How to make sense of them in VB.NET? | I am looking to try and understand delegates better. I've looked over the examples on MSDN and various other sites, but I just don't "get" them. I know that they are virtually similar to a pointer to a function in C. But for some reason, C's syntax is just SO much clearer on the use of such constructs. So I've develope... | To extend your second example you can do this: Private Shared MyList As New List(Of MyObj)(Obj1, Obj2, Obj3, Obj4, Obj5, Obj6)
Friend Shared Sub RedOctober(toFind as String) Dim obj4Pos As Int32 = MyList.FindIndex( Function(o) String.Equals(o.Name, toFind, OrdinalIgnoreCase))
If obj4Pos <> -1 Then Debug.Print("Found ... | Delegates: How to make sense of them in VB.NET? I am looking to try and understand delegates better. I've looked over the examples on MSDN and various other sites, but I just don't "get" them. I know that they are virtually similar to a pointer to a function in C. But for some reason, C's syntax is just SO much clearer... | TITLE:
Delegates: How to make sense of them in VB.NET?
QUESTION:
I am looking to try and understand delegates better. I've looked over the examples on MSDN and various other sites, but I just don't "get" them. I know that they are virtually similar to a pointer to a function in C. But for some reason, C's syntax is ju... | [
"vb.net"
] | 2 | 2 | 959 | 1 | 0 | 2011-05-31T02:46:37.173000 | 2011-05-31T02:58:42.473000 |
6,182,527 | 6,182,813 | How can I deploy an ASP.NET web on IIS without creating a separate site? | I've created an ASP.NET web tool that will just be used by a few people in my team where I work. I deployed it on our internal (Win2k, IIS6) web server by creating a new website in IIS and assigning it port 81. Users can access it with an address like http://myserver:81. All the other web stuff on the server is classic... | Assuming you want your application to run as a subfolder of a website bound to http://192.168.1.1: Build your website, and drop it into a subfolder called "A" in the root website folder Verify that Network Service and IUsr accounts have read access (at least) to your Subfolder Verify that the application pool serving t... | How can I deploy an ASP.NET web on IIS without creating a separate site? I've created an ASP.NET web tool that will just be used by a few people in my team where I work. I deployed it on our internal (Win2k, IIS6) web server by creating a new website in IIS and assigning it port 81. Users can access it with an address ... | TITLE:
How can I deploy an ASP.NET web on IIS without creating a separate site?
QUESTION:
I've created an ASP.NET web tool that will just be used by a few people in my team where I work. I deployed it on our internal (Win2k, IIS6) web server by creating a new website in IIS and assigning it port 81. Users can access i... | [
"asp.net",
"iis"
] | 3 | 2 | 1,578 | 1 | 0 | 2011-05-31T02:47:23.477000 | 2011-05-31T03:46:33.963000 |
6,182,536 | 6,183,255 | SQL ORDER BY query | I want to have my table, rcarddet, ordered by "SDNO" (not primary key) in ascending order with the exception of "0". So it should turn out to be like: 1 1 2.. 10 0 0 My query now is: SELECT * FROM `rcarddet` WHERE `RDATE` = '2011-05-25' AND `RCNO` = '1' AND `PLACE` = 'H' AND `SDNO`!= 0 ORDER BY `rcarddet`.`SDNO` ASC; | SELECT * FROM `rcarddet` WHERE `RDATE` = '2011-05-25' AND `RCNO` = '1' AND `PLACE` = 'H' ORDER BY `SDNO` = 0, `SDNO`; | SQL ORDER BY query I want to have my table, rcarddet, ordered by "SDNO" (not primary key) in ascending order with the exception of "0". So it should turn out to be like: 1 1 2.. 10 0 0 My query now is: SELECT * FROM `rcarddet` WHERE `RDATE` = '2011-05-25' AND `RCNO` = '1' AND `PLACE` = 'H' AND `SDNO`!= 0 ORDER BY `rcar... | TITLE:
SQL ORDER BY query
QUESTION:
I want to have my table, rcarddet, ordered by "SDNO" (not primary key) in ascending order with the exception of "0". So it should turn out to be like: 1 1 2.. 10 0 0 My query now is: SELECT * FROM `rcarddet` WHERE `RDATE` = '2011-05-25' AND `RCNO` = '1' AND `PLACE` = 'H' AND `SDNO`!... | [
"mysql",
"sql",
"sql-order-by"
] | 5 | 4 | 132 | 2 | 0 | 2011-05-31T02:48:39.730000 | 2011-05-31T05:14:51.823000 |
6,182,543 | 6,182,664 | common lisp - ch 02, code error? | I've installed clisp on my fedora-13 machine. In the clisp interpreter, i've entered the following: (defun ask-num () (format t "Please enter a number.") (let ((val (read))) (if (numberp val) val (ask-num)))) Here is the original code from Paul Graham's book: (defun ask-number () (format t "Please enter a number. ") (l... | You should be typing (ask-num), not ask-num, in order to have CLISP execute your function. [1]> (defun ask-num () (format t "Please enter a number.") (let ((val (read))) (if (numberp val) val (ask-num)))) ASK-NUM [2]> (ask-num) Please enter a number.1 1 [3]> ask-num
*** - SYSTEM::READ-EVAL-PRINT: variable ASK-NUM has ... | common lisp - ch 02, code error? I've installed clisp on my fedora-13 machine. In the clisp interpreter, i've entered the following: (defun ask-num () (format t "Please enter a number.") (let ((val (read))) (if (numberp val) val (ask-num)))) Here is the original code from Paul Graham's book: (defun ask-number () (forma... | TITLE:
common lisp - ch 02, code error?
QUESTION:
I've installed clisp on my fedora-13 machine. In the clisp interpreter, i've entered the following: (defun ask-num () (format t "Please enter a number.") (let ((val (read))) (if (numberp val) val (ask-num)))) Here is the original code from Paul Graham's book: (defun as... | [
"clisp"
] | 0 | 2 | 2,355 | 3 | 0 | 2011-05-31T02:49:41.983000 | 2011-05-31T03:14:01.767000 |
6,182,548 | 6,182,673 | Will JavaScript tag's src attribute follow HTTP redirects in all browsers | Let's say, a javascript tag's src attribute points to a redirect: where http://foo.com/foo.js is a 301 redirect to https://foo.com/foo.js... Will all browsers successfully load the JS file? I've noticed it seems to work in Chrome, Firefox, Safari, and IE9... but I'm just curious if this is something that's in a spec or... | Loading resources for a webpage (be it script source, image source or whatever) is agnostic to how browser fetches it for you (using HTTP protocol over TCP/IP). The only thing to be aware of here is that browser makes two request to download one resource & provided that script calls are blocking in browser, so it is no... | Will JavaScript tag's src attribute follow HTTP redirects in all browsers Let's say, a javascript tag's src attribute points to a redirect: where http://foo.com/foo.js is a 301 redirect to https://foo.com/foo.js... Will all browsers successfully load the JS file? I've noticed it seems to work in Chrome, Firefox, Safari... | TITLE:
Will JavaScript tag's src attribute follow HTTP redirects in all browsers
QUESTION:
Let's say, a javascript tag's src attribute points to a redirect: where http://foo.com/foo.js is a 301 redirect to https://foo.com/foo.js... Will all browsers successfully load the JS file? I've noticed it seems to work in Chrom... | [
"javascript",
"html",
"http",
"http-redirect"
] | 7 | 2 | 6,756 | 2 | 0 | 2011-05-31T02:51:07.077000 | 2011-05-31T03:16:10.647000 |
6,182,549 | 6,192,287 | How do I get my MonoTouch app deployed to device/app store now? | Over the last couple months I've been developing an app with the free version of MonoTouch. Now (at the time of this question) it seems Novell killed it, and now that my app is ready, not really sure where to go. If I understand correctly, to deploy to device or package for app store, I need to get a license; do I buy ... | The Novell Store is still up, and as recently as this weekend someone reported that the activation server is still working. However, if you don't want to risk spending money on a license right now (and I don't blame you) your best bet is to get someone with an active MT license to help you. | How do I get my MonoTouch app deployed to device/app store now? Over the last couple months I've been developing an app with the free version of MonoTouch. Now (at the time of this question) it seems Novell killed it, and now that my app is ready, not really sure where to go. If I understand correctly, to deploy to dev... | TITLE:
How do I get my MonoTouch app deployed to device/app store now?
QUESTION:
Over the last couple months I've been developing an app with the free version of MonoTouch. Now (at the time of this question) it seems Novell killed it, and now that my app is ready, not really sure where to go. If I understand correctly... | [
"xamarin.ios"
] | 0 | 1 | 534 | 3 | 0 | 2011-05-31T02:51:20.363000 | 2011-05-31T19:07:28.257000 |
6,182,560 | 6,187,876 | Printing support for Windows Mobile | I'm a windows developer looking for implementation of priting support for Windows Mobile 6.5. As the WM6.5 is based on the Windows CE 5.0, I have gone through the architecture of Printing in Windows CE and what I have realized from the Windows CE Printer architecture is: For a USB class printer the main components requ... | I Don't believe WinMo includes the printer pieces for CE. I'm not a lawyer (nor do I play one on TV) but my interpretation is that you can't take the pieces from Platform Builder and use them in your WinMo OS. You are licensed to modify them if you need and use them in your own custom OS. See #2. PCL would probably wor... | Printing support for Windows Mobile I'm a windows developer looking for implementation of priting support for Windows Mobile 6.5. As the WM6.5 is based on the Windows CE 5.0, I have gone through the architecture of Printing in Windows CE and what I have realized from the Windows CE Printer architecture is: For a USB cl... | TITLE:
Printing support for Windows Mobile
QUESTION:
I'm a windows developer looking for implementation of priting support for Windows Mobile 6.5. As the WM6.5 is based on the Windows CE 5.0, I have gone through the architecture of Printing in Windows CE and what I have realized from the Windows CE Printer architectur... | [
"printing",
"windows-mobile",
"windows-ce"
] | 1 | 1 | 1,252 | 1 | 0 | 2011-05-31T02:53:19.743000 | 2011-05-31T12:55:02.067000 |
6,182,563 | 6,182,589 | Color a WPF ListBox item based on a property | I have an observable collection of Song objects. These song objects have a property called "Playing" that is a bool (bad naming, I know). The songs display in a ListBox in my application. I want the song that is Playing to be colored red. I have been working with triggers all day trying to make this work. So far, I hav... | Does your object with the Playing property implement INotifyPropertyChanged? If it does, then your UI should auto-update based on the DataTrigger approach you are using. Another approach is to use ViewModels instead of Triggers (easier to understand and work with - when things don't go as expected) An example Update: J... | Color a WPF ListBox item based on a property I have an observable collection of Song objects. These song objects have a property called "Playing" that is a bool (bad naming, I know). The songs display in a ListBox in my application. I want the song that is Playing to be colored red. I have been working with triggers al... | TITLE:
Color a WPF ListBox item based on a property
QUESTION:
I have an observable collection of Song objects. These song objects have a property called "Playing" that is a bool (bad naming, I know). The songs display in a ListBox in my application. I want the song that is Playing to be colored red. I have been workin... | [
"wpf",
"colors",
"triggers",
"listbox",
"listboxitem"
] | 1 | 2 | 16,402 | 2 | 0 | 2011-05-31T02:54:06.740000 | 2011-05-31T03:00:20.613000 |
6,182,567 | 6,182,689 | Recursive Datatypes and types in Objective C | Related: Lazy datatypes in Objective C From the related question I was able to figure out how to use block objects to mimic suspended computation, but I am still trying to grasp the concept. For a horribleComputation it would work, but how would one model an infinite stream? How it is normally done in SML, (* Have a da... | There are two separate, orthogonal concepts: recursive datatypes and lazy computations. In C and C-like languages, you model the former with a struct that contains pointer(s) to either itself, or to other data type that contains/points to that struct directly or indirectly. Use block objects or whatever to suspend your... | Recursive Datatypes and types in Objective C Related: Lazy datatypes in Objective C From the related question I was able to figure out how to use block objects to mimic suspended computation, but I am still trying to grasp the concept. For a horribleComputation it would work, but how would one model an infinite stream?... | TITLE:
Recursive Datatypes and types in Objective C
QUESTION:
Related: Lazy datatypes in Objective C From the related question I was able to figure out how to use block objects to mimic suspended computation, but I am still trying to grasp the concept. For a horribleComputation it would work, but how would one model a... | [
"objective-c",
"sml"
] | 3 | 3 | 273 | 1 | 0 | 2011-05-31T02:55:36.503000 | 2011-05-31T03:19:58.740000 |
6,182,572 | 6,193,765 | How important is it to enable read repair in Cassandra? | If I understand it correctly, upon a write request the write is sent to all N replicas, and the operation succeeds when the first W responses are received. Is this correct? If it is, then combined with Hinted Handoff, it seems that all replicas will already get all writes as soon as possible, do we really have to do re... | Short answer: you still need read repair. Longer answer: there wasn't a good discussion of Hinted Handoff anywhere, so I wrote one. For Cassandra 1.0+, read the updated article. The crucial part being: At first glance, it may appear that Hinted Handoff lets you safely get away without needing repair. This is only true ... | How important is it to enable read repair in Cassandra? If I understand it correctly, upon a write request the write is sent to all N replicas, and the operation succeeds when the first W responses are received. Is this correct? If it is, then combined with Hinted Handoff, it seems that all replicas will already get al... | TITLE:
How important is it to enable read repair in Cassandra?
QUESTION:
If I understand it correctly, upon a write request the write is sent to all N replicas, and the operation succeeds when the first W responses are received. Is this correct? If it is, then combined with Hinted Handoff, it seems that all replicas w... | [
"cassandra"
] | 8 | 9 | 5,549 | 3 | 0 | 2011-05-31T02:55:59.980000 | 2011-05-31T21:26:55.577000 |
6,182,576 | 6,183,098 | Android Dev: Parsing a XML file | Here is a snippet from the XML file I am trying to parse: 240 432 0 1 1 255 255 255 255 4294967295 I'm using an XmlResourceParser object to parse the XML file and here is my code so far: XmlResourceParser xrp = context.getResources().getXml(R.xml.level_1);
int eventType = xrp.getEventType(); while (eventType!= XmlPull... | You're on the right track. Just create an object model that maps to what you expect and fill it in as you parse the XML. You'll be better off having a light-weight representation of the data instead of trying to use xpath as you need values. | Android Dev: Parsing a XML file Here is a snippet from the XML file I am trying to parse: 240 432 0 1 1 255 255 255 255 4294967295 I'm using an XmlResourceParser object to parse the XML file and here is my code so far: XmlResourceParser xrp = context.getResources().getXml(R.xml.level_1);
int eventType = xrp.getEventTy... | TITLE:
Android Dev: Parsing a XML file
QUESTION:
Here is a snippet from the XML file I am trying to parse: 240 432 0 1 1 255 255 255 255 4294967295 I'm using an XmlResourceParser object to parse the XML file and here is my code so far: XmlResourceParser xrp = context.getResources().getXml(R.xml.level_1);
int eventTyp... | [
"java",
"android",
"xml"
] | 0 | 2 | 464 | 1 | 0 | 2011-05-31T02:57:48.240000 | 2011-05-31T04:45:28.410000 |
6,182,579 | 6,182,584 | Constructing a linq query | I have a Question (q) with many Answers, each Answer has a variety of Texts, differing in language. I want to write a query to return all the answers in a given language (Lang) but I'm having difficulty figuring it out... here's what I'm trying: List Answers = q.Answers.Select(x => x.Texts.Where(l => l.Language.ISO == ... | You need to call.SelectMany() to flatten the list of sets of Text s ( IEnumerable > ) into a single set of Text s ( IEnumerable ). | Constructing a linq query I have a Question (q) with many Answers, each Answer has a variety of Texts, differing in language. I want to write a query to return all the answers in a given language (Lang) but I'm having difficulty figuring it out... here's what I'm trying: List Answers = q.Answers.Select(x => x.Texts.Whe... | TITLE:
Constructing a linq query
QUESTION:
I have a Question (q) with many Answers, each Answer has a variety of Texts, differing in language. I want to write a query to return all the answers in a given language (Lang) but I'm having difficulty figuring it out... here's what I'm trying: List Answers = q.Answers.Selec... | [
"c#",
"asp.net-mvc-3",
"linq-to-entities"
] | 1 | 2 | 101 | 2 | 0 | 2011-05-31T02:58:14.417000 | 2011-05-31T02:59:08.680000 |
6,182,582 | 6,182,609 | Random Character Generation Error C# | For some reason, when I try to generate this code all at once, the code produces the same number or letter over and over again (30 times) - see below. When I go through line by line in debug mode, however, the code works great... private string Generate_ActiveX_name() {
StringBuilder charBuilder = new StringBuilder("a... | You need to move the Random constructor out of your loop. Change this: while (activeX_builder.Length < 30) { Random activeX_gen = new Random(); To: Random activeX_gen = new Random(); while (activeX_builder.Length < 30) { The issue is that, when an instance of Random is created, it uses the current system clock as a "se... | Random Character Generation Error C# For some reason, when I try to generate this code all at once, the code produces the same number or letter over and over again (30 times) - see below. When I go through line by line in debug mode, however, the code works great... private string Generate_ActiveX_name() {
StringBuild... | TITLE:
Random Character Generation Error C#
QUESTION:
For some reason, when I try to generate this code all at once, the code produces the same number or letter over and over again (30 times) - see below. When I go through line by line in debug mode, however, the code works great... private string Generate_ActiveX_nam... | [
"c#",
"debugging",
"random"
] | 2 | 5 | 254 | 2 | 0 | 2011-05-31T02:59:00.320000 | 2011-05-31T03:03:49.713000 |
6,182,601 | 6,183,133 | What kind of class is embedded media in Flash Builder? | When you embed media in FLash Builder like below it creates a class to reference [Embed(source="images/list.png")] protected static const LIST_ICON:Class; What kind of class does that create? And if I had a library swc that contained bitmapData, how would I go about in code creating the same kind of class using a bitma... | If you check out the documentation ( http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html ) on the Embed metadata it shows that the image will be embedded with the type mx.core.BitmapAsset (that is, your LIST_ICON class extends BitmapAsset). Adjusted for your embed, the code would be: [Embed(source="ima... | What kind of class is embedded media in Flash Builder? When you embed media in FLash Builder like below it creates a class to reference [Embed(source="images/list.png")] protected static const LIST_ICON:Class; What kind of class does that create? And if I had a library swc that contained bitmapData, how would I go abou... | TITLE:
What kind of class is embedded media in Flash Builder?
QUESTION:
When you embed media in FLash Builder like below it creates a class to reference [Embed(source="images/list.png")] protected static const LIST_ICON:Class; What kind of class does that create? And if I had a library swc that contained bitmapData, h... | [
"flash",
"apache-flex",
"actionscript"
] | 3 | 2 | 372 | 3 | 0 | 2011-05-31T03:02:28.990000 | 2011-05-31T04:53:05.897000 |
6,182,606 | 6,182,709 | jQuery Syntax & Wordpress Tags | I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); }); }); I'd like to know how the best way to add a Wordpress Template Tag is to the #slideViewer img section. The template tag is: /builderimages/ Basically I want ... | You could try this: var IMG_DIR = ' /builderimages/';
// And then, later on... $('#slideViewer img').attr('src', IMG_DIR + $(this).val() + '.png'); This should work as long as the file with the var IMG_DIR part is being processed by PHP/WordPress. If necessary, you could put that in a | jQuery Syntax & Wordpress Tags I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); }); }); I'd like to know how the best way to add a Wordpress Template Tag is to the #slideViewer img section. The template tag is: /b... | TITLE:
jQuery Syntax & Wordpress Tags
QUESTION:
I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); }); }); I'd like to know how the best way to add a Wordpress Template Tag is to the #slideViewer img section. The t... | [
"jquery",
"wordpress",
"syntax"
] | 1 | 1 | 196 | 2 | 0 | 2011-05-31T03:03:32.863000 | 2011-05-31T03:24:05.530000 |
6,182,610 | 6,182,646 | Javascript Regex - How to extract last word before path to image | I want to use regex to extract the last word from a file path. For example, I have: /xyz/blahblah/zzz/abc-blah/def-xyz- color.jpg I want to extract the " color " out of the path. The path color have different syntax. The only thing that is consistent is the ending where it is always -color.jpg where color would be any ... | var matched = /-(\w+).jpg/i.exec('/xyz/blahblah/zzz/abc-blah/def-xyz-color.jpg')[1]; | Javascript Regex - How to extract last word before path to image I want to use regex to extract the last word from a file path. For example, I have: /xyz/blahblah/zzz/abc-blah/def-xyz- color.jpg I want to extract the " color " out of the path. The path color have different syntax. The only thing that is consistent is t... | TITLE:
Javascript Regex - How to extract last word before path to image
QUESTION:
I want to use regex to extract the last word from a file path. For example, I have: /xyz/blahblah/zzz/abc-blah/def-xyz- color.jpg I want to extract the " color " out of the path. The path color have different syntax. The only thing that ... | [
"javascript",
"regex"
] | 1 | 1 | 1,555 | 5 | 0 | 2011-05-31T03:04:00.807000 | 2011-05-31T03:09:26.390000 |
6,182,611 | 6,182,704 | In .xsl, take a range value like "130-210", and determine if "86" or "458" is within that numeric range | I'm parsing an.xml file like: 100-200 83 In an.xls stylesheet I need to display a value indicating whether the value is within the normalRange, below it, or above it. This is a very common problem when displaying Human Readable results from the CCR (Continuity of Care Record in Healthcare HL7 messaging) xml document. | below above within Note that element name "xml" is reserved by XML 1.0 standard, so it's probably good idea to avoid it. | In .xsl, take a range value like "130-210", and determine if "86" or "458" is within that numeric range I'm parsing an.xml file like: 100-200 83 In an.xls stylesheet I need to display a value indicating whether the value is within the normalRange, below it, or above it. This is a very common problem when displaying Hum... | TITLE:
In .xsl, take a range value like "130-210", and determine if "86" or "458" is within that numeric range
QUESTION:
I'm parsing an.xml file like: 100-200 83 In an.xls stylesheet I need to display a value indicating whether the value is within the normalRange, below it, or above it. This is a very common problem w... | [
"xml",
"xls",
"hl7",
"ccr"
] | 5 | 7 | 1,879 | 1 | 0 | 2011-05-31T03:04:07.693000 | 2011-05-31T03:23:16.720000 |
6,182,621 | 6,182,688 | Need design suggestions for my android application | Currently I am in process of developing my android application. My requirement is something like this. I need to run a timer of 5mins and when timeout occurs I need to check certain things and take certain action. This need to be keep on running if the user starts the application. In my knowledge I want to proceed like... | There's no need for a service. You can use a Timer and schedule a TimerTask. If the task needs to touch the UI, then you should create a Handler to which you can post a Runnable. P.S. You asked about what happens if your activity goes to the background. The Timer will keep running unless you cancel either the task or t... | Need design suggestions for my android application Currently I am in process of developing my android application. My requirement is something like this. I need to run a timer of 5mins and when timeout occurs I need to check certain things and take certain action. This need to be keep on running if the user starts the ... | TITLE:
Need design suggestions for my android application
QUESTION:
Currently I am in process of developing my android application. My requirement is something like this. I need to run a timer of 5mins and when timeout occurs I need to check certain things and take certain action. This need to be keep on running if th... | [
"android",
"service",
"android-activity",
"timer"
] | 2 | 1 | 118 | 1 | 0 | 2011-05-31T03:05:36 | 2011-05-31T03:19:50.233000 |
6,182,626 | 6,182,716 | "Help Arthur find his restricted class" or "how can i make google app engine happy" | somewhere in here I'm using java.rmi.server.UID which is upsetting GAE. After:only'ing my dependencies to the bone I'm at an impasse. (ns helloworld.core (:use;[hiccup.core] [hiccup.page-helpers:only (html5 include-css)] [clojure.contrib.string:only (split)] [compojure.core:only (defroutes GET)] [hiccup.middleware:only... | FWIW I don't think:only will make a bit of difference to GAE. It's probably watching what classes you load, and refusing to refer to a function doesn't stop its code from being loaded. With no domain-specific experience other than looking at the stacktrace, I think the handler that's causing the issue is probably compo... | "Help Arthur find his restricted class" or "how can i make google app engine happy" somewhere in here I'm using java.rmi.server.UID which is upsetting GAE. After:only'ing my dependencies to the bone I'm at an impasse. (ns helloworld.core (:use;[hiccup.core] [hiccup.page-helpers:only (html5 include-css)] [clojure.contri... | TITLE:
"Help Arthur find his restricted class" or "how can i make google app engine happy"
QUESTION:
somewhere in here I'm using java.rmi.server.UID which is upsetting GAE. After:only'ing my dependencies to the bone I'm at an impasse. (ns helloworld.core (:use;[hiccup.core] [hiccup.page-helpers:only (html5 include-css... | [
"java",
"google-app-engine",
"clojure",
"compojure",
"appengine-magic"
] | 6 | 6 | 428 | 1 | 0 | 2011-05-31T03:06:21.520000 | 2011-05-31T03:25:10.257000 |
6,182,628 | 6,183,084 | Ruby class inheritance: What is `<<` (double less than)? | class << Awesomeness What is this << for? I searched, but the results only tell me about string concatenation... | While it's true that class << something is the syntax for a singleton class, as someone else said, it's most often used to define class methods within a class definition. But these two usages are consistent. Here's how. Ruby lets you add methods to any particular instance by doing this: class << someinstance def foo "H... | Ruby class inheritance: What is `<<` (double less than)? class << Awesomeness What is this << for? I searched, but the results only tell me about string concatenation... | TITLE:
Ruby class inheritance: What is `<<` (double less than)?
QUESTION:
class << Awesomeness What is this << for? I searched, but the results only tell me about string concatenation...
ANSWER:
While it's true that class << something is the syntax for a singleton class, as someone else said, it's most often used to ... | [
"ruby"
] | 78 | 141 | 23,726 | 3 | 0 | 2011-05-31T03:06:27.620000 | 2011-05-31T04:43:14 |
6,182,644 | 6,182,717 | "Missing compiler required member" error being thrown multiple times with almost no changes to code | Today after deploying some changes to a C# MVC site that I run, I went back to make some more modifications and came across this error: Missing compiler required member System.Runtime.CompilerServices.ExtensionAttribute..ctor The error is a bit vague (other than it's description, obviously) as it doesn't give me a file... | This error usually means either your project is compiling against.NET 2.0 or you aren't referencing the correct version of System.Core.dll For a near duplicate question, see Error when using extension methods in C# | "Missing compiler required member" error being thrown multiple times with almost no changes to code Today after deploying some changes to a C# MVC site that I run, I went back to make some more modifications and came across this error: Missing compiler required member System.Runtime.CompilerServices.ExtensionAttribute.... | TITLE:
"Missing compiler required member" error being thrown multiple times with almost no changes to code
QUESTION:
Today after deploying some changes to a C# MVC site that I run, I went back to make some more modifications and came across this error: Missing compiler required member System.Runtime.CompilerServices.E... | [
"c#",
"asp.net-mvc"
] | 104 | 28 | 83,941 | 12 | 0 | 2011-05-31T03:09:18.153000 | 2011-05-31T03:25:34.503000 |
6,182,651 | 6,182,794 | Firefox Javascript, stop script | Basically, this script checks if the user is running a certain addon, if yes, it shows an alert... the problem is after it shows the alert Firefox's spinning wheel keeps spinning like it's waiting for something. And if I refresh the page the script does not work... This is the code: testing! | After calling document.write(), you need a document.close(). See this link. | Firefox Javascript, stop script Basically, this script checks if the user is running a certain addon, if yes, it shows an alert... the problem is after it shows the alert Firefox's spinning wheel keeps spinning like it's waiting for something. And if I refresh the page the script does not work... This is the code: test... | TITLE:
Firefox Javascript, stop script
QUESTION:
Basically, this script checks if the user is running a certain addon, if yes, it shows an alert... the problem is after it shows the alert Firefox's spinning wheel keeps spinning like it's waiting for something. And if I refresh the page the script does not work... This... | [
"javascript",
"firefox",
"firefox-addon",
"dom-events",
"throbber"
] | 2 | 4 | 912 | 2 | 0 | 2011-05-31T03:10:13.627000 | 2011-05-31T03:42:56.670000 |
6,182,668 | 6,182,680 | OutOfMemory error while Encrypting | First off, this is the error I am getting java.lang.OutOfMemoryError at coderaustin.com.FileEncryptor.encryptFile(FileEncryptor.java:56) at coderaustin.com.Main.onCreate(Main.java:41) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069) at android.app.ActivityThread.performLaunchActivity(Activ... | Odd: if the file is very big I could see how that could be an issue. Why are you reading the entire file at once instead of reading it in small chunks and processing? EDIT: try this. byte[] input = new byte[4096];
int bytesRead; while ((bytesRead = inFile.read(input, 0, 4096))!= -1) { byte[] output = cipher.update(inp... | OutOfMemory error while Encrypting First off, this is the error I am getting java.lang.OutOfMemoryError at coderaustin.com.FileEncryptor.encryptFile(FileEncryptor.java:56) at coderaustin.com.Main.onCreate(Main.java:41) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069) at android.app.Activit... | TITLE:
OutOfMemory error while Encrypting
QUESTION:
First off, this is the error I am getting java.lang.OutOfMemoryError at coderaustin.com.FileEncryptor.encryptFile(FileEncryptor.java:56) at coderaustin.com.Main.onCreate(Main.java:41) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069) at a... | [
"java",
"android",
"encryption",
"out-of-memory"
] | 2 | 5 | 1,600 | 1 | 0 | 2011-05-31T03:15:09.623000 | 2011-05-31T03:18:50.293000 |
6,182,672 | 6,182,869 | How to find the Iphone speed and Gravity values? | I am developing one application,In that i want speed of the iPhone and gravity values. For gravity, i need x,y,z axis values So How to find that values Please send me the some post regarding that one Thanks. | Please refer this http://developer.apple.com/library/ios/#documentation/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html#//apple_ref/occ/cl/CMMotionManager | How to find the Iphone speed and Gravity values? I am developing one application,In that i want speed of the iPhone and gravity values. For gravity, i need x,y,z axis values So How to find that values Please send me the some post regarding that one Thanks. | TITLE:
How to find the Iphone speed and Gravity values?
QUESTION:
I am developing one application,In that i want speed of the iPhone and gravity values. For gravity, i need x,y,z axis values So How to find that values Please send me the some post regarding that one Thanks.
ANSWER:
Please refer this http://developer.a... | [
"iphone"
] | 1 | 0 | 922 | 2 | 0 | 2011-05-31T03:16:04.220000 | 2011-05-31T03:57:08.617000 |
6,182,676 | 6,182,971 | Mathematica: is it possible to put AxesLabel for 3D graphics at the end of the axes as in 2D? | According to http://reference.wolfram.com/mathematica/ref/AxesLabel.html it says "By default, axes labels in two-dimensional graphics are placed at the ends of the axes. In three-dimensional graphics, they are aligned with the middles of the axes." I wanted to put the axes labels at the end of the axes also for my 3D p... | You could draw the labels manually, at the location of your choosing: Graphics3D[ { Cuboid[{-.1,-.1,-.1},{.1,.1,.1}], Text[Style["X", Bold, Red, 16], {3, 0, 0}], Text[Style["Y", Bold, Black, 16], {0, 3, 0}], Text[Style["Z", Bold, Blue, 16], {0, 0, 3}] }, AxesOrigin -> {0, 0, 0}, PlotRange -> {{-3, 3}, {-3, 3}, {-3, 3}}... | Mathematica: is it possible to put AxesLabel for 3D graphics at the end of the axes as in 2D? According to http://reference.wolfram.com/mathematica/ref/AxesLabel.html it says "By default, axes labels in two-dimensional graphics are placed at the ends of the axes. In three-dimensional graphics, they are aligned with the... | TITLE:
Mathematica: is it possible to put AxesLabel for 3D graphics at the end of the axes as in 2D?
QUESTION:
According to http://reference.wolfram.com/mathematica/ref/AxesLabel.html it says "By default, axes labels in two-dimensional graphics are placed at the ends of the axes. In three-dimensional graphics, they ar... | [
"wolfram-mathematica"
] | 4 | 4 | 4,685 | 1 | 0 | 2011-05-31T03:16:34.960000 | 2011-05-31T04:19:28.770000 |
6,182,681 | 6,182,735 | How can I get these elements on the same line? | I have links and a sprite image I want to render in one line centered vertically: HTML: Why Eminem is the best by Justin Meltzer How would I get all of these elements on one line? I'd do a jsfiddle but I don't have my sprite images at a public url | Set your div to display inline-block so that everything will stay on one line. Do you want the links to then be aligned with the center of the image? http://jsfiddle.net/gUrc9/ div.sprite { background: blue; height: 50px; width: 50px; display: inline-block; } UPDATE: As pointed out in comments inline-block is not suppo... | How can I get these elements on the same line? I have links and a sprite image I want to render in one line centered vertically: HTML: Why Eminem is the best by Justin Meltzer How would I get all of these elements on one line? I'd do a jsfiddle but I don't have my sprite images at a public url | TITLE:
How can I get these elements on the same line?
QUESTION:
I have links and a sprite image I want to render in one line centered vertically: HTML: Why Eminem is the best by Justin Meltzer How would I get all of these elements on one line? I'd do a jsfiddle but I don't have my sprite images at a public url
ANSWER... | [
"html",
"css",
"inline"
] | 0 | 0 | 122 | 4 | 0 | 2011-05-31T03:18:53.630000 | 2011-05-31T03:30:53.830000 |
6,182,687 | 6,184,038 | Rails 3 build_association | I am attempting to create something along the lines of How to Implement Basic Defensio Spam Protection in Rails but I'm running into a problem. In the article they have something like: def self.init(attributes) self.new(clean!(attributes)) end
private
def self.clean!(attrs) returning({}) do |cleansed_attributes| attr... | You could override initializer of model, like this def initialize(attributes = {}) super(clean!(attributes)) end | Rails 3 build_association I am attempting to create something along the lines of How to Implement Basic Defensio Spam Protection in Rails but I'm running into a problem. In the article they have something like: def self.init(attributes) self.new(clean!(attributes)) end
private
def self.clean!(attrs) returning({}) do ... | TITLE:
Rails 3 build_association
QUESTION:
I am attempting to create something along the lines of How to Implement Basic Defensio Spam Protection in Rails but I'm running into a problem. In the article they have something like: def self.init(attributes) self.new(clean!(attributes)) end
private
def self.clean!(attrs)... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 0 | 1 | 363 | 1 | 0 | 2011-05-31T03:19:42.043000 | 2011-05-31T07:02:35.340000 |
6,182,693 | 6,182,778 | Python -- Send Email When Exception Is Raised? | I have a python class with many methods(): Method1() Method2()...................... MethodN() All methods -- while performing different tasks -- have the same scheme: do something do something else has anything gone wrong? raise an exception I want to be able to get an email whenever an exception is raised anywhere in... | Note: Although this is a simple, obvious solution to the problem as stated, the below answer is probably better in most cases. If the alternative is this: if problem_test(): SendEmail() raise Exception Then why don't you just define a custom raise_email method? def raise_email(self, e): SendEmail() raise e | Python -- Send Email When Exception Is Raised? I have a python class with many methods(): Method1() Method2()...................... MethodN() All methods -- while performing different tasks -- have the same scheme: do something do something else has anything gone wrong? raise an exception I want to be able to get an em... | TITLE:
Python -- Send Email When Exception Is Raised?
QUESTION:
I have a python class with many methods(): Method1() Method2()...................... MethodN() All methods -- while performing different tasks -- have the same scheme: do something do something else has anything gone wrong? raise an exception I want to be... | [
"python",
"exception"
] | 24 | 9 | 45,116 | 12 | 0 | 2011-05-31T03:20:22.040000 | 2011-05-31T03:38:37.840000 |
6,182,700 | 6,182,769 | Rails namespaced routes work in development but not production | I'm trying to nest some routes under the namespace, account. I want user management under account like /account/users and /account/users/5/edit In routes.rb: namespace:account do resources:users do member do put 'generate_api_key' end
collection do post 'api_key' end end end My controllers are not namespaced or put th... | If you're namespacing like this, Rails requires the controllers to be at their correct paths, such as app/controllers/account/users_controller.rb. If you don't want to do this, then use scope instead: scope:path => "account" do resources:users end | Rails namespaced routes work in development but not production I'm trying to nest some routes under the namespace, account. I want user management under account like /account/users and /account/users/5/edit In routes.rb: namespace:account do resources:users do member do put 'generate_api_key' end
collection do post 'a... | TITLE:
Rails namespaced routes work in development but not production
QUESTION:
I'm trying to nest some routes under the namespace, account. I want user management under account like /account/users and /account/users/5/edit In routes.rb: namespace:account do resources:users do member do put 'generate_api_key' end
col... | [
"ruby-on-rails",
"namespaces",
"routes",
"production-environment"
] | 5 | 5 | 1,523 | 1 | 0 | 2011-05-31T03:21:25.903000 | 2011-05-31T03:37:13.820000 |
6,182,701 | 6,183,532 | implementing uitabbar to uitableview | I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tutorial or examples as well. Thanx in advance. | You can't do it in this way. They both are different things but you can have UITableView inside the uitabbar view. But vica-versa is not allowed...this is not feasible and also not proper as per apple's guideline. So, please make sure not to use in this way...rather go for some other alternative: like put Custom UITool... | implementing uitabbar to uitableview I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tutorial or examples ... | TITLE:
implementing uitabbar to uitableview
QUESTION:
I want to put a uitabbar into a section in uitableview, I have hard time looking a way for it, since I just started doing XCODE in less than a month. Anyone there know the solution for it? Any help is appreciated, and if possible, could you share a link for the tut... | [
"ios",
"uitableview",
"xcode4",
"uitabbar"
] | 0 | 2 | 528 | 3 | 0 | 2011-05-31T03:21:26.820000 | 2011-05-31T05:54:54.690000 |
6,182,715 | 6,184,787 | WebBrowser not loading my page | I have a WebBrowser element in my UI, I can make it navigate to a hosted page, but when I want it to load a local webpage (which is in my solution resources), which is the exact html file hosted on internet, it just shows a blank page. browser.Navigate(new Uri("test.html", UriKind.Relative)); If I change the UriKind or... | If the html file has a build action of Content you can access it directly from the install location if you set a relative path. If you want to be able to navigate between pages or include other resources in the file (including external css, js or even images) then you'll either need to copy all the files to IsolatedSto... | WebBrowser not loading my page I have a WebBrowser element in my UI, I can make it navigate to a hosted page, but when I want it to load a local webpage (which is in my solution resources), which is the exact html file hosted on internet, it just shows a blank page. browser.Navigate(new Uri("test.html", UriKind.Relativ... | TITLE:
WebBrowser not loading my page
QUESTION:
I have a WebBrowser element in my UI, I can make it navigate to a hosted page, but when I want it to load a local webpage (which is in my solution resources), which is the exact html file hosted on internet, it just shows a blank page. browser.Navigate(new Uri("test.html... | [
"c#",
"silverlight",
"windows-phone-7"
] | 0 | 0 | 944 | 2 | 0 | 2011-05-31T03:24:53.003000 | 2011-05-31T08:20:05.447000 |
6,182,718 | 6,182,901 | iPhone - NSUndoManager + NSInvocation + object released = crash | I am building a undo/redo functionality for my app. I am using the NSInvocation method of NSUndoManager. This is how I build the invocation NSNumber *firstState = [NSNumber numberWithInt:fsNumber]; NSInvocation *initialState = [self restoreStateInvocation:firstState]; //... the code continues... these are the methods r... | the correct answer is to add the following line to restoreStateInvocation... [moveInvocation retainArguments]; | iPhone - NSUndoManager + NSInvocation + object released = crash I am building a undo/redo functionality for my app. I am using the NSInvocation method of NSUndoManager. This is how I build the invocation NSNumber *firstState = [NSNumber numberWithInt:fsNumber]; NSInvocation *initialState = [self restoreStateInvocation:... | TITLE:
iPhone - NSUndoManager + NSInvocation + object released = crash
QUESTION:
I am building a undo/redo functionality for my app. I am using the NSInvocation method of NSUndoManager. This is how I build the invocation NSNumber *firstState = [NSNumber numberWithInt:fsNumber]; NSInvocation *initialState = [self resto... | [
"iphone",
"nsundomanager"
] | 0 | 1 | 293 | 2 | 0 | 2011-05-31T03:25:38.793000 | 2011-05-31T04:05:14.907000 |
6,182,729 | 6,182,744 | How to display an incremental value that was just created in mysql | I have a PHP script that creates an entry into a mysql database. The PHP inserts all of the data except the primary key, which mysql automatically increments. The problem is that i want to insert information into two tables, and these tables must be able to associate. Is there a way to have PHP create an entry in one t... | Yes. This is certainly doable. The function/method you use to get the auto-incremented value that was just inserted will depend on the way you access MySQL from PHP. If you're using the mysql_ functions, use mysql_insert_id(). If you're using the mysqli_ functions (or OO versions), use mysqli_insert_id(). If you're usi... | How to display an incremental value that was just created in mysql I have a PHP script that creates an entry into a mysql database. The PHP inserts all of the data except the primary key, which mysql automatically increments. The problem is that i want to insert information into two tables, and these tables must be abl... | TITLE:
How to display an incremental value that was just created in mysql
QUESTION:
I have a PHP script that creates an entry into a mysql database. The PHP inserts all of the data except the primary key, which mysql automatically increments. The problem is that i want to insert information into two tables, and these ... | [
"php",
"mysql"
] | 3 | 3 | 99 | 3 | 0 | 2011-05-31T03:28:16.100000 | 2011-05-31T03:32:43.750000 |
6,182,732 | 6,183,202 | Applying a background image to ListView using SimpleAdapter | I recently created a ListView using ListAdapter and applied a static background image behind the lists; String[] teams = getResources().getStringArray(R.array.array); setListAdapter(new ArrayAdapter (this, R.layout.list_view, teams));
ListView lv = getListView(); lv.setTextFilterEnabled(true);
lv.setBackgroundResourc... | android:background="@drawable/worldmap4" add this element in your xml file it is use for setting the static background of ListView. I hope this is help. | Applying a background image to ListView using SimpleAdapter I recently created a ListView using ListAdapter and applied a static background image behind the lists; String[] teams = getResources().getStringArray(R.array.array); setListAdapter(new ArrayAdapter (this, R.layout.list_view, teams));
ListView lv = getListVie... | TITLE:
Applying a background image to ListView using SimpleAdapter
QUESTION:
I recently created a ListView using ListAdapter and applied a static background image behind the lists; String[] teams = getResources().getStringArray(R.array.array); setListAdapter(new ArrayAdapter (this, R.layout.list_view, teams));
ListVi... | [
"android",
"listview",
"listadapter",
"simpleadapter"
] | 1 | 1 | 1,786 | 2 | 0 | 2011-05-31T03:30:02.550000 | 2011-05-31T05:05:39.903000 |
6,182,737 | 6,182,748 | Can a .NET 3.5 application run on Windows XP Home? | I have built an application in.NET framework 3.5, in C#. I want to know whether it will run on a machine having Windows XP Home Basic Service pack 3. Thank You, Bibhu | It's hard to say about your specific application (as it may have specific OS requirements depending on how you made it), but for.NET 3.5 applications in general, yes, they will run just fine. Compatibility Matrix: http://msdn.microsoft.com/en-us/library/8z6watww(v=VS.100).aspx | Can a .NET 3.5 application run on Windows XP Home? I have built an application in.NET framework 3.5, in C#. I want to know whether it will run on a machine having Windows XP Home Basic Service pack 3. Thank You, Bibhu | TITLE:
Can a .NET 3.5 application run on Windows XP Home?
QUESTION:
I have built an application in.NET framework 3.5, in C#. I want to know whether it will run on a machine having Windows XP Home Basic Service pack 3. Thank You, Bibhu
ANSWER:
It's hard to say about your specific application (as it may have specific O... | [
"c#",
".net"
] | 1 | 2 | 999 | 4 | 0 | 2011-05-31T03:31:37.713000 | 2011-05-31T03:33:20.903000 |
6,182,739 | 6,182,777 | How do I write a COM object from scratch | In Visual Studio, how do I write a COM object from scratch? There does not seem to be a new project option for a com object. | You have to go to Other Languages -> Visual C++ -> ATL Project to write a COM object. | How do I write a COM object from scratch In Visual Studio, how do I write a COM object from scratch? There does not seem to be a new project option for a com object. | TITLE:
How do I write a COM object from scratch
QUESTION:
In Visual Studio, how do I write a COM object from scratch? There does not seem to be a new project option for a com object.
ANSWER:
You have to go to Other Languages -> Visual C++ -> ATL Project to write a COM object. | [
"visual-studio-2010",
"com"
] | 0 | 1 | 970 | 2 | 0 | 2011-05-31T03:31:41.333000 | 2011-05-31T03:38:34.823000 |
6,182,740 | 6,182,788 | call jquery function within "a" tag "onclick" | here is my code: Read More Read More Read More my script: $('.basic').click(function(id){ $.ajax({ url: 'display_pro.php?id='+$('.basic').attr('href'), success: function(data) {alert(data);} }); }); when i click all links it's always get the 'P001'. what is the problem? Thanks for your help. | $('.basic').click(function(e) { var link = this; // <-- best practice $.ajax({ url: 'display_pro.php?id=' + link.href, // use link here... success: function(data) {alert(data);} }); return false; // <-- needed, prevents page from jumping into another page.. }); | call jquery function within "a" tag "onclick" here is my code: Read More Read More Read More my script: $('.basic').click(function(id){ $.ajax({ url: 'display_pro.php?id='+$('.basic').attr('href'), success: function(data) {alert(data);} }); }); when i click all links it's always get the 'P001'. what is the problem? Tha... | TITLE:
call jquery function within "a" tag "onclick"
QUESTION:
here is my code: Read More Read More Read More my script: $('.basic').click(function(id){ $.ajax({ url: 'display_pro.php?id='+$('.basic').attr('href'), success: function(data) {alert(data);} }); }); when i click all links it's always get the 'P001'. what i... | [
"jquery"
] | 2 | 6 | 6,111 | 4 | 0 | 2011-05-31T03:31:58.960000 | 2011-05-31T03:41:33.070000 |
6,182,750 | 6,182,795 | How does a three tiered system work in Java? | How does a three tiered system work in Java? Can someone explain this to me with some simple examples? | Here's the basic idea, which can actually be derived more or less from first principles, ie, Parnas's rule that modules should conceal one secret: the "front end" tier holds the secrets of making a visible presentation the "middle tier" holds the secrets of managing the behavior of the system the "back end" holds the s... | How does a three tiered system work in Java? How does a three tiered system work in Java? Can someone explain this to me with some simple examples? | TITLE:
How does a three tiered system work in Java?
QUESTION:
How does a three tiered system work in Java? Can someone explain this to me with some simple examples?
ANSWER:
Here's the basic idea, which can actually be derived more or less from first principles, ie, Parnas's rule that modules should conceal one secret... | [
"java",
"applet",
"system"
] | 2 | 11 | 3,006 | 3 | 0 | 2011-05-31T03:33:27.680000 | 2011-05-31T03:43:02.230000 |
6,182,762 | 6,182,784 | SQL: Order by both a column and rand()? | My table has many row that have a same column. I'll call the column "likes". If I use "order by likes", then the rows with the same "likes" will be ordered by the time they were added to the database. I want all rows with the same "likes" to be sorted randomly. I tried "ORDER BY likes, rand()", but everything is being ... | I suggest you check again. Adding the clause order by something, rand() to one of my queries acts exactly as you would expect, with the only randomising happening within a something group. Just be aware that using rand() in an order by clause will not scale very well as your table gets bigger. | SQL: Order by both a column and rand()? My table has many row that have a same column. I'll call the column "likes". If I use "order by likes", then the rows with the same "likes" will be ordered by the time they were added to the database. I want all rows with the same "likes" to be sorted randomly. I tried "ORDER BY ... | TITLE:
SQL: Order by both a column and rand()?
QUESTION:
My table has many row that have a same column. I'll call the column "likes". If I use "order by likes", then the rows with the same "likes" will be ordered by the time they were added to the database. I want all rows with the same "likes" to be sorted randomly. ... | [
"mysql",
"sql",
"sql-order-by"
] | 2 | 5 | 1,589 | 3 | 0 | 2011-05-31T03:35:45.293000 | 2011-05-31T03:40:41.853000 |
6,182,771 | 6,182,793 | How to Properly Handle Exceptions in a JSP/Servlet App? | How do you properly handle errors encountered in a servlet? Right now, the app that I inherited (uses only plain JSP/Servlet) has a superclass called Controller which extends HttpServlet and which all other servlets extend from. In that Controller class is a try and catch block like the following: try { // execute doPo... | The standard thing to do is have your Servlet's doXxx() method (eg. doGet(), doPost(), etc.) throw a ServletException and allow the container to catch and handle it. You can specify a custom error page to be shown in WEB-INF/web.xml using the tag: 500 /error.jsp If you end up catching an Exception you can't elegantly h... | How to Properly Handle Exceptions in a JSP/Servlet App? How do you properly handle errors encountered in a servlet? Right now, the app that I inherited (uses only plain JSP/Servlet) has a superclass called Controller which extends HttpServlet and which all other servlets extend from. In that Controller class is a try a... | TITLE:
How to Properly Handle Exceptions in a JSP/Servlet App?
QUESTION:
How do you properly handle errors encountered in a servlet? Right now, the app that I inherited (uses only plain JSP/Servlet) has a superclass called Controller which extends HttpServlet and which all other servlets extend from. In that Controlle... | [
"java",
"jsp",
"servlets"
] | 13 | 18 | 35,677 | 4 | 0 | 2011-05-31T03:37:40.160000 | 2011-05-31T03:42:54.827000 |
6,182,772 | 6,182,800 | NSMutableArray insertObject atIndex issues | There are lots of examples on this site about adding to NSMutableArray and I have looked at many but I still don't either understand (highly possible) or am missing something fundamental. I am trying to add to an NSMutableArray via a for loop. I want to keep track of button x,y coordinate position using the button tag ... | I think your problem is that you are creating the NSNumbers with the method numberWithInteger, when an NSUInteger is actually an unsigned long. So try xNumber = [NSNumber numberWithUnsignedLong:[self xpos]]; | NSMutableArray insertObject atIndex issues There are lots of examples on this site about adding to NSMutableArray and I have looked at many but I still don't either understand (highly possible) or am missing something fundamental. I am trying to add to an NSMutableArray via a for loop. I want to keep track of button x,... | TITLE:
NSMutableArray insertObject atIndex issues
QUESTION:
There are lots of examples on this site about adding to NSMutableArray and I have looked at many but I still don't either understand (highly possible) or am missing something fundamental. I am trying to add to an NSMutableArray via a for loop. I want to keep ... | [
"objective-c",
"ios4",
"nsmutablearray"
] | 0 | 0 | 960 | 2 | 0 | 2011-05-31T03:37:54.843000 | 2011-05-31T03:43:30.670000 |
6,182,780 | 6,183,493 | iOS: Retaining a shared instance | I am using a shared instance of a singleton class in a function, do I need to do a retain on the object? A few examples I have seen do this: AVAudioSession *session = [[ AVAudioSession sharedInstance] retain]; while a few simply do: AVAudioSession *session = [ AVAudioSession sharedInstance];. I am sure there is a rule ... | You're right, there are rules that tell you what to do. They're the same rules you use everywhere else in Cocoa Touch. Clients of a singleton shouldn't care that the object they're using is a singleton, and they definitely shouldn't rely on the singleton's single-ness to avoid the usual memory management conventions. Y... | iOS: Retaining a shared instance I am using a shared instance of a singleton class in a function, do I need to do a retain on the object? A few examples I have seen do this: AVAudioSession *session = [[ AVAudioSession sharedInstance] retain]; while a few simply do: AVAudioSession *session = [ AVAudioSession sharedInsta... | TITLE:
iOS: Retaining a shared instance
QUESTION:
I am using a shared instance of a singleton class in a function, do I need to do a retain on the object? A few examples I have seen do this: AVAudioSession *session = [[ AVAudioSession sharedInstance] retain]; while a few simply do: AVAudioSession *session = [ AVAudioS... | [
"objective-c",
"ios",
"retain"
] | 4 | 5 | 1,366 | 3 | 0 | 2011-05-31T03:38:58.507000 | 2011-05-31T05:49:35.957000 |
6,182,781 | 6,182,852 | has_many to has_many ...do I have to add_index both ways? | I am pretty new to Rails. I am wondering if I need to add_index to both migrations? I am trying to define users and events. Each user can have many events and each event can have many users. so i would do something like this right: class User < ActiveRecord::Base attr_accessor:password attr_accessible:name,:email,:pass... | Even without 'indexes' your code will work, But as a best practice its good to use 'indexes' which will make your queries faster check here http://rails-bestpractices.com/posts/21-always-add-db-index HTH sameera | has_many to has_many ...do I have to add_index both ways? I am pretty new to Rails. I am wondering if I need to add_index to both migrations? I am trying to define users and events. Each user can have many events and each event can have many users. so i would do something like this right: class User < ActiveRecord::Bas... | TITLE:
has_many to has_many ...do I have to add_index both ways?
QUESTION:
I am pretty new to Rails. I am wondering if I need to add_index to both migrations? I am trying to define users and events. Each user can have many events and each event can have many users. so i would do something like this right: class User <... | [
"ruby-on-rails"
] | 3 | 4 | 810 | 2 | 0 | 2011-05-31T03:39:09.957000 | 2011-05-31T03:54:00.473000 |
6,182,783 | 6,182,825 | How to call a method? | I have a method find_all_media in model abc.rb. Model xyz and abc has relationship, abc:has_many xyzs and xyz:belongs_to abc
# abc.rb
method is in abc model def self.find_all_media(media_name)
if self.media_name == self.xyz.media_name return media_name end end
### view file <% @abc.xyzs.each do |xyz| %> <%=h xyz.me... | Seems like your def self.find_all_media(media_name)
if self.media_name == self.xyz.media_name return media_name end end Method is a class method (self). So, you are trying to access you class method from your class instance @abc You have two options 1 - Make the method an instance method (by removing the 'self') 2 - C... | How to call a method? I have a method find_all_media in model abc.rb. Model xyz and abc has relationship, abc:has_many xyzs and xyz:belongs_to abc
# abc.rb
method is in abc model def self.find_all_media(media_name)
if self.media_name == self.xyz.media_name return media_name end end
### view file <% @abc.xyzs.each d... | TITLE:
How to call a method?
QUESTION:
I have a method find_all_media in model abc.rb. Model xyz and abc has relationship, abc:has_many xyzs and xyz:belongs_to abc
# abc.rb
method is in abc model def self.find_all_media(media_name)
if self.media_name == self.xyz.media_name return media_name end end
### view file <... | [
"ruby-on-rails"
] | 0 | 1 | 106 | 2 | 0 | 2011-05-31T03:40:06.823000 | 2011-05-31T03:49:41.347000 |
6,182,786 | 6,183,024 | XML to SOAP transformation | I am new to XML, XSLT and SOAP and I would like to know whether it's possible to transform this XML file Database name Description Document number Belong To into this SOAP request Database name imProfileDescription Description imProfileCustom3 Belong To imProfileCustom4 APP, 20 imProfileDocNum Document number imSearchD... | So, or your question is really simple, or I'm missing something obvious...Are you searching for something like this? imProfileDescription imProfileCustom3 imProfileCustom4 APP, 20 imProfileDocNum imSearchDocumentsOnly Profile imProfileDocNum imProfileDescription imProfileVersion imProfileCustom16 imProfileCustom3 imPro... | XML to SOAP transformation I am new to XML, XSLT and SOAP and I would like to know whether it's possible to transform this XML file Database name Description Document number Belong To into this SOAP request Database name imProfileDescription Description imProfileCustom3 Belong To imProfileCustom4 APP, 20 imProfileDocNu... | TITLE:
XML to SOAP transformation
QUESTION:
I am new to XML, XSLT and SOAP and I would like to know whether it's possible to transform this XML file Database name Description Document number Belong To into this SOAP request Database name imProfileDescription Description imProfileCustom3 Belong To imProfileCustom4 APP,... | [
"xml",
"xslt",
"soap"
] | 0 | 2 | 12,257 | 1 | 0 | 2011-05-31T03:40:44.700000 | 2011-05-31T04:29:16.057000 |
6,182,798 | 6,183,577 | Help needed on web spider | I am writing a very basic web spider in java.I am facing one problem, that content loaded for same url is different than that in browser.For example try below URL. http://www.google.co.in/search?sourceid=chrome&ie=UTF-8&q=web+spider#sclient=psy&hl=en&source=hp&q=web+spider&aq=f&aqi=&aql=&oq=web+spider&pbx=1&fp=d8e8e41d... | try htmlunit it can emulate browser behaviour and handle javascript | Help needed on web spider I am writing a very basic web spider in java.I am facing one problem, that content loaded for same url is different than that in browser.For example try below URL. http://www.google.co.in/search?sourceid=chrome&ie=UTF-8&q=web+spider#sclient=psy&hl=en&source=hp&q=web+spider&aq=f&aqi=&aql=&oq=we... | TITLE:
Help needed on web spider
QUESTION:
I am writing a very basic web spider in java.I am facing one problem, that content loaded for same url is different than that in browser.For example try below URL. http://www.google.co.in/search?sourceid=chrome&ie=UTF-8&q=web+spider#sclient=psy&hl=en&source=hp&q=web+spider&aq... | [
"java",
"html",
"browser",
"web-scraping"
] | 3 | 1 | 339 | 1 | 0 | 2011-05-31T03:43:17.847000 | 2011-05-31T06:02:16.390000 |
6,182,801 | 6,235,139 | How do I get the command-line arguments of a Windows service? | I'm looking for a way to figure out the command-line arguments of any Windows service. For a non-service process, the command-line arguments can be found in the Windows Task Manager, or programmatically by using WMI as shown in this post. Unfortunately, these two solutions don't work for a Windows service that is start... | There are two types of arguments for services: Arguments that were passed on the process start command line. You can get to those easily using Process Explorer, etc. Arguments that were passed to the ServiceMain function. This is the WIndows API that a service is supposed to implement. The.NET equivalent is ServiceBase... | How do I get the command-line arguments of a Windows service? I'm looking for a way to figure out the command-line arguments of any Windows service. For a non-service process, the command-line arguments can be found in the Windows Task Manager, or programmatically by using WMI as shown in this post. Unfortunately, thes... | TITLE:
How do I get the command-line arguments of a Windows service?
QUESTION:
I'm looking for a way to figure out the command-line arguments of any Windows service. For a non-service process, the command-line arguments can be found in the Windows Task Manager, or programmatically by using WMI as shown in this post. U... | [
"c#",
".net",
"windows",
"service"
] | 8 | 9 | 17,841 | 5 | 0 | 2011-05-31T03:44:00.367000 | 2011-06-04T06:22:40.707000 |
6,182,804 | 6,182,902 | Mathematica: Help me understand Mathematica 3D coordinates system | I gave up trying to understand Mathematica 3D axes configuration. When I make 3D plot, and label the 3 axes to identify which axes is which, and then make points on these axes, the points appear on different axes than what I expect them to show at using the Point command, which takes {x,y,z} coordinates. Here is an exa... | I believe the labels are being placed in unintuitive spots. Replacing your dots with colored lines of different length is clearer to me. I've also removed the explicit plot range which helps Mathematica put the labels in much clearer places. g=Graphics3D[ { {Red,Thick, Line[{{0, 0, 0}, {1, 0, 0}}]}, {Black,Thick, Line[... | Mathematica: Help me understand Mathematica 3D coordinates system I gave up trying to understand Mathematica 3D axes configuration. When I make 3D plot, and label the 3 axes to identify which axes is which, and then make points on these axes, the points appear on different axes than what I expect them to show at using ... | TITLE:
Mathematica: Help me understand Mathematica 3D coordinates system
QUESTION:
I gave up trying to understand Mathematica 3D axes configuration. When I make 3D plot, and label the 3 axes to identify which axes is which, and then make points on these axes, the points appear on different axes than what I expect them... | [
"wolfram-mathematica"
] | 5 | 3 | 2,316 | 2 | 0 | 2011-05-31T03:44:27.240000 | 2011-05-31T04:05:16.670000 |
6,182,806 | 6,185,078 | jQuery KeyUp causes page to refresh | So working with an area with enter should add a result, it works but it also refreshes the page afterwards. var targetX, targetY; var tagCount = 0; $(function(){ $('#tag').live('click', function(){ var iid = $(this).attr('p'); var img = $('#img-'+iid); $(img).wrap(' '); $('#tag-wrapper').css({width: $(img).outerWidth()... | As we don't see your HTML markup, I can only guess, but most probably you've got your element wrapped in a. Even if you don't specify any attributes on it, it defaults to a GET request to the current URL, and it WILL submit as soon as you press the Enter key. The solution would be to bind a handler to the form's submit... | jQuery KeyUp causes page to refresh So working with an area with enter should add a result, it works but it also refreshes the page afterwards. var targetX, targetY; var tagCount = 0; $(function(){ $('#tag').live('click', function(){ var iid = $(this).attr('p'); var img = $('#img-'+iid); $(img).wrap(' '); $('#tag-wrapp... | TITLE:
jQuery KeyUp causes page to refresh
QUESTION:
So working with an area with enter should add a result, it works but it also refreshes the page afterwards. var targetX, targetY; var tagCount = 0; $(function(){ $('#tag').live('click', function(){ var iid = $(this).attr('p'); var img = $('#img-'+iid); $(img).wrap('... | [
"jquery",
"keyboard-events",
"page-refresh"
] | 4 | 9 | 4,262 | 1 | 0 | 2011-05-31T03:45:30.437000 | 2011-05-31T08:49:44.357000 |
6,182,816 | 6,185,011 | Hooking into the change() event on jQuery .toChecklist | I'm experiencing a problem when I attempt to use the.change() event on select lists, using the jQuery.toChecklist plugin. My page contains a number of select lists, which are changed to CheckLists, using jQuery. Consider the following Javascript snippet: for (var i=0;i<5;i++) { var selectListId = 'selectList' + i;
// ... | Try pulling the change function out of the loop. I also added a line that adds a class to each list. The new change function references the lists by the class and will know which is actively being changed via this. for (var i = 0; i < 5; i++) {
var selectListId = 'selectList' + i;
$("#" + selectListId).toChecklist();... | Hooking into the change() event on jQuery .toChecklist I'm experiencing a problem when I attempt to use the.change() event on select lists, using the jQuery.toChecklist plugin. My page contains a number of select lists, which are changed to CheckLists, using jQuery. Consider the following Javascript snippet: for (var i... | TITLE:
Hooking into the change() event on jQuery .toChecklist
QUESTION:
I'm experiencing a problem when I attempt to use the.change() event on select lists, using the jQuery.toChecklist plugin. My page contains a number of select lists, which are changed to CheckLists, using jQuery. Consider the following Javascript s... | [
"javascript",
"jquery"
] | 2 | 1 | 378 | 2 | 0 | 2011-05-31T03:47:47.883000 | 2011-05-31T08:42:52.050000 |
6,182,818 | 6,182,845 | JSON.parse Issues | so, I am working on a website for a client, a friend of mine. He sells geckos, and he has made a website for himself, and his sales partner, and I am doing a lot of javascript work for him, IE AJAX, etc... Well, I got to the available lizard page for him, and I am making a sort of dynamic gecko selection system. The wa... | I don't think its valid, there's a bunch of missing commas part way down the file, screenshot attached as no line numbering. | JSON.parse Issues so, I am working on a website for a client, a friend of mine. He sells geckos, and he has made a website for himself, and his sales partner, and I am doing a lot of javascript work for him, IE AJAX, etc... Well, I got to the available lizard page for him, and I am making a sort of dynamic gecko select... | TITLE:
JSON.parse Issues
QUESTION:
so, I am working on a website for a client, a friend of mine. He sells geckos, and he has made a website for himself, and his sales partner, and I am doing a lot of javascript work for him, IE AJAX, etc... Well, I got to the available lizard page for him, and I am making a sort of dy... | [
"javascript",
"jquery",
"json",
"parsing",
"firefox"
] | 1 | 1 | 4,592 | 2 | 0 | 2011-05-31T03:47:59 | 2011-05-31T03:53:00.270000 |
6,182,832 | 6,182,910 | How do I access an object created in one event in another event? | I created an object in on event, now I want another event to access it. How do I do this? I'm doing this in Visual Studio 2010. I have a form that has three button events. The first button creates an object. I want the second button to use the object. How do I do this? public void buttonCreate_Click(object sender, Even... | If I parse your question correctly, you want to use the one variable created in buttonCreate_Click in buttonAddValue_Click. To accomplish this you need to make one a class variable, as in: class MyForm: Form { Histogram one;
public void buttonCreate_Click(object sender, EventArgs e) { int size; int sizeI; string inVal... | How do I access an object created in one event in another event? I created an object in on event, now I want another event to access it. How do I do this? I'm doing this in Visual Studio 2010. I have a form that has three button events. The first button creates an object. I want the second button to use the object. How... | TITLE:
How do I access an object created in one event in another event?
QUESTION:
I created an object in on event, now I want another event to access it. How do I do this? I'm doing this in Visual Studio 2010. I have a form that has three button events. The first button creates an object. I want the second button to u... | [
"c#"
] | 3 | 4 | 403 | 2 | 0 | 2011-05-31T03:50:59.263000 | 2011-05-31T04:06:46.497000 |
6,182,853 | 6,185,122 | OS X - drag file onto executable to launch with file as first argument? | I have Mono application which takes a file as the only argument. For example if I invoked the application with a file named "MyFile.txt" it would be done like so: Mono app.exe MyFile.txt In Windows I can simply drag a file onto an executable to run it with that file as an argument. Can I do the same thing in OS X? You ... | One approach would be to use Automator to make an application, which will treat any files dropped on it as an input. A "Run Shell Script" action will let you run the mono app.exe on the files. | OS X - drag file onto executable to launch with file as first argument? I have Mono application which takes a file as the only argument. For example if I invoked the application with a file named "MyFile.txt" it would be done like so: Mono app.exe MyFile.txt In Windows I can simply drag a file onto an executable to run... | TITLE:
OS X - drag file onto executable to launch with file as first argument?
QUESTION:
I have Mono application which takes a file as the only argument. For example if I invoked the application with a file named "MyFile.txt" it would be done like so: Mono app.exe MyFile.txt In Windows I can simply drag a file onto an... | [
"macos",
"executable"
] | 2 | 1 | 1,223 | 2 | 0 | 2011-05-31T03:54:01.197000 | 2011-05-31T08:53:57.653000 |
6,182,856 | 6,183,039 | jQuery animate won't slide width, but will toggle | I am trying to get jQuery to animate with slide rather than toggle. I have these files included in my HTML: jQuery: // $item is a list gathered as $('#gallery ul li') and all output to console as should // $prev will be used to get current li width, but not to worry about for now. $.fn.slider = function($item,$prev){ $... | From http://api.jquery.com/animate/ In addition to numeric values, each property can take the strings 'show', 'hide', and 'toggle'. These shortcuts allow for custom hiding and showing animations that take into account the display type of the element. Note that 'slide' isn't mentioned, therefore it's ignored. | jQuery animate won't slide width, but will toggle I am trying to get jQuery to animate with slide rather than toggle. I have these files included in my HTML: jQuery: // $item is a list gathered as $('#gallery ul li') and all output to console as should // $prev will be used to get current li width, but not to worry abo... | TITLE:
jQuery animate won't slide width, but will toggle
QUESTION:
I am trying to get jQuery to animate with slide rather than toggle. I have these files included in my HTML: jQuery: // $item is a list gathered as $('#gallery ul li') and all output to console as should // $prev will be used to get current li width, bu... | [
"javascript",
"jquery",
"jquery-animate"
] | 2 | 2 | 733 | 1 | 0 | 2011-05-31T03:54:18.727000 | 2011-05-31T04:33:07.023000 |
6,182,865 | 6,182,892 | Download URL content with timeout | I want to download the URL content in java with a specified download time. For ex: i want to have a maximum download timeout of 10 seconds for www.yahoo.com. If download takes more than 10s, then an error should be thrown. I have written the code for opening a connection and downloading the entire contents. But how do ... | You can set it by URLConnection#setReadTimeout(). urlconn.setReadTimeout(10000); // 10 sec //... | Download URL content with timeout I want to download the URL content in java with a specified download time. For ex: i want to have a maximum download timeout of 10 seconds for www.yahoo.com. If download takes more than 10s, then an error should be thrown. I have written the code for opening a connection and downloadin... | TITLE:
Download URL content with timeout
QUESTION:
I want to download the URL content in java with a specified download time. For ex: i want to have a maximum download timeout of 10 seconds for www.yahoo.com. If download takes more than 10s, then an error should be thrown. I have written the code for opening a connect... | [
"java",
"urlconnection"
] | 3 | 4 | 6,512 | 2 | 0 | 2011-05-31T03:56:12.007000 | 2011-05-31T04:02:53.817000 |
6,182,877 | 6,182,893 | File locks for linux | I tried using temp files: char *temp = tempnam(NULL, "myapp_"); printf("Tempname: %s", temp) // Prints /tmp/myapp_random while (1) { } But when I check /tmp (while the app is still running), the myapp_random is not there! As for using File Locks, I can't get a good grasp on it, I tried looking at but it seems to focus ... | tempnam doesn't create the file, it just gives you a filename that didn't exist at the time you called it. You still have to create the file yourself and therefore still have the race condition that another process may sneak in and create it before you. You don't actually want to use tempnam since that will give each p... | File locks for linux I tried using temp files: char *temp = tempnam(NULL, "myapp_"); printf("Tempname: %s", temp) // Prints /tmp/myapp_random while (1) { } But when I check /tmp (while the app is still running), the myapp_random is not there! As for using File Locks, I can't get a good grasp on it, I tried looking at b... | TITLE:
File locks for linux
QUESTION:
I tried using temp files: char *temp = tempnam(NULL, "myapp_"); printf("Tempname: %s", temp) // Prints /tmp/myapp_random while (1) { } But when I check /tmp (while the app is still running), the myapp_random is not there! As for using File Locks, I can't get a good grasp on it, I ... | [
"c",
"linux",
"file",
"locking"
] | 9 | 12 | 8,883 | 1 | 0 | 2011-05-31T03:59:09.867000 | 2011-05-31T04:03:11.493000 |
6,182,880 | 6,183,969 | Checking out a repository I created on a server using SVN | This is my first time creating a SVN repository. I am running into problems on the client machine when I try to check out my repo files. I have no issues when I try to check things out on the machine where I created the repos; i.e. when I do: svn co file:///repo_path/project_name/trunk But, when I try to access the sam... | My configuration consists of three files (located in the conf folder): authz passwd svnserve.conf They serve the following purpose: svnserve.conf: configures the overall access to the repo and provides the following content: [general] anon-access = none password-db = passwd # password database authz-db = authz # author... | Checking out a repository I created on a server using SVN This is my first time creating a SVN repository. I am running into problems on the client machine when I try to check out my repo files. I have no issues when I try to check things out on the machine where I created the repos; i.e. when I do: svn co file:///repo... | TITLE:
Checking out a repository I created on a server using SVN
QUESTION:
This is my first time creating a SVN repository. I am running into problems on the client machine when I try to check out my repo files. I have no issues when I try to check things out on the machine where I created the repos; i.e. when I do: s... | [
"svn",
"tortoisesvn"
] | 0 | 0 | 219 | 1 | 0 | 2011-05-31T03:59:19.293000 | 2011-05-31T06:53:00.847000 |
6,182,883 | 6,184,130 | Update: RewriteRule on virtual subdomain | here i am again:( got big problem hiks... need HELP!!! i have URL like http://www.foo.com/user/index.php? uid=me&page=about and i want to change into like this http://me.foo.com/about i already success to make virtual subdomain + wildcard + using this htaccess RewriteBase / RewriteCond %{HTTP_HOST}!www.foo.com$ [NC] Re... | See it this helps: RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:www\.)?([a-z0-9-]+)(? I'll be happy to explain what the above rules do if necessary. | Update: RewriteRule on virtual subdomain here i am again:( got big problem hiks... need HELP!!! i have URL like http://www.foo.com/user/index.php? uid=me&page=about and i want to change into like this http://me.foo.com/about i already success to make virtual subdomain + wildcard + using this htaccess RewriteBase / Rewr... | TITLE:
Update: RewriteRule on virtual subdomain
QUESTION:
here i am again:( got big problem hiks... need HELP!!! i have URL like http://www.foo.com/user/index.php? uid=me&page=about and i want to change into like this http://me.foo.com/about i already success to make virtual subdomain + wildcard + using this htaccess ... | [
"php",
".htaccess",
"mod-rewrite"
] | 1 | 0 | 561 | 2 | 0 | 2011-05-31T04:00:03.440000 | 2011-05-31T07:11:27.773000 |
6,182,885 | 6,182,903 | Function overloading and function pointers | The name of a function is a pointer to the function... But in case of function overloading the names of two functions are the same... So which function does the name point to? | It depends on the context; otherwise it's ambiguous. See this example (modified except below): void foo(int a) { } void foo(int a, char b) { }
int main() { void (*functionPointer1)(int); void (*functionPointer2)(int, char); functionPointer1 = foo; // gets address of foo(int) functionPointer2 = foo; // gets address of ... | Function overloading and function pointers The name of a function is a pointer to the function... But in case of function overloading the names of two functions are the same... So which function does the name point to? | TITLE:
Function overloading and function pointers
QUESTION:
The name of a function is a pointer to the function... But in case of function overloading the names of two functions are the same... So which function does the name point to?
ANSWER:
It depends on the context; otherwise it's ambiguous. See this example (mod... | [
"c++"
] | 17 | 21 | 5,366 | 1 | 0 | 2011-05-31T04:01:29.113000 | 2011-05-31T04:05:20.680000 |
6,182,894 | 6,191,593 | R's approxfun in Matlab | What is the equivalent for R's approxfun in Matlab? I used interp3() to calculate the interpolation points, now I need to create an inverse function to perform this interpolation. Any ideas? | When you need the inverse of a function you should simply reverse the order of the x and y values. So if interp3( x, y) gets you a satisfactory function, then interp3( y, x) should produce the inverse, subject of course to the possibility you may need to do it piecewise if it is not monotonic. | R's approxfun in Matlab What is the equivalent for R's approxfun in Matlab? I used interp3() to calculate the interpolation points, now I need to create an inverse function to perform this interpolation. Any ideas? | TITLE:
R's approxfun in Matlab
QUESTION:
What is the equivalent for R's approxfun in Matlab? I used interp3() to calculate the interpolation points, now I need to create an inverse function to perform this interpolation. Any ideas?
ANSWER:
When you need the inverse of a function you should simply reverse the order of... | [
"r",
"matlab"
] | 2 | 0 | 558 | 1 | 0 | 2011-05-31T04:03:18.513000 | 2011-05-31T18:03:30.427000 |
6,182,897 | 6,182,917 | Replacing a DLL while AppDomain is already loaded in ASP.NET | What happens if a dll is already loaded by w3wp.exe and we replace it? Of course we can replace a dll since asp.net uses a cached version of Bin folder DLLs, but I want to know if upon replacing a dll it will load the new one or it wait until next recycling or when there's no new request. EDIT: DLL contains a singleton... | From MSDN: If you change the.dll and write a new version of it to the Bin folder, ASP.NET detects the update and uses the new version of the.dll for new page requests from then on. | Replacing a DLL while AppDomain is already loaded in ASP.NET What happens if a dll is already loaded by w3wp.exe and we replace it? Of course we can replace a dll since asp.net uses a cached version of Bin folder DLLs, but I want to know if upon replacing a dll it will load the new one or it wait until next recycling o... | TITLE:
Replacing a DLL while AppDomain is already loaded in ASP.NET
QUESTION:
What happens if a dll is already loaded by w3wp.exe and we replace it? Of course we can replace a dll since asp.net uses a cached version of Bin folder DLLs, but I want to know if upon replacing a dll it will load the new one or it wait unti... | [
"c#",
".net",
"asp.net",
"iis",
"application-pool"
] | 5 | 3 | 1,658 | 2 | 0 | 2011-05-31T04:04:29.063000 | 2011-05-31T04:08:28.803000 |
6,182,906 | 6,182,948 | How to pass edit text data in form of string to next activity? | I am developing an android application in which i have taken two buttons and one edit text box. i want to pass the data of edit text box in from of string to the next activity on click of one of the buttons, how can i pass the text to the next activity and receive that text in the new launched activity so could use the... | After you have used setContentView(...) you need to reference your EditText and get the text such as... EditText et = (EditText) findViewById(R.id.my_edit_text); String theText = et.getText().toString(); To pass it to another Activity you use an Intent. Example... Intent i = new Intent(this, MyNewActivity.class); i.put... | How to pass edit text data in form of string to next activity? I am developing an android application in which i have taken two buttons and one edit text box. i want to pass the data of edit text box in from of string to the next activity on click of one of the buttons, how can i pass the text to the next activity and... | TITLE:
How to pass edit text data in form of string to next activity?
QUESTION:
I am developing an android application in which i have taken two buttons and one edit text box. i want to pass the data of edit text box in from of string to the next activity on click of one of the buttons, how can i pass the text to the... | [
"android",
"string",
"button",
"android-activity"
] | 12 | 16 | 36,246 | 4 | 0 | 2011-05-31T04:06:12.143000 | 2011-05-31T04:15:37.967000 |
6,182,907 | 6,182,926 | How I can write in appSetting in web.config file using ASP.NET? | I can easily read my appSetting in web.config file and then fill all keys and values in asp.net form. but I need to have initial setup for my web application how I can write in appSetting? Is it the best way or not I have to store all of the keys in database which is better? and How I can implement this? I need to add ... | Manipulating values in the web.config file is not recommend, because once a user tries to modify a value, all User sessions will be terminated. An application domain will unload when any change occurs in the Machine.Config, Web.Config, or Global.asax. Read ASP.NET Case Study: Lost session variables and appdomain recycl... | How I can write in appSetting in web.config file using ASP.NET? I can easily read my appSetting in web.config file and then fill all keys and values in asp.net form. but I need to have initial setup for my web application how I can write in appSetting? Is it the best way or not I have to store all of the keys in databa... | TITLE:
How I can write in appSetting in web.config file using ASP.NET?
QUESTION:
I can easily read my appSetting in web.config file and then fill all keys and values in asp.net form. but I need to have initial setup for my web application how I can write in appSetting? Is it the best way or not I have to store all of ... | [
".net",
"asp.net",
"web-config",
"appsettings"
] | 3 | 1 | 2,025 | 3 | 0 | 2011-05-31T04:06:24.333000 | 2011-05-31T04:10:49.287000 |
6,182,913 | 6,182,955 | How come I have this simple error in Selenium? | I'm on AWS micro instance. There is no GUI. I SSH'ed into it. pip install selenium sudo apt-get install firefox Then, I do this in the python shell: >>> from selenium.webdriver.firefox.webdriver import WebDriver >>> driver = WebDriver() Error: cannot open display::0 How do I make this error go away? | Set up your SSH session to allow X11 forwarding, and run your client from an X windows session. On the server, the config /etc/ssh/sshd_config should have the line X11Forwarding yes. and your client side should have ForwardX11 yes. Then just to be sure invoke ssh with the -X option. The server side should have the prog... | How come I have this simple error in Selenium? I'm on AWS micro instance. There is no GUI. I SSH'ed into it. pip install selenium sudo apt-get install firefox Then, I do this in the python shell: >>> from selenium.webdriver.firefox.webdriver import WebDriver >>> driver = WebDriver() Error: cannot open display::0 How do... | TITLE:
How come I have this simple error in Selenium?
QUESTION:
I'm on AWS micro instance. There is no GUI. I SSH'ed into it. pip install selenium sudo apt-get install firefox Then, I do this in the python shell: >>> from selenium.webdriver.firefox.webdriver import WebDriver >>> driver = WebDriver() Error: cannot open... | [
"python",
"user-interface",
"firefox",
"selenium"
] | 1 | 3 | 389 | 2 | 0 | 2011-05-31T04:07:55.317000 | 2011-05-31T04:16:29.183000 |
6,182,914 | 6,210,475 | Weird Error message in Xcode | I have a program that I am trying to make, and so far things seem to be going well. I've been busy debugging a certain chunk of code, and it works fine in the debugger. The problem, however, is that the program still crashes. When I go through the debugger window, it looks like it's something outside of my own code. Th... | Nevermind, solved it. Turns out I wasn't releasing an NSArray right, so I just set it up as a property in the header file, and it works now. | Weird Error message in Xcode I have a program that I am trying to make, and so far things seem to be going well. I've been busy debugging a certain chunk of code, and it works fine in the debugger. The problem, however, is that the program still crashes. When I go through the debugger window, it looks like it's somethi... | TITLE:
Weird Error message in Xcode
QUESTION:
I have a program that I am trying to make, and so far things seem to be going well. I've been busy debugging a certain chunk of code, and it works fine in the debugger. The problem, however, is that the program still crashes. When I go through the debugger window, it looks... | [
"objective-c",
"xcode"
] | 0 | 0 | 71 | 1 | 0 | 2011-05-31T04:07:58.310000 | 2011-06-02T04:42:52.117000 |
6,182,915 | 6,182,929 | Searching for names in a MySQL database that probably has typos | I'm currently writing a script tasked with going through tens of thousands of rows of account information and cleaning mistyped addresses, as well as printing out reports on how the address was cleaned. Currently the biggest source of unclean addresses is mistyped street-names (it's amazing how many ways you can spell ... | One option might be to try to use SOUNDEX to get you close to what you want. SOUNDEX will make matches off of pronunciation so it might get you closer if people are mistyping based off of the phonetic spelling of a street name. You might also try the Levenshtein distance algorithm. This is probably more closely tied to... | Searching for names in a MySQL database that probably has typos I'm currently writing a script tasked with going through tens of thousands of rows of account information and cleaning mistyped addresses, as well as printing out reports on how the address was cleaned. Currently the biggest source of unclean addresses is ... | TITLE:
Searching for names in a MySQL database that probably has typos
QUESTION:
I'm currently writing a script tasked with going through tens of thousands of rows of account information and cleaning mistyped addresses, as well as printing out reports on how the address was cleaned. Currently the biggest source of unc... | [
"mysql",
"sql"
] | 4 | 2 | 1,714 | 3 | 0 | 2011-05-31T04:08:07.633000 | 2011-05-31T04:11:40.877000 |
6,182,919 | 6,182,984 | VBA text file parsing | I have to figure out a way to parse a text file in VBA this week and I was hoping I could get some guidance on how this would work. The fileformat is similar to the example below (2 lines per relevant entry with no delimiters). Individual records are determined by the positions on the line: 005839998000017868XC9089 002... | Most of your question is answered in this other question Read lines from a text file but skip the first two lines If you end up with a line in a string, you can use the mid() to break out individual fields and the left() function to tell you what kind of line you are on. | VBA text file parsing I have to figure out a way to parse a text file in VBA this week and I was hoping I could get some guidance on how this would work. The fileformat is similar to the example below (2 lines per relevant entry with no delimiters). Individual records are determined by the positions on the line: 005839... | TITLE:
VBA text file parsing
QUESTION:
I have to figure out a way to parse a text file in VBA this week and I was hoping I could get some guidance on how this would work. The fileformat is similar to the example below (2 lines per relevant entry with no delimiters). Individual records are determined by the positions o... | [
"parsing",
"vba",
"text"
] | 0 | 0 | 3,084 | 1 | 0 | 2011-05-31T04:08:39.880000 | 2011-05-31T04:22:09.117000 |
6,182,921 | 6,183,096 | UIImageView as background of UITextView | I have the following code: UIImageView *imgView = [[UIImageView alloc]initWithFrame: description.frame]; imgView.image = [UIImage imageNamed: @"textview.png"]; [description addSubview: imgView]; [description sendSubviewToBack: imgView]; [imgView release]; where description here is a UITextView. I have an image that I w... | UIImageView *imgView = [[UIImageView alloc]initWithFrame: CGRectMake(0,0,description.frame.size.width,description.frame.size.height)]; imgView.image = [UIImage imageNamed: @"textview.png"]; [description addSubview: imgView]; [description sendSubviewToBack: imgView]; [imgView release]; the image is not placed at right p... | UIImageView as background of UITextView I have the following code: UIImageView *imgView = [[UIImageView alloc]initWithFrame: description.frame]; imgView.image = [UIImage imageNamed: @"textview.png"]; [description addSubview: imgView]; [description sendSubviewToBack: imgView]; [imgView release]; where description here i... | TITLE:
UIImageView as background of UITextView
QUESTION:
I have the following code: UIImageView *imgView = [[UIImageView alloc]initWithFrame: description.frame]; imgView.image = [UIImage imageNamed: @"textview.png"]; [description addSubview: imgView]; [description sendSubviewToBack: imgView]; [imgView release]; where ... | [
"iphone",
"objective-c",
"ipad"
] | 2 | 3 | 2,141 | 4 | 0 | 2011-05-31T04:10:00.870000 | 2011-05-31T04:45:04.970000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.