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,233,379 | 6,236,764 | How to read the contents of a local image into a base64 string in MonoTouch | I am trying to read the contents of an image stored in the Documents folder for my application into a string, using base64 encoding. I have the image location as a url; so, for example, I could have the following url for the image: file://localhost/var/mobile/Applications/40A88352-7F78-4085-856B-9621541774ED/Documents/... | If you are getting VMDisconnectedException at startup, it probably means that the FinishedLaunching method does not return in time and iOS kills your app. If you need to load that file at startup, wrap your code in an async method or thread that will allow FinishedLaunching to return in time: byte[] imgData; string bas... | How to read the contents of a local image into a base64 string in MonoTouch I am trying to read the contents of an image stored in the Documents folder for my application into a string, using base64 encoding. I have the image location as a url; so, for example, I could have the following url for the image: file://local... | TITLE:
How to read the contents of a local image into a base64 string in MonoTouch
QUESTION:
I am trying to read the contents of an image stored in the Documents folder for my application into a string, using base64 encoding. I have the image location as a url; so, for example, I could have the following url for the i... | [
"xamarin.ios",
"monodevelop"
] | 1 | 2 | 1,363 | 1 | 0 | 2011-06-03T22:46:58.703000 | 2011-06-04T12:35:12.837000 |
6,233,392 | 6,233,959 | How do I convert/reshape a data frame in long format to a wide format without aggregating the records? | From this: > test <- data.frame(x = c("a","a","a"), y = c("b","b","c"), z = c(1,2,1)) > test x y z 1 a b 1 2 a b 2 3 a c 1 To this: x b c 1 a 1 NA 2 a 2 NA 3 a NA 1 | Since the x column in the test data-frame doesn't uniquely identify the rows, and yet you don't want to do any aggregation, you need to augment the data-frame with a unique id column, and then use dcast() from the reshape2 package: require(reshape2) test$id <- 1:nrow(test)
> dcast(test, id + x ~ y, value_var = 'z')[,-... | How do I convert/reshape a data frame in long format to a wide format without aggregating the records? From this: > test <- data.frame(x = c("a","a","a"), y = c("b","b","c"), z = c(1,2,1)) > test x y z 1 a b 1 2 a b 2 3 a c 1 To this: x b c 1 a 1 NA 2 a 2 NA 3 a NA 1 | TITLE:
How do I convert/reshape a data frame in long format to a wide format without aggregating the records?
QUESTION:
From this: > test <- data.frame(x = c("a","a","a"), y = c("b","b","c"), z = c(1,2,1)) > test x y z 1 a b 1 2 a b 2 3 a c 1 To this: x b c 1 a 1 NA 2 a 2 NA 3 a NA 1
ANSWER:
Since the x column in the... | [
"r",
"pivot",
"reshape"
] | 3 | 5 | 406 | 1 | 0 | 2011-06-03T22:49:09.203000 | 2011-06-04T00:53:54.653000 |
6,233,398 | 6,233,537 | Download and insert salt string inside wordpress wp-config.php with Bash | How can I insert the content of the variable $SALT in a specific point (line or string) of a file like wp-contet.php from wordpress using Bash script? SALT=$(curl -L https://api.wordpress.org/secret-key/1.1/salt/) | I'm not an expert at parsing text files in bash but you should delete the lines that define the things you're downloading from the wordpress salt and then insert the variable at the end... something like: #!/bin/sh
SALT=$(curl -L https://api.wordpress.org/secret-key/1.1/salt/) STRING='put your unique phrase here' prin... | Download and insert salt string inside wordpress wp-config.php with Bash How can I insert the content of the variable $SALT in a specific point (line or string) of a file like wp-contet.php from wordpress using Bash script? SALT=$(curl -L https://api.wordpress.org/secret-key/1.1/salt/) | TITLE:
Download and insert salt string inside wordpress wp-config.php with Bash
QUESTION:
How can I insert the content of the variable $SALT in a specific point (line or string) of a file like wp-contet.php from wordpress using Bash script? SALT=$(curl -L https://api.wordpress.org/secret-key/1.1/salt/)
ANSWER:
I'm no... | [
"wordpress",
"bash",
"sed"
] | 15 | 20 | 6,773 | 12 | 0 | 2011-06-03T22:50:56.970000 | 2011-06-03T23:16:33.610000 |
6,233,400 | 6,233,531 | How do you convert PDFs to PNGs with ghostscript? | I'm usually able to use ghostscript to convert PDFs to PNGs with the command: gs \ -q \ -dNOPAUSE \ -dBATCH \ -sDEVICE=pnggray \ -g2550x3300 \ -dPDFFitPage \ -sOutputFile=output.png \ input.pdf But this doesn't work for some PDF files. For example, the command above converts this PDF file to this PNG -- the original PD... | Just use ImageMagick's convert. convert foo.pdf foo.png You can have more precise control over the page number with format strings, e.g.: convert foo.pdf "foo-%03d.png" And of course there are the myriad other ImageMagick options, but the basic command above is all you need most of the time. Edit: about your "bad.pdf":... | How do you convert PDFs to PNGs with ghostscript? I'm usually able to use ghostscript to convert PDFs to PNGs with the command: gs \ -q \ -dNOPAUSE \ -dBATCH \ -sDEVICE=pnggray \ -g2550x3300 \ -dPDFFitPage \ -sOutputFile=output.png \ input.pdf But this doesn't work for some PDF files. For example, the command above con... | TITLE:
How do you convert PDFs to PNGs with ghostscript?
QUESTION:
I'm usually able to use ghostscript to convert PDFs to PNGs with the command: gs \ -q \ -dNOPAUSE \ -dBATCH \ -sDEVICE=pnggray \ -g2550x3300 \ -dPDFFitPage \ -sOutputFile=output.png \ input.pdf But this doesn't work for some PDF files. For example, the... | [
"pdf",
"ghostscript",
"postscript"
] | 8 | 8 | 12,093 | 1 | 0 | 2011-06-03T22:51:13.293000 | 2011-06-03T23:15:14.237000 |
6,233,401 | 6,233,436 | Custom logger in Rails 3? | I want to have a custom logger for my application, which of course logs to a different file, someone asked a question: Setting up the logger in rails 3 But I want to have a logger which I can call with my own class name like: StatusLogger.info "something happend!!!" How can I do this? | You could do that with this code logfile = File.open('/path/to/log.log', 'a') StatusLogger = Logger.new(logfile) StatusLogger.info 'Hello World!' And you would most likely configure this in an initializer file, or you could do it in an environment file if you wanted. | Custom logger in Rails 3? I want to have a custom logger for my application, which of course logs to a different file, someone asked a question: Setting up the logger in rails 3 But I want to have a logger which I can call with my own class name like: StatusLogger.info "something happend!!!" How can I do this? | TITLE:
Custom logger in Rails 3?
QUESTION:
I want to have a custom logger for my application, which of course logs to a different file, someone asked a question: Setting up the logger in rails 3 But I want to have a logger which I can call with my own class name like: StatusLogger.info "something happend!!!" How can I... | [
"ruby-on-rails"
] | 8 | 14 | 6,344 | 2 | 0 | 2011-06-03T22:51:36.747000 | 2011-06-03T22:58:12.667000 |
6,233,405 | 6,233,435 | need help troubleshooting a function that searches for specific url links in an array of text | hey guys Im building a script by which Im attempting to find specific links in twitter text results This script basically checks whether the text contains a url, then determines if that url is one of 6 specific urls, and if it matches outputs the original text into a new array Ive labeled as $imgtweets the problem howe... | basically you can replace all your code with something like $hosts = "lockerz|yfrog|twitpic|etc"; $regexp = "~http://($hosts)~";
$img_tweets = preg_grep($regexp, $all_tweets); | need help troubleshooting a function that searches for specific url links in an array of text hey guys Im building a script by which Im attempting to find specific links in twitter text results This script basically checks whether the text contains a url, then determines if that url is one of 6 specific urls, and if it... | TITLE:
need help troubleshooting a function that searches for specific url links in an array of text
QUESTION:
hey guys Im building a script by which Im attempting to find specific links in twitter text results This script basically checks whether the text contains a url, then determines if that url is one of 6 specif... | [
"php"
] | 1 | 1 | 77 | 2 | 0 | 2011-06-03T22:52:20.583000 | 2011-06-03T22:58:07.427000 |
6,233,407 | 6,247,919 | Dynamic controls in updatepanel not posting in Opera Mobile | I have a page to which I am adding a dynamic UpdatePanel with more dynamic controls in it's ContentTemplateContainer. ViewState is disabled on the ContentTemplateContainer because the entire state can be recreated on postbacks from a single ID in a HiddenField like so: if (request.HttpMethod == "POST") { string ctrlNam... | Since you haven't posted an example, I can only give you some general tips. My best guess is that the core version of Opera mobile may have a bug that's already fixed in Opera desktop/Mini. Make sure your markup inside the form is correct - if tags are in the wrong order somewhere, for example something like it can con... | Dynamic controls in updatepanel not posting in Opera Mobile I have a page to which I am adding a dynamic UpdatePanel with more dynamic controls in it's ContentTemplateContainer. ViewState is disabled on the ContentTemplateContainer because the entire state can be recreated on postbacks from a single ID in a HiddenField... | TITLE:
Dynamic controls in updatepanel not posting in Opera Mobile
QUESTION:
I have a page to which I am adding a dynamic UpdatePanel with more dynamic controls in it's ContentTemplateContainer. ViewState is disabled on the ContentTemplateContainer because the entire state can be recreated on postbacks from a single I... | [
"c#",
"asp.net",
"opera"
] | 0 | 0 | 305 | 1 | 0 | 2011-06-03T22:52:31.717000 | 2011-06-06T04:59:42.743000 |
6,233,409 | 6,233,446 | How to get access token for searching venues in foursquare | How can i get access token for searching venues in foursquare. From this gem, to fetch venues. venue = Foursquare::Venue.new(access_token) venue.search({:ll => "37.792694,-122.409325"}) and from foursquare API. https://developer.foursquare.com/docs/oauth.html Obtain an access token There are three general ways to use t... | I think you should take a look on foursquare Venues Project (beta) | How to get access token for searching venues in foursquare How can i get access token for searching venues in foursquare. From this gem, to fetch venues. venue = Foursquare::Venue.new(access_token) venue.search({:ll => "37.792694,-122.409325"}) and from foursquare API. https://developer.foursquare.com/docs/oauth.html O... | TITLE:
How to get access token for searching venues in foursquare
QUESTION:
How can i get access token for searching venues in foursquare. From this gem, to fetch venues. venue = Foursquare::Venue.new(access_token) venue.search({:ll => "37.792694,-122.409325"}) and from foursquare API. https://developer.foursquare.com... | [
"api",
"foursquare",
"access-token"
] | 0 | 1 | 3,394 | 1 | 0 | 2011-06-03T22:52:32.447000 | 2011-06-03T22:59:13.550000 |
6,233,415 | 6,233,609 | How to get params from android.intent.action.SEND | I have registered my activity in the manifest as android.intent.action.SEND. Now, after pressing SHARE on every app, my application pops - which is great, but I didn't understand how do I fetch the parameters the other app sent to me? Thanks | The parameters you want to extract are called extras. You can extract them this way: Bundle extras = this.getIntent().getExtras(); String[] recipients = (String[]) extras.get(EXTRA_EMAIL); There are several extras you can get from an ACTION_SEND intent (e.g. EXTRA_EMAIL, EXTRA_CC, EXTRA_BCC, EXTRA_SUBJECT). Take a look... | How to get params from android.intent.action.SEND I have registered my activity in the manifest as android.intent.action.SEND. Now, after pressing SHARE on every app, my application pops - which is great, but I didn't understand how do I fetch the parameters the other app sent to me? Thanks | TITLE:
How to get params from android.intent.action.SEND
QUESTION:
I have registered my activity in the manifest as android.intent.action.SEND. Now, after pressing SHARE on every app, my application pops - which is great, but I didn't understand how do I fetch the parameters the other app sent to me? Thanks
ANSWER:
T... | [
"android"
] | 1 | 3 | 2,152 | 3 | 0 | 2011-06-03T22:53:24.547000 | 2011-06-03T23:29:57.073000 |
6,233,416 | 6,233,459 | How do you use a T-SQL variable within an if OBJECT_ID to check if a table exists? | What I am trying to do with the following code is have it grab all the database names then loop through those databases check to see if the table tblAdminLogin exists and if it does update the password for username 'foo' I have been using a select statement instead of an update as of yet until it works properly. declar... | Dynamic SQL. Untested declare @SQL varchar(max) -- varchar(8000) if on SQL Server 2000 or earlier While @pk <= @maxPK Begin Select @name = name from @databases where PK=@pk if OBJECT_ID(''+@name+'.dbo.tblAdminLogin') IS NOT NULL Begin set @SQL = 'update ' + quotename(@name) + '.dbo.tblAdminLogin Set password=''bar'' wh... | How do you use a T-SQL variable within an if OBJECT_ID to check if a table exists? What I am trying to do with the following code is have it grab all the database names then loop through those databases check to see if the table tblAdminLogin exists and if it does update the password for username 'foo' I have been usin... | TITLE:
How do you use a T-SQL variable within an if OBJECT_ID to check if a table exists?
QUESTION:
What I am trying to do with the following code is have it grab all the database names then loop through those databases check to see if the table tblAdminLogin exists and if it does update the password for username 'foo... | [
"sql-server",
"exists"
] | 4 | 1 | 5,751 | 3 | 0 | 2011-06-03T22:53:25.410000 | 2011-06-03T23:01:25.300000 |
6,233,420 | 6,238,825 | MAX sql query in oracle | I have the testmax table as following: I J ---------------------- ---------------------- 1 2 2 4 3 3 Now, the problem is how can I find the I which has max J, by following I can find only what is the max J SELECT MAX(j) FROM testmax but by following I get this error: ORA-00937: not a single-group group function: SELECT... | Note that your question is still somewhat ambiguous; what should be returned when there is more than one record with a maximum value for J. Will you return one record or more than one? My answer is only applicable if you want one record returned. And in that case, the query below, using FIRST/LAST aggregate function fo... | MAX sql query in oracle I have the testmax table as following: I J ---------------------- ---------------------- 1 2 2 4 3 3 Now, the problem is how can I find the I which has max J, by following I can find only what is the max J SELECT MAX(j) FROM testmax but by following I get this error: ORA-00937: not a single-grou... | TITLE:
MAX sql query in oracle
QUESTION:
I have the testmax table as following: I J ---------------------- ---------------------- 1 2 2 4 3 3 Now, the problem is how can I find the I which has max J, by following I can find only what is the max J SELECT MAX(j) FROM testmax but by following I get this error: ORA-00937:... | [
"sql",
"oracle",
"ora-00937"
] | 0 | 4 | 2,314 | 5 | 0 | 2011-06-03T22:54:42.503000 | 2011-06-04T19:10:39.150000 |
6,233,422 | 6,233,449 | Eval bug in Rhino inside a try/catch | Ok, I think I found a bug in Rhino. I am trying to dynamically eval code in the global scope, and it works fine if I just do eval.call(null, "code to eval"); All was well until I tried to capture exceptions. When I surround that code with try/catch, the code is not actually eval'ed in the global context. To illustrate ... | The Rhino code built into the JDK is really, really old, and it has lots of bugs that have been fixed (for a long time) in the current release of the software from Mozilla. If you're starting a new project, I would strongly recommend that you look into what it's like to integrate Rhino using only the from-Mozilla code,... | Eval bug in Rhino inside a try/catch Ok, I think I found a bug in Rhino. I am trying to dynamically eval code in the global scope, and it works fine if I just do eval.call(null, "code to eval"); All was well until I tried to capture exceptions. When I surround that code with try/catch, the code is not actually eval'ed ... | TITLE:
Eval bug in Rhino inside a try/catch
QUESTION:
Ok, I think I found a bug in Rhino. I am trying to dynamically eval code in the global scope, and it works fine if I just do eval.call(null, "code to eval"); All was well until I tried to capture exceptions. When I surround that code with try/catch, the code is not... | [
"javascript",
"eval",
"rhino"
] | 3 | 2 | 1,710 | 1 | 0 | 2011-06-03T22:55:12.840000 | 2011-06-03T22:59:30.327000 |
6,233,434 | 6,233,453 | When creating a PictureBox in an array it does not show up on my Form | I created an array of PictureBox objects in my code like so: PictureBox[] picturbox = new PictureBox[100]; Then I have this in Form's load code: picturbox[1] = new PictureBox(); picturbox[1].Image = Properties.Resources.img1; picturbox[1].Visible = true; picturbox[1].Location = new Point(0, 0); this.Size = new Size(800... | You need to add the pictureBox to the Form: this.Controls.Add(picturebox[1]); | When creating a PictureBox in an array it does not show up on my Form I created an array of PictureBox objects in my code like so: PictureBox[] picturbox = new PictureBox[100]; Then I have this in Form's load code: picturbox[1] = new PictureBox(); picturbox[1].Image = Properties.Resources.img1; picturbox[1].Visible = t... | TITLE:
When creating a PictureBox in an array it does not show up on my Form
QUESTION:
I created an array of PictureBox objects in my code like so: PictureBox[] picturbox = new PictureBox[100]; Then I have this in Form's load code: picturbox[1] = new PictureBox(); picturbox[1].Image = Properties.Resources.img1; pictur... | [
"c#",
"winforms"
] | 0 | 2 | 6,024 | 4 | 0 | 2011-06-03T22:57:38.793000 | 2011-06-03T23:00:16.757000 |
6,233,445 | 6,233,491 | UITableView Separator Style Question | I have a tableview that is blank by default. User can add cells to it. I want the separator lines to be clear when there are no cells, and grey when there are cells. I am using this code: if ([[self.fetchedResultsController fetchedObjects] count] == 0) { self.routineTableView.separatorStyle = UITableViewCellSeparatorSt... | Maybe you are missing this?... else { self.routineTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; // or you have the previous 'None' style... self.routineTableView.separatorColor = [UIColor grayColor]; } EDIT: You need this but not only this... According to Apple Documentation: The value of this pro... | UITableView Separator Style Question I have a tableview that is blank by default. User can add cells to it. I want the separator lines to be clear when there are no cells, and grey when there are cells. I am using this code: if ([[self.fetchedResultsController fetchedObjects] count] == 0) { self.routineTableView.separa... | TITLE:
UITableView Separator Style Question
QUESTION:
I have a tableview that is blank by default. User can add cells to it. I want the separator lines to be clear when there are no cells, and grey when there are cells. I am using this code: if ([[self.fetchedResultsController fetchedObjects] count] == 0) { self.routi... | [
"iphone",
"objective-c",
"uitableview"
] | 6 | 13 | 31,967 | 3 | 0 | 2011-06-03T22:59:10.790000 | 2011-06-03T23:07:09.003000 |
6,233,447 | 6,233,558 | Implementing a Plugin System in Python | I am writing an application (a server wrapper for Minecraft) that I wish to make extensible with plugins. I have a system in place that works, however I think that in the long run it could use improvement. The way that I have it now, the application calls a "get_plugins" method in the server class that, first imports a... | Having written quite a few different plugin architectures in different platforms and languages, I will say that you are pretty much on track with how most plugins systems are written. Basically what it boils down to, is your host and your plugin need to have some kind of common contract to work with; in other words, yo... | Implementing a Plugin System in Python I am writing an application (a server wrapper for Minecraft) that I wish to make extensible with plugins. I have a system in place that works, however I think that in the long run it could use improvement. The way that I have it now, the application calls a "get_plugins" method in... | TITLE:
Implementing a Plugin System in Python
QUESTION:
I am writing an application (a server wrapper for Minecraft) that I wish to make extensible with plugins. I have a system in place that works, however I think that in the long run it could use improvement. The way that I have it now, the application calls a "get_... | [
"python",
"plugins"
] | 9 | 2 | 2,702 | 2 | 0 | 2011-06-03T22:59:14.853000 | 2011-06-03T23:19:51.970000 |
6,233,464 | 6,233,607 | New YouTube iframe code not displaying video on iPhone | We added the new YouTube iframe code into our News site. The problem is the video doesn't appear on the iPhone. Here's my page and code: How can I get YouTube video to appear on the iPhone? | The URL for the video might be the problem. The embedded video code goes like this Notice how the URL uses embed instead of v. | New YouTube iframe code not displaying video on iPhone We added the new YouTube iframe code into our News site. The problem is the video doesn't appear on the iPhone. Here's my page and code: How can I get YouTube video to appear on the iPhone? | TITLE:
New YouTube iframe code not displaying video on iPhone
QUESTION:
We added the new YouTube iframe code into our News site. The problem is the video doesn't appear on the iPhone. Here's my page and code: How can I get YouTube video to appear on the iPhone?
ANSWER:
The URL for the video might be the problem. The ... | [
"iphone",
"iframe",
"youtube",
"mobile-safari"
] | 3 | 6 | 8,295 | 3 | 0 | 2011-06-03T23:02:14.600000 | 2011-06-03T23:29:45.500000 |
6,233,470 | 6,261,601 | Core animation equivalent for built-in UIView animation | I'm looking for an equivalent core animation for the following UIView animation? [UIView animateWithDuration:0.25 animations:^(void) { cell.frame = newCellFrame;
} completion:^(BOOL finished) { [UIView animateWithDuration:0.25 animation:^(void) { cell.frame = finalCellFrame; }]; }]; What I would like to know in partic... | In CoreAnimation it's done with delegates. You can set a delegate on your CAAnimation/CABasicAnimation instance, and the animation will make animationDidStart: and animationDidStop:finished: callbacks to you. | Core animation equivalent for built-in UIView animation I'm looking for an equivalent core animation for the following UIView animation? [UIView animateWithDuration:0.25 animations:^(void) { cell.frame = newCellFrame;
} completion:^(BOOL finished) { [UIView animateWithDuration:0.25 animation:^(void) { cell.frame = fin... | TITLE:
Core animation equivalent for built-in UIView animation
QUESTION:
I'm looking for an equivalent core animation for the following UIView animation? [UIView animateWithDuration:0.25 animations:^(void) { cell.frame = newCellFrame;
} completion:^(BOOL finished) { [UIView animateWithDuration:0.25 animation:^(void) ... | [
"cocoa-touch",
"ios",
"core-animation"
] | 0 | 2 | 325 | 1 | 0 | 2011-06-03T23:03:23.907000 | 2011-06-07T06:54:58.487000 |
6,233,473 | 6,233,523 | javax.el.ELException: The identifier [return] is not a valid Java identifier | I have a page url, which looks like: http://mydomain.com/nodes/32/article/new?return=view After installing tomcat 7, when trying to access it I got this exception: /nodes/${param.id}/article/new?return=${param.return} contains invalid expression(s): javax.el.ELException: The identifier [return] is not a valid Java iden... | return is a reserved keyword in the Java Programming Language(tm). But luckily there is an alternative spelling. Try param['return'] instead. | javax.el.ELException: The identifier [return] is not a valid Java identifier I have a page url, which looks like: http://mydomain.com/nodes/32/article/new?return=view After installing tomcat 7, when trying to access it I got this exception: /nodes/${param.id}/article/new?return=${param.return} contains invalid expressi... | TITLE:
javax.el.ELException: The identifier [return] is not a valid Java identifier
QUESTION:
I have a page url, which looks like: http://mydomain.com/nodes/32/article/new?return=view After installing tomcat 7, when trying to access it I got this exception: /nodes/${param.id}/article/new?return=${param.return} contain... | [
"jakarta-ee",
"tomcat7"
] | 6 | 10 | 11,250 | 1 | 0 | 2011-06-03T23:04:05.327000 | 2011-06-03T23:14:31.333000 |
6,233,476 | 6,233,710 | For a FireFox Overlay how do you specify what Gecko/FireFox version(s) to apply it to? | Have a pluggin that is installed as part of an app, the pluggin needs to use different overlays depending on what version of FF is being used as it modifies the interface. I found https://developer.mozilla.org/en/Bundles to specify different files but this only seems to cover which OS/bitness. Is there a way to specify... | I haven't done this myself, but I think you can accomplish this effect using flags in your chrome.manifest file. See https://developer.mozilla.org/en/Chrome_Registration#Manifest_flags | For a FireFox Overlay how do you specify what Gecko/FireFox version(s) to apply it to? Have a pluggin that is installed as part of an app, the pluggin needs to use different overlays depending on what version of FF is being used as it modifies the interface. I found https://developer.mozilla.org/en/Bundles to specify d... | TITLE:
For a FireFox Overlay how do you specify what Gecko/FireFox version(s) to apply it to?
QUESTION:
Have a pluggin that is installed as part of an app, the pluggin needs to use different overlays depending on what version of FF is being used as it modifies the interface. I found https://developer.mozilla.org/en/Bu... | [
"firefox",
"firefox-addon",
"xul"
] | 1 | 1 | 141 | 2 | 0 | 2011-06-03T23:04:47.483000 | 2011-06-03T23:52:35.053000 |
6,233,482 | 6,233,490 | How do I set a property to a default value in C#? | so for a user control, I have public int Count { get; set; } so that I can use this.Count in another method. The trouble is, I want to set a default for Count to something like 15. How do I set defaults? | In the constructor of the userControl public YourUserControl(){ Count = 15; } | How do I set a property to a default value in C#? so for a user control, I have public int Count { get; set; } so that I can use this.Count in another method. The trouble is, I want to set a default for Count to something like 15. How do I set defaults? | TITLE:
How do I set a property to a default value in C#?
QUESTION:
so for a user control, I have public int Count { get; set; } so that I can use this.Count in another method. The trouble is, I want to set a default for Count to something like 15. How do I set defaults?
ANSWER:
In the constructor of the userControl p... | [
"c#",
"properties"
] | 2 | 7 | 269 | 7 | 0 | 2011-06-03T23:05:40.147000 | 2011-06-03T23:07:08.550000 |
6,233,493 | 6,233,865 | Django Combine a Variable Number of QuerySets | Is there a way to concatenate a unknown number of querysets into a list? Here are my models: class Item(models.Model): name = models.CharField(max_length=200) brand = models.ForeignKey(User, related_name='brand') tags = models.ManyToManyField(Tag, blank=True, null=True) def __unicode__(self): return self.name class Met... | Slightly unorthodox, but you could use recursion. So in your example: def recursive_search(tags, results_queryset): if len(tags) > 0: result_qs = result_queryset.filter(tags_name=tags[0]) if result_queryset.exists(): return filter_recursion(tags[1:],result_queryset) else: return None return result_queryset
tags = ["co... | Django Combine a Variable Number of QuerySets Is there a way to concatenate a unknown number of querysets into a list? Here are my models: class Item(models.Model): name = models.CharField(max_length=200) brand = models.ForeignKey(User, related_name='brand') tags = models.ManyToManyField(Tag, blank=True, null=True) def... | TITLE:
Django Combine a Variable Number of QuerySets
QUESTION:
Is there a way to concatenate a unknown number of querysets into a list? Here are my models: class Item(models.Model): name = models.CharField(max_length=200) brand = models.ForeignKey(User, related_name='brand') tags = models.ManyToManyField(Tag, blank=Tr... | [
"python",
"django",
"django-queryset",
"python-itertools"
] | 1 | 3 | 1,459 | 1 | 0 | 2011-06-03T23:07:23.250000 | 2011-06-04T00:28:12.620000 |
6,233,498 | 6,233,588 | How do I use enumerated datatypes in Objective-C? | I'm working on several iOS projects where I think enumerated datatypes would be helpful to me. For example, I have a game where the player can walk in several directions. I could just define four constants with string values as kDirectionUp, kDirectionDown, etc. I think an enumerated type would be better here. Is that ... | That sounds like the right thing to do. It's really simple to create enums in Objective-C using C-style type definitions. For example, in one of my header files, I have the following type definition: typedef enum { CFPosterViewTypePoster = 0, CFPosterViewTypeStart, // 1 CFPosterViewTypeEnd, // 2.... // 3 } CFPosterView... | How do I use enumerated datatypes in Objective-C? I'm working on several iOS projects where I think enumerated datatypes would be helpful to me. For example, I have a game where the player can walk in several directions. I could just define four constants with string values as kDirectionUp, kDirectionDown, etc. I think... | TITLE:
How do I use enumerated datatypes in Objective-C?
QUESTION:
I'm working on several iOS projects where I think enumerated datatypes would be helpful to me. For example, I have a game where the player can walk in several directions. I could just define four constants with string values as kDirectionUp, kDirection... | [
"objective-c",
"enums"
] | 11 | 13 | 2,410 | 3 | 0 | 2011-06-03T23:08:02.040000 | 2011-06-03T23:27:07.803000 |
6,233,499 | 6,233,691 | Mocks or Stubs? | I have a method that calls two other methods in it. def main_method(self, query): result = self.method_one(query) count = self.method_two(result) return count
def method_one(self, query): #Do some stuff based on results. #This method hits the database. return result
def method_two(self, result): #Do some stuff based ... | Before worrying about testing main_method(), first test the smaller methods. Consider method_one(). For the purpose of discussion, let's say it exists in a class like this: class Foo(object): def method_one(self, query): # Big nasty query that hits the database really hard!! return query.all() In order to test that met... | Mocks or Stubs? I have a method that calls two other methods in it. def main_method(self, query): result = self.method_one(query) count = self.method_two(result) return count
def method_one(self, query): #Do some stuff based on results. #This method hits the database. return result
def method_two(self, result): #Do s... | TITLE:
Mocks or Stubs?
QUESTION:
I have a method that calls two other methods in it. def main_method(self, query): result = self.method_one(query) count = self.method_two(result) return count
def method_one(self, query): #Do some stuff based on results. #This method hits the database. return result
def method_two(se... | [
"python",
"unit-testing",
"mocking",
"stubs",
"mox"
] | 4 | 5 | 1,079 | 1 | 0 | 2011-06-03T23:08:35.943000 | 2011-06-03T23:47:22.173000 |
6,233,501 | 6,240,922 | Trouble defining multiple self-referencing foreign keys in a table | I have some code here. I recently added this root_id parameter. The goal of that is to let me determine whether a File belongs to a particular Project without having to add a project_id FK into File (which would result in a model cycle.) Thus, I want to be able to compare Project.directory to File.root. If that is true... | My understanding is that defining a FK foo_id into table Foo implicit creates a foo attribute to which you can assign a Foo object. No, it doesn't. In the snippet, it just looks like it is being done for Project.directory, but if you look at the SQL statements being echo'ed, there is no INSERT at all for the projects t... | Trouble defining multiple self-referencing foreign keys in a table I have some code here. I recently added this root_id parameter. The goal of that is to let me determine whether a File belongs to a particular Project without having to add a project_id FK into File (which would result in a model cycle.) Thus, I want to... | TITLE:
Trouble defining multiple self-referencing foreign keys in a table
QUESTION:
I have some code here. I recently added this root_id parameter. The goal of that is to let me determine whether a File belongs to a particular Project without having to add a project_id FK into File (which would result in a model cycle... | [
"sqlalchemy"
] | 1 | 2 | 628 | 1 | 0 | 2011-06-03T23:08:50.957000 | 2011-06-05T03:57:16.060000 |
6,233,504 | 6,233,545 | css - list of links with shortened horizontal borders? | I'm trying to do something like so: a link here ------------------ another link here ------------------ >> active link here ------------------ one more link ------------------ where all the --- are borders but equal lengths. If the current page is the link (i.e. active link) then >> display (it'll be an image). The pro... | I'd suggest applying the.active class to the li, rather than the link, and then using: li { margin: 0 0 0 5em; border-bottom: 1px dashed #ccc; position: relative; }.active:before { position: absolute; display: block; left: -3em; width: 2.5em; content: '>>'; content: url(http://path/to/image.gif); } JS Fiddle demo. Give... | css - list of links with shortened horizontal borders? I'm trying to do something like so: a link here ------------------ another link here ------------------ >> active link here ------------------ one more link ------------------ where all the --- are borders but equal lengths. If the current page is the link (i.e. ac... | TITLE:
css - list of links with shortened horizontal borders?
QUESTION:
I'm trying to do something like so: a link here ------------------ another link here ------------------ >> active link here ------------------ one more link ------------------ where all the --- are borders but equal lengths. If the current page is... | [
"html",
"css",
"anchor",
"html-lists"
] | 0 | 5 | 971 | 2 | 0 | 2011-06-03T23:10:00.270000 | 2011-06-03T23:17:36.707000 |
6,233,507 | 6,233,528 | How to properly handle apostrophes in html forms? | I am making a dynamic web page that allows people to post their favorite recipes. Below each recipe is a link that allows you to make a comment on the recipe. If you make a comment, the comment will be posted in the database UNLESS the comment has any apostrophes in it. Here's the code for the addcomment.inc.php page: ... | Before you glue anything into the MySql query pass it through mysql_real_escape_string() Before you glue anything into HTML pass it through htmlspecialchars() This way you can prevent SQL injections, JavaScript/HTML injections and wildfires. | How to properly handle apostrophes in html forms? I am making a dynamic web page that allows people to post their favorite recipes. Below each recipe is a link that allows you to make a comment on the recipe. If you make a comment, the comment will be posted in the database UNLESS the comment has any apostrophes in it.... | TITLE:
How to properly handle apostrophes in html forms?
QUESTION:
I am making a dynamic web page that allows people to post their favorite recipes. Below each recipe is a link that allows you to make a comment on the recipe. If you make a comment, the comment will be posted in the database UNLESS the comment has any ... | [
"php",
"mysql"
] | 1 | 6 | 8,056 | 3 | 0 | 2011-06-03T23:10:44.057000 | 2011-06-03T23:15:08.900000 |
6,233,509 | 6,233,522 | UITabBar and View Controller rotation problems | I have a UITabBar with 2 bar items. The initial orientation of the device is portrait. If I rotate the device to landscape while being at tabBarItem2 the whole thing(Status Bar, TabBar, ViewContent2 ) rotates fine, but when I press the tabBarItem1 the ViewContent1 is still in Portrait. It also happens if I'm in tabBarI... | Both view controllers need to have - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } | UITabBar and View Controller rotation problems I have a UITabBar with 2 bar items. The initial orientation of the device is portrait. If I rotate the device to landscape while being at tabBarItem2 the whole thing(Status Bar, TabBar, ViewContent2 ) rotates fine, but when I press the tabBarItem1 the ViewContent1 is still... | TITLE:
UITabBar and View Controller rotation problems
QUESTION:
I have a UITabBar with 2 bar items. The initial orientation of the device is portrait. If I rotate the device to landscape while being at tabBarItem2 the whole thing(Status Bar, TabBar, ViewContent2 ) rotates fine, but when I press the tabBarItem1 the Vie... | [
"iphone",
"objective-c",
"ios4"
] | 0 | 0 | 227 | 1 | 0 | 2011-06-03T23:10:52.043000 | 2011-06-03T23:14:25.693000 |
6,233,510 | 6,233,546 | Parsing XML using regex and grabbing the value inbetween tags | I have a regular expression that I use to grab data between two sets of id's for example 70 The regular expression I use is (?<= )(?:[^<]|<(?!/CLASSCOD))* which works in most case but when i have a single value like this N it says there are no matches. The whole data string looks like this 0601 11 Department of the Int... | Something simpler should work: (.+?) Example: Match match = Regex.Match(input, @" (.+?) "); if (match.Success) { string value = match.Groups[1].Value; Console.WriteLine(value); } | Parsing XML using regex and grabbing the value inbetween tags I have a regular expression that I use to grab data between two sets of id's for example 70 The regular expression I use is (?<= )(?:[^<]|<(?!/CLASSCOD))* which works in most case but when i have a single value like this N it says there are no matches. The w... | TITLE:
Parsing XML using regex and grabbing the value inbetween tags
QUESTION:
I have a regular expression that I use to grab data between two sets of id's for example 70 The regular expression I use is (?<= )(?:[^<]|<(?!/CLASSCOD))* which works in most case but when i have a single value like this N it says there are... | [
"c#",
"regex",
"vb.net"
] | 0 | 2 | 148 | 2 | 0 | 2011-06-03T23:11:22.057000 | 2011-06-03T23:17:50.077000 |
6,233,511 | 6,234,416 | Detect if Google Satellite Images Available | Using the Google Maps API is it possible to detect whether or not satellite tiles will be available given coordinates and a zoom level? | Yes, it is possible. Read the "Maximum Zoom Imagery" section of the Google Maps API v3 for an explanation and a code sample. http://code.google.com/apis/maps/documentation/javascript/services.html#MaxZoom Here is the sample code from that documentation that "shows a map of metropolitan Tokyo. Clicking anywhere on the m... | Detect if Google Satellite Images Available Using the Google Maps API is it possible to detect whether or not satellite tiles will be available given coordinates and a zoom level? | TITLE:
Detect if Google Satellite Images Available
QUESTION:
Using the Google Maps API is it possible to detect whether or not satellite tiles will be available given coordinates and a zoom level?
ANSWER:
Yes, it is possible. Read the "Maximum Zoom Imagery" section of the Google Maps API v3 for an explanation and a c... | [
"google-maps",
"google-maps-api-3"
] | 0 | 1 | 823 | 1 | 0 | 2011-06-03T23:11:26.837000 | 2011-06-04T02:56:16.373000 |
6,233,517 | 6,233,857 | facebook how to display application notifications next to applications name in the left sidebar? | i was wondering how i can make my app display that notification number next to the apps name in the left sidebar on facebook. i see many apps that want to let you know that something happened, they made a change or something and u can see a counter. i just don't know how that works and i can't find anything on google. ... | What you are looking for is the dashboard API methods. http://developers.facebook.com/docs/reference/rest/dashboard.incrementCount/ As an FYI, Facebook is moving some (all?) of the dashboard methods to the new requests dialog. http://developers.facebook.com/docs/reference/dialogs/requests/ | facebook how to display application notifications next to applications name in the left sidebar? i was wondering how i can make my app display that notification number next to the apps name in the left sidebar on facebook. i see many apps that want to let you know that something happened, they made a change or somethin... | TITLE:
facebook how to display application notifications next to applications name in the left sidebar?
QUESTION:
i was wondering how i can make my app display that notification number next to the apps name in the left sidebar on facebook. i see many apps that want to let you know that something happened, they made a ... | [
"facebook",
"api"
] | 1 | 0 | 383 | 1 | 0 | 2011-06-03T23:13:10.620000 | 2011-06-04T00:27:11.410000 |
6,233,524 | 6,233,616 | how to make this better code and more optimized | so i am displaying first letter of the each Name starting from A and all the way to Z some thing like this: A Anthony Allan... B Bob Builder.... C Charyl Carl... Z Zoah.... how can i make this code more optimized and use less line? int _a = 0; int _b = 0; int _c = 0;........ int _z = 0;
protected void ListItem(List.En... | I will change the repeated code with this idea. List HeaderOf = new List ();
protected void ListItem(List.Enumerator cust) { if (cust.MoveNext()) { Customer t = cust.Current; string[] list = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "v", "... | how to make this better code and more optimized so i am displaying first letter of the each Name starting from A and all the way to Z some thing like this: A Anthony Allan... B Bob Builder.... C Charyl Carl... Z Zoah.... how can i make this code more optimized and use less line? int _a = 0; int _b = 0; int _c = 0;........ | TITLE:
how to make this better code and more optimized
QUESTION:
so i am displaying first letter of the each Name starting from A and all the way to Z some thing like this: A Anthony Allan... B Bob Builder.... C Charyl Carl... Z Zoah.... how can i make this code more optimized and use less line? int _a = 0; int _b = 0... | [
"asp.net"
] | 4 | 1 | 121 | 2 | 0 | 2011-06-03T23:14:41.550000 | 2011-06-03T23:30:39.060000 |
6,233,540 | 6,261,815 | Client-Side Validation for Rails 2 | Are there any client-side validation gems similar to client_side_validations (https://github.com/bcardarella/client_side_validations) for Rails 2.x? | I am actually in the process of backporting the current ClientSideValidations gem to Rails 2.x https://github.com/bcardarella/client_side_validations-rails_2 It's not ready for public consumption yet, but you might want to keep an eye on it. It will inherit from the current gem and add the necessary functionality to Ra... | Client-Side Validation for Rails 2 Are there any client-side validation gems similar to client_side_validations (https://github.com/bcardarella/client_side_validations) for Rails 2.x? | TITLE:
Client-Side Validation for Rails 2
QUESTION:
Are there any client-side validation gems similar to client_side_validations (https://github.com/bcardarella/client_side_validations) for Rails 2.x?
ANSWER:
I am actually in the process of backporting the current ClientSideValidations gem to Rails 2.x https://github... | [
"ruby-on-rails",
"validation",
"client-side-validation"
] | 0 | 1 | 374 | 2 | 0 | 2011-06-03T23:16:58.543000 | 2011-06-07T07:19:11.990000 |
6,233,541 | 6,233,568 | java set file permissions to 777 while creating a file object | Possible Duplicate: How can I set the umask from within java? How do you set file permissions to 777(or any other arbitrary permission) while creating a file object in java? | If you set the umask(2) to 0 before starting the JVM, all files and directories created will be created with full permissions for everyone. This is probably a bad idea. You can use the File.setReadable(), File.setWritable APIs to fiddle with the mode bits after the file has been created. That's often good enough, if yo... | java set file permissions to 777 while creating a file object Possible Duplicate: How can I set the umask from within java? How do you set file permissions to 777(or any other arbitrary permission) while creating a file object in java? | TITLE:
java set file permissions to 777 while creating a file object
QUESTION:
Possible Duplicate: How can I set the umask from within java? How do you set file permissions to 777(or any other arbitrary permission) while creating a file object in java?
ANSWER:
If you set the umask(2) to 0 before starting the JVM, all... | [
"java",
"file",
"file-permissions",
"umask"
] | 19 | 17 | 103,174 | 3 | 0 | 2011-06-03T23:17:01.597000 | 2011-06-03T23:21:52.390000 |
6,233,548 | 6,237,069 | How to set a target of NSTimer from active instance when applicationDidBecomeActive on iphone | I have an NSTimer that I created in the appDelegate to handle the pause when the app locks or is put in the background, but the timers selector is in another viewController, when the user is in that viewController and then hits the home button the app closes and moves to the background, but when the app is tapped I nee... | Well it turns out that this is pretty easy, I just wasn't thinking it through, maybe a bit too tired, anyway the answer is close to what David mentioned, the key is to loop through the viewControllers in the navigation controller to get the proper viewController for (UIViewController *vc in [self.navigationController v... | How to set a target of NSTimer from active instance when applicationDidBecomeActive on iphone I have an NSTimer that I created in the appDelegate to handle the pause when the app locks or is put in the background, but the timers selector is in another viewController, when the user is in that viewController and then hit... | TITLE:
How to set a target of NSTimer from active instance when applicationDidBecomeActive on iphone
QUESTION:
I have an NSTimer that I created in the appDelegate to handle the pause when the app locks or is put in the background, but the timers selector is in another viewController, when the user is in that viewContr... | [
"iphone",
"ios",
"nstimer"
] | 0 | 0 | 507 | 2 | 0 | 2011-06-03T23:18:01.080000 | 2011-06-04T13:43:15.587000 |
6,233,550 | 6,233,660 | query to a SQLite DB in android | I have a table in DB called TABLE_3 which has several columns....and I wanna do a query to that table using conditions for two of its columns KEY_SPEED>prefix and KEY_USER_ID_=user_id but I don't know how to write it...can someone help me with that...here is how my query looks with only one of the conditions....How sho... | The condition argument is like WHERE clause in SQL, so you can concatenate your conditions with AND and OR, something like the following, KEY_SPEED + " > " + prefix + " AND KEY_USER_ID_=user_id" | query to a SQLite DB in android I have a table in DB called TABLE_3 which has several columns....and I wanna do a query to that table using conditions for two of its columns KEY_SPEED>prefix and KEY_USER_ID_=user_id but I don't know how to write it...can someone help me with that...here is how my query looks with only ... | TITLE:
query to a SQLite DB in android
QUESTION:
I have a table in DB called TABLE_3 which has several columns....and I wanna do a query to that table using conditions for two of its columns KEY_SPEED>prefix and KEY_USER_ID_=user_id but I don't know how to write it...can someone help me with that...here is how my quer... | [
"android",
"sqlite"
] | 0 | 0 | 200 | 1 | 0 | 2011-06-03T23:18:22.783000 | 2011-06-03T23:38:41.103000 |
6,233,553 | 6,233,578 | MVC3 routes - replace id with object name | I'm looking for a fast & elegant way of converting my object IDs with descriptive names, so that my autogenerated routes look like: /products/oak-table-25x25-3-1 instead of /products/5bd8c59c-fc37-40c3-bf79-dd30e79b55a5 In this sample: uid = "5bd8c59c-fc37-40c3-bf79-dd30e79b55a5" name = "Oak table (25x25) 3/1" I don't ... | One method is that employed by stackoverflow.com which in your case would be: /products/5bd8c59c-fc37-40c3-bf79-dd30e79b55a5/oak-table-25x25-3-1 This ensures uniqueness, however the length of the UUID may be a deterrent. You may consider adding a sequential int or bigint identity value to the products table in addition... | MVC3 routes - replace id with object name I'm looking for a fast & elegant way of converting my object IDs with descriptive names, so that my autogenerated routes look like: /products/oak-table-25x25-3-1 instead of /products/5bd8c59c-fc37-40c3-bf79-dd30e79b55a5 In this sample: uid = "5bd8c59c-fc37-40c3-bf79-dd30e79b55a... | TITLE:
MVC3 routes - replace id with object name
QUESTION:
I'm looking for a fast & elegant way of converting my object IDs with descriptive names, so that my autogenerated routes look like: /products/oak-table-25x25-3-1 instead of /products/5bd8c59c-fc37-40c3-bf79-dd30e79b55a5 In this sample: uid = "5bd8c59c-fc37-40c... | [
"asp.net",
"asp.net-mvc",
"asp.net-mvc-3"
] | 0 | 1 | 689 | 4 | 0 | 2011-06-03T23:18:46.473000 | 2011-06-03T23:24:40.990000 |
6,233,559 | 6,254,253 | Is Hbase or BigTable like massive Matrix Store? | I have been doing some research on the HBase and Google's BigTable. HBase and BigTable look like a massive Matrix store for me. Each row key is mapped to a big m*n matrix(X), which m is the number of total rows, n is the number of total columns. And X consists total of Q k*2 matrices. Which m=Q*k, n=2*Q Is this right? ... | There are different logical ways of looking at HBase. You certainly can use it as a large sparse matrix. Your description seemed slightly off to me however. A table is a matrix; rows are composed of column families; column families are composed of column qualifiers. Each column qualifier can have N versions. Practicall... | Is Hbase or BigTable like massive Matrix Store? I have been doing some research on the HBase and Google's BigTable. HBase and BigTable look like a massive Matrix store for me. Each row key is mapped to a big m*n matrix(X), which m is the number of total rows, n is the number of total columns. And X consists total of Q ... | TITLE:
Is Hbase or BigTable like massive Matrix Store?
QUESTION:
I have been doing some research on the HBase and Google's BigTable. HBase and BigTable look like a massive Matrix store for me. Each row key is mapped to a big m*n matrix(X), which m is the number of total rows, n is the number of total columns. And X co... | [
"hadoop",
"hbase",
"bigtable"
] | 0 | 1 | 465 | 1 | 0 | 2011-06-03T23:20:00.800000 | 2011-06-06T15:22:14.917000 |
6,233,562 | 6,233,781 | Node.js: chunked transfer encoding | Is that code valid HTTP/1.1? var fs = require('fs') var http = require('http')
var buf=function(res,fd,i,s,buffer){ if(i+buffer.length I think I am violating HTTP/1.1 here? Text files do seem to work fine, but that could be coincidental. Is my header "200 OK" or need it to be "100"? Is one header sufficient? | If you're doing chunked transfer encoding, you actually need to set that header: Transfer-Encoding: chunked You can see from the headers returned by google, which does chunked transfers for the homepage and most likely other pages: HTTP/1.1 200 OK Date: Sat, 04 Jun 2011 00:04:08 GMT Expires: -1 Cache-Control: private, ... | Node.js: chunked transfer encoding Is that code valid HTTP/1.1? var fs = require('fs') var http = require('http')
var buf=function(res,fd,i,s,buffer){ if(i+buffer.length I think I am violating HTTP/1.1 here? Text files do seem to work fine, but that could be coincidental. Is my header "200 OK" or need it to be "100"? ... | TITLE:
Node.js: chunked transfer encoding
QUESTION:
Is that code valid HTTP/1.1? var fs = require('fs') var http = require('http')
var buf=function(res,fd,i,s,buffer){ if(i+buffer.length I think I am violating HTTP/1.1 here? Text files do seem to work fine, but that could be coincidental. Is my header "200 OK" or nee... | [
"node.js"
] | 16 | 14 | 43,647 | 3 | 0 | 2011-06-03T23:20:47.210000 | 2011-06-04T00:07:38.260000 |
6,233,564 | 6,236,666 | Using only 1 resource file instead of 1 resource file per form/other strings | We are localizing our forms and strings in a project and are having a problem; Visual Studio creates a resource file for each form when setting Localizable to true. It's nothing more than a minor nuisance having to send all of the resource files to translators, but is it possible to get VS to use a global resources fil... | As others already said, it is possible to use global resource file manually. I believe that it is actually more problematic and less maintainable but still possible. Now onto why MS decided on one resource file per form. Well, from Internationalization point of view, this solution is better. On one hand it gives transl... | Using only 1 resource file instead of 1 resource file per form/other strings We are localizing our forms and strings in a project and are having a problem; Visual Studio creates a resource file for each form when setting Localizable to true. It's nothing more than a minor nuisance having to send all of the resource fil... | TITLE:
Using only 1 resource file instead of 1 resource file per form/other strings
QUESTION:
We are localizing our forms and strings in a project and are having a problem; Visual Studio creates a resource file for each form when setting Localizable to true. It's nothing more than a minor nuisance having to send all o... | [
"c#",
"resources",
"localization"
] | 5 | 1 | 1,726 | 3 | 0 | 2011-06-03T23:21:02.150000 | 2011-06-04T12:09:33.887000 |
6,233,566 | 6,233,615 | What is a Sandbox | When anti-viruses run some application in a virtual environment called a "sandbox", how does this sandbox precisely work from the Windows kernel point of view? Is it hard to write such a sandbox? | At a high level such sandboxes are kernel drivers which intercept calls to APIs, and modify the results those APIs return using hooking. How an entire sandboxing solution works under the hood though, could easily fill several books. As for difficulty, it's probably one of the harder things you could ever possibly write... | What is a Sandbox When anti-viruses run some application in a virtual environment called a "sandbox", how does this sandbox precisely work from the Windows kernel point of view? Is it hard to write such a sandbox? | TITLE:
What is a Sandbox
QUESTION:
When anti-viruses run some application in a virtual environment called a "sandbox", how does this sandbox precisely work from the Windows kernel point of view? Is it hard to write such a sandbox?
ANSWER:
At a high level such sandboxes are kernel drivers which intercept calls to APIs... | [
"c++",
"windows",
"kernel",
"sandbox"
] | 13 | 14 | 1,616 | 1 | 0 | 2011-06-03T23:21:43.077000 | 2011-06-03T23:30:36.823000 |
6,233,572 | 6,233,597 | Where is the web server root directory in WAMP? | Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser? | If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www, however this might vary depending on version. Yes, this is where you would put your site files to access them through a browser. | Where is the web server root directory in WAMP? Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser? | TITLE:
Where is the web server root directory in WAMP?
QUESTION:
Also is the web server root directory the place where you put your site files and later acces them with localhost/file_name in the browser?
ANSWER:
If you installed WAMP to c:\wamp then I believe your webserver root directory would be c:\wamp\www, howev... | [
"server",
"wamp",
"document-root"
] | 31 | 42 | 156,321 | 7 | 0 | 2011-06-03T23:22:52.563000 | 2011-06-03T23:28:14.590000 |
6,233,574 | 6,233,976 | How to get pattern rules to match file names with spaces in Makefile? | In the GNU make docs, '%' is documented to match "any nonempty substring". However, it seems it actually only matches non-empty substrings that do not contain whitespace. For example, say you do this: mkdir /tmp/foo cd /tmp/foo echo 'int main() { return 0; }' > "test.c" echo 'int main() { return 0; }' > "test space.c" ... | I don't believe so. The notion of a list of whitespace-separated tokens being passed around as a string is pretty deeply ingrained in make. Those lists are parsed and reparsed. There's a reason why spaces in directory and file names is considered bad practice in the UNIX world. | How to get pattern rules to match file names with spaces in Makefile? In the GNU make docs, '%' is documented to match "any nonempty substring". However, it seems it actually only matches non-empty substrings that do not contain whitespace. For example, say you do this: mkdir /tmp/foo cd /tmp/foo echo 'int main() { ret... | TITLE:
How to get pattern rules to match file names with spaces in Makefile?
QUESTION:
In the GNU make docs, '%' is documented to match "any nonempty substring". However, it seems it actually only matches non-empty substrings that do not contain whitespace. For example, say you do this: mkdir /tmp/foo cd /tmp/foo echo... | [
"makefile",
"design-patterns",
"whitespace",
"filenames",
"rule"
] | 10 | 7 | 2,918 | 2 | 0 | 2011-06-03T23:23:02.860000 | 2011-06-04T00:58:41.313000 |
6,233,580 | 6,233,720 | Abstracting access to Entity-Framework | I have an entity in EF called Registry that I use for throwing all kinds of useful stuff in. My typical query looks like this: db.Registry.Where(x => x.Domain == "SomeDomain" && x.Key == "SomeKey").Select(x => x.Value).Single(); where db is a variable of type EFContainer. Rather than having this sort of query all over ... | The typical way to do this would be to create a RegisterRepository and inject either the EFContainer into the constructor of the repository or inject a mechanism for creating containers. public class RegistryRepository { public RegistryRepository(EFContainer db) { this.db = db; }
readonly EFContainer db;
public Regis... | Abstracting access to Entity-Framework I have an entity in EF called Registry that I use for throwing all kinds of useful stuff in. My typical query looks like this: db.Registry.Where(x => x.Domain == "SomeDomain" && x.Key == "SomeKey").Select(x => x.Value).Single(); where db is a variable of type EFContainer. Rather t... | TITLE:
Abstracting access to Entity-Framework
QUESTION:
I have an entity in EF called Registry that I use for throwing all kinds of useful stuff in. My typical query looks like this: db.Registry.Where(x => x.Domain == "SomeDomain" && x.Key == "SomeKey").Select(x => x.Value).Single(); where db is a variable of type EFC... | [
"entity-framework",
"asp.net-mvc-3",
"linq-to-entities"
] | 1 | 3 | 114 | 1 | 0 | 2011-06-03T23:25:06.727000 | 2011-06-03T23:54:23.233000 |
6,233,584 | 6,233,630 | Load img from local Drive | I have the following HTML Tags: User select file and I want to preview this file inside image size as onchange event: $(document).ready(function(){ $("#bigPicture").change(function() { alert($("#bigPicture").val()); $("#test1").attr("src",$("#bigPicture").val()); }); }); I have very weird behavior: as alert I got C:\fa... | http://dev.w3.org/html5/spec/Overview.html#file-upload-state For historical reasons, the value IDL attribute prefixes the filename with the string "C:\fakepath\". Some legacy user agents actually included the full path (which was a security vulnerability). filename On getting, it must return the string "C:\fakepath\" f... | Load img from local Drive I have the following HTML Tags: User select file and I want to preview this file inside image size as onchange event: $(document).ready(function(){ $("#bigPicture").change(function() { alert($("#bigPicture").val()); $("#test1").attr("src",$("#bigPicture").val()); }); }); I have very weird beha... | TITLE:
Load img from local Drive
QUESTION:
I have the following HTML Tags: User select file and I want to preview this file inside image size as onchange event: $(document).ready(function(){ $("#bigPicture").change(function() { alert($("#bigPicture").val()); $("#test1").attr("src",$("#bigPicture").val()); }); }); I ha... | [
"javascript",
"html",
"jquery",
"jquery-events"
] | 1 | 2 | 2,096 | 2 | 0 | 2011-06-03T23:26:24.420000 | 2011-06-03T23:33:26.893000 |
6,233,589 | 6,233,690 | how to rotate this openGl code | in this code i'm try to draw simple olympic ring and rotate it... the below work fine but i can't rotate the rings.. help me to solve this problme... void myReshape (int width, int height) { glViewport (0, 0, width, height); glMatrixMode (GL_PROJECTION); glLoadIdentity(); gluOrtho2D (-5, 105, -5, 105); glMatrixMode (GL... | Try this: #include #include #include #include #include #define PIXEL_SIZE 3 #define MESSAGE "hello world!"
void draw_circle(int x, int y, int r);
int ring_radius = 19; int color[5][3]={{0,0,1}, {0,0,0},{1,0,0}, {1,1,0},{0,1,0}}; int center[5][2]={{15,60},{50,60},{85,60},{33,45},{68,45}}; //===========================... | how to rotate this openGl code in this code i'm try to draw simple olympic ring and rotate it... the below work fine but i can't rotate the rings.. help me to solve this problme... void myReshape (int width, int height) { glViewport (0, 0, width, height); glMatrixMode (GL_PROJECTION); glLoadIdentity(); gluOrtho2D (-5, ... | TITLE:
how to rotate this openGl code
QUESTION:
in this code i'm try to draw simple olympic ring and rotate it... the below work fine but i can't rotate the rings.. help me to solve this problme... void myReshape (int width, int height) { glViewport (0, 0, width, height); glMatrixMode (GL_PROJECTION); glLoadIdentity()... | [
"opengl",
"3d",
"rotation"
] | 1 | 0 | 1,910 | 3 | 0 | 2011-06-03T23:27:23.437000 | 2011-06-03T23:47:17.267000 |
6,233,595 | 6,233,728 | Is there a comment system for blogging site that does not require javascript? | I have been looking for a proper comment system for my blogging site. I built my blog engine from scratch using php and mysql and do not use wordpress, joomla, or anything like it. I want the comment system to be functional even if a user has javascript disabled. I was previously looking at Disqus, but it turns out tha... | I understand your trepidation, but I've slapped together a commenting system on my own also. Even got threaded comments to work. Really, it's just a matter of filling a form with username, email and the comment, then assigning it a timestamp and ID in your database. For spam protection you can use: OpenID, which of cou... | Is there a comment system for blogging site that does not require javascript? I have been looking for a proper comment system for my blogging site. I built my blog engine from scratch using php and mysql and do not use wordpress, joomla, or anything like it. I want the comment system to be functional even if a user has... | TITLE:
Is there a comment system for blogging site that does not require javascript?
QUESTION:
I have been looking for a proper comment system for my blogging site. I built my blog engine from scratch using php and mysql and do not use wordpress, joomla, or anything like it. I want the comment system to be functional ... | [
"php",
"javascript",
"mysql",
"blogs"
] | 1 | 2 | 474 | 3 | 0 | 2011-06-03T23:27:51.140000 | 2011-06-03T23:56:01.533000 |
6,233,610 | 6,233,936 | PHP Code Deployment Tips | In the past, I have been developing in a very amateurish fashion, meaning I had a local machine where I developed and tested code and a production machine to which I copied the code when I was done. Recently I modified this slightly to where I developed locally, checked the code into SVN and then updated the production... | I would suggest making your testing deployment strategy a production-ready install-script -- since you're going to need one of those anyway eventually. A few tips that may seem obvious to some, but are worth pointing out: Your config file saved in your VCS should be a template, and should be named differently from the ... | PHP Code Deployment Tips In the past, I have been developing in a very amateurish fashion, meaning I had a local machine where I developed and tested code and a production machine to which I copied the code when I was done. Recently I modified this slightly to where I developed locally, checked the code into SVN and th... | TITLE:
PHP Code Deployment Tips
QUESTION:
In the past, I have been developing in a very amateurish fashion, meaning I had a local machine where I developed and tested code and a production machine to which I copied the code when I was done. Recently I modified this slightly to where I developed locally, checked the co... | [
"php",
"svn",
"deployment",
"build-process"
] | 25 | 3 | 2,068 | 3 | 0 | 2011-06-03T23:30:00.787000 | 2011-06-04T00:46:57.967000 |
6,233,617 | 6,233,634 | is prototyping different than directly naming the function? | For exampleis this: function obj(val) { this.val = val; } obj.prototype.newfunction = function(){ return this.val; }; Different than this in any way at all? function obj(val) { this.val = val; this.newfunction = function(){ return this.val; } } I realize that the reason for prototype is so that you can add methods to o... | With first approach you cannot call obj.newfunction(), with the second one you can. when you extend prototype with extra functionality (like in your first example), this extra functionality will be available to all the objects you create from this function with new operator.but this functionality does not become part o... | is prototyping different than directly naming the function? For exampleis this: function obj(val) { this.val = val; } obj.prototype.newfunction = function(){ return this.val; }; Different than this in any way at all? function obj(val) { this.val = val; this.newfunction = function(){ return this.val; } } I realize that ... | TITLE:
is prototyping different than directly naming the function?
QUESTION:
For exampleis this: function obj(val) { this.val = val; } obj.prototype.newfunction = function(){ return this.val; }; Different than this in any way at all? function obj(val) { this.val = val; this.newfunction = function(){ return this.val; }... | [
"javascript"
] | 0 | 3 | 146 | 1 | 0 | 2011-06-03T23:31:06.407000 | 2011-06-03T23:34:15.240000 |
6,233,625 | 6,233,642 | VB.NET - Adding items to a listview along with tag property | I can add items to a listview this way: ListViewItem.Items.Add("Text") But how can I set the Tag property of that same item as the same loop? I tried going ListViewItem.Items(0).Tag = "something" But that doesn't seem to do the trick. How do I do this? | Because.Add returns a ListViewItem, you can set new item's Tag property directly after the call: ListViewItem.Items.Add("Text").Tag = "something" If you want to set more than 1 property, store it in a local variable then you can do what you want: Dim lvi As ListViewItem lvi = ListViewItem.Items.Add("Text") lvi.Tag = "s... | VB.NET - Adding items to a listview along with tag property I can add items to a listview this way: ListViewItem.Items.Add("Text") But how can I set the Tag property of that same item as the same loop? I tried going ListViewItem.Items(0).Tag = "something" But that doesn't seem to do the trick. How do I do this? | TITLE:
VB.NET - Adding items to a listview along with tag property
QUESTION:
I can add items to a listview this way: ListViewItem.Items.Add("Text") But how can I set the Tag property of that same item as the same loop? I tried going ListViewItem.Items(0).Tag = "something" But that doesn't seem to do the trick. How do ... | [
"vb.net"
] | 3 | 5 | 8,907 | 1 | 0 | 2011-06-03T23:32:19.303000 | 2011-06-03T23:35:17.853000 |
6,233,628 | 6,233,646 | Returning raw soap response in java using JAX-WS | I have have a program where i am invoking the generated code from jax-ws wsimport function. Here's what it looks like: HolidayService2 service = new HolidayService2(); HolidayService2Soap proxy = service.getHolidayService2Soap(); ArrayOfCountryCode countries = proxy.GetCountriesAvailable("USA"); the proxy.GetCountriesA... | You can use a packet sniffing program or a proxy based program. Fiddler is a great proxy based program or there is the JAX-WS WSMonitor tool. For packet sniffing: Wireshark To get access to the SOAPMessage, you effectively need to create a class that implements the javax.xml.ws.handler.soap.SOAPHandler interface: publi... | Returning raw soap response in java using JAX-WS I have have a program where i am invoking the generated code from jax-ws wsimport function. Here's what it looks like: HolidayService2 service = new HolidayService2(); HolidayService2Soap proxy = service.getHolidayService2Soap(); ArrayOfCountryCode countries = proxy.GetC... | TITLE:
Returning raw soap response in java using JAX-WS
QUESTION:
I have have a program where i am invoking the generated code from jax-ws wsimport function. Here's what it looks like: HolidayService2 service = new HolidayService2(); HolidayService2Soap proxy = service.getHolidayService2Soap(); ArrayOfCountryCode coun... | [
"java",
"web-services",
"jax-ws"
] | 1 | 5 | 3,451 | 1 | 0 | 2011-06-03T23:32:49.920000 | 2011-06-03T23:36:09.507000 |
6,233,637 | 6,233,687 | ValueType to IntPtr to use during application lifetime | Lets say we have a native library that works with data like this: double *pointer = &globalValue SetAddress(pointer);
//Then we can change value and write it to disk globalValue = 5.0;
FlushValues(); // this function writes all values // registered by SetAddress(..) functions... //Then we change our value (or values)... | (There are some major downsides to this...) You can use GCHandle. Alloc (data1, GCHandleType.Pinned ) to "pin" an object, and then get an IntPtr from GCHandle.AddrOfPinnedObject. If you do this, you'll be able to pass this IntPtr to your native code, which should work as expected. However, this is going to cause a lot ... | ValueType to IntPtr to use during application lifetime Lets say we have a native library that works with data like this: double *pointer = &globalValue SetAddress(pointer);
//Then we can change value and write it to disk globalValue = 5.0;
FlushValues(); // this function writes all values // registered by SetAddress(... | TITLE:
ValueType to IntPtr to use during application lifetime
QUESTION:
Lets say we have a native library that works with data like this: double *pointer = &globalValue SetAddress(pointer);
//Then we can change value and write it to disk globalValue = 5.0;
FlushValues(); // this function writes all values // registe... | [
"c#",
"pointers",
"interop"
] | 1 | 3 | 664 | 1 | 0 | 2011-06-03T23:34:27.757000 | 2011-06-03T23:46:52.780000 |
6,233,640 | 6,233,688 | How to pass a variable with in jquery | I just started using jQuery in the past few days. I love how it makes functions simple. However because I am very new to using Javascript, I keep hitting a road block with one function. I am trying to bind a couple functions together, but I'm not sure if I am doing it in the right order. What I want it to do is get a v... | In the handler for the click event on each link you can get a reference to the target link and extract the values from the href attribute and then set the values of the hidden fields in the form. $('.foo').click(function() {
var href = $(this).attr('href'); // will contain the string "#from=0&to=0"
var from,to =... /... | How to pass a variable with in jquery I just started using jQuery in the past few days. I love how it makes functions simple. However because I am very new to using Javascript, I keep hitting a road block with one function. I am trying to bind a couple functions together, but I'm not sure if I am doing it in the right ... | TITLE:
How to pass a variable with in jquery
QUESTION:
I just started using jQuery in the past few days. I love how it makes functions simple. However because I am very new to using Javascript, I keep hitting a road block with one function. I am trying to bind a couple functions together, but I'm not sure if I am doin... | [
"php",
"jquery"
] | 0 | 0 | 649 | 1 | 0 | 2011-06-03T23:35:10.500000 | 2011-06-03T23:46:55.807000 |
6,233,645 | 6,233,940 | RSolve not solving discrete Rossler system | I'm working with chaotic attractors, and testing some continuous-> discrete equivalences. I've made a continuous simulation of the Rossler system this way a = 0.432; b = 2; c = 4; Rossler = { x'[t] == -y[t] - z[t], y'[t] == x[t] + a*y[t], z'[t] == b + x[t]*z[t]-c*z[t]}; sol = NDSolve[ {Rossler, x[0] == y[0] == z[0] == ... | RecurrenceTable is the numeric analogue to RSolve: rosslerDiscreto = { x[n+1] == x[n] - C[1]*(y[n] + z[n]), y[n+1] == (1 - a*C[2])*y[n] + C[2]*x[n], z[n+1] == (z[n]*(1 - C[3]) + b*C[3]) / (1 - C[3]*x[n]), x[0] == y[0] == z[0] == 0.5 } /. {a->0.432, b->2, c->4, C[1]->0.1, C[2]->0.1, C[3]->0.1}; coords = RecurrenceTable[... | RSolve not solving discrete Rossler system I'm working with chaotic attractors, and testing some continuous-> discrete equivalences. I've made a continuous simulation of the Rossler system this way a = 0.432; b = 2; c = 4; Rossler = { x'[t] == -y[t] - z[t], y'[t] == x[t] + a*y[t], z'[t] == b + x[t]*z[t]-c*z[t]}; sol = ... | TITLE:
RSolve not solving discrete Rossler system
QUESTION:
I'm working with chaotic attractors, and testing some continuous-> discrete equivalences. I've made a continuous simulation of the Rossler system this way a = 0.432; b = 2; c = 4; Rossler = { x'[t] == -y[t] - z[t], y'[t] == x[t] + a*y[t], z'[t] == b + x[t]*z[... | [
"wolfram-mathematica",
"discrete-mathematics",
"chaos"
] | 5 | 8 | 519 | 1 | 0 | 2011-06-03T23:35:54.330000 | 2011-06-04T00:48:12.307000 |
6,233,647 | 6,234,636 | Clone an instance of a class (Display Object) | I have a collection of movieclips, I would like to create a clone (a new instance) of a instance everytime I create a new object. For example var s:Star = new Star(); // star-shaped movielcip addChild(s); // then I want to duplicate an instance of s and add it beside s For an example like above, it's simple enough to c... | moses' solution is correct. What is the purpose of the clone, where you wouldn't need to know the name of the clone to reference it? One option is you could create an array to store your references in so you don't need to explicitly name them. Using moses' code... var clones:Array = new Array(); for each (var star:Star... | Clone an instance of a class (Display Object) I have a collection of movieclips, I would like to create a clone (a new instance) of a instance everytime I create a new object. For example var s:Star = new Star(); // star-shaped movielcip addChild(s); // then I want to duplicate an instance of s and add it beside s For ... | TITLE:
Clone an instance of a class (Display Object)
QUESTION:
I have a collection of movieclips, I would like to create a clone (a new instance) of a instance everytime I create a new object. For example var s:Star = new Star(); // star-shaped movielcip addChild(s); // then I want to duplicate an instance of s and ad... | [
"actionscript-3",
"clone"
] | 0 | 1 | 2,996 | 2 | 0 | 2011-06-03T23:36:30.240000 | 2011-06-04T04:11:09.820000 |
6,233,654 | 6,234,144 | How to extend an existing background thread solution? | I am using Eclipse to develop an Android application that plots Bluetooth data. I am using open source code, which has an existing solution that I want to extend and not replace to solve my development problem as stated above. The open source code has a very nice and solid background thread that among other things cont... | Anyone who says that you should use AIDL for this is a loon who should not be listened to.:) Also someone saying you need a Service if you don't want to have your background thread running when the user is not viewing your activity. I'm not sure what you mean by "writes to logcat to call a static plotData()." You shoul... | How to extend an existing background thread solution? I am using Eclipse to develop an Android application that plots Bluetooth data. I am using open source code, which has an existing solution that I want to extend and not replace to solve my development problem as stated above. The open source code has a very nice an... | TITLE:
How to extend an existing background thread solution?
QUESTION:
I am using Eclipse to develop an Android application that plots Bluetooth data. I am using open source code, which has an existing solution that I want to extend and not replace to solve my development problem as stated above. The open source code ... | [
"android",
"multithreading",
"thread-safety"
] | 0 | 3 | 183 | 1 | 0 | 2011-06-03T23:37:53.297000 | 2011-06-04T01:41:03.027000 |
6,233,656 | 6,233,739 | Segmentation fault when run as root? | My c++ program gives me a seg fault when I run as root from my computer but not when I start a remote session. My program run from my computer only as a user. What can be the problem? I wrote my program for an embedded device and I'm using this to compile: gcc -Werror notify.cc -o notify `pkg-config --libs --cflags gtk... | You might want to run your program under valgrind. I wrote a tiny program that writes outside of an allocated array: $ valgrind./segfault ==11830== Memcheck, a memory error detector ==11830== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==11830== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with... | Segmentation fault when run as root? My c++ program gives me a seg fault when I run as root from my computer but not when I start a remote session. My program run from my computer only as a user. What can be the problem? I wrote my program for an embedded device and I'm using this to compile: gcc -Werror notify.cc -o n... | TITLE:
Segmentation fault when run as root?
QUESTION:
My c++ program gives me a seg fault when I run as root from my computer but not when I start a remote session. My program run from my computer only as a user. What can be the problem? I wrote my program for an embedded device and I'm using this to compile: gcc -Wer... | [
"c++",
"linux",
"gdb",
"maemo"
] | 1 | 4 | 3,931 | 4 | 0 | 2011-06-03T23:38:14.397000 | 2011-06-03T23:58:45.073000 |
6,233,661 | 6,233,753 | How to extend a Cocoa protocol in a category to avoid "not found in protocol(s)" warning? | This seems like a simple thing, but my brain doesn't seem to be working today, and my searches haven't turned up a helpful answer. I have lots of code that extends Cocoa classes via categories (it's open source, too). Some methods want to call the delegate; the old code used informal protocols to do this, but now when ... | I think this is because the NSOutlineView delegate is now typed as id rather than a plain id as it was in the 10.5 SDK. The category is declared on NSObject, but the compiler doesn't see the delegate object as inheriting from NSObject, so it doesn't recognize that it would respond to the message. Before, since the dele... | How to extend a Cocoa protocol in a category to avoid "not found in protocol(s)" warning? This seems like a simple thing, but my brain doesn't seem to be working today, and my searches haven't turned up a helpful answer. I have lots of code that extends Cocoa classes via categories (it's open source, too). Some methods... | TITLE:
How to extend a Cocoa protocol in a category to avoid "not found in protocol(s)" warning?
QUESTION:
This seems like a simple thing, but my brain doesn't seem to be working today, and my searches haven't turned up a helpful answer. I have lots of code that extends Cocoa classes via categories (it's open source, ... | [
"cocoa",
"protocols",
"categories",
"nsoutlineview"
] | 0 | 0 | 288 | 1 | 0 | 2011-06-03T23:38:54.140000 | 2011-06-04T00:01:30.640000 |
6,233,663 | 6,273,317 | When was a clearcase snapshot view last updated? | I want to find the timestamp when a clearcase snapshot view was last updated. By this, I mean the time when the last "cleartool update" was started. Or, said another way, if I was going to make a dynamic view with a timestamp, what timestamp should I use to make it exactly equivalent to a given snapshot view? The only ... | I think I answered my own question -- The timestamp in the update..updt is the moment that the " cleartool update " was started, but it's the time on the local machine - which may be different from the time on the clearcase server machine. For instance, the time on my two machines are different by about 3 minutes. So t... | When was a clearcase snapshot view last updated? I want to find the timestamp when a clearcase snapshot view was last updated. By this, I mean the time when the last "cleartool update" was started. Or, said another way, if I was going to make a dynamic view with a timestamp, what timestamp should I use to make it exact... | TITLE:
When was a clearcase snapshot view last updated?
QUESTION:
I want to find the timestamp when a clearcase snapshot view was last updated. By this, I mean the time when the last "cleartool update" was started. Or, said another way, if I was going to make a dynamic view with a timestamp, what timestamp should I us... | [
"version-control",
"clearcase",
"snapshot-view"
] | 2 | 2 | 1,663 | 2 | 0 | 2011-06-03T23:39:05.237000 | 2011-06-08T01:26:20.957000 |
6,233,685 | 6,237,239 | Zend Router Question | I use modules layout to structure my controllers::module/:controller/:action I would like to add a new custom route so that the following url will work. domain.com/username where username is a username of any registered user on the website. Can anyone point me in the right direction? Thank you | See this blog post for a detailed explanation of how to do this in ZF: http://tfountain.co.uk/blog/2010/9/9/vanity-urls-zend-framework | Zend Router Question I use modules layout to structure my controllers::module/:controller/:action I would like to add a new custom route so that the following url will work. domain.com/username where username is a username of any registered user on the website. Can anyone point me in the right direction? Thank you | TITLE:
Zend Router Question
QUESTION:
I use modules layout to structure my controllers::module/:controller/:action I would like to add a new custom route so that the following url will work. domain.com/username where username is a username of any registered user on the website. Can anyone point me in the right directi... | [
"zend-framework",
"zend-controller-router"
] | 1 | 1 | 171 | 3 | 0 | 2011-06-03T23:46:16.913000 | 2011-06-04T14:19:15.780000 |
6,233,701 | 6,233,706 | Need jQuery selector for <ul> inside a hovered <li> | Here is my XHTML code: Category 1 Category 2 Link 1 Link 2 Link 3 Category 3 Link Link Category 4 Actually, I want to make a menu with hover interaction to show sub links. (anyway, a standard menu:)) And here is my JS code: /* menu handler */ $(document).ready(function(){ $('#MenuBar1 li.hasasubmenu').hover(function(){... | children() or find() /* menu handler */ $(document).ready(function(){ $('#MenuBar1 li.hasasubmenu').hover(function(){ $(this).children('ul').toggle(); // select the ul }); }); Example: http://jsfiddle.net/niklasvh/2GY4V/ | Need jQuery selector for <ul> inside a hovered <li> Here is my XHTML code: Category 1 Category 2 Link 1 Link 2 Link 3 Category 3 Link Link Category 4 Actually, I want to make a menu with hover interaction to show sub links. (anyway, a standard menu:)) And here is my JS code: /* menu handler */ $(document).ready(functio... | TITLE:
Need jQuery selector for <ul> inside a hovered <li>
QUESTION:
Here is my XHTML code: Category 1 Category 2 Link 1 Link 2 Link 3 Category 3 Link Link Category 4 Actually, I want to make a menu with hover interaction to show sub links. (anyway, a standard menu:)) And here is my JS code: /* menu handler */ $(docum... | [
"jquery",
"jquery-selectors"
] | 3 | 3 | 5,003 | 2 | 0 | 2011-06-03T23:49:11.580000 | 2011-06-03T23:51:16.073000 |
6,233,707 | 6,233,724 | forking and pid | The code: int main(void) { printf("pid: %d\n", getpid()); pid = fork();
if (pid < 0) { fprintf(stderr, "Fork Failed!"); exit(-1); } else if (pid == 0) { execv("sum", argv); } else { printf(" pid: %d\n", pid); wait(NULL); } } The output: pid: 280 pid: 281 The question: Why are the two pid's different. I thought they sh... | RETURN VALUE On success, the PID of the child process is returned in the parent, and 0 is returned in the child. On failure, -1 is returned in the parent, no child process is created, and errno is set appropriately. So, in the parent process, fork() returns the pid of the child process that was created. | forking and pid The code: int main(void) { printf("pid: %d\n", getpid()); pid = fork();
if (pid < 0) { fprintf(stderr, "Fork Failed!"); exit(-1); } else if (pid == 0) { execv("sum", argv); } else { printf(" pid: %d\n", pid); wait(NULL); } } The output: pid: 280 pid: 281 The question: Why are the two pid's different. I... | TITLE:
forking and pid
QUESTION:
The code: int main(void) { printf("pid: %d\n", getpid()); pid = fork();
if (pid < 0) { fprintf(stderr, "Fork Failed!"); exit(-1); } else if (pid == 0) { execv("sum", argv); } else { printf(" pid: %d\n", pid); wait(NULL); } } The output: pid: 280 pid: 281 The question: Why are the two ... | [
"c",
"linux",
"fork"
] | 2 | 10 | 254 | 2 | 0 | 2011-06-03T23:51:53.483000 | 2011-06-03T23:55:00.173000 |
6,233,709 | 6,236,223 | check occupied grid-elements | I created a visual grid of sprites which are stored in an Array1. Some of those sprites got an image placed on it. Now I would like to drag another image on an empty grid-element. Special case: Several images are dragged at the same time for being placed. Therefore a drag-container holds also an Array2 of those dragged... | Let's make a boolean array (let's cal it boolarr ), containing true on i-th place if i-th Sprite of a grid already has an image. otherwise boolarr[i] is false. You should store boolarr in grid class, and change it each time images are added. So, here's possible solution. We drop several images on i -th place. Let's fin... | check occupied grid-elements I created a visual grid of sprites which are stored in an Array1. Some of those sprites got an image placed on it. Now I would like to drag another image on an empty grid-element. Special case: Several images are dragged at the same time for being placed. Therefore a drag-container holds al... | TITLE:
check occupied grid-elements
QUESTION:
I created a visual grid of sprites which are stored in an Array1. Some of those sprites got an image placed on it. Now I would like to drag another image on an empty grid-element. Special case: Several images are dragged at the same time for being placed. Therefore a drag-... | [
"actionscript-3",
"grid"
] | 1 | 0 | 172 | 1 | 0 | 2011-06-03T23:52:29.880000 | 2011-06-04T10:36:50.087000 |
6,233,711 | 6,233,887 | How to make maven-surefire-plugin work with TestNG in Eclipse | I cannot make these two work together in eclipse I can set up surefire plugin like this ${basedir}/src/test/resources/testng.xml ${project.basedir}/src/test/java **/*.* ${project.basedir}/src/test/resources **/* and run $mvn test and all resources are compiled and moved into /target/test-classes, which works fine. But ... | testResources & resources is part of maven-resources-plugin compile & test-compile is part of maven-compiler-plugin So that all you have to do is to click a button that invokes all these phases & goals before you run tests via TestNG view compile test-compile maven-resources-plugin:resources maven-resources-plugin:test... | How to make maven-surefire-plugin work with TestNG in Eclipse I cannot make these two work together in eclipse I can set up surefire plugin like this ${basedir}/src/test/resources/testng.xml ${project.basedir}/src/test/java **/*.* ${project.basedir}/src/test/resources **/* and run $mvn test and all resources are compil... | TITLE:
How to make maven-surefire-plugin work with TestNG in Eclipse
QUESTION:
I cannot make these two work together in eclipse I can set up surefire plugin like this ${basedir}/src/test/resources/testng.xml ${project.basedir}/src/test/java **/*.* ${project.basedir}/src/test/resources **/* and run $mvn test and all re... | [
"java",
"maven",
"testng",
"maven-surefire-plugin"
] | 1 | 1 | 3,331 | 1 | 0 | 2011-06-03T23:52:51.890000 | 2011-06-04T00:33:39.653000 |
6,233,714 | 6,234,474 | Injecting Redirect JS in Chrome extension. Fail! :( | I'm trying to generate an extension that keeps my brother of facebook. So I decided i'll redirect all facebook links to google for starters. This is how i went about it. My manifest.json file: {
"name": "FBRehab" "version": "1.0", "description": "Redirect FB", "permissions": [ "tabs", "http://www.facebook.com/*", "htt... | Remember a Background Page runs exactly once in Chrome, it is a single long running script that runs exactly once. Basically what your code does now is that once your browser loads, it will inject jquery and try Content Scripts to the current tab. You have no tabs that are currently loaded (which it will fail unless yo... | Injecting Redirect JS in Chrome extension. Fail! :( I'm trying to generate an extension that keeps my brother of facebook. So I decided i'll redirect all facebook links to google for starters. This is how i went about it. My manifest.json file: {
"name": "FBRehab" "version": "1.0", "description": "Redirect FB", "permi... | TITLE:
Injecting Redirect JS in Chrome extension. Fail! :(
QUESTION:
I'm trying to generate an extension that keeps my brother of facebook. So I decided i'll redirect all facebook links to google for starters. This is how i went about it. My manifest.json file: {
"name": "FBRehab" "version": "1.0", "description": "Re... | [
"javascript",
"google-chrome",
"google-chrome-extension"
] | 1 | 2 | 731 | 3 | 0 | 2011-06-03T23:53:15.357000 | 2011-06-04T03:16:26.030000 |
6,233,719 | 6,233,771 | Sql Select top 2 , bottom 2 and 6 random records | How to select top 2, bottom 2 and 6 random (not in Top 2 and Bottom 2) records of the table using one SQL select query? | In MS SQL 2005/2008: with cte as ( select row_number() over (order by name) RowNumber, row_number() over (order by newid()) RandomOrder, count(*) over() Total, * from sys.tables ) select * from cte where RowNumber <= 2 or Total - RowNumber + 1 <= 2 union all select * from ( select top 6 * from cte where RowNumber > 2 a... | Sql Select top 2 , bottom 2 and 6 random records How to select top 2, bottom 2 and 6 random (not in Top 2 and Bottom 2) records of the table using one SQL select query? | TITLE:
Sql Select top 2 , bottom 2 and 6 random records
QUESTION:
How to select top 2, bottom 2 and 6 random (not in Top 2 and Bottom 2) records of the table using one SQL select query?
ANSWER:
In MS SQL 2005/2008: with cte as ( select row_number() over (order by name) RowNumber, row_number() over (order by newid()) ... | [
"sql",
"sql-server",
"sql-server-2005",
"t-sql"
] | 3 | 3 | 5,171 | 3 | 0 | 2011-06-03T23:54:05.300000 | 2011-06-04T00:04:58.897000 |
6,233,722 | 6,235,852 | Vim Scripting: Count lines that match expression, and fold | I am currently developing a plugin for Vim for managing checklists. I am currently using ":setlocal foldmethod=indent" in a syntax file to handle all of the folding within each checklist document. However, I'd like to create a function for folding that is more flexible, and will not rely on the indentation of the line ... | Well, it seems like I found a solution. I ended up using this: setlocal foldlevel=0 setlocal foldmethod=expr setlocal foldexpr=FoldLevel(v:lnum)
function! FoldLevel(linenum) let linetext = getline(a:linenum) let level = indent(a:linenum) / 4 if linetext =~ '^\s*[\*|×]' let level = 20 endif return level endfunction | Vim Scripting: Count lines that match expression, and fold I am currently developing a plugin for Vim for managing checklists. I am currently using ":setlocal foldmethod=indent" in a syntax file to handle all of the folding within each checklist document. However, I'd like to create a function for folding that is more ... | TITLE:
Vim Scripting: Count lines that match expression, and fold
QUESTION:
I am currently developing a plugin for Vim for managing checklists. I am currently using ":setlocal foldmethod=indent" in a syntax file to handle all of the folding within each checklist document. However, I'd like to create a function for fol... | [
"vim",
"plugins",
"scripting",
"loops",
"folding"
] | 2 | 1 | 566 | 2 | 0 | 2011-06-03T23:54:51.920000 | 2011-06-04T09:13:01.527000 |
6,233,731 | 6,233,921 | Doubts about the use of polymorphism, and also about how is polymorphism related to casting? | I give lessons on the fundamentals of the Java programming language, to students who study this subject in college. Today one of them got me really confused with her question, so I told her to give me just a day to think about the problem, and I'll give her as accurate of an answer as I can. She told me that the teache... | In your above example, there is no need to call makeItClimbToATree (new Hippopotamus ()); It could be easily avoided, if makeItClimbToATree wouldn't expect an animal, but something more specific, which is really able to climb a tree. The necessity to allow animals, and therefore to use instanceof, isn't visible. If you... | Doubts about the use of polymorphism, and also about how is polymorphism related to casting? I give lessons on the fundamentals of the Java programming language, to students who study this subject in college. Today one of them got me really confused with her question, so I told her to give me just a day to think about ... | TITLE:
Doubts about the use of polymorphism, and also about how is polymorphism related to casting?
QUESTION:
I give lessons on the fundamentals of the Java programming language, to students who study this subject in college. Today one of them got me really confused with her question, so I told her to give me just a d... | [
"java",
"oop",
"polymorphism",
"instanceof"
] | 6 | 4 | 1,003 | 8 | 0 | 2011-06-03T23:57:18.147000 | 2011-06-04T00:43:13.430000 |
6,233,747 | 6,234,196 | Losing my mind from jquery validate and knockout | I have been trying to do this for months, and months, and months, and months. And I am literally at the point of tears from trying to get Knockout to work for me. I have posts dating back way last year trying to do this. I just simply cannot get validation to work with knockout and asp.net mvc. If I put the $.validator... | I think that the issue is that the unobtrusive library will have already setup validation on the form, so you would actually need to go in and set the submitHandler like: // attach the jquery unobtrusive validator $.validator.unobtrusive.parse("#__frmAspect");
// bind the submit handler to unobtrusive validation. $("#... | Losing my mind from jquery validate and knockout I have been trying to do this for months, and months, and months, and months. And I am literally at the point of tears from trying to get Knockout to work for me. I have posts dating back way last year trying to do this. I just simply cannot get validation to work with k... | TITLE:
Losing my mind from jquery validate and knockout
QUESTION:
I have been trying to do this for months, and months, and months, and months. And I am literally at the point of tears from trying to get Knockout to work for me. I have posts dating back way last year trying to do this. I just simply cannot get validat... | [
"json",
"asp.net-mvc-3",
"jquery-validate",
"knockout.js"
] | 11 | 14 | 4,562 | 1 | 0 | 2011-06-04T00:00:22.247000 | 2011-06-04T01:55:56.053000 |
6,233,752 | 6,233,826 | Why does the following jQuery function fire twice? | I have the following in my (document).ready function: replace_fav_url(); and the jQuery function: function replace_fav_url(){ $j('a.fav').click(function(e) { $j.post($j(this).attr('href')); e.preventDefault(); }); } Everything works good with the exception that function seems to be called twice? 1 click two function ca... | I'm only guessing this is the problem, but if you call the replace_fav_url() function more than once, it will bind an additional click event to a.fav. And will continue to do so each time you call it. If you change the number of a.fav elements in any way, it would be better to use delegate() or live() to bind a click e... | Why does the following jQuery function fire twice? I have the following in my (document).ready function: replace_fav_url(); and the jQuery function: function replace_fav_url(){ $j('a.fav').click(function(e) { $j.post($j(this).attr('href')); e.preventDefault(); }); } Everything works good with the exception that functio... | TITLE:
Why does the following jQuery function fire twice?
QUESTION:
I have the following in my (document).ready function: replace_fav_url(); and the jQuery function: function replace_fav_url(){ $j('a.fav').click(function(e) { $j.post($j(this).attr('href')); e.preventDefault(); }); } Everything works good with the exce... | [
"jquery"
] | 0 | 3 | 1,309 | 1 | 0 | 2011-06-04T00:01:02.123000 | 2011-06-04T00:18:31.490000 |
6,233,755 | 6,234,001 | RubyMine Support for SASS | I'm wondering if anyone has managed to integrate SASS into their RubyMine environment, and if so, how they managed to configure it? I'm a little confused, because although there is a SASS plugin by default in RubyMine, I don't seem to be able to use SCSS files in my project. Presently what I do is open up a Terminal wi... | OK, 45 minutes of experimentation later and it's all figured out. First, you need to know the EXACT command you intend on running in SASS, so if you plan to monitor multiple directories or something else using multiple arguments, test it in a command line for functionality first. Then: Click menu Run / Edit Configurati... | RubyMine Support for SASS I'm wondering if anyone has managed to integrate SASS into their RubyMine environment, and if so, how they managed to configure it? I'm a little confused, because although there is a SASS plugin by default in RubyMine, I don't seem to be able to use SCSS files in my project. Presently what I d... | TITLE:
RubyMine Support for SASS
QUESTION:
I'm wondering if anyone has managed to integrate SASS into their RubyMine environment, and if so, how they managed to configure it? I'm a little confused, because although there is a SASS plugin by default in RubyMine, I don't seem to be able to use SCSS files in my project. ... | [
"ruby-on-rails",
"ruby",
"sass",
"rubymine"
] | 1 | 4 | 952 | 1 | 0 | 2011-06-04T00:01:53.963000 | 2011-06-04T01:05:16.163000 |
6,233,762 | 6,234,542 | Comet protocol and Django - I know some options but I can't seem to make them WORK | I'm very interested in making real-time web apps with Django. Unfortunately, I'm having more than a little bit of problem with setting things up. Some options I'm considering: Orbited: Seems to be the choice for Django. Unfortunately, their domains have seemingly expired, and with it pretty much all of the documentatio... | To do real-time web apps using comet techniques (or websocket) you need a server that can handle long-lived connections and a javascript client. Most of the comet libraries give you both (APE, orbited, etc). Working with websockets seems preferable to me, it's part of HTML5, the client code is really simple to implemen... | Comet protocol and Django - I know some options but I can't seem to make them WORK I'm very interested in making real-time web apps with Django. Unfortunately, I'm having more than a little bit of problem with setting things up. Some options I'm considering: Orbited: Seems to be the choice for Django. Unfortunately, th... | TITLE:
Comet protocol and Django - I know some options but I can't seem to make them WORK
QUESTION:
I'm very interested in making real-time web apps with Django. Unfortunately, I'm having more than a little bit of problem with setting things up. Some options I'm considering: Orbited: Seems to be the choice for Django.... | [
"python",
"django",
"comet"
] | 4 | 5 | 1,081 | 2 | 0 | 2011-06-04T00:03:35.370000 | 2011-06-04T03:41:32.960000 |
6,233,766 | 6,254,740 | My calender has something wrong with the current day and events | How are you all my friends, after a very hard time I got this calender but there was things I can't resolve it down there. please I need some one to tell me whats wrong with this code as there is something wrong with the current day it should have a different color and the same with the events if there is any and the l... | first of all thanks for the good answers that I got, it was really very helpful for me this is the last code I have put it for this calender. calender query ($inserEvent) or die ("$db->error");
if (isset($result)) {
echo "Event added successfully... $eventTitle";
}else{
echo "Event Faild to add";
} }?> Sun Mon Tue... | My calender has something wrong with the current day and events How are you all my friends, after a very hard time I got this calender but there was things I can't resolve it down there. please I need some one to tell me whats wrong with this code as there is something wrong with the current day it should have a differ... | TITLE:
My calender has something wrong with the current day and events
QUESTION:
How are you all my friends, after a very hard time I got this calender but there was things I can't resolve it down there. please I need some one to tell me whats wrong with this code as there is something wrong with the current day it sh... | [
"php",
"javascript",
"mysqli"
] | 0 | 0 | 222 | 1 | 0 | 2011-06-04T00:04:27.060000 | 2011-06-06T15:59:08.603000 |
6,233,772 | 6,233,794 | My List in Java is coming out null, instantiating it doesn't seem to work... help? | Searched around the site and google nothing seems to come in for what I'm sure is a super simple problem. So I have a list I declare like so: private List mList; When I try to do a method on it like mList.add(...); it doesn't work, returns a null pointer exception. I tried to instantiate the List like so: public Class(... | A variable must be initialized before it can be used. Otherwise it is null and you get NullPointerExceptions. Java has interfaces, which are like classes with only methods defined. However you cannot create real objects from them. They just serve to define the contract. java.util.List is such an interface. You have to ... | My List in Java is coming out null, instantiating it doesn't seem to work... help? Searched around the site and google nothing seems to come in for what I'm sure is a super simple problem. So I have a list I declare like so: private List mList; When I try to do a method on it like mList.add(...); it doesn't work, retur... | TITLE:
My List in Java is coming out null, instantiating it doesn't seem to work... help?
QUESTION:
Searched around the site and google nothing seems to come in for what I'm sure is a super simple problem. So I have a list I declare like so: private List mList; When I try to do a method on it like mList.add(...); it d... | [
"java",
"list"
] | 1 | 5 | 936 | 4 | 0 | 2011-06-04T00:05:29.010000 | 2011-06-04T00:10:22.367000 |
6,233,774 | 6,233,851 | SemaphoreSlim.Wait( CancellationToken ) proper try/finally for OperationCancelledException? | How should I structure the try/finally when using a SemaphorSlim with cancellation token so that OperationCancelledException is handled correctly? In Option A, cancelling the token source throws OperationCancelledException but does not call Release(). In Option B, cancelling the token source throws OperationCancelledEx... | Option A is more correct here. You do not need to Release the SemaphoreSlim when you cancel, as you never actually acquire and increment its count. As such, you don't want to release unless your Wait call actually succeeded. From this MSDN Page on using Semaphore and SemaphoreSlim: It is the programmer's responsibility... | SemaphoreSlim.Wait( CancellationToken ) proper try/finally for OperationCancelledException? How should I structure the try/finally when using a SemaphorSlim with cancellation token so that OperationCancelledException is handled correctly? In Option A, cancelling the token source throws OperationCancelledException but d... | TITLE:
SemaphoreSlim.Wait( CancellationToken ) proper try/finally for OperationCancelledException?
QUESTION:
How should I structure the try/finally when using a SemaphorSlim with cancellation token so that OperationCancelledException is handled correctly? In Option A, cancelling the token source throws OperationCancel... | [
".net",
"multithreading",
".net-4.0",
"semaphore"
] | 9 | 9 | 1,895 | 2 | 0 | 2011-06-04T00:05:48.127000 | 2011-06-04T00:25:58.480000 |
6,233,775 | 6,233,882 | How do I make eclipse print out weird characters in unicode? | So I'm trying to make my program output a text file with a list of names. Some of the names have weird characters, such as Åström. I have grabbed these list of names from a webpage that is encoded in "UTF-8", or at least I'm pretty sure it does because the page source says " meta http-equiv="Content-Type" content="text... | Set your Eclipse > Preferences > General > Workspace > Text file encoding to UTF-8. | How do I make eclipse print out weird characters in unicode? So I'm trying to make my program output a text file with a list of names. Some of the names have weird characters, such as Åström. I have grabbed these list of names from a webpage that is encoded in "UTF-8", or at least I'm pretty sure it does because the pa... | TITLE:
How do I make eclipse print out weird characters in unicode?
QUESTION:
So I'm trying to make my program output a text file with a list of names. Some of the names have weird characters, such as Åström. I have grabbed these list of names from a webpage that is encoded in "UTF-8", or at least I'm pretty sure it d... | [
"java",
"eclipse",
"unicode",
"special-characters"
] | 7 | 20 | 13,008 | 3 | 0 | 2011-06-04T00:05:48.387000 | 2011-06-04T00:32:42.120000 |
6,233,780 | 6,233,823 | How to tell version of .NET used for a delivered project with no project or solution file? | I have a friend who was handed off a C#/.NET web project from a departed employee. The project had no project file or solution file, but did have the full contents of files, including code behind files. We know that it was built using.NET 2.0 or higher because of some things found in the web.config file. But this raise... | You can't reliably tell which version the code was written for, since (most) code written using only features of an earlier version compiles under newer versions. What you can do though is to try to build the project under different versions of the runtime, which is as close as you can get, I think. Also, the whole.Net... | How to tell version of .NET used for a delivered project with no project or solution file? I have a friend who was handed off a C#/.NET web project from a departed employee. The project had no project file or solution file, but did have the full contents of files, including code behind files. We know that it was built ... | TITLE:
How to tell version of .NET used for a delivered project with no project or solution file?
QUESTION:
I have a friend who was handed off a C#/.NET web project from a departed employee. The project had no project file or solution file, but did have the full contents of files, including code behind files. We know ... | [
".net",
"version"
] | 2 | 2 | 1,171 | 2 | 0 | 2011-06-04T00:07:31.940000 | 2011-06-04T00:16:48.863000 |
6,233,792 | 6,234,314 | DLR LambdaExpressions and the System.Runtime.CompilerServices.Closure object | I'm working on a small programming language for the Microsoft DLR, and having a bit of a problem invoking my anonymous methods. Specifically, the code: Delegate CompiledBody = Expression.Lambda(rt.Parser.ParseSingle(Body), parms).Compile(); So, parms is an array containing a single ParameterExpression, and the first ar... | It would be helpful if you could share the body that you're compiling as that would contain the actual closure and how you're invoking it. My guess is that you are attempting to invoke the resulting delegate "by hand" somehow instead of holding onto something of the delegate object and simply generating an Invoke expre... | DLR LambdaExpressions and the System.Runtime.CompilerServices.Closure object I'm working on a small programming language for the Microsoft DLR, and having a bit of a problem invoking my anonymous methods. Specifically, the code: Delegate CompiledBody = Expression.Lambda(rt.Parser.ParseSingle(Body), parms).Compile(); So... | TITLE:
DLR LambdaExpressions and the System.Runtime.CompilerServices.Closure object
QUESTION:
I'm working on a small programming language for the Microsoft DLR, and having a bit of a problem invoking my anonymous methods. Specifically, the code: Delegate CompiledBody = Expression.Lambda(rt.Parser.ParseSingle(Body), pa... | [
"c#",
"compiler-construction",
"closures",
"dynamic-language-runtime"
] | 4 | 3 | 1,519 | 1 | 0 | 2011-06-04T00:10:04.163000 | 2011-06-04T02:28:23.463000 |
6,233,798 | 6,234,452 | Different NSIS UAC Plugin | I made an NSIS installer that uses a UAC plugin awhile back. Now I am trying to build this installer on a new (Windows 7) machine. I have installed NSIS, and this UAC plugin, but when I try to compile my script, I get this error: Invalid command: ${UAC.I.Elevate.AdminOnly} At that point, I tried the older version of th... | That is an old macro, you would have to go back to v0.0.x ( v0.0.11d is probably the last version that supports it) | Different NSIS UAC Plugin I made an NSIS installer that uses a UAC plugin awhile back. Now I am trying to build this installer on a new (Windows 7) machine. I have installed NSIS, and this UAC plugin, but when I try to compile my script, I get this error: Invalid command: ${UAC.I.Elevate.AdminOnly} At that point, I tri... | TITLE:
Different NSIS UAC Plugin
QUESTION:
I made an NSIS installer that uses a UAC plugin awhile back. Now I am trying to build this installer on a new (Windows 7) machine. I have installed NSIS, and this UAC plugin, but when I try to compile my script, I get this error: Invalid command: ${UAC.I.Elevate.AdminOnly} At... | [
"uac",
"nsis"
] | 1 | 3 | 1,270 | 1 | 0 | 2011-06-04T00:10:58.097000 | 2011-06-04T03:08:29.700000 |
6,233,806 | 6,233,896 | Upload file does not work - cURL & PHP | My code to upload the file on the REMOTE server doesn't seem to be working. When uploading the file from the browser at the link, all the contents of csv file is committed to the database. Here is the code: function postToDB() { $fp = fopen('./errorLog.txt', 'w+'); $csvFile = fopen('./myFile.csv', 'r'); $url="http://ab... | This is because your submitting the raw CSV data, and its not encoded into field=value pairs as form post data is. The easiest way to deal with this is on the server to just use: $csvfile = file_get_contents("php//input"); | Upload file does not work - cURL & PHP My code to upload the file on the REMOTE server doesn't seem to be working. When uploading the file from the browser at the link, all the contents of csv file is committed to the database. Here is the code: function postToDB() { $fp = fopen('./errorLog.txt', 'w+'); $csvFile = fope... | TITLE:
Upload file does not work - cURL & PHP
QUESTION:
My code to upload the file on the REMOTE server doesn't seem to be working. When uploading the file from the browser at the link, all the contents of csv file is committed to the database. Here is the code: function postToDB() { $fp = fopen('./errorLog.txt', 'w+'... | [
"php",
"curl"
] | 0 | 1 | 1,036 | 1 | 0 | 2011-06-04T00:12:49.387000 | 2011-06-04T00:36:39.313000 |
6,233,807 | 6,234,517 | problem with UISlider : printing values of the slider and getting to change the style | I am facing some problem with UISlider programming. 1) style: I know we have to set the minimum and maximum images. I am just not sure what images and any image reference will be great? I only want to change from blue to black! 2) also, my code for the UISlider is this: in header file: UISlider *slider; in code file: /... | For part 1, to replace the default blue part of the slider track with black, you could take a snapshot of the default blue track and convert it to a darker grayscale like this (only need the left end and 1 pixel of the stretchable part): and call setMinimumTrackImage:forState:: UIImage *minTrackImg = [[UIImage imageNam... | problem with UISlider : printing values of the slider and getting to change the style I am facing some problem with UISlider programming. 1) style: I know we have to set the minimum and maximum images. I am just not sure what images and any image reference will be great? I only want to change from blue to black! 2) als... | TITLE:
problem with UISlider : printing values of the slider and getting to change the style
QUESTION:
I am facing some problem with UISlider programming. 1) style: I know we have to set the minimum and maximum images. I am just not sure what images and any image reference will be great? I only want to change from blu... | [
"ios",
"uislider"
] | 3 | 2 | 1,947 | 1 | 0 | 2011-06-04T00:12:59.683000 | 2011-06-04T03:35:03.820000 |
6,233,810 | 6,233,917 | JavaScript prototype problem | If I call myRobot.Speak.sayHi() it always returns undefined. Please, what am I doing wrong? Thanks for reply! var Factory = (function() {
// Constructor var Robot = function() {
};
// Public return { extendRobot: function(power, methods) { Robot.prototype[power] = methods; }, createRobot: function() { return new Rob... | createRobot: function() { var r = new Robot(); for (var k in r.Speak) { if (typeof r.Speak[k] === "function") { r.Speak[k] = r.speak[k].bind(r); } } return r; } Rather then returning a new robot, make sure to bind all the methods in your powers to the robot. To avoid hard coding in the loops try this: Robot.powers = []... | JavaScript prototype problem If I call myRobot.Speak.sayHi() it always returns undefined. Please, what am I doing wrong? Thanks for reply! var Factory = (function() {
// Constructor var Robot = function() {
};
// Public return { extendRobot: function(power, methods) { Robot.prototype[power] = methods; }, createRobot... | TITLE:
JavaScript prototype problem
QUESTION:
If I call myRobot.Speak.sayHi() it always returns undefined. Please, what am I doing wrong? Thanks for reply! var Factory = (function() {
// Constructor var Robot = function() {
};
// Public return { extendRobot: function(power, methods) { Robot.prototype[power] = metho... | [
"javascript"
] | 0 | 2 | 248 | 3 | 0 | 2011-06-04T00:14:43.357000 | 2011-06-04T00:41:49.117000 |
6,233,815 | 6,234,528 | Twitter api authorization of my application | I am using this twitter api library and so far everything is great. My problem (well not really a problem more a user experience) is that every time you want to sign in with twitter you need to open a popup. Right now the flow is this: User clicks on the sign in with twitter logo on my page. Javascript induced popup co... | Try using the " Sign in with Twitter " flow. If the user is already authenticated, it's a one click operation. The linked doc above has a flowchart and description of the process, but I'll list the steps here (with emphasis added ) as well, and link in the relevant API pages: "Sign in with Twitter" is the pattern of au... | Twitter api authorization of my application I am using this twitter api library and so far everything is great. My problem (well not really a problem more a user experience) is that every time you want to sign in with twitter you need to open a popup. Right now the flow is this: User clicks on the sign in with twitter ... | TITLE:
Twitter api authorization of my application
QUESTION:
I am using this twitter api library and so far everything is great. My problem (well not really a problem more a user experience) is that every time you want to sign in with twitter you need to open a popup. Right now the flow is this: User clicks on the sig... | [
"php",
"javascript",
"jquery",
"twitter"
] | 6 | 3 | 1,957 | 2 | 0 | 2011-06-04T00:15:56.810000 | 2011-06-04T03:37:50.910000 |
6,233,822 | 6,233,952 | android camera preview with textview | I have camera preview on my android app but when I add an 'id' to the TextView in the xml then the app no longer runs. Are you not allowed to have a textview with an id? I need this because I would like the text to change on screen while having the camera preview? main.xml control.xml main.java: package com.example.and... | as I can see in the xml you give the textview id as "textview" and in code you take it by R.id.mind Did you changed the code here or its the code that you have? | android camera preview with textview I have camera preview on my android app but when I add an 'id' to the TextView in the xml then the app no longer runs. Are you not allowed to have a textview with an id? I need this because I would like the text to change on screen while having the camera preview? main.xml control.x... | TITLE:
android camera preview with textview
QUESTION:
I have camera preview on my android app but when I add an 'id' to the TextView in the xml then the app no longer runs. Are you not allowed to have a textview with an id? I need this because I would like the text to change on screen while having the camera preview? ... | [
"android",
"camera",
"textview",
"preview"
] | 0 | 1 | 3,765 | 2 | 0 | 2011-06-04T00:16:30.357000 | 2011-06-04T00:52:16.020000 |
6,233,832 | 6,234,568 | Easy way for accessing memcached from node.js | I want to know if there is a good driver or native implementation to connect node.js directly to memcached. | Use the search on: https://npmjs.org/ If you don't have npm, install it. On the cli: npm search memcache Brings up 5 modules. This seems to be the most popular: https://github.com/3rd-Eden/node-memcached | Easy way for accessing memcached from node.js I want to know if there is a good driver or native implementation to connect node.js directly to memcached. | TITLE:
Easy way for accessing memcached from node.js
QUESTION:
I want to know if there is a good driver or native implementation to connect node.js directly to memcached.
ANSWER:
Use the search on: https://npmjs.org/ If you don't have npm, install it. On the cli: npm search memcache Brings up 5 modules. This seems to... | [
"node.js",
"memcached"
] | 28 | 32 | 34,851 | 3 | 0 | 2011-06-04T00:19:27.353000 | 2011-06-04T03:52:17.660000 |
6,233,837 | 6,234,093 | How to tell (programmatically) if there are / are not any registered apps that support opening a specific document type? | Apple's documentation for UIDocumentInteractionController presentOpenInMenuFromBarButtonItem:animated: method states that "If there are no registered apps that support opening the document, the document interaction controller does not display a menu." In my app I want to display a button if and only if there is an app ... | OK, more research reveals a stackoverflow user frenchkiss-dev has a solution - derived from reading the docs more carefully than me and some lateral thinking. My code below, based on frenchkiss-dev's answer, sits in a ViewDidAppear method and disables my button if opening and then closing the open file menu (without an... | How to tell (programmatically) if there are / are not any registered apps that support opening a specific document type? Apple's documentation for UIDocumentInteractionController presentOpenInMenuFromBarButtonItem:animated: method states that "If there are no registered apps that support opening the document, the docum... | TITLE:
How to tell (programmatically) if there are / are not any registered apps that support opening a specific document type?
QUESTION:
Apple's documentation for UIDocumentInteractionController presentOpenInMenuFromBarButtonItem:animated: method states that "If there are no registered apps that support opening the d... | [
"iphone",
"ios",
"uti"
] | 6 | 11 | 3,671 | 2 | 0 | 2011-06-04T00:22:08.493000 | 2011-06-04T01:31:21.903000 |
6,233,841 | 6,233,891 | How to implement "Refresh" and "Reload" Table (re-factoring of code) | I have the following situation: 1) 1 X PhotoTableViewController to display a list of photos (one photo per cell) like what Instagram does 2) A refresh button in the navbar of PhotoTableViewController to do a table reload (top right) 3) An option button in the navbar of PhotoTableViewController to select a list of optio... | You are correct that they all essentially have the same behavior. I would say that you implement a cursor type of backend call so that you can pass in the next result number you want or the next page you want. That is up to you, but here's a sample. { "cursor": { "currentPageIndex":0, "estimatedNumberOfHits":351, "page... | How to implement "Refresh" and "Reload" Table (re-factoring of code) I have the following situation: 1) 1 X PhotoTableViewController to display a list of photos (one photo per cell) like what Instagram does 2) A refresh button in the navbar of PhotoTableViewController to do a table reload (top right) 3) An option butto... | TITLE:
How to implement "Refresh" and "Reload" Table (re-factoring of code)
QUESTION:
I have the following situation: 1) 1 X PhotoTableViewController to display a list of photos (one photo per cell) like what Instagram does 2) A refresh button in the navbar of PhotoTableViewController to do a table reload (top right) ... | [
"objective-c",
"cocoa-touch",
"ios",
"uitableview"
] | 2 | 2 | 1,061 | 3 | 0 | 2011-06-04T00:24:31.427000 | 2011-06-04T00:35:25.773000 |
6,233,844 | 6,234,676 | How to display a separate text in UITexview other than its text? | In my app i have to display some other text with the text of UITextView i text view. For ex: I want to display the today's date first and then i will start adding the content on UITextView. all the data is coming from xml's and i have different NSSet's containing these values. Thanks | Very simple. If you have text in your text view and than create 1 date Variable and convert it to NSString. And use following assignment to have your goal finished. yourTextView.text = [NSString stringWithFormat:"%@ %@",yourStringDateVariable,yourTextView.text]; Does this make sense? | How to display a separate text in UITexview other than its text? In my app i have to display some other text with the text of UITextView i text view. For ex: I want to display the today's date first and then i will start adding the content on UITextView. all the data is coming from xml's and i have different NSSet's co... | TITLE:
How to display a separate text in UITexview other than its text?
QUESTION:
In my app i have to display some other text with the text of UITextView i text view. For ex: I want to display the today's date first and then i will start adding the content on UITextView. all the data is coming from xml's and i have di... | [
"objective-c",
"ipad",
"uitextview"
] | 0 | 0 | 128 | 3 | 0 | 2011-06-04T00:24:50.577000 | 2011-06-04T04:24:51.983000 |
6,233,847 | 6,233,871 | Is there a field in django that can have multiple foreign key fields? | Is there a field in django that can have multiple foreign key fields? I have the following code: from django.db import models from django.auth.models import * class Wish(Model): name = CharField(max_length=128) cost = IntegerField() person = ForeignKey(Person) date = DateField('Date Wished') comments = CharField(max_le... | Try using the ManyToMany field. Note that ManyToMany to the same model, is assumed to be symmetrical - if Person A is a friend of Person B, then Person B will also be a friend of Person A. You can specify symmetrical=False to avoid that. | Is there a field in django that can have multiple foreign key fields? Is there a field in django that can have multiple foreign key fields? I have the following code: from django.db import models from django.auth.models import * class Wish(Model): name = CharField(max_length=128) cost = IntegerField() person = ForeignK... | TITLE:
Is there a field in django that can have multiple foreign key fields?
QUESTION:
Is there a field in django that can have multiple foreign key fields? I have the following code: from django.db import models from django.auth.models import * class Wish(Model): name = CharField(max_length=128) cost = IntegerField()... | [
"python",
"django",
"foreign-keys",
"models"
] | 1 | 4 | 2,532 | 2 | 0 | 2011-06-04T00:25:14.967000 | 2011-06-04T00:30:32.623000 |
6,233,860 | 6,233,937 | Accessing properties x and y of CCSprite from NSMutableArray | If I have a sprite in a NSMutableArray of sprites in Cocos2d and need to access the x and y values of a specific sprite how can I do that? [array objectAtIndex:0].position.y // or.x for x value doesn't work when trying to access the element of y from a specific sprite in the array. But, I can not think of any other way... | You need to cast the value returned by -[NSArray objectAtIndex:] so the compiler knows it’s a CCSprite * object: ((CCSprite *)[array objectAtIndex:0]).position.y; Alternatively, you could store the return value in a CCSprite * variable: CCSprite *sprite = [array objectAtIndex:0]; and then use this variable to obtain th... | Accessing properties x and y of CCSprite from NSMutableArray If I have a sprite in a NSMutableArray of sprites in Cocos2d and need to access the x and y values of a specific sprite how can I do that? [array objectAtIndex:0].position.y // or.x for x value doesn't work when trying to access the element of y from a specif... | TITLE:
Accessing properties x and y of CCSprite from NSMutableArray
QUESTION:
If I have a sprite in a NSMutableArray of sprites in Cocos2d and need to access the x and y values of a specific sprite how can I do that? [array objectAtIndex:0].position.y // or.x for x value doesn't work when trying to access the element ... | [
"iphone",
"cocos2d-iphone",
"nsmutablearray"
] | 0 | 2 | 645 | 1 | 0 | 2011-06-04T00:27:59.497000 | 2011-06-04T00:47:01.337000 |
6,233,863 | 6,233,979 | Pass Ruby Array via Ajax and Parse | I'm working on a Rails project in which I have a somewhat of an odd situation where I need to load a template (via ajax) into an existing page and populate the template with values from a Ruby array sent from that page. Here's my example: Article Page: <% @article = my_article_array.to_json %> Controller: def show @art... | Using JSON to transport you data to the page and back again shouldn't be a problem. If your actual code is anywhere near as messy and buggy as your example then you likely just have a few bugs to squash and are on the right track. | Pass Ruby Array via Ajax and Parse I'm working on a Rails project in which I have a somewhat of an odd situation where I need to load a template (via ajax) into an existing page and populate the template with values from a Ruby array sent from that page. Here's my example: Article Page: <% @article = my_article_array.t... | TITLE:
Pass Ruby Array via Ajax and Parse
QUESTION:
I'm working on a Rails project in which I have a somewhat of an odd situation where I need to load a template (via ajax) into an existing page and populate the template with values from a Ruby array sent from that page. Here's my example: Article Page: <% @article = ... | [
"javascript",
"jquery",
"ruby-on-rails",
"ruby",
"ajax"
] | 0 | 0 | 1,038 | 1 | 0 | 2011-06-04T00:28:07.133000 | 2011-06-04T00:59:41.960000 |
6,233,872 | 6,234,373 | overlay on clickable region - CSS | Is there a way I can have a partially transparent image (or anything really) overlay a clickable region using XHTML and CSS? | @thirtydot If you know of a solution that works in only one browser I still would love to here it! Although the more support the better. You can use pointer-events: none. Browser support: http://caniuse.com/pointer-events (works everywhere except IE10 and older) http://jsfiddle.net/QC5Yw/ | overlay on clickable region - CSS Is there a way I can have a partially transparent image (or anything really) overlay a clickable region using XHTML and CSS? | TITLE:
overlay on clickable region - CSS
QUESTION:
Is there a way I can have a partially transparent image (or anything really) overlay a clickable region using XHTML and CSS?
ANSWER:
@thirtydot If you know of a solution that works in only one browser I still would love to here it! Although the more support the bette... | [
"html",
"css"
] | 7 | 9 | 7,517 | 3 | 0 | 2011-06-04T00:30:34.440000 | 2011-06-04T02:46:09.307000 |
6,233,874 | 6,234,497 | Adding Controls to Controls in codebehind | I'm trying to add a span, inside an anchor, inside a dd tag. for some reason this: protected Control MakeDD() { var dd = new HtmlGenericControl("dd"); var link = new HtmlGenericControl("a"); var span = new HtmlGenericControl("span");
link.Controls.Add(span); dd.Controls.Add(link); return dd; } only generates instead o... | Dropping a panel on a page as the container and doing: protected void Page_Load(object sender, EventArgs e) { pnlTest.Controls.Add(MakeDD()); } emits the following on the page: This is asp.net 4 | Adding Controls to Controls in codebehind I'm trying to add a span, inside an anchor, inside a dd tag. for some reason this: protected Control MakeDD() { var dd = new HtmlGenericControl("dd"); var link = new HtmlGenericControl("a"); var span = new HtmlGenericControl("span");
link.Controls.Add(span); dd.Controls.Add(li... | TITLE:
Adding Controls to Controls in codebehind
QUESTION:
I'm trying to add a span, inside an anchor, inside a dd tag. for some reason this: protected Control MakeDD() { var dd = new HtmlGenericControl("dd"); var link = new HtmlGenericControl("a"); var span = new HtmlGenericControl("span");
link.Controls.Add(span); ... | [
"c#",
"asp.net"
] | 0 | 1 | 667 | 2 | 0 | 2011-06-04T00:30:38.353000 | 2011-06-04T03:27:39.537000 |
6,233,877 | 6,233,886 | Where should transaction records go? Flat file or Database | I'm developing a Java Enterprise Application which needs to write transaction records either to flat files or directly to a relational database. Transaction records are records which show when the transaction starts, ends, transaction status (success/failure) and also data unique to this transaction. These transaction ... | If you DO use a flat file, you'll need to worry about locking and flushing and all of that garbage. Furthermore, it can only live in one place which makes it a pain if you ever want the app to scale. Go with the database unless downtime is a REALLY big concern. | Where should transaction records go? Flat file or Database I'm developing a Java Enterprise Application which needs to write transaction records either to flat files or directly to a relational database. Transaction records are records which show when the transaction starts, ends, transaction status (success/failure) a... | TITLE:
Where should transaction records go? Flat file or Database
QUESTION:
I'm developing a Java Enterprise Application which needs to write transaction records either to flat files or directly to a relational database. Transaction records are records which show when the transaction starts, ends, transaction status (... | [
"database",
"java-ee-6",
"flat-file",
"cdr"
] | 0 | 1 | 199 | 1 | 0 | 2011-06-04T00:31:21.973000 | 2011-06-04T00:33:35.677000 |
6,233,879 | 6,233,897 | Move or Named Return Value Optimization (NRVO)? | Lets say we have the following code: std::vector f() { std::vector y;... return y; }
std::vector x =... x = f(); It seems the compiler has two approaches here: (a) NRVO: Destruct x, then construct f() in place of x. (b) Move: Construct f() in temp space, move f() into x, destruct f(). Is the compiler free to use eithe... | The compiler may NRVO into a temp space, or move construct into a temp space. From there it will move assign x. Update: Any time you're tempted to optimize with rvalue references, and you're not positive of the results, create yourself an example class that keeps track of its state: constructed default constructed move... | Move or Named Return Value Optimization (NRVO)? Lets say we have the following code: std::vector f() { std::vector y;... return y; }
std::vector x =... x = f(); It seems the compiler has two approaches here: (a) NRVO: Destruct x, then construct f() in place of x. (b) Move: Construct f() in temp space, move f() into x,... | TITLE:
Move or Named Return Value Optimization (NRVO)?
QUESTION:
Lets say we have the following code: std::vector f() { std::vector y;... return y; }
std::vector x =... x = f(); It seems the compiler has two approaches here: (a) NRVO: Destruct x, then construct f() in place of x. (b) Move: Construct f() in temp space... | [
"c++",
"optimization",
"c++11",
"move-semantics",
"return-value-optimization"
] | 60 | 65 | 29,772 | 1 | 0 | 2011-06-04T00:31:32.947000 | 2011-06-04T00:36:41.410000 |
6,233,888 | 6,234,074 | MKMapView not updating when i call setCoordinate | This is my second question today and the first was an incredibly stupid question so I'm fully expecting this one to be as well. I have a view with an embedded MKMapView. I want to some how be able to get at this MKMapView? Can I connect it up someway in the xib file? Or failing that... can I just extract it directly fr... | In the place that you want to get at it from, set up an outlet. In the.h file, declare a mapview property MKMapView *mapView; then declare its property with an IBOutlet @property (nonatomic, retain) IBOutlet MKMapView *mapView; You should be able to control-drag from File's Owner in your IB file to the mapview in your ... | MKMapView not updating when i call setCoordinate This is my second question today and the first was an incredibly stupid question so I'm fully expecting this one to be as well. I have a view with an embedded MKMapView. I want to some how be able to get at this MKMapView? Can I connect it up someway in the xib file? Or ... | TITLE:
MKMapView not updating when i call setCoordinate
QUESTION:
This is my second question today and the first was an incredibly stupid question so I'm fully expecting this one to be as well. I have a view with an embedded MKMapView. I want to some how be able to get at this MKMapView? Can I connect it up someway in... | [
"iphone",
"objective-c",
"mkmapview",
"xib",
"nib"
] | 0 | 2 | 373 | 3 | 0 | 2011-06-04T00:34:09.633000 | 2011-06-04T01:28:46.293000 |
6,233,893 | 6,233,898 | Naming: WorkspaceViewModelFactory or WorkspaceVMFactory or WorkspaceViewModel_Factory? | According to naming conventions, which one is recommenced? * WorkspaceViewModelFactory * WorkspaceVMFactory * WorkspaceViewModel_Factory * WorkspaceVM_Factory * Workspace_ViewModel_Factory * Workspace_VM_Factory In case that matters: I'm a hobbyist programmer, I'm the only one who has to read my code. | The first one WorkspaceViewModelFactory. Quote #1 from Capitalization Conventions When an identifier consists of multiple words, do not use separators, such as underscores ("_") or hyphens ("-"), between words. Instead, use casing to indicate the beginning of each word. This rules out all the options that have _. Quote... | Naming: WorkspaceViewModelFactory or WorkspaceVMFactory or WorkspaceViewModel_Factory? According to naming conventions, which one is recommenced? * WorkspaceViewModelFactory * WorkspaceVMFactory * WorkspaceViewModel_Factory * WorkspaceVM_Factory * Workspace_ViewModel_Factory * Workspace_VM_Factory In case that matters:... | TITLE:
Naming: WorkspaceViewModelFactory or WorkspaceVMFactory or WorkspaceViewModel_Factory?
QUESTION:
According to naming conventions, which one is recommenced? * WorkspaceViewModelFactory * WorkspaceVMFactory * WorkspaceViewModel_Factory * WorkspaceVM_Factory * Workspace_ViewModel_Factory * Workspace_VM_Factory In ... | [
"c#",
".net",
"naming-conventions",
"coding-style",
"naming"
] | 1 | 1 | 25 | 1 | 0 | 2011-06-04T00:35:51.600000 | 2011-06-04T00:37:28.057000 |
6,233,895 | 6,233,908 | Rand() function cause error when I replace static value with random value | What am I doing wrong I have this script, and added the $randnumber = rand(100, 500); function to it, this should generate a random number for me between 100 and 500. $randnumber = rand(100, 500); function word_limiter( $text, $limit = $randnumber, $chars = '0123456789' ) The problem is that it gives me a error: Parse ... | That is a syntax error. You cannot assign the value of an expression as a default value. Default values can only be constants. Instead of doing that, you could be doing something like: function word_limiter ($text, $limit = null, $chars = '0123456789') { if ($limit === null) { $limit = rand(100, 500); } //... } | Rand() function cause error when I replace static value with random value What am I doing wrong I have this script, and added the $randnumber = rand(100, 500); function to it, this should generate a random number for me between 100 and 500. $randnumber = rand(100, 500); function word_limiter( $text, $limit = $randnumbe... | TITLE:
Rand() function cause error when I replace static value with random value
QUESTION:
What am I doing wrong I have this script, and added the $randnumber = rand(100, 500); function to it, this should generate a random number for me between 100 and 500. $randnumber = rand(100, 500); function word_limiter( $text, $... | [
"php"
] | 2 | 3 | 544 | 4 | 0 | 2011-06-04T00:36:32.683000 | 2011-06-04T00:39:07.120000 |
6,233,916 | 6,233,938 | C++ multiple file error | i have been attempting to pass an object into a function that belongs to a class both classes are in there own files...but when i try to pass the object as an argument for the function prototype it gives me an error saying that the object doesn't exist... ill provide some pseudo code to demonstrate my problem //class 1... | You'll need to include Class2's header file in Class1.h. That is: ////////////////// //Class1.h
#include "Class2.h"
class Class1 { public: void function(Class2 arg); }; If you are only using a pointer to Class2 as an argument, then you can forward declare Class2 instead of including the header, that is: /////////////... | C++ multiple file error i have been attempting to pass an object into a function that belongs to a class both classes are in there own files...but when i try to pass the object as an argument for the function prototype it gives me an error saying that the object doesn't exist... ill provide some pseudo code to demonstr... | TITLE:
C++ multiple file error
QUESTION:
i have been attempting to pass an object into a function that belongs to a class both classes are in there own files...but when i try to pass the object as an argument for the function prototype it gives me an error saying that the object doesn't exist... ill provide some pseud... | [
"c++"
] | 2 | 3 | 174 | 4 | 0 | 2011-06-04T00:41:21.680000 | 2011-06-04T00:47:35.673000 |
6,233,922 | 6,233,957 | How do you make an image or button glow when you mouse over using javascript or jquery? | I want to add a glowing effect when I mouse over a button or image. How do I do this with javascript, jquery, or CSS? Here is an example of what I want it to look http://www.flashuser.net/flash-menus/tutorial-flash-glow-buttons-menu.html Can someone give me some sample code? Thanks in advance | If you dont mind targeting modern browsers you can use CSS transitions and box-shadow properties, no JS needed. Check out this site here: http://designshack.co.uk/articles/css/5-cool-css-hover-effects-you-can-copy-and-paste (Scroll down until you see Fade-in and Reflect) Demo here: http://designshack.co.uk/tutorialexam... | How do you make an image or button glow when you mouse over using javascript or jquery? I want to add a glowing effect when I mouse over a button or image. How do I do this with javascript, jquery, or CSS? Here is an example of what I want it to look http://www.flashuser.net/flash-menus/tutorial-flash-glow-buttons-menu... | TITLE:
How do you make an image or button glow when you mouse over using javascript or jquery?
QUESTION:
I want to add a glowing effect when I mouse over a button or image. How do I do this with javascript, jquery, or CSS? Here is an example of what I want it to look http://www.flashuser.net/flash-menus/tutorial-flash... | [
"javascript",
"jquery",
"html",
"css",
"effect"
] | 8 | 11 | 86,003 | 5 | 0 | 2011-06-04T00:43:21.823000 | 2011-06-04T00:53:31.880000 |
6,233,923 | 6,234,257 | iPhone OS: EXC_BAD_ACCESS and xcode freezing while debugging on device? | So usually when EXC_BAD_ACCESS happens when I'm debugging my (largely c++ based) iphone app, I can go over to the GDB window and it'll show me the current stack. However, for some reason, lately XCode freezes. This happened on both xcode 4 and xcode 3. By freezing, I mean the wheel of death just spins non-stop, and aft... | Considering I use 2GB of RAM without even loading Xcode, your 1GB could well be a problem. It also could be a recursive bug that causes the debugger a hell of a lot of work by having an enormous stack trace. | iPhone OS: EXC_BAD_ACCESS and xcode freezing while debugging on device? So usually when EXC_BAD_ACCESS happens when I'm debugging my (largely c++ based) iphone app, I can go over to the GDB window and it'll show me the current stack. However, for some reason, lately XCode freezes. This happened on both xcode 4 and xcod... | TITLE:
iPhone OS: EXC_BAD_ACCESS and xcode freezing while debugging on device?
QUESTION:
So usually when EXC_BAD_ACCESS happens when I'm debugging my (largely c++ based) iphone app, I can go over to the GDB window and it'll show me the current stack. However, for some reason, lately XCode freezes. This happened on bot... | [
"xcode",
"ios"
] | 1 | 2 | 278 | 2 | 0 | 2011-06-04T00:43:25.137000 | 2011-06-04T02:13:06.860000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.