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,273,265 | 6,273,295 | Python class function being called from another class function returning None | OK I have two classes: PMBMessage and PPConsume PPConsume instanciated PMBMessage and then calls a function from PMBMessage to get a string returned. Here is the code from PPConsume: def handle(self, ch, delivery_tag, body): print "Got: " + body pmbmessage = PMBMessage(body) msg_format_id = pmbmessage.get_header_attrib... | The recursive call needs to return its return value again, i.e.... print "HEY WE WENT THIS WAY" return self.get_header_attribute(attr) Otherwise the return value is simply dropped, and after the recursive call has returned, control reaches the end of the function and None is implicitly returned. | Python class function being called from another class function returning None OK I have two classes: PMBMessage and PPConsume PPConsume instanciated PMBMessage and then calls a function from PMBMessage to get a string returned. Here is the code from PPConsume: def handle(self, ch, delivery_tag, body): print "Got: " + b... | TITLE:
Python class function being called from another class function returning None
QUESTION:
OK I have two classes: PMBMessage and PPConsume PPConsume instanciated PMBMessage and then calls a function from PMBMessage to get a string returned. Here is the code from PPConsume: def handle(self, ch, delivery_tag, body):... | [
"python",
"class",
"null"
] | 0 | 3 | 346 | 1 | 0 | 2011-06-08T01:15:41.203000 | 2011-06-08T01:22:32.863000 |
6,273,275 | 6,273,322 | How to reclaim memory after glutMainLoop is activated? | According to OpenGL documentation, 3.1 glutMainLoop glutMainLoop enters the GLUT event processing loop. Usage void glutMainLoop(void); Description glutMainLoop enters the GLUT event processing loop. This routine should be called at most once in a GLUT program. Once called, this routine will never return. It will call a... | The "recommended" mechanism is to use the atexit or onexit function to schedule a function to be called when the program is exiting: void exitProgram() { // cleanup code }
// then put this in main(): atexit( exitProgram ); Note that as soon as a program exits, the operating system cleans up all resources, including me... | How to reclaim memory after glutMainLoop is activated? According to OpenGL documentation, 3.1 glutMainLoop glutMainLoop enters the GLUT event processing loop. Usage void glutMainLoop(void); Description glutMainLoop enters the GLUT event processing loop. This routine should be called at most once in a GLUT program. Once... | TITLE:
How to reclaim memory after glutMainLoop is activated?
QUESTION:
According to OpenGL documentation, 3.1 glutMainLoop glutMainLoop enters the GLUT event processing loop. Usage void glutMainLoop(void); Description glutMainLoop enters the GLUT event processing loop. This routine should be called at most once in a ... | [
"c++",
"opengl",
"glut"
] | 3 | 7 | 1,242 | 2 | 0 | 2011-06-08T01:18:39.183000 | 2011-06-08T01:26:57.650000 |
6,273,288 | 6,273,385 | loading view in codeigniter | HI I have a codeigniter controller called CIcontroller and I have a method say redirectmethod in the redirectmethod i have some code and then i do this $data['redirect_page'] = 'page_name'; $this->load->view('template_view',$data); the template view basically loads header footer and the corresponding view as specified ... | You need to emit a Location header to tell the browser to load a different page. See redirect in the url helper. | loading view in codeigniter HI I have a codeigniter controller called CIcontroller and I have a method say redirectmethod in the redirectmethod i have some code and then i do this $data['redirect_page'] = 'page_name'; $this->load->view('template_view',$data); the template view basically loads header footer and the corr... | TITLE:
loading view in codeigniter
QUESTION:
HI I have a codeigniter controller called CIcontroller and I have a method say redirectmethod in the redirectmethod i have some code and then i do this $data['redirect_page'] = 'page_name'; $this->load->view('template_view',$data); the template view basically loads header f... | [
"codeigniter",
"codeigniter-url"
] | 0 | 2 | 86 | 1 | 0 | 2011-06-08T01:20:56.993000 | 2011-06-08T01:43:53.337000 |
6,273,289 | 6,273,461 | Validate presence of field only if another field is blank - Rails | I have a form with a mobile/cell number and a home phone number. I want to have only validate presence of mobile/cell number if the phone number has been left blank or vice versa. My current validations for these fields are as follows. validates_presence_of:mobile_number validates_presence_of:home_phone
validates_leng... | You don't need a lambda. This will do: validates_presence_of:mobile_number,:unless =>:home_phone? Also, all of the validators take the same if/unless options, so you can make them conditional at will. Update: Looking back at this answer a few days later, I see that I should explain why it works: If you set a validator'... | Validate presence of field only if another field is blank - Rails I have a form with a mobile/cell number and a home phone number. I want to have only validate presence of mobile/cell number if the phone number has been left blank or vice versa. My current validations for these fields are as follows. validates_presence... | TITLE:
Validate presence of field only if another field is blank - Rails
QUESTION:
I have a form with a mobile/cell number and a home phone number. I want to have only validate presence of mobile/cell number if the phone number has been left blank or vice versa. My current validations for these fields are as follows. ... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 70 | 137 | 57,648 | 7 | 0 | 2011-06-08T01:21:02.390000 | 2011-06-08T02:01:46.667000 |
6,273,290 | 6,273,482 | GetEnumName TypeInfo problems (pascal / Delphi console) | Working on a console application using Delphi 7, and have run into a problem. I get an error on line 26 after str:= GetEnumName(TypeInfo (words[3].group), The error reads "[Error] Project1.dpr(26): TYPEINFO standard function expects a type identifier" if anyone could help with this, it would be a great help! Cheers! pr... | You are trying to pass there an enumeration field not a type identifier. You need to declare this enumeration separately (what is in the example below TGroup type). Anyway there is an unwritten convention to use T prefix for each Type identifier so then you can easy recognize a Type. That's the reason why I renamed Wor... | GetEnumName TypeInfo problems (pascal / Delphi console) Working on a console application using Delphi 7, and have run into a problem. I get an error on line 26 after str:= GetEnumName(TypeInfo (words[3].group), The error reads "[Error] Project1.dpr(26): TYPEINFO standard function expects a type identifier" if anyone co... | TITLE:
GetEnumName TypeInfo problems (pascal / Delphi console)
QUESTION:
Working on a console application using Delphi 7, and have run into a problem. I get an error on line 26 after str:= GetEnumName(TypeInfo (words[3].group), The error reads "[Error] Project1.dpr(26): TYPEINFO standard function expects a type identi... | [
"delphi",
"pascal"
] | 3 | 7 | 3,857 | 1 | 0 | 2011-06-08T01:21:15.760000 | 2011-06-08T02:05:43.933000 |
6,273,293 | 6,273,373 | Working examples of :after css selector w/ multiple background images? | I swear I've seen people add multiple background images to an element using the:after selector. For whatever reason, I can't get it to work. What am I doing wrong? Can anyone point me to a working example? #el li { background:url(image1.jpg) top center;} #el li:after { background:url(image2.jpg) bottom center;} Thanks! | As Blender notes, there is some type of dom node added as content to the end of the element's content. However, you also need to provide some kind of content AFAICT to make it work. Hello world #el li { background:url(http://www.gravatar.com/avatar/e1122386990776c6c39a08e9f5fe5648?s=128&d=identicon&r=PG) top center no-... | Working examples of :after css selector w/ multiple background images? I swear I've seen people add multiple background images to an element using the:after selector. For whatever reason, I can't get it to work. What am I doing wrong? Can anyone point me to a working example? #el li { background:url(image1.jpg) top cen... | TITLE:
Working examples of :after css selector w/ multiple background images?
QUESTION:
I swear I've seen people add multiple background images to an element using the:after selector. For whatever reason, I can't get it to work. What am I doing wrong? Can anyone point me to a working example? #el li { background:url(i... | [
"css",
"css-selectors"
] | 1 | 3 | 11,318 | 4 | 0 | 2011-06-08T01:22:30.210000 | 2011-06-08T01:40:49.950000 |
6,273,296 | 6,273,324 | CoreData web service using MySQL | I currently have a MySQL database that I wish to create a web service for. One of the main purposes of this web service is to be used in an iPhone app. Because of this I would like to used CoreData, as it will make parsing on the iPhone side so much easier. How would I use CoreData to get the data from my MySQL databas... | To get the data from the server to the iPhone I would recommend JSON. Then you need to write some code that will turn that JSON into an object that you can put into the CoreData database. You have a couple choices there, but I would recommend providing your own implementations of the NSCoding protocol. The great part a... | CoreData web service using MySQL I currently have a MySQL database that I wish to create a web service for. One of the main purposes of this web service is to be used in an iPhone app. Because of this I would like to used CoreData, as it will make parsing on the iPhone side so much easier. How would I use CoreData to g... | TITLE:
CoreData web service using MySQL
QUESTION:
I currently have a MySQL database that I wish to create a web service for. One of the main purposes of this web service is to be used in an iPhone app. Because of this I would like to used CoreData, as it will make parsing on the iPhone side so much easier. How would I... | [
"iphone",
"mysql",
"web-services",
"core-data"
] | 1 | 2 | 567 | 1 | 0 | 2011-06-08T01:22:48.697000 | 2011-06-08T01:27:22.023000 |
6,273,300 | 6,287,649 | Default GCC Architecture | When the -arch option is not explicitly specified, which architecture will GCC compile for? Can I rely on it being the machine's native architecture? | Yes, GCC will, by default, compile to the native architecture. At least this is the 'default' behavior. So, if you're using a default install (either as part of your distro or via its package manager) you can be pretty sure GCC will "do the right thing." | Default GCC Architecture When the -arch option is not explicitly specified, which architecture will GCC compile for? Can I rely on it being the machine's native architecture? | TITLE:
Default GCC Architecture
QUESTION:
When the -arch option is not explicitly specified, which architecture will GCC compile for? Can I rely on it being the machine's native architecture?
ANSWER:
Yes, GCC will, by default, compile to the native architecture. At least this is the 'default' behavior. So, if you're ... | [
"gcc",
"build",
"compilation",
"default"
] | 2 | 1 | 632 | 1 | 0 | 2011-06-08T01:23:54.050000 | 2011-06-09T02:59:17.333000 |
6,273,301 | 6,273,492 | Best way to pull out an unknown string from a known tag in a web page using Python | I am trying to determine the best way to save an unknown string on a web page that relates to a specific tag, using Python. E.g. What I wish to pull out is the images URL address and use it to download the image. The class "pictures" is unique to the page so I gather I can use that as a reference point to grab the URL,... | This is messy but would get the job done. Obviously it'd be better to break this down into functions, etc. to make it smoother. Note that I haven't tested this script specifically, but I have written other scripts in this ilk to do similar things (break down html, add stuff in, and paste it back together, for instance)... | Best way to pull out an unknown string from a known tag in a web page using Python I am trying to determine the best way to save an unknown string on a web page that relates to a specific tag, using Python. E.g. What I wish to pull out is the images URL address and use it to download the image. The class "pictures" is ... | TITLE:
Best way to pull out an unknown string from a known tag in a web page using Python
QUESTION:
I am trying to determine the best way to save an unknown string on a web page that relates to a specific tag, using Python. E.g. What I wish to pull out is the images URL address and use it to download the image. The cl... | [
"python"
] | 0 | 1 | 140 | 3 | 0 | 2011-06-08T01:23:57.787000 | 2011-06-08T02:09:06.007000 |
6,273,308 | 6,273,522 | How to draw a curve that goes both up and down? | I've used the following code to make 3 points, draw them to a bitmap, then draw the bitmap to the main form, however it seems to always draw point 3 before point 2, because the Y co-ordinate is lower then point 2's. Is there a way to get over this, as I need a curve that curves up and down, rather than just up Bitmap b... | Y-coordinate for point 3 is not lower, it's actually higher. The (0;0) point of Graphics is in the left top corner, and the Y value increases from the top down rather than from the bottom up. So a point (0;100) will be higher than (0;200) on the result image. If you want a curve that goes up then down, you should place... | How to draw a curve that goes both up and down? I've used the following code to make 3 points, draw them to a bitmap, then draw the bitmap to the main form, however it seems to always draw point 3 before point 2, because the Y co-ordinate is lower then point 2's. Is there a way to get over this, as I need a curve that ... | TITLE:
How to draw a curve that goes both up and down?
QUESTION:
I've used the following code to make 3 points, draw them to a bitmap, then draw the bitmap to the main form, however it seems to always draw point 3 before point 2, because the Y co-ordinate is lower then point 2's. Is there a way to get over this, as I ... | [
"c#-4.0",
"drawing"
] | 0 | 0 | 266 | 2 | 0 | 2011-06-08T01:24:46.357000 | 2011-06-08T02:14:23.320000 |
6,273,310 | 6,273,429 | Rails 3 Problem with postgreSQL query on Heroku - boolean vs checkbox parameter = 'on' | I'm getting a postgreSQL error on heroku that I don't get locally on my computer which also uses postgreSQL. I have a search form with checkboxes and a model with boolean fields. When I check the box to find all reports that are completed, the form passes the parameter value completed='on'. As shown by the heroku logs,... | This is probably due to a Postgres version mismatch. 'on' became a valid value for boolean fields in Postgres 8.4, so I guess Heroku is still on 8.3. You'll just need to make sure you pass true or false into your query instead. As far as testing goes, you can indeed setup a staging environment. You can either setup two... | Rails 3 Problem with postgreSQL query on Heroku - boolean vs checkbox parameter = 'on' I'm getting a postgreSQL error on heroku that I don't get locally on my computer which also uses postgreSQL. I have a search form with checkboxes and a model with boolean fields. When I check the box to find all reports that are comp... | TITLE:
Rails 3 Problem with postgreSQL query on Heroku - boolean vs checkbox parameter = 'on'
QUESTION:
I'm getting a postgreSQL error on heroku that I don't get locally on my computer which also uses postgreSQL. I have a search form with checkboxes and a model with boolean fields. When I check the box to find all rep... | [
"ruby-on-rails-3",
"postgresql",
"heroku"
] | 2 | 1 | 1,229 | 2 | 0 | 2011-06-08T01:25:08.700000 | 2011-06-08T01:54:13.300000 |
6,273,323 | 6,273,494 | Move Cursor One Word at a Time in UTextView | I would like to create a button that moves the cursor position in a UITextView one word at a time. From a user perspective, this would be the same as Option-Right Arrow in Mac OS X, which is defined as "go to the word to the right of the insertion point." I have found a couple ways to move on character at a time. How w... | Was able to implement it like this, - (IBAction)nextWord { NSRange selectedRange = self.textView.selectedRange; NSInteger currentLocation = selectedRange.location + selectedRange.length; NSInteger textLength = [self.textView.text length];
if ( currentLocation == textLength ) { return; }
NSRange newRange = [self.textV... | Move Cursor One Word at a Time in UTextView I would like to create a button that moves the cursor position in a UITextView one word at a time. From a user perspective, this would be the same as Option-Right Arrow in Mac OS X, which is defined as "go to the word to the right of the insertion point." I have found a coupl... | TITLE:
Move Cursor One Word at a Time in UTextView
QUESTION:
I would like to create a button that moves the cursor position in a UITextView one word at a time. From a user perspective, this would be the same as Option-Right Arrow in Mac OS X, which is defined as "go to the word to the right of the insertion point." I ... | [
"iphone",
"ipad",
"uitextview",
"text-cursor"
] | 4 | 8 | 856 | 1 | 0 | 2011-06-08T01:27:21.993000 | 2011-06-08T02:09:24.250000 |
6,273,326 | 6,273,352 | How are global static/non-static variables mangled in c? | I can imagine static variables var inside a function func to be named like var@func, what about global static and non-static variables? | Compilers don't need to uniquely name things with internal linkage, like static variables and functions. You can't access static objects outside the translation unit, so the linker doesn't need to get a name for them. Global variables with external linkage don't usually have much mangling or decoration applied to their... | How are global static/non-static variables mangled in c? I can imagine static variables var inside a function func to be named like var@func, what about global static and non-static variables? | TITLE:
How are global static/non-static variables mangled in c?
QUESTION:
I can imagine static variables var inside a function func to be named like var@func, what about global static and non-static variables?
ANSWER:
Compilers don't need to uniquely name things with internal linkage, like static variables and functi... | [
"c",
"name-mangling"
] | 2 | 5 | 2,290 | 2 | 0 | 2011-06-08T01:27:39.227000 | 2011-06-08T01:34:33.173000 |
6,273,327 | 6,275,163 | is this code using UIActivityIndicatorView flawed? | Is this code using UIActivityIndicatorView flawed? It appears that I don't actually get to see the indicator/spinner at all here, so is this because the view isn't drawn until the who viewDidLoad completes? Is the only way around this to do the viewDidLoad custom work (e.g. data updates) on a separate thread? (I was ho... | You should also call startAnimating. Sleeping is not a good idea. I would prefer the performSelector -methods which starts a not recurring NSTimer under the hood. Try this: -(void) doStuff:(id)aSender { [self.waitView stopAnimating]; } -(void)viewDidLoad {... [self performSelector:@selector(doStuff:) withObject:self af... | is this code using UIActivityIndicatorView flawed? Is this code using UIActivityIndicatorView flawed? It appears that I don't actually get to see the indicator/spinner at all here, so is this because the view isn't drawn until the who viewDidLoad completes? Is the only way around this to do the viewDidLoad custom work ... | TITLE:
is this code using UIActivityIndicatorView flawed?
QUESTION:
Is this code using UIActivityIndicatorView flawed? It appears that I don't actually get to see the indicator/spinner at all here, so is this because the view isn't drawn until the who viewDidLoad completes? Is the only way around this to do the viewDi... | [
"iphone",
"ios",
"uitableview",
"uiactivityindicatorview"
] | 0 | 2 | 927 | 2 | 0 | 2011-06-08T01:27:52.903000 | 2011-06-08T06:49:40.530000 |
6,273,328 | 6,286,975 | can't export htmltable to xls file when using jquery? | I need to export a htmltable to xls, I have a page that uses jquery heavily and has a link triggers a jquery post var downloadType = document.getElementById("downloadType"); var downloadTypeValue = downloadType.options[downloadType.selectedIndex].value; var data = { exportFormat: downloadTypeValue }; $.post("ajax.aspx"... | I ended up using iframe to return the file that works great! | can't export htmltable to xls file when using jquery? I need to export a htmltable to xls, I have a page that uses jquery heavily and has a link triggers a jquery post var downloadType = document.getElementById("downloadType"); var downloadTypeValue = downloadType.options[downloadType.selectedIndex].value; var data = {... | TITLE:
can't export htmltable to xls file when using jquery?
QUESTION:
I need to export a htmltable to xls, I have a page that uses jquery heavily and has a link triggers a jquery post var downloadType = document.getElementById("downloadType"); var downloadTypeValue = downloadType.options[downloadType.selectedIndex].v... | [
"jquery",
"asp.net",
"export",
"xls"
] | 0 | 0 | 444 | 2 | 0 | 2011-06-08T01:28:01.020000 | 2011-06-09T00:54:15.277000 |
6,273,329 | 6,273,403 | Custom Python shell for Emacs python-mode | What does it take to replace regular /usr/bin/python with a custom python shell in Emacs' python-mode? Basically I have a binary /usr/bin/mypython which does some initializations before starting python interpreter prompt, and for all interaction purposes, the resulting interpreter shell is equivalent to /usr/bin/python... | I'm about to read the elisp to check, but I'd bet if you added a --version flag that gave the save results as /usr/bin/python, emacs would be happy. Update Here's the code in python.el line 1555 et seq in EMACS 23.3.1: (defvar python-version-checked nil) (defun python-check-version (cmd) "Check that CMD runs a suitable... | Custom Python shell for Emacs python-mode What does it take to replace regular /usr/bin/python with a custom python shell in Emacs' python-mode? Basically I have a binary /usr/bin/mypython which does some initializations before starting python interpreter prompt, and for all interaction purposes, the resulting interpre... | TITLE:
Custom Python shell for Emacs python-mode
QUESTION:
What does it take to replace regular /usr/bin/python with a custom python shell in Emacs' python-mode? Basically I have a binary /usr/bin/mypython which does some initializations before starting python interpreter prompt, and for all interaction purposes, the ... | [
"python",
"emacs"
] | 6 | 5 | 1,389 | 3 | 0 | 2011-06-08T01:28:09.227000 | 2011-06-08T01:48:54.373000 |
6,273,333 | 6,273,459 | ScrollView FOCUS_DOWN, not quite there yet | I apologize for this, and I am sure it's a very rookie question... but I am still trying to grasp java and how everything works (I'm surprised I made it this far.) I have a TextView inside of a ScrollView and I am trying to get it to focus on the bottom entry each time a new entry is added. I have this in the code: get... | A couple things: To get access to the view from code, you use (ScrollView)findViewById(R.id.scrollView1) -- getScrollView() doesn't exist, though you can write it using the command I described. Based on what it sounds like you're trying to do, you might want to look into ListView instead (rather than appending lines to... | ScrollView FOCUS_DOWN, not quite there yet I apologize for this, and I am sure it's a very rookie question... but I am still trying to grasp java and how everything works (I'm surprised I made it this far.) I have a TextView inside of a ScrollView and I am trying to get it to focus on the bottom entry each time a new e... | TITLE:
ScrollView FOCUS_DOWN, not quite there yet
QUESTION:
I apologize for this, and I am sure it's a very rookie question... but I am still trying to grasp java and how everything works (I'm surprised I made it this far.) I have a TextView inside of a ScrollView and I am trying to get it to focus on the bottom entry... | [
"android",
"scrollview"
] | 0 | 0 | 2,674 | 2 | 0 | 2011-06-08T01:28:45.717000 | 2011-06-08T02:01:37.507000 |
6,273,338 | 6,278,467 | SQLite3 + CakePHP 1.3.10 - how to? | SOLVED so i forgot to sudo apt-get php5-sqlite also. downvoters gonna downvote:D (fyi, i feel bad everytime i use "StackOverload". bad as in, 'i have been hammering for five hours and the nail doesnt seem to fit. but it does! i seez it does!'.) Summed up, because people might think i'm ranting. (and i wasnt, it was som... | Personally I haven't worked with Cake + Sqlite yet, but I surmised the following: download the plugin from https://github.com/cakephp/datasources into app/plugins so you have the folder structure app/plugins/datasources/models/... configure a source in app/config/database.php to use the driver Datasources.DboSqlite3, a... | SQLite3 + CakePHP 1.3.10 - how to? SOLVED so i forgot to sudo apt-get php5-sqlite also. downvoters gonna downvote:D (fyi, i feel bad everytime i use "StackOverload". bad as in, 'i have been hammering for five hours and the nail doesnt seem to fit. but it does! i seez it does!'.) Summed up, because people might think i'... | TITLE:
SQLite3 + CakePHP 1.3.10 - how to?
QUESTION:
SOLVED so i forgot to sudo apt-get php5-sqlite also. downvoters gonna downvote:D (fyi, i feel bad everytime i use "StackOverload". bad as in, 'i have been hammering for five hours and the nail doesnt seem to fit. but it does! i seez it does!'.) Summed up, because peo... | [
"cakephp",
"sqlite"
] | 1 | 1 | 1,145 | 1 | 0 | 2011-06-08T01:30:52.983000 | 2011-06-08T12:09:43.313000 |
6,273,357 | 6,273,384 | What is Prism for WPF? | I've come across something called Prism a lot recently. Microsoft, who run the project, describe it as Guidelines for composite applications in WPF and Silverlight. Even after reading the more detailed descriptions out there, I have next to no clue what it's actually about, I'm afraid. I'm hoping here that someone coul... | Prism is the Microsoft Patterns and Practices Team official guidance for building "composite applications" in WPF and Silverlight. It's intended to provide guidance on the best practices for building large scale applications which are flexible in terms of development and maintainability. This includes guidance on depen... | What is Prism for WPF? I've come across something called Prism a lot recently. Microsoft, who run the project, describe it as Guidelines for composite applications in WPF and Silverlight. Even after reading the more detailed descriptions out there, I have next to no clue what it's actually about, I'm afraid. I'm hoping... | TITLE:
What is Prism for WPF?
QUESTION:
I've come across something called Prism a lot recently. Microsoft, who run the project, describe it as Guidelines for composite applications in WPF and Silverlight. Even after reading the more detailed descriptions out there, I have next to no clue what it's actually about, I'm ... | [
"wpf",
"mvvm",
"prism"
] | 141 | 93 | 78,521 | 3 | 0 | 2011-06-08T01:34:55.093000 | 2011-06-08T01:43:47.420000 |
6,273,361 | 6,273,368 | MySql query to select records with a particular date | so right now I'm storing a the date of each search done on my site like this 2011-06-07 21:44:01 now I'd like to execute a query to select all values where the date is equal to whatever, but only the year / month and day are taken into account, so it would be like mysql_query("SELECT tag from tags WHERE date = '2011-06... | You could use the DATE() function. SELECT `tag` FROM `tags` WHERE DATE(`date`) = '2011-06-07' However, for better performance you could use... WHERE `date` BETWEEN '2011-06-07' AND '2011-06-07 23:59:59' | MySql query to select records with a particular date so right now I'm storing a the date of each search done on my site like this 2011-06-07 21:44:01 now I'd like to execute a query to select all values where the date is equal to whatever, but only the year / month and day are taken into account, so it would be like my... | TITLE:
MySql query to select records with a particular date
QUESTION:
so right now I'm storing a the date of each search done on my site like this 2011-06-07 21:44:01 now I'd like to execute a query to select all values where the date is equal to whatever, but only the year / month and day are taken into account, so i... | [
"mysql",
"datetime"
] | 36 | 74 | 91,390 | 4 | 0 | 2011-06-08T01:36:24.393000 | 2011-06-08T01:39:14.057000 |
6,273,370 | 6,273,413 | How can I delete an item from a Databound windows phone application? | Starting with the stock Databound application, I replace the xaml on the MainPage with this: In Button_Click(), I’d like to remove that item from Items. I know the syntax would be something like App.ViewModel.Items.Remove(something) but I’m missing what that something is. How can I ensure the correct item is removed ba... | There are a few ways to go about doing this. The best way is with an ICommand. But you also need to add a CommandButton class to hold the reference and the parameter. If you want a quick workaround though, then the sender object in the button click event should be the button you clicked, and its DataContext property sh... | How can I delete an item from a Databound windows phone application? Starting with the stock Databound application, I replace the xaml on the MainPage with this: In Button_Click(), I’d like to remove that item from Items. I know the syntax would be something like App.ViewModel.Items.Remove(something) but I’m missing wh... | TITLE:
How can I delete an item from a Databound windows phone application?
QUESTION:
Starting with the stock Databound application, I replace the xaml on the MainPage with this: In Button_Click(), I’d like to remove that item from Items. I know the syntax would be something like App.ViewModel.Items.Remove(something) ... | [
"data-binding",
"windows-phone-7"
] | 1 | 2 | 262 | 1 | 0 | 2011-06-08T01:39:41.250000 | 2011-06-08T01:51:40.710000 |
6,273,375 | 6,273,388 | ASP.NET - UpdatePanel inside a JQuery modal dialog | I am trying to update the content of a modal dialog. I am using an updatepanel inside the dialog, but the page refreshes so the dialog is closed. $("#dlg").dialog({ autoOpen: false, bgiframe: true, width: 500, modal: true, closable: true, buttons: { Close: function () { $(this).dialog('close'); } } }); $("#dlg").parent... | You'll have to define AsyncPostBackTrigger for the linkbutton in the updatepanel like this | ASP.NET - UpdatePanel inside a JQuery modal dialog I am trying to update the content of a modal dialog. I am using an updatepanel inside the dialog, but the page refreshes so the dialog is closed. $("#dlg").dialog({ autoOpen: false, bgiframe: true, width: 500, modal: true, closable: true, buttons: { Close: function () ... | TITLE:
ASP.NET - UpdatePanel inside a JQuery modal dialog
QUESTION:
I am trying to update the content of a modal dialog. I am using an updatepanel inside the dialog, but the page refreshes so the dialog is closed. $("#dlg").dialog({ autoOpen: false, bgiframe: true, width: 500, modal: true, closable: true, buttons: { C... | [
"jquery",
"asp.net",
"updatepanel"
] | 1 | 3 | 5,204 | 2 | 0 | 2011-06-08T01:41:20.827000 | 2011-06-08T01:44:43.320000 |
6,273,376 | 6,274,003 | Memory leaks happens in nested anonymous method | In Delphi XE, the following code will cause memory leak: procedure TForm1.Button1Click(Sender: TObject); var P, B: TProc; begin B:= procedure begin end;
P:= procedure begin B; end; end; Run the code with ReportMemoryLeaksOnShutdown:= True; and the memory manager prompt: 21-28 bytes: TForm1.Button1Click$ActRec x 1 | This is a bug in the compiler (as far as I know). I opened QC83259 in Embarcadero's quality central about it. You can work around this bug by creating the anonymous procedure in a routine. The following code won't leak. procedure TForm1.Button1Click(Sender: TObject); var P, B: TProc; begin B:= GetMethod(); //Note, the ... | Memory leaks happens in nested anonymous method In Delphi XE, the following code will cause memory leak: procedure TForm1.Button1Click(Sender: TObject); var P, B: TProc; begin B:= procedure begin end;
P:= procedure begin B; end; end; Run the code with ReportMemoryLeaksOnShutdown:= True; and the memory manager prompt: ... | TITLE:
Memory leaks happens in nested anonymous method
QUESTION:
In Delphi XE, the following code will cause memory leak: procedure TForm1.Button1Click(Sender: TObject); var P, B: TProc; begin B:= procedure begin end;
P:= procedure begin B; end; end; Run the code with ReportMemoryLeaksOnShutdown:= True; and the memor... | [
"delphi",
"memory-leaks",
"anonymous-methods"
] | 16 | 13 | 1,480 | 3 | 0 | 2011-06-08T01:42:10.013000 | 2011-06-08T03:49:35.073000 |
6,273,380 | 6,273,509 | do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell? | do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell? That is, if I want to have a TableViewCell that has all text, but the text needs to contain 4 separate rows for 4 separate strings (e.g. Name, Title, Description, Location), and each these separate rows could include a wr... | The answer to the last question: NO. (Answer to the title: YES.) You can build a cell in its own NIB file. An exercise I suggest if you've never done it. Layout the size/location/resize functionality as you like it. your table view controller can be the owner of the file, add an outlet to the TV controller of loadedCel... | do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell? do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell? That is, if I want to have a TableViewCell that has all text, but the text needs to contain 4 separate rows for 4 separate... | TITLE:
do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell?
QUESTION:
do I need separate UILabel in a custom UIView to have separate UILabel lines in a UITableViewCell? That is, if I want to have a TableViewCell that has all text, but the text needs to contain 4 separate r... | [
"iphone",
"ios",
"uitableview"
] | 0 | 2 | 176 | 1 | 0 | 2011-06-08T01:43:08.050000 | 2011-06-08T02:12:04.637000 |
6,273,391 | 6,273,417 | Sending E-Mail on iPhone - A Better Approach (plus possible issues..) | I have this app which has an e-mail feature. When the e-mail window appears theres a recipient, subject and template text that asks for a few numbers and a name to be filled in to the gaps. However I would like to approach this in a slightly better way. For example I would like a text box and a few drop down boxes in a... | I can't speak to the policy issue, but there's no way for you to send a mail from the device (ie from the user's account) yourself without their UI. If you want to accomplish this, you'll need your own server somewhere that you post the email messages to, and send on the back end from your own email account. This is pr... | Sending E-Mail on iPhone - A Better Approach (plus possible issues..) I have this app which has an e-mail feature. When the e-mail window appears theres a recipient, subject and template text that asks for a few numbers and a name to be filled in to the gaps. However I would like to approach this in a slightly better w... | TITLE:
Sending E-Mail on iPhone - A Better Approach (plus possible issues..)
QUESTION:
I have this app which has an e-mail feature. When the e-mail window appears theres a recipient, subject and template text that asks for a few numbers and a name to be filled in to the gaps. However I would like to approach this in a... | [
"iphone",
"objective-c",
"ios",
"email",
"messageui"
] | 0 | 1 | 343 | 1 | 0 | 2011-06-08T01:45:43.187000 | 2011-06-08T01:52:04.697000 |
6,273,404 | 6,273,432 | How to disable parameterless constructor in C# | abstract class CAbstract { private string mParam1; public CAbstract(string param1) { mParam1 = param1; } }
class CBase: CAbstract { } For the class CBase, it should be initialized by providing the parameter, so how to disable the parameterless constructor for CBase class? | If you define a parameterized constructor in CBase, there is no default constructor. You do not need to do anything special. If your intention is for all derived classes of CAbstract to implement a parameterized constructor, that is not something you can (cleanly) accomplish. The derived types have freedom to provide t... | How to disable parameterless constructor in C# abstract class CAbstract { private string mParam1; public CAbstract(string param1) { mParam1 = param1; } }
class CBase: CAbstract { } For the class CBase, it should be initialized by providing the parameter, so how to disable the parameterless constructor for CBase class? | TITLE:
How to disable parameterless constructor in C#
QUESTION:
abstract class CAbstract { private string mParam1; public CAbstract(string param1) { mParam1 = param1; } }
class CBase: CAbstract { } For the class CBase, it should be initialized by providing the parameter, so how to disable the parameterless constructo... | [
"c#",
".net",
"inheritance",
"constructor",
"abstract-class"
] | 17 | 24 | 8,497 | 3 | 0 | 2011-06-08T01:48:55.037000 | 2011-06-08T01:55:09.303000 |
6,273,426 | 6,273,886 | Load from file into listbox? | So in my program i am trying to make it so that when you press a button it opens a "choose file" popup(where the user can choose a text file) then after the user chooses it the program will automatically load each line of the textfile into a listbox. But i have been researching it and the only thing i have been able to... | Using FD As New OpenFileDialog() FD.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" If FD.ShowDialog = Windows.Forms.DialogResult.OK Then Listbox1.Items.Clear ListBox1.Items.AddRange(IO.File.ReadAllLines(FD.FileName)) End If End Using EDIT: Answer on the comment: If you can use LINQ, then its a one row of code t... | Load from file into listbox? So in my program i am trying to make it so that when you press a button it opens a "choose file" popup(where the user can choose a text file) then after the user chooses it the program will automatically load each line of the textfile into a listbox. But i have been researching it and the o... | TITLE:
Load from file into listbox?
QUESTION:
So in my program i am trying to make it so that when you press a button it opens a "choose file" popup(where the user can choose a text file) then after the user chooses it the program will automatically load each line of the textfile into a listbox. But i have been resear... | [
"vb.net",
"button",
"listbox",
"load",
"text-files"
] | 0 | 2 | 9,121 | 3 | 0 | 2011-06-08T01:53:24.697000 | 2011-06-08T03:26:16.093000 |
6,273,437 | 6,273,662 | When is aggregate initialisation valid in C++11? | Lets say we have the following code: #include #include struct A { A() {} A(const A&) { std::cout << "Copy" << std::endl; } A(A&&) { std::cout << "Move" << std::endl; } std::string s; };
struct B { A a; };
int main() { B{A()}; } Here, I believe struct A is not an aggregate, as it has both non-trivial constructors and ... | According to the new standard, clause 8.5.1 (Aggretates), a sufficiently simple type (e.g. no user-defined constructors) qualifies as an aggregate. For such an aggregate Foo, writing Foo x{a, b,... }; will construct the members from the list items. Simple example: struct A { std::unordered_map a; std::string b; std::ar... | When is aggregate initialisation valid in C++11? Lets say we have the following code: #include #include struct A { A() {} A(const A&) { std::cout << "Copy" << std::endl; } A(A&&) { std::cout << "Move" << std::endl; } std::string s; };
struct B { A a; };
int main() { B{A()}; } Here, I believe struct A is not an aggreg... | TITLE:
When is aggregate initialisation valid in C++11?
QUESTION:
Lets say we have the following code: #include #include struct A { A() {} A(const A&) { std::cout << "Copy" << std::endl; } A(A&&) { std::cout << "Move" << std::endl; } std::string s; };
struct B { A a; };
int main() { B{A()}; } Here, I believe struct ... | [
"c++",
"optimization",
"c++11",
"aggregate",
"aggregate-initialization"
] | 10 | 6 | 1,923 | 2 | 0 | 2011-06-08T01:56:20.143000 | 2011-06-08T02:44:05.620000 |
6,273,440 | 6,273,554 | Adding photo upload to an iPhone App that's mostly HTML5/JS | I'm working on an iPhone App that's HTML5/JS displayed in a single UI Webview. I'd like to add photo upload capabilities, and I'm wondering what the best approach would be to extend the iPhone app with the necessary classes to pick a photo and upload via an API. I'd also like to trigger the display of the photo picker ... | the image picker (UIImagePicker) is fairly straightforward to work with: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html and for an API, are you sending it to an existing system? or creating your own. You just need ... | Adding photo upload to an iPhone App that's mostly HTML5/JS I'm working on an iPhone App that's HTML5/JS displayed in a single UI Webview. I'd like to add photo upload capabilities, and I'm wondering what the best approach would be to extend the iPhone app with the necessary classes to pick a photo and upload via an AP... | TITLE:
Adding photo upload to an iPhone App that's mostly HTML5/JS
QUESTION:
I'm working on an iPhone App that's HTML5/JS displayed in a single UI Webview. I'd like to add photo upload capabilities, and I'm wondering what the best approach would be to extend the iPhone app with the necessary classes to pick a photo an... | [
"iphone",
"ios"
] | 0 | 0 | 1,946 | 1 | 0 | 2011-06-08T01:56:35.180000 | 2011-06-08T02:22:32.743000 |
6,273,441 | 6,273,447 | variables prefixed with underline | i have asked this question before and it was closed because i was unable to provide the language it was written in. currently i am looking at these AS3 codes and the variables are prefixed with _, may i know why? is it because of a convention, if so, why put a _? why do you even need to put a _? /** * Enemy AI - Random... | It's a naming convention that typically denotes a private class level variable. It's supposed to make the code easier to read by allowing you to be able to determine the scope of the variable. | variables prefixed with underline i have asked this question before and it was closed because i was unable to provide the language it was written in. currently i am looking at these AS3 codes and the variables are prefixed with _, may i know why? is it because of a convention, if so, why put a _? why do you even need t... | TITLE:
variables prefixed with underline
QUESTION:
i have asked this question before and it was closed because i was unable to provide the language it was written in. currently i am looking at these AS3 codes and the variables are prefixed with _, may i know why? is it because of a convention, if so, why put a _? why ... | [
"flash",
"actionscript-3",
"naming-conventions",
"flash-cs4"
] | 1 | 1 | 1,122 | 4 | 0 | 2011-06-08T01:56:37.420000 | 2011-06-08T01:59:18.443000 |
6,273,452 | 6,273,485 | How to put an EditText and Button next to each other? | I want to try to get an EditText and Button next to each other. I currently have where the button is on the right and the edit text is left aligned but the button then shows that it is on top of the EditText. I want the Button to start where the EditText ends. This is what I have right now: I tried to set it up with ma... | If you want to continue to use a relative layout and have the edit text to go up until the button you can add this to the edittext xml android:layout_toLeftOf="@+id/skipButton" | How to put an EditText and Button next to each other? I want to try to get an EditText and Button next to each other. I currently have where the button is on the right and the edit text is left aligned but the button then shows that it is on top of the EditText. I want the Button to start where the EditText ends. This ... | TITLE:
How to put an EditText and Button next to each other?
QUESTION:
I want to try to get an EditText and Button next to each other. I currently have where the button is on the right and the edit text is left aligned but the button then shows that it is on top of the EditText. I want the Button to start where the Ed... | [
"android",
"android-layout"
] | 9 | 21 | 32,596 | 3 | 0 | 2011-06-08T02:00:45.933000 | 2011-06-08T02:06:05.180000 |
6,273,455 | 6,275,141 | How to center the Nav-Bar | Hy! I don't know how to center the Nav-Bar please help! HTML: News Fotos Mitglieder Jugend Gästebuch Intern Pellentesque habitant morbi Css: #page-wrap { position: relative; width: 1024px; margin: 50px auto; padding: 20px; background: white; -moz-box-shadow: 0 0 20px black; -webkit-box-shadow: 0 0 20px black; box-shado... | To centre your nav you will need to do the following: CSS: In #minitabs assign text-align:center; In #minitabs a:link, #minitabs a:visited remove or comment out float:left; That should centre your nav. You will have to adjust some of your styles in your nav to get it to look the same as before but at least it should be... | How to center the Nav-Bar Hy! I don't know how to center the Nav-Bar please help! HTML: News Fotos Mitglieder Jugend Gästebuch Intern Pellentesque habitant morbi Css: #page-wrap { position: relative; width: 1024px; margin: 50px auto; padding: 20px; background: white; -moz-box-shadow: 0 0 20px black; -webkit-box-shadow:... | TITLE:
How to center the Nav-Bar
QUESTION:
Hy! I don't know how to center the Nav-Bar please help! HTML: News Fotos Mitglieder Jugend Gästebuch Intern Pellentesque habitant morbi Css: #page-wrap { position: relative; width: 1024px; margin: 50px auto; padding: 20px; background: white; -moz-box-shadow: 0 0 20px black; -... | [
"html",
"css"
] | 0 | 0 | 790 | 1 | 0 | 2011-06-08T02:00:50.130000 | 2011-06-08T06:47:33.733000 |
6,273,463 | 6,273,479 | cross-site scripting (xss) attack | I just have one simple question about XSS attack. I know that you can prevent them by sanitizing the form inputs, but my question is, how about a search input (a general search on a website for example)? Should we sanitize search inputs as well? I mean, it's just a search input, the user should be able to search for an... | I know that you can prevent them by sanitizing the form inputs nope, you should prevent them by sanitizing the output. So in database (or wherever) you need to pass the data as-is, and process it right before you show it to user | cross-site scripting (xss) attack I just have one simple question about XSS attack. I know that you can prevent them by sanitizing the form inputs, but my question is, how about a search input (a general search on a website for example)? Should we sanitize search inputs as well? I mean, it's just a search input, the us... | TITLE:
cross-site scripting (xss) attack
QUESTION:
I just have one simple question about XSS attack. I know that you can prevent them by sanitizing the form inputs, but my question is, how about a search input (a general search on a website for example)? Should we sanitize search inputs as well? I mean, it's just a se... | [
"php",
"xss"
] | 4 | 7 | 905 | 5 | 0 | 2011-06-08T02:02:22.377000 | 2011-06-08T02:05:00.440000 |
6,273,466 | 6,273,666 | Closing a chrome-extension notification using JavaScript | I am creating an google-chrome-extension which has html notifications. There will be a "close" button on it. Is there anyway to make the notification close on the button click? I have already tried window.close(), but it does not seem to work in Chrome. | window.close(); should work for you, check out the Chrome/Silver Bird code as there is a close link on these that works and might point you towards what you're doing differently... similiar questions which might help you at Closing popup window created by Google Chrome extension Chrome extension development: auto close... | Closing a chrome-extension notification using JavaScript I am creating an google-chrome-extension which has html notifications. There will be a "close" button on it. Is there anyway to make the notification close on the button click? I have already tried window.close(), but it does not seem to work in Chrome. | TITLE:
Closing a chrome-extension notification using JavaScript
QUESTION:
I am creating an google-chrome-extension which has html notifications. There will be a "close" button on it. Is there anyway to make the notification close on the button click? I have already tried window.close(), but it does not seem to work in... | [
"javascript",
"google-chrome",
"google-chrome-extension"
] | 0 | 2 | 1,017 | 1 | 0 | 2011-06-08T02:02:47.650000 | 2011-06-08T02:44:28.810000 |
6,273,483 | 6,273,614 | code igniter and exec? | I have a script that, inserts into the database e.g. 20,000 users with email addresses in batches of 1000 (so two tables, emailParent, emailChild), there are 1000 rows in emailChild for every row in emailParent. I want to run a script that sends these emails which basically says //check_for_pending_parent_rows() return... | Use exec to run a vanilla CLI PHP script to calls the page via cURL See http://php.net/manual/en/book.curl.php for info on cURL This is what I have had to do with some of my codeigniter applications (Also make sure you set time out to 0) And doing it this way, you are still able to debug it in the browser | code igniter and exec? I have a script that, inserts into the database e.g. 20,000 users with email addresses in batches of 1000 (so two tables, emailParent, emailChild), there are 1000 rows in emailChild for every row in emailParent. I want to run a script that sends these emails which basically says //check_for_pendi... | TITLE:
code igniter and exec?
QUESTION:
I have a script that, inserts into the database e.g. 20,000 users with email addresses in batches of 1000 (so two tables, emailParent, emailChild), there are 1000 rows in emailChild for every row in emailParent. I want to run a script that sends these emails which basically says... | [
"php",
"codeigniter",
"background"
] | 1 | 1 | 4,209 | 3 | 0 | 2011-06-08T02:05:51.877000 | 2011-06-08T02:33:38 |
6,273,498 | 6,275,472 | Entity Framework Logical Entity Error | I want to have a Person entity in my model. There is no corresponding table and no discriminator. I simply want it as a common base class for some other entities to share (I want to define a public partial class Person with common functionality. So, for example, I want to have: // this class has no corresponding table ... | You must define the Person entity in EDMX file and inherit both User and Contact from the Person in EDMX. None of properties defined in Person can appear in inherited entity. Then go to mapping details and map inherited entities to corresponding tables. Be aware that primary key now must be unique for all persons - not... | Entity Framework Logical Entity Error I want to have a Person entity in my model. There is no corresponding table and no discriminator. I simply want it as a common base class for some other entities to share (I want to define a public partial class Person with common functionality. So, for example, I want to have: // ... | TITLE:
Entity Framework Logical Entity Error
QUESTION:
I want to have a Person entity in my model. There is no corresponding table and no discriminator. I simply want it as a common base class for some other entities to share (I want to define a public partial class Person with common functionality. So, for example, I... | [
".net",
"entity-framework",
"entity-framework-4"
] | 3 | 1 | 1,383 | 1 | 0 | 2011-06-08T02:09:46.050000 | 2011-06-08T07:25:55.830000 |
6,273,505 | 6,273,555 | How to fix the size of a tag "li"? | I'm trying to create a menu like this or this. But I am trying all ways to fix the size of the tag "read" but I can not. I'm in the beginning, to see where I am. Notice that when the user hovers the tag "a" changes the background color. Please, if you can change the code and show me how. Thanks. | Your problem is that you've specified display:inline; and styled it from that point, you'll have to remove that, or change to inline-block like they said, and re-style your menu. | How to fix the size of a tag "li"? I'm trying to create a menu like this or this. But I am trying all ways to fix the size of the tag "read" but I can not. I'm in the beginning, to see where I am. Notice that when the user hovers the tag "a" changes the background color. Please, if you can change the code and show me h... | TITLE:
How to fix the size of a tag "li"?
QUESTION:
I'm trying to create a menu like this or this. But I am trying all ways to fix the size of the tag "read" but I can not. I'm in the beginning, to see where I am. Notice that when the user hovers the tag "a" changes the background color. Please, if you can change the ... | [
"html",
"css",
"menu",
"html-lists"
] | 0 | 1 | 356 | 3 | 0 | 2011-06-08T02:10:52.283000 | 2011-06-08T02:22:55.440000 |
6,273,506 | 6,273,570 | Ruby block method help | I was trying to see if I could reconstruct the Array class' delete_if iterator as my own method in order to see if I understood methods and blocks correctly. Here is what I coded: def delete_if(arr) for x in 0...arr.length if (yield arr[x]) arr[x]=arr[x+1,arr.length] redo end end end
arr = [0,1,2,3,4,5] delete_if(arr)... | def delete_if arr for x in 0...arr.length return if x >= arr.length if yield arr[x] arr[x..-1] = arr[(x + 1)..-1] redo end end end Things I fixed: it's necessary to mutate the array, if all you do is assign to the parameter, your changes will be local to the method. And for that matter, you were assigning your calculat... | Ruby block method help I was trying to see if I could reconstruct the Array class' delete_if iterator as my own method in order to see if I understood methods and blocks correctly. Here is what I coded: def delete_if(arr) for x in 0...arr.length if (yield arr[x]) arr[x]=arr[x+1,arr.length] redo end end end
arr = [0,1,... | TITLE:
Ruby block method help
QUESTION:
I was trying to see if I could reconstruct the Array class' delete_if iterator as my own method in order to see if I understood methods and blocks correctly. Here is what I coded: def delete_if(arr) for x in 0...arr.length if (yield arr[x]) arr[x]=arr[x+1,arr.length] redo end en... | [
"ruby",
"ruby-on-rails-3",
"methods"
] | 0 | 1 | 125 | 1 | 0 | 2011-06-08T02:11:33.430000 | 2011-06-08T02:26:05.970000 |
6,273,512 | 6,273,713 | GIT RM a file with a leading whitespace character in filename | I need help with a git issue. I have managed to create a file with a space at the beginning of it's name. I also have the same file without the space. When I first created the file with the single space I added it and committed it to my local repo. if I do a git rm it deletes the file I want to kepp not the file I want... | Escape each space with a slash, for example: $ la total 20 drwxr-xr-x 3 stevek stevek 4096 2011-06-07 22:50./ drwxr-xr-x 40 stevek stevek 4096 2011-06-07 22:50../ drwxr-xr-x 8 stevek stevek 4096 2011-06-07 22:50.git/ -rw-r--r-- 1 stevek stevek 5 2011-06-07 22:50 test.txt -rw-r--r-- 1 stevek stevek 5 2011-06-07 22:50 te... | GIT RM a file with a leading whitespace character in filename I need help with a git issue. I have managed to create a file with a space at the beginning of it's name. I also have the same file without the space. When I first created the file with the single space I added it and committed it to my local repo. if I do a... | TITLE:
GIT RM a file with a leading whitespace character in filename
QUESTION:
I need help with a git issue. I have managed to create a file with a space at the beginning of it's name. I also have the same file without the space. When I first created the file with the single space I added it and committed it to my loc... | [
"git"
] | 3 | 8 | 1,317 | 1 | 0 | 2011-06-08T02:12:48.900000 | 2011-06-08T02:53:30.753000 |
6,273,517 | 6,273,553 | Objective C: Unable to obtain Network Status value | I am trying to get the network status via the following code //define in my.h file NetworkStatus internetConnectionStatus;
//define in my.m file self.internetConnectionStatus = [[Reachability reachabilityForInternetConnection]currentReachabilityStatus]; I am getting self.internetconnection status =. What am I doing wr... | You should compare the value of it to the enum values defined in Reachability.h: if(self.internetConnectionStatus == NotReachable) { // no connection } else if(self.internetConnectionStatus == ReachableViaWiFi) { // WiFi connection } else if(self.internetConnectionStatus == ReachableViaWWAN) { // 3G connection } Also, ... | Objective C: Unable to obtain Network Status value I am trying to get the network status via the following code //define in my.h file NetworkStatus internetConnectionStatus;
//define in my.m file self.internetConnectionStatus = [[Reachability reachabilityForInternetConnection]currentReachabilityStatus]; I am getting s... | TITLE:
Objective C: Unable to obtain Network Status value
QUESTION:
I am trying to get the network status via the following code //define in my.h file NetworkStatus internetConnectionStatus;
//define in my.m file self.internetConnectionStatus = [[Reachability reachabilityForInternetConnection]currentReachabilityStatu... | [
"objective-c",
"ios",
"networking",
"reachability"
] | 1 | 5 | 1,404 | 1 | 0 | 2011-06-08T02:13:43.090000 | 2011-06-08T02:22:32.043000 |
6,273,523 | 6,273,568 | How do I disable all the validators on a usercontrol? | I need to disable validation on the user control level. I am aware we can do this with properties. Is there a way to disable all at a once in code? Perhaps by going through a loop or a key? (I do not need to disable all validation at the page level, only the user control level) | Perhaps using Validation Groups would give you the flexibility you need? | How do I disable all the validators on a usercontrol? I need to disable validation on the user control level. I am aware we can do this with properties. Is there a way to disable all at a once in code? Perhaps by going through a loop or a key? (I do not need to disable all validation at the page level, only the user co... | TITLE:
How do I disable all the validators on a usercontrol?
QUESTION:
I need to disable validation on the user control level. I am aware we can do this with properties. Is there a way to disable all at a once in code? Perhaps by going through a loop or a key? (I do not need to disable all validation at the page level... | [
"c#",
"asp.net",
"oop",
"validation",
"user-controls"
] | 0 | 1 | 2,507 | 2 | 0 | 2011-06-08T02:14:42.377000 | 2011-06-08T02:25:16 |
6,273,526 | 6,273,539 | How do I change the case on every field in a mysql table in one call? | I have a table with 27 varchar fields. I want to make all fields lowercase, but i want to do it in one short mysql call. This does a single field: UPDATE table SET field = LOWER(field) How do I do the equivalent of this (which doesn't work): UPDATE table SET * = LOWER(*) | You can't do it with your creative attempt SET * = LOWER(*) etc. You can however do it like this: UPDATE table SET column1 = LOWER(column1), column2 = LOWER(column2), -- etc, listing all text type columns columnN = LOWER(columnN); The reason there's no "shortcut" is probably because this pattern is so infrequently need... | How do I change the case on every field in a mysql table in one call? I have a table with 27 varchar fields. I want to make all fields lowercase, but i want to do it in one short mysql call. This does a single field: UPDATE table SET field = LOWER(field) How do I do the equivalent of this (which doesn't work): UPDATE t... | TITLE:
How do I change the case on every field in a mysql table in one call?
QUESTION:
I have a table with 27 varchar fields. I want to make all fields lowercase, but i want to do it in one short mysql call. This does a single field: UPDATE table SET field = LOWER(field) How do I do the equivalent of this (which doesn... | [
"mysql",
"sql"
] | 5 | 3 | 94 | 2 | 0 | 2011-06-08T02:15:33.443000 | 2011-06-08T02:18:39.653000 |
6,273,527 | 6,275,091 | FilterAttributes conflicting Compress, RegexFilter | I have a controller action like so [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Put)] [InsertScript(Order = 1)] [Compress(Order = 2)] public ViewResult Service(Page page) { //omitted } The InsertScript attribute applied a Response.Filter response.Filter = new RegexResponseFilter(response.Filter, scriptInsertRegex, replacemen... | Try flipping the order of inclusion: [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Put)] [Compress(Order = 1)] [InsertScript(Order = 2)] public ViewResult Service(Page page) { //omitted } Another possibility is to combine multiple filters like this and then use a single action filter attribute: response.Filter = new CompressS... | FilterAttributes conflicting Compress, RegexFilter I have a controller action like so [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Put)] [InsertScript(Order = 1)] [Compress(Order = 2)] public ViewResult Service(Page page) { //omitted } The InsertScript attribute applied a Response.Filter response.Filter = new RegexResponseFi... | TITLE:
FilterAttributes conflicting Compress, RegexFilter
QUESTION:
I have a controller action like so [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Put)] [InsertScript(Order = 1)] [Compress(Order = 2)] public ViewResult Service(Page page) { //omitted } The InsertScript attribute applied a Response.Filter response.Filter = n... | [
"asp.net",
"asp.net-mvc-3",
"compression",
"action-filter"
] | 0 | 0 | 181 | 1 | 0 | 2011-06-08T02:15:36.157000 | 2011-06-08T06:42:15.027000 |
6,273,545 | 6,273,586 | Rotate a WPF Canvas derived component using code behind | I'm wanting to make a component that inherits from rotate canvas using a storyboard. But when I try nothing happens. Eventually I also want to dynamically change the speed of rotation to a stop. But first, i need rotate the componente. This is the code for the component: class MyToy: Canvas { public MyToy() { this.Back... | The target of your animation is a MyToy object and your target property is Angle. MyToy doesn't have an angle property though. Solution: Set the RenderTransform (or LayoutTransform) property of MyToy to be a new RotateTransform object. Then use that object (which has the Angle property) as the target of the animation. | Rotate a WPF Canvas derived component using code behind I'm wanting to make a component that inherits from rotate canvas using a storyboard. But when I try nothing happens. Eventually I also want to dynamically change the speed of rotation to a stop. But first, i need rotate the componente. This is the code for the com... | TITLE:
Rotate a WPF Canvas derived component using code behind
QUESTION:
I'm wanting to make a component that inherits from rotate canvas using a storyboard. But when I try nothing happens. Eventually I also want to dynamically change the speed of rotation to a stop. But first, i need rotate the componente. This is th... | [
"c#",
"wpf",
"xaml",
"animation",
"canvas"
] | 1 | 1 | 3,855 | 1 | 0 | 2011-06-08T02:20:10.327000 | 2011-06-08T02:28:28.773000 |
6,273,552 | 6,273,584 | Memory size of a list of int | I have a list of int that's stored in the DB in the form of a string with commas in between (4345,324,24,2424,64567,33...). This string could become quite large and contain 2-3 thousand numbers. It's stored in the DB and used quite frequently. I'm thinking that instead of reading it from the DB every time it's needed, ... | An int in C# is always 4 bytes (no matter what the value). A list of 1,000 ints is therefore ~4,000 bytes. I say approximately because the list structure will add some overhead. A few thousand ints in a list shouldn't be a problem for a modern computer. | Memory size of a list of int I have a list of int that's stored in the DB in the form of a string with commas in between (4345,324,24,2424,64567,33...). This string could become quite large and contain 2-3 thousand numbers. It's stored in the DB and used quite frequently. I'm thinking that instead of reading it from th... | TITLE:
Memory size of a list of int
QUESTION:
I have a list of int that's stored in the DB in the form of a string with commas in between (4345,324,24,2424,64567,33...). This string could become quite large and contain 2-3 thousand numbers. It's stored in the DB and used quite frequently. I'm thinking that instead of ... | [
"c#",
".net",
"asp.net",
"session",
".net-4.0"
] | 2 | 4 | 7,089 | 6 | 0 | 2011-06-08T02:22:29.343000 | 2011-06-08T02:28:10.017000 |
6,273,565 | 6,273,674 | Can't determine what selector to use on td inside of table inside of div | I'm having trouble determining what selector to use access the CSS properties. Here's my code: My jquery: My html: Day 1 August 15, 2011 I'm trying to access the.calendarHeader CSS property background-color. I have tried #columnDay1.calendarHeader and it does not work. I'm banging my head on the desk. Any help? | instead of $('#columnDay1').mouseover(function () { $('td.calendarHeader').css("background-color", "#a43802"); }); try $('#columnDay1').mouseover(function () { $('td.calendarHeader', this).css("background-color", "#a43802"); }); td.calendarHeader will reference every td of class "calendarHeader". You need to give it a ... | Can't determine what selector to use on td inside of table inside of div I'm having trouble determining what selector to use access the CSS properties. Here's my code: My jquery: My html: Day 1 August 15, 2011 I'm trying to access the.calendarHeader CSS property background-color. I have tried #columnDay1.calendarHeader... | TITLE:
Can't determine what selector to use on td inside of table inside of div
QUESTION:
I'm having trouble determining what selector to use access the CSS properties. Here's my code: My jquery: My html: Day 1 August 15, 2011 I'm trying to access the.calendarHeader CSS property background-color. I have tried #columnD... | [
"jquery",
"html",
"css",
"html-table"
] | 0 | 0 | 124 | 3 | 0 | 2011-06-08T02:25:12.540000 | 2011-06-08T02:46:10.053000 |
6,273,581 | 6,273,667 | Java: Safe Animations with Swing | I am creating a program that uses JFrame, JPanel, JLabel and all other sorts of swing components. What I want to do is create a 2D animation on a separate JPanel that is dedicated to this animation. So I will be overriding the paintComponent (Graphics g) method. I have experience making animations with for loops + Thre... | Jimmy, I think you are misunderstanding how threads work in Swing. You must use a specific thread called the Event Dispatch Thread to do any updating on swing components (with a few specific exceptions I won't discuss here). You can use a swing timer to set a recurring task to run on the event dispatch thread. See this... | Java: Safe Animations with Swing I am creating a program that uses JFrame, JPanel, JLabel and all other sorts of swing components. What I want to do is create a 2D animation on a separate JPanel that is dedicated to this animation. So I will be overriding the paintComponent (Graphics g) method. I have experience making... | TITLE:
Java: Safe Animations with Swing
QUESTION:
I am creating a program that uses JFrame, JPanel, JLabel and all other sorts of swing components. What I want to do is create a 2D animation on a separate JPanel that is dedicated to this animation. So I will be overriding the paintComponent (Graphics g) method. I have... | [
"java",
"swing",
"animation",
"jframe"
] | 5 | 8 | 14,707 | 2 | 0 | 2011-06-08T02:27:44.533000 | 2011-06-08T02:44:33.600000 |
6,273,587 | 6,277,035 | How to set up protected static files in Kohana 3.1 | I'm using Kohana 3.1 with the ORM/Auth module enabled. I would like to serve static files (docs, pdfs, etc.) only to people with role A, in directory A_only. Since the.htaccess files just serves URLs that it finds directly and doesn't hand it off to index.php, I could deny all access in A_only through a.htaccess, but t... | You're going to need to tell your web server to stop handling static files. The easiest solution would be to move the static files outside of the web directory so Apache can't find them; This will force that request to go through Kohana. The second part is creating a controller which handles the permissions and file se... | How to set up protected static files in Kohana 3.1 I'm using Kohana 3.1 with the ORM/Auth module enabled. I would like to serve static files (docs, pdfs, etc.) only to people with role A, in directory A_only. Since the.htaccess files just serves URLs that it finds directly and doesn't hand it off to index.php, I could ... | TITLE:
How to set up protected static files in Kohana 3.1
QUESTION:
I'm using Kohana 3.1 with the ORM/Auth module enabled. I would like to serve static files (docs, pdfs, etc.) only to people with role A, in directory A_only. Since the.htaccess files just serves URLs that it finds directly and doesn't hand it off to i... | [
"php",
"kohana",
"kohana-3",
"kohana-auth"
] | 1 | 3 | 1,058 | 1 | 0 | 2011-06-08T02:28:33.020000 | 2011-06-08T09:58:11.137000 |
6,273,590 | 6,273,609 | is a 'variable' but is used like a 'method' | I attempted to search for a solution on google and on SO but was not able to resolve my issue. My code is: try { objEmployerAuditReportData empAuditData = new objEmployerAuditReportData(); IList listAuditBatchList = empAuditData.GetAuditBatchList();
foreach (var batchList in listAuditBatchList) { IList listAuditBatchD... | It is where you "call" listAuditBatchList with parentheses and a string argument, "form_request_id". listAuditBatchList is a list of EmployerAuditReport, so there is no way to call it as a method, and no string keys if you meant listAuditBatchList["form_request_id"]. | is a 'variable' but is used like a 'method' I attempted to search for a solution on google and on SO but was not able to resolve my issue. My code is: try { objEmployerAuditReportData empAuditData = new objEmployerAuditReportData(); IList listAuditBatchList = empAuditData.GetAuditBatchList();
foreach (var batchList in... | TITLE:
is a 'variable' but is used like a 'method'
QUESTION:
I attempted to search for a solution on google and on SO but was not able to resolve my issue. My code is: try { objEmployerAuditReportData empAuditData = new objEmployerAuditReportData(); IList listAuditBatchList = empAuditData.GetAuditBatchList();
foreach... | [
"c#-4.0"
] | 0 | 3 | 4,799 | 2 | 0 | 2011-06-08T02:28:50.397000 | 2011-06-08T02:32:38.180000 |
6,273,595 | 6,273,914 | Faster Alternative to std::ofstream | I generate a set of data files. As the files are supposed to be readable, they text files (opposed to binary files). To output information to my files, I used very comfortable std::ofstream object. In the beginning, when the data to be exported was smaller, the time needed to write to the files was not noticeable. Howe... | How are vpTilesetSprites and vpTilesetSprites[nSprite] stored? Are they implemented with lists or arrays? There is a lot of indexed access to them, and if they are list-like structures, you'll spend a lot of extra time following needless pointers. Ed S.'s comment is right: giving the long indexed temporary variables an... | Faster Alternative to std::ofstream I generate a set of data files. As the files are supposed to be readable, they text files (opposed to binary files). To output information to my files, I used very comfortable std::ofstream object. In the beginning, when the data to be exported was smaller, the time needed to write t... | TITLE:
Faster Alternative to std::ofstream
QUESTION:
I generate a set of data files. As the files are supposed to be readable, they text files (opposed to binary files). To output information to my files, I used very comfortable std::ofstream object. In the beginning, when the data to be exported was smaller, the time... | [
"c++",
"std",
"fstream",
"ofstream"
] | 1 | 3 | 6,937 | 5 | 0 | 2011-06-08T02:29:42.867000 | 2011-06-08T03:31:41.563000 |
6,273,608 | 6,273,809 | How to pass argument to Makefile from command line? | How to pass argument to Makefile from command line? I understand I can do $ make action VAR="value" $ value with Makefile VAR = "default" action: @echo $(VAR) How do I get the following behavior? $ make action value value How about $make action value1 value2 value1 value2 | You probably shouldn't do this; you're breaking the basic pattern of how Make works. But here it is: action: @echo action $(filter-out $@,$(MAKECMDGOALS))
%: # thanks to chakrit @: # thanks to William Pursell EDIT: To explain the first command, $(MAKECMDGOALS) is the list of "targets" spelled out on the command line, ... | How to pass argument to Makefile from command line? How to pass argument to Makefile from command line? I understand I can do $ make action VAR="value" $ value with Makefile VAR = "default" action: @echo $(VAR) How do I get the following behavior? $ make action value value How about $make action value1 value2 value1 va... | TITLE:
How to pass argument to Makefile from command line?
QUESTION:
How to pass argument to Makefile from command line? I understand I can do $ make action VAR="value" $ value with Makefile VAR = "default" action: @echo $(VAR) How do I get the following behavior? $ make action value value How about $make action value... | [
"command-line",
"parameters",
"makefile",
"arguments"
] | 194 | 290 | 237,921 | 6 | 0 | 2011-06-08T02:32:38.117000 | 2011-06-08T03:13:00.627000 |
6,273,616 | 6,273,632 | Rails for Zombie Level 5 Challenge 2 - Custom Routes | The objective is to create a custom route so that /undead will go to the undead action on the ZombiesController. My code: TwitterForZombies::Application.routes.draw do resources:zombies match 'show_zombie' => "undead#show" end And the error..."Did not add the correct route, could not get to ZombiesController#undead." I... | Your route notation should look like this: match 'path' => 'controller#action' So, the path is undead, the controller is zombies, and the action is undead: match 'undead' => 'zombies#undead' | Rails for Zombie Level 5 Challenge 2 - Custom Routes The objective is to create a custom route so that /undead will go to the undead action on the ZombiesController. My code: TwitterForZombies::Application.routes.draw do resources:zombies match 'show_zombie' => "undead#show" end And the error..."Did not add the correct... | TITLE:
Rails for Zombie Level 5 Challenge 2 - Custom Routes
QUESTION:
The objective is to create a custom route so that /undead will go to the undead action on the ZombiesController. My code: TwitterForZombies::Application.routes.draw do resources:zombies match 'show_zombie' => "undead#show" end And the error..."Did n... | [
"ruby-on-rails",
"routes"
] | 3 | 8 | 3,795 | 4 | 0 | 2011-06-08T02:34:24.950000 | 2011-06-08T02:37:46.917000 |
6,273,621 | 6,274,016 | Understanding a recursively defined list (fibs in terms of zipWith) | I'm learning Haskell, and came across the following code: fibs = 0: 1: zipWith (+) fibs (tail fibs) which I'm having a bit of trouble parsing, in terms of how it works. It's very neat, I understand that nothing more is needed, but I'd like to understand how Haskell manages to "fill in" fibs when I write: take 50 fibs A... | I'll give a bit of an explanation of how it works internally. First, you must realise that Haskell uses a thing called a thunk for its values. A thunk is basically a value that has not yet been computed yet -- think of it as a function of 0 arguments. Whenever Haskell wants to, it can evaluate (or partly-evaluate) the ... | Understanding a recursively defined list (fibs in terms of zipWith) I'm learning Haskell, and came across the following code: fibs = 0: 1: zipWith (+) fibs (tail fibs) which I'm having a bit of trouble parsing, in terms of how it works. It's very neat, I understand that nothing more is needed, but I'd like to understan... | TITLE:
Understanding a recursively defined list (fibs in terms of zipWith)
QUESTION:
I'm learning Haskell, and came across the following code: fibs = 0: 1: zipWith (+) fibs (tail fibs) which I'm having a bit of trouble parsing, in terms of how it works. It's very neat, I understand that nothing more is needed, but I'd... | [
"list",
"haskell",
"lazy-evaluation",
"fibonacci",
"lazy-sequences"
] | 73 | 123 | 9,205 | 4 | 0 | 2011-06-08T02:35:36.450000 | 2011-06-08T03:52:21.047000 |
6,273,622 | 6,273,637 | Is there an expression which dictates which form of delete is used (implicite versus complete)? | Let's say I have class A( ): pass. Should I be explicitly calling del for a deep delete? Let me be more specific: What happens just before a fork merge with a current thread? When a thread is being interwoven with another, does it thrash or use a pointer? EDIT Aha! http://docs.python.org/library/gc.html | The del keyword doesn't actually explicitly remove an object. It decrements the reference count, and then the garbage collector cleans up the memory if nothing else is using it. It's useful when you have a block of code that will be running for a long time, and a variable that's eating up a lot of memory that you don't... | Is there an expression which dictates which form of delete is used (implicite versus complete)? Let's say I have class A( ): pass. Should I be explicitly calling del for a deep delete? Let me be more specific: What happens just before a fork merge with a current thread? When a thread is being interwoven with another, d... | TITLE:
Is there an expression which dictates which form of delete is used (implicite versus complete)?
QUESTION:
Let's say I have class A( ): pass. Should I be explicitly calling del for a deep delete? Let me be more specific: What happens just before a fork merge with a current thread? When a thread is being interwov... | [
"python"
] | 2 | 4 | 287 | 1 | 0 | 2011-06-08T02:35:45.847000 | 2011-06-08T02:38:32.797000 |
6,273,625 | 6,273,675 | Setting Datetime field using Ruby Form helpers | I am trying to set a datetime field using the ruby forum helpers. <%= form_for @event do |f| %> <%= render 'shared/error_messages',:object => f.object %> Title <%= f.text_field:title %> Description <%= f.text_area:description,:class => "comment" %> Location <%= f.text_field:location %> Time <%= select_datetime Date.tod... | You need to process what you're getting in your controller, like: def create @event = current_user.events.build(params[:event]) datetime=DateTime.civil(params[:start_date][:year].to_i, params[:start_date][:month].to_i, params[:start_date][:day].to_i, params[:start_date][:hours].to_i,params[:start_date][:minutes].to_i, ... | Setting Datetime field using Ruby Form helpers I am trying to set a datetime field using the ruby forum helpers. <%= form_for @event do |f| %> <%= render 'shared/error_messages',:object => f.object %> Title <%= f.text_field:title %> Description <%= f.text_area:description,:class => "comment" %> Location <%= f.text_fiel... | TITLE:
Setting Datetime field using Ruby Form helpers
QUESTION:
I am trying to set a datetime field using the ruby forum helpers. <%= form_for @event do |f| %> <%= render 'shared/error_messages',:object => f.object %> Title <%= f.text_field:title %> Description <%= f.text_area:description,:class => "comment" %> Locati... | [
"ruby-on-rails",
"datetime",
"form-helpers"
] | 0 | 0 | 5,965 | 2 | 0 | 2011-06-08T02:36:36.097000 | 2011-06-08T02:46:41.673000 |
6,273,653 | 6,273,663 | How are large text fields stored in mySQL? | For example, this field I am writing in now can holds a lot of text. I'm assuming this is a mySQL VARCHAR or TEXT field but this is just a guess. According to MySQL: Large VARCHAR vs. TEXT? TEXT should be used. Where is the line for switching from VARHCAR to TEXT. I'm looking for something more concrete then the link I... | VARCHAR is limited to 255 characters in all mysql versions <= 5.0.3 There are various sizes of TEXT fields as well, TEXT, MEDIUMTEXT, LONGTEXT. You can find more details here: http://dev.mysql.com/doc/refman/5.5/en/blob.html I would strongly suggest defaulting to text or larger for what you're proposing. | How are large text fields stored in mySQL? For example, this field I am writing in now can holds a lot of text. I'm assuming this is a mySQL VARCHAR or TEXT field but this is just a guess. According to MySQL: Large VARCHAR vs. TEXT? TEXT should be used. Where is the line for switching from VARHCAR to TEXT. I'm looking ... | TITLE:
How are large text fields stored in mySQL?
QUESTION:
For example, this field I am writing in now can holds a lot of text. I'm assuming this is a mySQL VARCHAR or TEXT field but this is just a guess. According to MySQL: Large VARCHAR vs. TEXT? TEXT should be used. Where is the line for switching from VARHCAR to ... | [
"mysql",
"testing",
"varchar"
] | 0 | 2 | 2,842 | 1 | 0 | 2011-06-08T02:41:49.913000 | 2011-06-08T02:44:11.657000 |
6,273,659 | 6,273,691 | How can I sort the items in a Databound windows phone application? | Starting with the stock Databound application, I have three strings: LineOne, LineTwo and LineThree. Now imagine I had IntThree instead of LineThree. The data is added to Items like so: this.Items.Add(new ItemViewModel() { LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", IntThree = 5 }); this.I... | You can use linq to order your items lstItems.ItemsSource = yourList.OrderBy(i=>i.LineOne).ToList(); | How can I sort the items in a Databound windows phone application? Starting with the stock Databound application, I have three strings: LineOne, LineTwo and LineThree. Now imagine I had IntThree instead of LineThree. The data is added to Items like so: this.Items.Add(new ItemViewModel() { LineOne = "runtime one", LineT... | TITLE:
How can I sort the items in a Databound windows phone application?
QUESTION:
Starting with the stock Databound application, I have three strings: LineOne, LineTwo and LineThree. Now imagine I had IntThree instead of LineThree. The data is added to Items like so: this.Items.Add(new ItemViewModel() { LineOne = "r... | [
"sorting",
"windows-phone-7"
] | 0 | 4 | 859 | 2 | 0 | 2011-06-08T02:43:44.300000 | 2011-06-08T02:49:31.127000 |
6,273,670 | 6,273,722 | C++ std::sort on vector<object*> - Assignment of Read-only Location | UPDATED SOLUTION: With my particular problem, the sort call was inside a Render function marked as const. By either removing the const (not my preference) or putting the sort in another function (in this case, the bottom of my Update), the problem is taken care of. As several answerer's suggested, it WAS a const proble... | Just from your code, I guess that your Object::GetDist() method is not const. In C++, a const object of a class can call only const members. If this is the case then you have 2 ways to remove this error. (1) Make GetDist as const: class Object { int GetDist () const; // <-- add const }; (2) Change SortByDistance: bool ... | C++ std::sort on vector<object*> - Assignment of Read-only Location UPDATED SOLUTION: With my particular problem, the sort call was inside a Render function marked as const. By either removing the const (not my preference) or putting the sort in another function (in this case, the bottom of my Update), the problem is t... | TITLE:
C++ std::sort on vector<object*> - Assignment of Read-only Location
QUESTION:
UPDATED SOLUTION: With my particular problem, the sort call was inside a Render function marked as const. By either removing the const (not my preference) or putting the sort in another function (in this case, the bottom of my Update)... | [
"c++",
"stdvector"
] | 1 | 2 | 3,750 | 1 | 0 | 2011-06-08T02:45:15.173000 | 2011-06-08T02:55:58.573000 |
6,273,676 | 6,282,605 | Set PDF Version using iTextSharp | Anyone know how to save a PDF as a lower PDF version programmatically using iTextSharp so that you can use certain iTextSharp features that require the PDF to be version 5 or lower? I'm trying to merge two PDF version 7 documents together and it insists that they be version 5 or lower. | How odd. PDF versions are mostly a suggestion. PDFs must start with something like: %PDF-1.x Where the X is 0,1,2,... This is just a clue to the app reading the PDF. The only clue. Most "I need version X" requests I see from various customers are bogus. My fellow iText coders know this, so it strikes me as odd that iTe... | Set PDF Version using iTextSharp Anyone know how to save a PDF as a lower PDF version programmatically using iTextSharp so that you can use certain iTextSharp features that require the PDF to be version 5 or lower? I'm trying to merge two PDF version 7 documents together and it insists that they be version 5 or lower. | TITLE:
Set PDF Version using iTextSharp
QUESTION:
Anyone know how to save a PDF as a lower PDF version programmatically using iTextSharp so that you can use certain iTextSharp features that require the PDF to be version 5 or lower? I'm trying to merge two PDF version 7 documents together and it insists that they be ve... | [
"pdf",
"itext"
] | 5 | 3 | 18,432 | 4 | 0 | 2011-06-08T02:46:52.377000 | 2011-06-08T17:13:59.550000 |
6,273,679 | 6,273,690 | How to extract all text in front of the '@' character in a string | how to remove a string starting from '@'? for example admin@admin.com, i want to remove the string starting from @ so it becomes 'admin' only. just like in twitter..i read about str replace and trim but i think theres other way to do it? $email = 'admin@admin.com';
echo substr_replace($email,?,?); this i cant do | You don't need to replace the remainder, you can just cut out until the searched character. In this case it's very easy with strtok: $name = strtok($email, "@"); | How to extract all text in front of the '@' character in a string how to remove a string starting from '@'? for example admin@admin.com, i want to remove the string starting from @ so it becomes 'admin' only. just like in twitter..i read about str replace and trim but i think theres other way to do it? $email = 'admin@... | TITLE:
How to extract all text in front of the '@' character in a string
QUESTION:
how to remove a string starting from '@'? for example admin@admin.com, i want to remove the string starting from @ so it becomes 'admin' only. just like in twitter..i read about str replace and trim but i think theres other way to do it... | [
"php",
"string",
"replace",
"trim"
] | 1 | 5 | 330 | 7 | 0 | 2011-06-08T02:47:22.503000 | 2011-06-08T02:49:15.697000 |
6,273,695 | 6,273,728 | shotgun for django? | I like shotgun server. but is there any similar package available for Django development? shotgun reloads the server every time the code is changed, thus making the development process easier.. I am looking for a similar kind of program for Django development. Thanks! | You could use the Django Dev server that is supplied. OR you could use something similar to this: http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-server/ This will reload the server at each request, but make sure to turn it off before production! Edit: The part you really need is just this: MaxReques... | shotgun for django? I like shotgun server. but is there any similar package available for Django development? shotgun reloads the server every time the code is changed, thus making the development process easier.. I am looking for a similar kind of program for Django development. Thanks! | TITLE:
shotgun for django?
QUESTION:
I like shotgun server. but is there any similar package available for Django development? shotgun reloads the server every time the code is changed, thus making the development process easier.. I am looking for a similar kind of program for Django development. Thanks!
ANSWER:
You ... | [
"python",
"django",
"sinatra",
"shotgun"
] | 1 | 1 | 251 | 1 | 0 | 2011-06-08T02:50:03.123000 | 2011-06-08T02:56:42.430000 |
6,273,696 | 6,286,681 | {tableView reloadData} causes app to crash after section is deleted | I have a defined a custom header view programmatically in the method: ViewForHeaderInSection Inside the custom view is a UIButton which has a target-action method:"foodDeleteButtonPressed". I'm also setting the button's tag variable to the section number. Here is the implementation of that method -(void)foodDeleteButto... | When you removed the object, did you decrement the number of items that your table delegate reports to exist in the table? This line: Restaurant 0x00015c77 - [MyOrderViewController tableView:viewForHeaderInSection:] + 827 is doing an objectAtIndex on an array, likely the one you just removed the entry from. I would gue... | {tableView reloadData} causes app to crash after section is deleted I have a defined a custom header view programmatically in the method: ViewForHeaderInSection Inside the custom view is a UIButton which has a target-action method:"foodDeleteButtonPressed". I'm also setting the button's tag variable to the section numb... | TITLE:
{tableView reloadData} causes app to crash after section is deleted
QUESTION:
I have a defined a custom header view programmatically in the method: ViewForHeaderInSection Inside the custom view is a UIButton which has a target-action method:"foodDeleteButtonPressed". I'm also setting the button's tag variable t... | [
"ios",
"uitableview"
] | 0 | 0 | 3,030 | 3 | 0 | 2011-06-08T02:50:10.370000 | 2011-06-09T00:04:13.880000 |
6,273,697 | 6,273,716 | Anonymous function scope confusion | How can I assign values inside an anonymous function to global variables, or variables outside its scope. For instance, the example below. console.log(rows) returns the right data, while console.log(result) returns undefined var result; this.query(sql).execute(function(error, rows) { console.log( rows ) result = rows; ... | Node.js is event driven, meaning that most of the functions are asynchronous. The execute function does not return any value, because the "returned" value is in the anonymous function declared as your first argument, which function will be called only when the query has been executed and a value has been returned by th... | Anonymous function scope confusion How can I assign values inside an anonymous function to global variables, or variables outside its scope. For instance, the example below. console.log(rows) returns the right data, while console.log(result) returns undefined var result; this.query(sql).execute(function(error, rows) { ... | TITLE:
Anonymous function scope confusion
QUESTION:
How can I assign values inside an anonymous function to global variables, or variables outside its scope. For instance, the example below. console.log(rows) returns the right data, while console.log(result) returns undefined var result; this.query(sql).execute(functi... | [
"javascript",
"node.js",
"scope",
"anonymous-function"
] | 1 | 8 | 364 | 2 | 0 | 2011-06-08T02:50:24.487000 | 2011-06-08T02:53:56.783000 |
6,273,706 | 6,273,825 | Extract just the depot path from perforce output | Already tried a few of the "Extract up to a character" questions here, none work. Using this in grep -o example input: //blah/blah/foo.txt#7 - edit change 12526 (text) by blah@blah I want to get: //blah/blah/foo.txt Right now I am using the regex '/[^#]*/' but I get //blah/blah/ | grep does not use slashes to delimit the pattern, so the slashes are being matched literally. Try: echo '//blah/blah/foo.txt#7 - edit change 12526 (text)' | grep -o '/[^#]*' Note that if the "text" has a slash in it, that part will also match and will therefore be printed by grep -o. So I would go with something like t... | Extract just the depot path from perforce output Already tried a few of the "Extract up to a character" questions here, none work. Using this in grep -o example input: //blah/blah/foo.txt#7 - edit change 12526 (text) by blah@blah I want to get: //blah/blah/foo.txt Right now I am using the regex '/[^#]*/' but I get //bl... | TITLE:
Extract just the depot path from perforce output
QUESTION:
Already tried a few of the "Extract up to a character" questions here, none work. Using this in grep -o example input: //blah/blah/foo.txt#7 - edit change 12526 (text) by blah@blah I want to get: //blah/blah/foo.txt Right now I am using the regex '/[^#]... | [
"regex",
"perforce"
] | 2 | 5 | 317 | 4 | 0 | 2011-06-08T02:52:03.637000 | 2011-06-08T03:15:29.050000 |
6,273,718 | 6,273,797 | protocol to use password hashing with salt | I am trying to understand what information are needed to be sent in a web application. Basically I have a web app running on a web server, a database which has a user table with hashed password and salt, and of course the web client with javascript enabled. When a user login at the login, the user name and password are... | When the browser sends over the data you provided it sends it over in a format which most likely matches the requirements of the RFC(s) for the protocol it is communicating with the server over. In the case of an HTTP connection, the user name and password are sent in the clear (that is, in plain text) to your webserve... | protocol to use password hashing with salt I am trying to understand what information are needed to be sent in a web application. Basically I have a web app running on a web server, a database which has a user table with hashed password and salt, and of course the web client with javascript enabled. When a user login a... | TITLE:
protocol to use password hashing with salt
QUESTION:
I am trying to understand what information are needed to be sent in a web application. Basically I have a web app running on a web server, a database which has a user table with hashed password and salt, and of course the web client with javascript enabled. W... | [
"javascript",
"hash",
"salt",
"message-digest"
] | 3 | 6 | 3,947 | 3 | 0 | 2011-06-08T02:55:06.667000 | 2011-06-08T03:10:59.813000 |
6,273,725 | 6,273,952 | Binding commands to interactions such as MouseLeave? | I have been trying to find the simplest method (in XAML) to bind a command to a control interaction, such as MouseLeave. I have tried using EventTriggers but was unable to determine the correct structure for command binding, can anyone sugest something to me? | The most kosher way of doing this is using attached properties. An excellent implementation of that can be found here: http://marlongrech.wordpress.com/2008/12/13/attachedcommandbehavior-v2-aka-acb/ | Binding commands to interactions such as MouseLeave? I have been trying to find the simplest method (in XAML) to bind a command to a control interaction, such as MouseLeave. I have tried using EventTriggers but was unable to determine the correct structure for command binding, can anyone sugest something to me? | TITLE:
Binding commands to interactions such as MouseLeave?
QUESTION:
I have been trying to find the simplest method (in XAML) to bind a command to a control interaction, such as MouseLeave. I have tried using EventTriggers but was unable to determine the correct structure for command binding, can anyone sugest someth... | [
"wpf",
"mvvm",
".net-4.0"
] | 0 | 1 | 525 | 2 | 0 | 2011-06-08T02:56:30.847000 | 2011-06-08T03:40:35.480000 |
6,273,738 | 6,273,782 | ruby regex, everything BUT what is in parentheses and brackets | i am trying to write a regex that produces the content in a string that is NOT in parentheses or brackets. The parentheses is always a year, and the brackets could contain any normal characters, upper and lower case. i was going about it by finding the brackets and parentheses and then [^\regex] to escape it (is this r... | Try this /\(.+/ which will match everything from the opening ( onwards. If you strip that out, you're left with 'Some words' which should be what you need? Two points I may be misunderstanding the question You need something more complicated if there's any possibility of an ( appearing earlier in the string. By the way... | ruby regex, everything BUT what is in parentheses and brackets i am trying to write a regex that produces the content in a string that is NOT in parentheses or brackets. The parentheses is always a year, and the brackets could contain any normal characters, upper and lower case. i was going about it by finding the brac... | TITLE:
ruby regex, everything BUT what is in parentheses and brackets
QUESTION:
i am trying to write a regex that produces the content in a string that is NOT in parentheses or brackets. The parentheses is always a year, and the brackets could contain any normal characters, upper and lower case. i was going about it b... | [
"ruby",
"regex"
] | 1 | 5 | 7,227 | 4 | 0 | 2011-06-08T02:58:41.820000 | 2011-06-08T03:08:15.267000 |
6,273,742 | 6,273,752 | How do I prepend every item in a list of strings in C# with a Lambda Expression | I found a VB version of this here, but I'd like to use a Lambda Expression to take a List of strings and then prepend a string onto every item in the list. It seems like using the ForEach ends up sending in the string by value, so any changes disappear. Here's the line of code I was hoping to have work. listOfStrings.F... | Strings are immutable, they cannot be altered "in place". Therefore, you'd have to replace each entry in the list which you cannot do with List.ForEach. At this point you'd be best just making a new list: listOfStrings = listOfStrings.Select(value => "a" + value).ToList(); | How do I prepend every item in a list of strings in C# with a Lambda Expression I found a VB version of this here, but I'd like to use a Lambda Expression to take a List of strings and then prepend a string onto every item in the list. It seems like using the ForEach ends up sending in the string by value, so any chang... | TITLE:
How do I prepend every item in a list of strings in C# with a Lambda Expression
QUESTION:
I found a VB version of this here, but I'd like to use a Lambda Expression to take a List of strings and then prepend a string onto every item in the list. It seems like using the ForEach ends up sending in the string by v... | [
"c#",
"lambda"
] | 7 | 21 | 4,336 | 4 | 0 | 2011-06-08T03:01:05.267000 | 2011-06-08T03:03:39.913000 |
6,273,754 | 6,273,766 | SQL Server 2008 - Auditing Change Data Capture | I have been using SQL Server 2008 for about a year now and my knowledge is steadily progressing. The nature of the data I work with is fairly sensitive and as a result I wanted to ensure the integrity of it by implementing an audit table. I successfully followed http://msdn.microsoft.com/en-us/library/cc627397.aspx to ... | You're going to need to use triggers to do that so you have access to the INSERTED and DELETED tables. I use a modified version of this article in my own projects: Adding simple trigger-based auditing to your SQL Server database | SQL Server 2008 - Auditing Change Data Capture I have been using SQL Server 2008 for about a year now and my knowledge is steadily progressing. The nature of the data I work with is fairly sensitive and as a result I wanted to ensure the integrity of it by implementing an audit table. I successfully followed http://msd... | TITLE:
SQL Server 2008 - Auditing Change Data Capture
QUESTION:
I have been using SQL Server 2008 for about a year now and my knowledge is steadily progressing. The nature of the data I work with is fairly sensitive and as a result I wanted to ensure the integrity of it by implementing an audit table. I successfully f... | [
"sql-server-2008"
] | 2 | 1 | 960 | 1 | 0 | 2011-06-08T03:03:45.390000 | 2011-06-08T03:06:48.393000 |
6,273,761 | 6,273,819 | Correct way to clear preferences and make it use values from XML file? | So I was doing some development and changed the key names (android:key) of some preferences I have in my settings.xml file. During some testing I realized that the old settings (old keys and values) were still there, even though my new settings.xml file didn't have them anymore. I had been doing this when my app starte... | After your final example, you have to do a commit. I would recommend breaking the steps out to make it easier to read. SharedPreferences sharedPrefs = getDefaultSharedPreferences(this); Editor editor = sharedPrefs.edit(); editor.clear(); editor.commit(); | Correct way to clear preferences and make it use values from XML file? So I was doing some development and changed the key names (android:key) of some preferences I have in my settings.xml file. During some testing I realized that the old settings (old keys and values) were still there, even though my new settings.xml ... | TITLE:
Correct way to clear preferences and make it use values from XML file?
QUESTION:
So I was doing some development and changed the key names (android:key) of some preferences I have in my settings.xml file. During some testing I realized that the old settings (old keys and values) were still there, even though my... | [
"android",
"preferences"
] | 3 | 22 | 10,121 | 4 | 0 | 2011-06-08T03:05:16.773000 | 2011-06-08T03:15:15.150000 |
6,273,786 | 6,273,839 | Qt: QMainWindow taking ownership of QMenuBar | I would like to use a single instance of QMenuBar to ease integration with Mac OS X, however the documentation states Note: QMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time. How can I get all my QMainWindows to share a single QMenuBar? Or is the simple and unfortunate answer "yo... | Sorry for simply quoting the manual, but this question is really already covered on it. http://doc.qt.nokia.com/latest/qmainwindow.html#menuBar: If you want all windows in a Mac application to share one menu bar, don't use this function to create it, because the menu bar created here will have this QMainWindow as its p... | Qt: QMainWindow taking ownership of QMenuBar I would like to use a single instance of QMenuBar to ease integration with Mac OS X, however the documentation states Note: QMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time. How can I get all my QMainWindows to share a single QMenuBar... | TITLE:
Qt: QMainWindow taking ownership of QMenuBar
QUESTION:
I would like to use a single instance of QMenuBar to ease integration with Mac OS X, however the documentation states Note: QMainWindow takes ownership of the menuBar pointer and deletes it at the appropriate time. How can I get all my QMainWindows to share... | [
"qt",
"user-interface"
] | 2 | 0 | 943 | 1 | 0 | 2011-06-08T03:08:46.333000 | 2011-06-08T03:18:17.537000 |
6,273,788 | 6,273,876 | Building Expression Trees | I'm struggling with the idea of how to build an expression tree for more lambdas such as the one below, let alone something that might have multiple statements. For example: Func GetBytes = x => x.HasValue? BitConverter.GetBytes(x.Value): new byte[1] { 0xFF }; I would appreciate any thoughts. | I would suggest reading through the list of methods on the Expression class, all of your options are listed there, and the Expression Trees Programming Guide. As for this particular instance: /* build our parameters */ var pX = Expression.Parameter(typeof(double?));
/* build the body */ var body = Expression.Condition... | Building Expression Trees I'm struggling with the idea of how to build an expression tree for more lambdas such as the one below, let alone something that might have multiple statements. For example: Func GetBytes = x => x.HasValue? BitConverter.GetBytes(x.Value): new byte[1] { 0xFF }; I would appreciate any thoughts. | TITLE:
Building Expression Trees
QUESTION:
I'm struggling with the idea of how to build an expression tree for more lambdas such as the one below, let alone something that might have multiple statements. For example: Func GetBytes = x => x.HasValue? BitConverter.GetBytes(x.Value): new byte[1] { 0xFF }; I would appreci... | [
"c#",
"linq",
"lambda",
"expression-trees"
] | 6 | 5 | 3,177 | 1 | 0 | 2011-06-08T03:09:20.630000 | 2011-06-08T03:24:21.777000 |
6,273,791 | 6,273,843 | calling exec on a php file and passing parameters? | I am wanting to call a php file using exec. When I call it I want to be able to pass a variable through (an id). I can call echo exec("php /var/www/unity/src/emailer.php"); fine, but the moment I add anything like echo exec("php /var/www/unity/src/emailer.php?id=123"); the exec call fails. How can I do this? | Your call is failing because you're using a web-style syntax (?parameter=value ) with a command-line invokation. I understand what you're thinking, but it simply doesn't work. You'll want to use $argv instead. See the PHP manual. To see this in action, write this one-liner to a file: Then invoke it from the command-lin... | calling exec on a php file and passing parameters? I am wanting to call a php file using exec. When I call it I want to be able to pass a variable through (an id). I can call echo exec("php /var/www/unity/src/emailer.php"); fine, but the moment I add anything like echo exec("php /var/www/unity/src/emailer.php?id=123");... | TITLE:
calling exec on a php file and passing parameters?
QUESTION:
I am wanting to call a php file using exec. When I call it I want to be able to pass a variable through (an id). I can call echo exec("php /var/www/unity/src/emailer.php"); fine, but the moment I add anything like echo exec("php /var/www/unity/src/ema... | [
"php",
"variables",
"exec"
] | 23 | 34 | 69,499 | 5 | 0 | 2011-06-08T03:09:38.630000 | 2011-06-08T03:18:46.257000 |
6,273,792 | 6,273,827 | Changed text not posting back to code-behind | I have a textbox on an ASP.NET 4.0 page. I can add text to the textbox in the code-behind and when the page renders, the text displays just fine. However, when I modify the textbox in the browser and submit the page, the MyTextBox.Text property still shows the original text and not the modifed text I entered in the bro... | You need to check for a postback in your initial textbox, like this: if(!Page.IsPostBack) { MyTextBox.Text = "This is the text when page renders"; } You can set your textbox normally in the code behind for the submit button handler. void SubmitButton_Click(Object sender, EventArgs e) { MyTextBox.Text = tbUserInputHere.... | Changed text not posting back to code-behind I have a textbox on an ASP.NET 4.0 page. I can add text to the textbox in the code-behind and when the page renders, the text displays just fine. However, when I modify the textbox in the browser and submit the page, the MyTextBox.Text property still shows the original text ... | TITLE:
Changed text not posting back to code-behind
QUESTION:
I have a textbox on an ASP.NET 4.0 page. I can add text to the textbox in the code-behind and when the page renders, the text displays just fine. However, when I modify the textbox in the browser and submit the page, the MyTextBox.Text property still shows ... | [
"asp.net"
] | 1 | 1 | 685 | 2 | 0 | 2011-06-08T03:09:57.307000 | 2011-06-08T03:15:38.533000 |
6,273,793 | 6,273,857 | How to specialize Iterator by its value type, in C++? | Is it possible to specialize an Iterator template parameter by its value_type? I have a function with the following prototype. template void f(InputIterator first, InputIterator last); And I want to handle specially if InputIterator::value_type is SomeSpecificType. | You can use some intermediate structs to get the partial template specialisation that you need. Something like this should do the trick template struct f_impl { static void f( T first, T last ) {...}; //Default version };
template struct f_impl { static void f(T first,T last) {...}; //Specialisation };
template void ... | How to specialize Iterator by its value type, in C++? Is it possible to specialize an Iterator template parameter by its value_type? I have a function with the following prototype. template void f(InputIterator first, InputIterator last); And I want to handle specially if InputIterator::value_type is SomeSpecificType. | TITLE:
How to specialize Iterator by its value type, in C++?
QUESTION:
Is it possible to specialize an Iterator template parameter by its value_type? I have a function with the following prototype. template void f(InputIterator first, InputIterator last); And I want to handle specially if InputIterator::value_type is ... | [
"c++",
"templates",
"iterator",
"template-specialization"
] | 16 | 12 | 2,558 | 5 | 0 | 2011-06-08T03:10:05.590000 | 2011-06-08T03:20:36.130000 |
6,273,794 | 6,273,801 | How do I convert a date string to my datetime format? | I'm trying to convert a variable named $releasedate which contains the string 'May 31, 2011' to the string '2011-05-31 00:00:00' to insert into the database. I have tried... $pubdate = date('Y-m-d H:i:s',$releasedate);...but it didn't work. How do I do this? | You can use strtotime(). $pubdate = date('Y-m-d H:i:s', strtotime($releasedate)); // 2011-05-31 00:00:00 CodePad. | How do I convert a date string to my datetime format? I'm trying to convert a variable named $releasedate which contains the string 'May 31, 2011' to the string '2011-05-31 00:00:00' to insert into the database. I have tried... $pubdate = date('Y-m-d H:i:s',$releasedate);...but it didn't work. How do I do this? | TITLE:
How do I convert a date string to my datetime format?
QUESTION:
I'm trying to convert a variable named $releasedate which contains the string 'May 31, 2011' to the string '2011-05-31 00:00:00' to insert into the database. I have tried... $pubdate = date('Y-m-d H:i:s',$releasedate);...but it didn't work. How do ... | [
"php",
"sql"
] | 2 | 6 | 2,246 | 2 | 0 | 2011-06-08T03:10:24.887000 | 2011-06-08T03:11:48.023000 |
6,273,804 | 6,273,830 | Should I put this in my controller or model? | I have my attend method below currently in my controller. My question is how do I know whether to put this in my event or user model vs. my events controller? I am also going to add another method remove_attend which will do the opposite of attend. At what point do I put these methods into a model? def attend @event = ... | It belongs to the event controller. Flash messages or redirects cannot be put in the models. So, when you see either, it's safe to assume that they are controller material. It belongs to the event controller because the resource that attend refers to is an Event. You can create, edit or attend an event, in that sense. | Should I put this in my controller or model? I have my attend method below currently in my controller. My question is how do I know whether to put this in my event or user model vs. my events controller? I am also going to add another method remove_attend which will do the opposite of attend. At what point do I put the... | TITLE:
Should I put this in my controller or model?
QUESTION:
I have my attend method below currently in my controller. My question is how do I know whether to put this in my event or user model vs. my events controller? I am also going to add another method remove_attend which will do the opposite of attend. At what ... | [
"ruby-on-rails"
] | 0 | 3 | 157 | 3 | 0 | 2011-06-08T03:12:18.810000 | 2011-06-08T03:16:06.587000 |
6,273,806 | 6,273,899 | Regexp, how to limit a match | I have a string: string = %q{ 2503 read_attribute_before_type_cast( self.class.primary_key)} In this example I want to match the words 'class' which are not in the tag. Regexp for this: /\bclass[^=]/ But the problem is that it matches the last letter /\bclass[^=]/.match(string) => 'class.' I don't want have a last dot ... | You are almost correct, but you have an error in your look ahead. Try this: /\bclass(?!=)/ The regex term (?!=) means the input to the right must not match the character '=' | Regexp, how to limit a match I have a string: string = %q{ 2503 read_attribute_before_type_cast( self.class.primary_key)} In this example I want to match the words 'class' which are not in the tag. Regexp for this: /\bclass[^=]/ But the problem is that it matches the last letter /\bclass[^=]/.match(string) => 'class.' ... | TITLE:
Regexp, how to limit a match
QUESTION:
I have a string: string = %q{ 2503 read_attribute_before_type_cast( self.class.primary_key)} In this example I want to match the words 'class' which are not in the tag. Regexp for this: /\bclass[^=]/ But the problem is that it matches the last letter /\bclass[^=]/.match(st... | [
"ruby",
"regex"
] | 1 | 2 | 359 | 3 | 0 | 2011-06-08T03:12:34.087000 | 2011-06-08T03:28:42.850000 |
6,273,814 | 6,273,880 | Conditional validation on model dependent on value of model attribute | I'm struggling with validating a postal_code and using a different regex depending on what the country_code attribute is. I tried the following, but it does not work: class Venue < ActiveRecord::Base... attr_accessible:postal_code attr_accessible:country_code... validates_presence_of:country_code validates_length_of:co... | Take a look at this screencast http://asciicasts.com/episodes/211-validations-in-rails-3 I think its just about time to write a custom validator function for your postal code. | Conditional validation on model dependent on value of model attribute I'm struggling with validating a postal_code and using a different regex depending on what the country_code attribute is. I tried the following, but it does not work: class Venue < ActiveRecord::Base... attr_accessible:postal_code attr_accessible:cou... | TITLE:
Conditional validation on model dependent on value of model attribute
QUESTION:
I'm struggling with validating a postal_code and using a different regex depending on what the country_code attribute is. I tried the following, but it does not work: class Venue < ActiveRecord::Base... attr_accessible:postal_code a... | [
"ruby-on-rails",
"ruby",
"validation"
] | 2 | 3 | 5,540 | 2 | 0 | 2011-06-08T03:14:27.880000 | 2011-06-08T03:24:57.630000 |
6,273,822 | 6,273,837 | SQl Query to retrieve data | I cannot figure out how to get the required data from my table. The query which I wrote shows an error saying subquery returns more than one row.. SELECT name FROM `business` WHERE id = ( SELECT business_id FROM bill WHERE id = ( SELECT bill_id FROM bill_schedule WHERE show_bill = 1 ) Here the subquery for bill_schedul... | SELECT `name` FROM `business` WHERE id in ( SELECT business_id FROM bill WHERE id in ( SELECT bill_id FROM bill_schedule WHERE show_bill = 1 ) | SQl Query to retrieve data I cannot figure out how to get the required data from my table. The query which I wrote shows an error saying subquery returns more than one row.. SELECT name FROM `business` WHERE id = ( SELECT business_id FROM bill WHERE id = ( SELECT bill_id FROM bill_schedule WHERE show_bill = 1 ) Here th... | TITLE:
SQl Query to retrieve data
QUESTION:
I cannot figure out how to get the required data from my table. The query which I wrote shows an error saying subquery returns more than one row.. SELECT name FROM `business` WHERE id = ( SELECT business_id FROM bill WHERE id = ( SELECT bill_id FROM bill_schedule WHERE show_... | [
"mysql",
"sql"
] | 1 | 0 | 49 | 2 | 0 | 2011-06-08T03:15:23.730000 | 2011-06-08T03:18:06.833000 |
6,273,833 | 6,273,879 | Is there a standard Java implementation of a Fibonacci heap? | I was looking at the different kind of heap data structures. The Fibonacci heap seems to have the better worst case complexity for (1) insertion, (2) deletion and (2) finding the minimum element. I have found that in Java there is a class PriorityQueue that is a balanced binary heap. But why they did not use a Fibonacc... | No, the standard Java collections API does not contain an implementation of a Fibonacci heap. I'm not sure why this is, but I believe it is because while Fibonacci heaps are asymptotically great in an amortized sense, they have huge constant factors in practice. The collections framework also doesn't have a binomial he... | Is there a standard Java implementation of a Fibonacci heap? I was looking at the different kind of heap data structures. The Fibonacci heap seems to have the better worst case complexity for (1) insertion, (2) deletion and (2) finding the minimum element. I have found that in Java there is a class PriorityQueue that i... | TITLE:
Is there a standard Java implementation of a Fibonacci heap?
QUESTION:
I was looking at the different kind of heap data structures. The Fibonacci heap seems to have the better worst case complexity for (1) insertion, (2) deletion and (2) finding the minimum element. I have found that in Java there is a class Pr... | [
"java",
"data-structures",
"heap",
"fibonacci-heap"
] | 40 | 54 | 28,796 | 3 | 0 | 2011-06-08T03:17:17.147000 | 2011-06-08T03:24:43.310000 |
6,273,838 | 6,289,066 | How can I use local resources on a server? | How can I use local resources like css, js, png, etc. within a dynamically rendered page using webrick? In other words, how are things like Ruby on Rails linking made to work? I suppose this is one of the most basic things, and there should be a simple way to do it. Possible Solution I managed to do what I wanted using... | I finally found out that I can mount multiple servlets on a single server. It took a long time until I found such example. require 'webrick'
class WEBrick::HTTPServlet::AbstractServlet def do_GET request, response response.body = ' link... ' end end
server = WEBrick::HTTPServer.new(Port: 3000, BindAddress: "localhost... | How can I use local resources on a server? How can I use local resources like css, js, png, etc. within a dynamically rendered page using webrick? In other words, how are things like Ruby on Rails linking made to work? I suppose this is one of the most basic things, and there should be a simple way to do it. Possible S... | TITLE:
How can I use local resources on a server?
QUESTION:
How can I use local resources like css, js, png, etc. within a dynamically rendered page using webrick? In other words, how are things like Ruby on Rails linking made to work? I suppose this is one of the most basic things, and there should be a simple way to... | [
"ruby",
"local",
"absolute-path",
"webrick"
] | 1 | 0 | 1,620 | 4 | 0 | 2011-06-08T03:18:12.327000 | 2011-06-09T06:48:42.240000 |
6,273,860 | 6,283,059 | Spinner component in Wicket? | Where can I find a spinner component for Wicket?, including Maven repo and a source code example? | wicketstuff-minis has an implementation of a spinner. There is also a wicketstuff-minis-examples project The maven repos are: org.wicketstuff minis 1.4.17.2 and org.wicketstuff-examples minis 1.4.17.2 | Spinner component in Wicket? Where can I find a spinner component for Wicket?, including Maven repo and a source code example? | TITLE:
Spinner component in Wicket?
QUESTION:
Where can I find a spinner component for Wicket?, including Maven repo and a source code example?
ANSWER:
wicketstuff-minis has an implementation of a spinner. There is also a wicketstuff-minis-examples project The maven repos are: org.wicketstuff minis 1.4.17.2 and org.w... | [
"wicket",
"spinner"
] | 1 | 4 | 1,282 | 2 | 0 | 2011-06-08T03:20:55.757000 | 2011-06-08T17:50:47.153000 |
6,273,862 | 6,287,861 | How To Get XPerfViewer To Use Symbols | I am using the HeapMonitor.cmd script to pull in native memory profiling information in the attempt to diagnose a silverlight memory leak. This is using the XPerf tools. When I use XPerfViewer the symbols are not loaded, and thus I get no stack traces. I have added these two environment variables, _NT_SYMBOL_PATH = SRV... | Trick for new players! The stack column was not selected in the XPerfViewer. This means it doesn't trigger loading the symbols. It works after the stack column is selected to display. Don't assume that the stack column is selected by default! | How To Get XPerfViewer To Use Symbols I am using the HeapMonitor.cmd script to pull in native memory profiling information in the attempt to diagnose a silverlight memory leak. This is using the XPerf tools. When I use XPerfViewer the symbols are not loaded, and thus I get no stack traces. I have added these two enviro... | TITLE:
How To Get XPerfViewer To Use Symbols
QUESTION:
I am using the HeapMonitor.cmd script to pull in native memory profiling information in the attempt to diagnose a silverlight memory leak. This is using the XPerf tools. When I use XPerfViewer the symbols are not loaded, and thus I get no stack traces. I have adde... | [
"c#",
".net",
"performance",
"silverlight-4.0"
] | 0 | 0 | 101 | 1 | 0 | 2011-06-08T03:21:23.310000 | 2011-06-09T03:42:17.433000 |
6,273,882 | 6,273,974 | using @font-face for 2 fonts causing big slow-down | This is the first time I've used @font-face. The font pack is from myfonts.com and I'm currently testing in Safari and noticed through the web inspector that the css file, which loads the 2 fonts shows as a nearly-2mb-download! the fonts appear to be there as base64 encoded. The pack didn't include the actual.otf files... | Base64 is larger than the original file around 1.3 - from wikipedia. You can convert the file back to its original state with this convertor, but there are a lot of tool on the net. | using @font-face for 2 fonts causing big slow-down This is the first time I've used @font-face. The font pack is from myfonts.com and I'm currently testing in Safari and noticed through the web inspector that the css file, which loads the 2 fonts shows as a nearly-2mb-download! the fonts appear to be there as base64 en... | TITLE:
using @font-face for 2 fonts causing big slow-down
QUESTION:
This is the first time I've used @font-face. The font pack is from myfonts.com and I'm currently testing in Safari and noticed through the web inspector that the css file, which loads the 2 fonts shows as a nearly-2mb-download! the fonts appear to be ... | [
"css",
"font-face",
"embedded-fonts",
"webfonts",
"opentype"
] | 3 | 2 | 1,855 | 2 | 0 | 2011-06-08T03:25:18.287000 | 2011-06-08T03:44:48.440000 |
6,273,883 | 6,275,124 | How to erase a published Git commit from history? | I accidentally committed a change with Git, pushed it up to GitHub, and have done several commits afterward. I need to erase that commit from the history. I realize this could possibly hose other forks and I'm ok with that. I was able to modify my history locally with a command like: git rebase --onto HEAD~4 HEAD~3 HEA... | If you have any merges you need to conserve them with git rebase -i --preserve-merges commit^ Otherwise, git will flatten your history. Then push with the force option. | How to erase a published Git commit from history? I accidentally committed a change with Git, pushed it up to GitHub, and have done several commits afterward. I need to erase that commit from the history. I realize this could possibly hose other forks and I'm ok with that. I was able to modify my history locally with a... | TITLE:
How to erase a published Git commit from history?
QUESTION:
I accidentally committed a change with Git, pushed it up to GitHub, and have done several commits afterward. I need to erase that commit from the history. I realize this could possibly hose other forks and I'm ok with that. I was able to modify my hist... | [
"git",
"github"
] | 6 | 3 | 1,481 | 2 | 0 | 2011-06-08T03:25:34.973000 | 2011-06-08T06:45:58.713000 |
6,273,890 | 6,273,906 | MYSQL SELECT and JSON_ENCODE | I need to select a key from a json_encodED array from mysql.. SELECT * FROM json_field_table WHERE {var from JSON encoded array} = {expected value} or something.. How I can do this? PS.: Poor English, I know.. | You'd have to use substring matching. MySQL doesn't have anything to deal with JSON data and treats it like it does any other piece of random text. SELECT... WHERE the_json_field LIKE '%"var":"value"%'; | MYSQL SELECT and JSON_ENCODE I need to select a key from a json_encodED array from mysql.. SELECT * FROM json_field_table WHERE {var from JSON encoded array} = {expected value} or something.. How I can do this? PS.: Poor English, I know.. | TITLE:
MYSQL SELECT and JSON_ENCODE
QUESTION:
I need to select a key from a json_encodED array from mysql.. SELECT * FROM json_field_table WHERE {var from JSON encoded array} = {expected value} or something.. How I can do this? PS.: Poor English, I know..
ANSWER:
You'd have to use substring matching. MySQL doesn't ha... | [
"php",
"mysql",
"json"
] | 1 | 4 | 3,578 | 3 | 0 | 2011-06-08T03:26:37.827000 | 2011-06-08T03:30:49.970000 |
6,273,892 | 6,273,935 | Android - Package Name convention | For the "Hello World" example in android.com, the package name is "package com.example.helloandroid;" Is there any guideline/standard to name this package? (references would be nice) | Android follows normal java package conventions plus here is an important snippet of text to read (this is important regarding the wide use of xml files while developing on android). The reason for having it in reverse order is to do with the layout on the storage media. If you consider each period ('.') in the applica... | Android - Package Name convention For the "Hello World" example in android.com, the package name is "package com.example.helloandroid;" Is there any guideline/standard to name this package? (references would be nice) | TITLE:
Android - Package Name convention
QUESTION:
For the "Hello World" example in android.com, the package name is "package com.example.helloandroid;" Is there any guideline/standard to name this package? (references would be nice)
ANSWER:
Android follows normal java package conventions plus here is an important sn... | [
"android",
"naming"
] | 250 | 280 | 333,487 | 7 | 0 | 2011-06-08T03:27:27.813000 | 2011-06-08T03:36:34.127000 |
6,273,895 | 6,273,902 | jQuery example for val() of input box | The example for finding the value of an input box in jQuery is below. I have 2 questions. Why is the script inside the body? (I tried putting it between the head tags and it does not work). Why are there two different keyup() methods, one directly after $("input") and the other after the function? | If you want it to run in the head, you should use.ready() or.load() (usually.ready() ) The second.keyup() fires the event http://jsfiddle.net/eqfbY/ Ready waits until the DOM is ready to be parsed. Otherwise, what you're running is an inline script run in the order it is parsed. Note, a shorthand version of ready() is:... | jQuery example for val() of input box The example for finding the value of an input box in jQuery is below. I have 2 questions. Why is the script inside the body? (I tried putting it between the head tags and it does not work). Why are there two different keyup() methods, one directly after $("input") and the other aft... | TITLE:
jQuery example for val() of input box
QUESTION:
The example for finding the value of an input box in jQuery is below. I have 2 questions. Why is the script inside the body? (I tried putting it between the head tags and it does not work). Why are there two different keyup() methods, one directly after $("input")... | [
"jquery"
] | 0 | 3 | 1,624 | 5 | 0 | 2011-06-08T03:28:10.707000 | 2011-06-08T03:30:24.233000 |
6,273,905 | 6,275,349 | Zend redirect in a view script | Is it possible to redirect a view script via using a zend method? Or would it just be simpler to use a php redirect: | In your controller (use location header): $this->_redirect($url); or $redirector = $this->getHelper('Redirector'); /* @var $redirector Zend_Controller_Action_Helper_Redirector */ $redirector->gotoUrl($url); you can also use: $redirector->gotoRoute( array( 'action' => 'my-action', 'controller' => 'my-controller' ) ); If... | Zend redirect in a view script Is it possible to redirect a view script via using a zend method? Or would it just be simpler to use a php redirect: | TITLE:
Zend redirect in a view script
QUESTION:
Is it possible to redirect a view script via using a zend method? Or would it just be simpler to use a php redirect:
ANSWER:
In your controller (use location header): $this->_redirect($url); or $redirector = $this->getHelper('Redirector'); /* @var $redirector Zend_Contr... | [
"php",
"zend-framework",
"redirect"
] | 1 | 7 | 7,842 | 1 | 0 | 2011-06-08T03:30:40.543000 | 2011-06-08T07:12:55.843000 |
6,273,922 | 6,273,972 | SQLite SELECT col WHERE col=0; changes results | How could this be happening? sqlite> select read, text from message; 1|No just got off the train 1|yadayada 1|Beautiful 1|<3 1|DONE <3 0|Hey
sqlite> select read, text from message where read=0; 0| 0|Ooo very cool 0|Donors choose? 0|No prize for the computer reading program / model/master class 0|Hey I am truncating th... | You're not providing an "order by" clause in either SQL statement, so the results are being returned to you in the default order - which is probably by their primary key (if one exists) or by the order they were inserted into the table. The provided truncation from your first query is most likely the last 6 records in ... | SQLite SELECT col WHERE col=0; changes results How could this be happening? sqlite> select read, text from message; 1|No just got off the train 1|yadayada 1|Beautiful 1|<3 1|DONE <3 0|Hey
sqlite> select read, text from message where read=0; 0| 0|Ooo very cool 0|Donors choose? 0|No prize for the computer reading progra... | TITLE:
SQLite SELECT col WHERE col=0; changes results
QUESTION:
How could this be happening? sqlite> select read, text from message; 1|No just got off the train 1|yadayada 1|Beautiful 1|<3 1|DONE <3 0|Hey
sqlite> select read, text from message where read=0; 0| 0|Ooo very cool 0|Donors choose? 0|No prize for the compu... | [
"sql",
"select",
"sqlite",
"where-clause"
] | 1 | 1 | 506 | 1 | 0 | 2011-06-08T03:33:16.603000 | 2011-06-08T03:44:24.740000 |
6,273,928 | 6,273,945 | sql union returns duplicate results | I have the following query select count(trade_sid), shortcode from trade where trade.trade_date <= sysdate and trade.trade_date>= add_months(sysdate, -11) group by shortcode UNION ALL select count(trade_sid), shortcode from trade_archive where trade_archive.trade_date <= sysdate and trade_archive.trade_date>= add_month... | Something like this: select count(trade_sid), shortcode from ( select trade_sid, shortcode from trade where trade.trade_date <= sysdate and trade.trade_date>= add_months(sysdate, -11) UNION ALL select trade_sid, shortcode from trade_archive where trade_archive.trade_date <= sysdate and trade_archive.trade_date>= add_mo... | sql union returns duplicate results I have the following query select count(trade_sid), shortcode from trade where trade.trade_date <= sysdate and trade.trade_date>= add_months(sysdate, -11) group by shortcode UNION ALL select count(trade_sid), shortcode from trade_archive where trade_archive.trade_date <= sysdate and ... | TITLE:
sql union returns duplicate results
QUESTION:
I have the following query select count(trade_sid), shortcode from trade where trade.trade_date <= sysdate and trade.trade_date>= add_months(sysdate, -11) group by shortcode UNION ALL select count(trade_sid), shortcode from trade_archive where trade_archive.trade_da... | [
"sql",
"union"
] | 4 | 3 | 4,234 | 3 | 0 | 2011-06-08T03:34:58.503000 | 2011-06-08T03:39:19.827000 |
6,273,942 | 6,291,002 | Where is UISaveVideoAtPathToSavedPhotosAlbum in MonoTouch? | Where/how do you call the SDK equivalent of UISaveVideoAtPathToSavedPhotosAlbum(...) in MonoTouch? | It should be this one: MonoTouch.UIKit.UIVideo.SaveToPhotosAlbum public static void SaveToPhotosAlbum (string path, MonoTouch.UIKit.UIVideo.SaveStatus status) source: http://docs.go-mono.com/MonoTouch.UIKit.UIVideo/Members | Where is UISaveVideoAtPathToSavedPhotosAlbum in MonoTouch? Where/how do you call the SDK equivalent of UISaveVideoAtPathToSavedPhotosAlbum(...) in MonoTouch? | TITLE:
Where is UISaveVideoAtPathToSavedPhotosAlbum in MonoTouch?
QUESTION:
Where/how do you call the SDK equivalent of UISaveVideoAtPathToSavedPhotosAlbum(...) in MonoTouch?
ANSWER:
It should be this one: MonoTouch.UIKit.UIVideo.SaveToPhotosAlbum public static void SaveToPhotosAlbum (string path, MonoTouch.UIKit.UIV... | [
"c#",
"ios",
"xamarin.ios"
] | 1 | 4 | 514 | 1 | 0 | 2011-06-08T03:39:11.683000 | 2011-06-09T09:53:22.823000 |
6,273,946 | 6,273,970 | Python Inheritance question | I have a class of boxes that need to move around in a grid, but need to access that grid's coordinates in its methods. I don't want my classes to inherit the grid unless they need to. Do I need to pass the grid to the classes as a parameter, or make the box classes inherit from the grid class? Thanks. This is the edit.... | General rule would be parameter. The question is is-a vs. has-a: Is the box a grid? yes: # if so, then is it really a box??? The box should inherit grid no: The box should get a reference to the grid #(generally through a setter or constructor parameter). Edit An example: class Grid: def __init__(self,width=1,height=1)... | Python Inheritance question I have a class of boxes that need to move around in a grid, but need to access that grid's coordinates in its methods. I don't want my classes to inherit the grid unless they need to. Do I need to pass the grid to the classes as a parameter, or make the box classes inherit from the grid clas... | TITLE:
Python Inheritance question
QUESTION:
I have a class of boxes that need to move around in a grid, but need to access that grid's coordinates in its methods. I don't want my classes to inherit the grid unless they need to. Do I need to pass the grid to the classes as a parameter, or make the box classes inherit ... | [
"python",
"class",
"inheritance"
] | 1 | 3 | 209 | 4 | 0 | 2011-06-08T03:39:21.190000 | 2011-06-08T03:43:48.393000 |
6,273,949 | 6,274,002 | Android: Using email intent to send email, possible to alter message just before sending? | I'm using: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); to send email, I need to add some footer to the message, is there any listener or some way that I can edit the message when user clicks "send"? Thanks! Edit: below is the code I used: private void sendEmail(String recipient, String subject,... | If the email is sent from your own app, then you will need to add the footer before firing the intent. If the email is sent using any other app (including the default email app), then no, you won't be able to modify it. EDIT: In the case above, you will just need to append the signature to the message string, any time ... | Android: Using email intent to send email, possible to alter message just before sending? I'm using: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); to send email, I need to add some footer to the message, is there any listener or some way that I can edit the message when user clicks "send"? Thanks... | TITLE:
Android: Using email intent to send email, possible to alter message just before sending?
QUESTION:
I'm using: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); to send email, I need to add some footer to the message, is there any listener or some way that I can edit the message when user cli... | [
"android",
"email",
"android-intent",
"message",
"send"
] | 4 | 2 | 12,407 | 3 | 0 | 2011-06-08T03:39:32.500000 | 2011-06-08T03:49:32.837000 |
6,273,954 | 6,275,534 | Can I disas a specific statement in gdb? | (gdb) n 253 conf.log = log; Like above,the next statement is conf.log = log;,how can I just disas that? I tried simply disas,but gdb will disassembly all the current function(I don't need so much)... (gdb) disas Dump of assembler code for function ngx_init_cycle: 0x0000000000417c7c: push %rbp 0x0000000000417c7d: mov %r... | try something to the effect of: (gdb) info line 12 Line 12 of "test.c" starts at address 0x4004f4 and ends at 0x4004fe.
(gdb) disas 0x4004f4,0x4004fe Dump of assembler code from 0x4004f4 to 0x4004fe: 0x00000000004004f4: mov $0x0,%eax 0x00000000004004f9: callq 0x4004d0 End of assembler dump. Or: (gdb) disas main+24,mai... | Can I disas a specific statement in gdb? (gdb) n 253 conf.log = log; Like above,the next statement is conf.log = log;,how can I just disas that? I tried simply disas,but gdb will disassembly all the current function(I don't need so much)... (gdb) disas Dump of assembler code for function ngx_init_cycle: 0x0000000000417... | TITLE:
Can I disas a specific statement in gdb?
QUESTION:
(gdb) n 253 conf.log = log; Like above,the next statement is conf.log = log;,how can I just disas that? I tried simply disas,but gdb will disassembly all the current function(I don't need so much)... (gdb) disas Dump of assembler code for function ngx_init_cycl... | [
"gdb"
] | 0 | 0 | 394 | 1 | 0 | 2011-06-08T03:41:07.537000 | 2011-06-08T07:31:15.997000 |
6,273,958 | 6,274,011 | Are the default constructor and destructor ever inline? | I'm curious if the default constructor and destructor that the compiler generates are inline or not, because I can justify it either way. On the one hand, you want the default constructor/destructor to not be inline so that adding them later doesn't break ABI (because object files compiled when only the defaults were t... | The C++ standard says, in 12.1[class.ctor]/5 An implicitly-declared default constructor is an inline public member of its class and in 12.4[class.dtor]/3 An implicitly-declared destructor is an inline public member of its class. | Are the default constructor and destructor ever inline? I'm curious if the default constructor and destructor that the compiler generates are inline or not, because I can justify it either way. On the one hand, you want the default constructor/destructor to not be inline so that adding them later doesn't break ABI (bec... | TITLE:
Are the default constructor and destructor ever inline?
QUESTION:
I'm curious if the default constructor and destructor that the compiler generates are inline or not, because I can justify it either way. On the one hand, you want the default constructor/destructor to not be inline so that adding them later does... | [
"c++",
"c",
"inline",
"binary-compatibility",
"abi"
] | 10 | 19 | 3,174 | 3 | 0 | 2011-06-08T03:41:40.880000 | 2011-06-08T03:51:27.633000 |
6,273,966 | 6,276,394 | Detect Flash object click in JavaScript | Is there a way I can have JavaScript/jQuery know when a Flash object has been clicked (and still have Flash process the click)? I tried putting a table on top of the object with position: fixed and a z-index and the object set to param name='wmode' value='transparent' so I could have my JavaScript detect which column w... | Thank you Marty Wallace and Darwin! After testing, the XY coordinates of any clicks on the Flash object will be accurately printed to the screen and mouse interaction with the Flash object will proceed as normal. | Detect Flash object click in JavaScript Is there a way I can have JavaScript/jQuery know when a Flash object has been clicked (and still have Flash process the click)? I tried putting a table on top of the object with position: fixed and a z-index and the object set to param name='wmode' value='transparent' so I could ... | TITLE:
Detect Flash object click in JavaScript
QUESTION:
Is there a way I can have JavaScript/jQuery know when a Flash object has been clicked (and still have Flash process the click)? I tried putting a table on top of the object with position: fixed and a z-index and the object set to param name='wmode' value='transp... | [
"javascript",
"jquery",
"html",
"flash",
"object"
] | 3 | 10 | 9,710 | 2 | 0 | 2011-06-08T03:43:08.163000 | 2011-06-08T08:57:37.713000 |
6,273,968 | 6,273,989 | Why can't the operator=() function be inherited by the derive class | Possible Duplicate: Trouble with inheritance of operator= in C++ I updated the code #include class Base { int num; public: Base& operator=(int rhs) { this->num = rhs; return *this; } };
class Derive: public Base { public: int deriveNum; using Base::operator =; // unhide the function };
int main(int argc, char *argv[]... | It is inherited by the derived class. However, the derived class has it own operator = (implictly declared by the compiler), which hides the operator = inherited from the parent class (search and read about "name hiding" in C++). If you want the inherited operator = to become visible, you have to explicitly unhide it c... | Why can't the operator=() function be inherited by the derive class Possible Duplicate: Trouble with inheritance of operator= in C++ I updated the code #include class Base { int num; public: Base& operator=(int rhs) { this->num = rhs; return *this; } };
class Derive: public Base { public: int deriveNum; using Base::op... | TITLE:
Why can't the operator=() function be inherited by the derive class
QUESTION:
Possible Duplicate: Trouble with inheritance of operator= in C++ I updated the code #include class Base { int num; public: Base& operator=(int rhs) { this->num = rhs; return *this; } };
class Derive: public Base { public: int deriveN... | [
"c++",
"inheritance",
"operator-keyword"
] | 1 | 9 | 366 | 1 | 0 | 2011-06-08T03:43:25.880000 | 2011-06-08T03:46:46.643000 |
6,273,995 | 6,277,881 | OpenCV function to convert 8U image to 16U | Is anyone aware of any functions in OpenCV which support 8U to 16U conversion? I tried cvConvertImage, cvConvertScale but they are all meant to operate only on 8U image formats. | If you're using the newer C++ API, then check out Mat::convertTo Mat a(rows, cols, CV_8U); Mat b; a.convertTo(b, CV_16U); | OpenCV function to convert 8U image to 16U Is anyone aware of any functions in OpenCV which support 8U to 16U conversion? I tried cvConvertImage, cvConvertScale but they are all meant to operate only on 8U image formats. | TITLE:
OpenCV function to convert 8U image to 16U
QUESTION:
Is anyone aware of any functions in OpenCV which support 8U to 16U conversion? I tried cvConvertImage, cvConvertScale but they are all meant to operate only on 8U image formats.
ANSWER:
If you're using the newer C++ API, then check out Mat::convertTo Mat a(r... | [
"image",
"image-processing",
"opencv"
] | 5 | 8 | 3,930 | 1 | 0 | 2011-06-08T03:48:22.530000 | 2011-06-08T11:15:06.753000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.