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,185,215 | 6,186,199 | New Email Notification in android | I need to create the custom broadcast receiver,which notifies the arrival of new emails. That means when the new Email s received to the the already configured email account, then the intent will be fired. how can i find the arrival of new Email.I am Using Android_javamail API. | This is not possible. There are no documented and supported broadcast Intents for Gmail. There are no broadcast Intents for the open source Email app. Third party email clients are not obligated to support any particular broadcast Intents. | New Email Notification in android I need to create the custom broadcast receiver,which notifies the arrival of new emails. That means when the new Email s received to the the already configured email account, then the intent will be fired. how can i find the arrival of new Email.I am Using Android_javamail API. | TITLE:
New Email Notification in android
QUESTION:
I need to create the custom broadcast receiver,which notifies the arrival of new emails. That means when the new Email s received to the the already configured email account, then the intent will be fired. how can i find the arrival of new Email.I am Using Android_jav... | [
"android",
"email",
"notifications"
] | 1 | 0 | 3,660 | 2 | 0 | 2011-05-31T08:59:20.793000 | 2011-05-31T10:26:57.880000 |
6,185,217 | 6,185,388 | Memory session used to store immediate strings, in C | In the virtual memory concept, where does C compilers store immediate strings? Example: char *str = "Immediate string"; | gcc at least handles the following four cases differently: char *globalstr = "immediate global string"; char globalbuf[] = "immediate global array of chars"; int main(int argc, char* argv[]) { char *str = "immediate string"; char buf[] = "immediate array of chars"; return 0; } Local variable char *str and global variab... | Memory session used to store immediate strings, in C In the virtual memory concept, where does C compilers store immediate strings? Example: char *str = "Immediate string"; | TITLE:
Memory session used to store immediate strings, in C
QUESTION:
In the virtual memory concept, where does C compilers store immediate strings? Example: char *str = "Immediate string";
ANSWER:
gcc at least handles the following four cases differently: char *globalstr = "immediate global string"; char globalbuf[]... | [
"c",
"string",
"virtual-memory"
] | 4 | 6 | 257 | 2 | 0 | 2011-05-31T08:59:34.890000 | 2011-05-31T09:13:15.577000 |
6,185,220 | 6,185,304 | How to store Ajax uploaded documents before model has been created and assigned a primary key? | I'm really looking for a best approach for how to tackle this one. I have a page for creating a new object, let's call it a "Report". This is how it needs to perform: There are the usual text boxes and text areas for creating a report. I have functionality for ajax uploading documents. When complete the user clicks "cr... | We have similar requirements, and a structure close to yours which is like: upload/[filetype]/[customer_id]/[file-UUID] We're creating a Unique ID (timestamp+userID+hash or something like that) then store that file and bind the UUID in the database when the user decide to create his document | How to store Ajax uploaded documents before model has been created and assigned a primary key? I'm really looking for a best approach for how to tackle this one. I have a page for creating a new object, let's call it a "Report". This is how it needs to perform: There are the usual text boxes and text areas for creating... | TITLE:
How to store Ajax uploaded documents before model has been created and assigned a primary key?
QUESTION:
I'm really looking for a best approach for how to tackle this one. I have a page for creating a new object, let's call it a "Report". This is how it needs to perform: There are the usual text boxes and text ... | [
"asp.net-mvc"
] | 0 | 0 | 36 | 1 | 0 | 2011-05-31T08:59:49.593000 | 2011-05-31T09:06:48.540000 |
6,185,221 | 6,185,276 | HTML, CSS & Vertical text margins | This is probably basic stuff, so if there's some kind of online reference for how html text & margins work, please just throw me a link. Anyway, I'm having some trouble defining exact margins for text. Below is an example of an image, a div containing text below it and more text below the div. Other margins are set to ... | That's because the font doesn't use the entire height. A better (though maybe not perfect) indication would be to select the text and check the margins between the black border and the highlighted rectangle. And that goes for the text below 'testing' too. It will occupy part of those 14px. | HTML, CSS & Vertical text margins This is probably basic stuff, so if there's some kind of online reference for how html text & margins work, please just throw me a link. Anyway, I'm having some trouble defining exact margins for text. Below is an example of an image, a div containing text below it and more text below ... | TITLE:
HTML, CSS & Vertical text margins
QUESTION:
This is probably basic stuff, so if there's some kind of online reference for how html text & margins work, please just throw me a link. Anyway, I'm having some trouble defining exact margins for text. Below is an example of an image, a div containing text below it an... | [
"html",
"css",
"text",
"margins"
] | 0 | 2 | 5,241 | 3 | 0 | 2011-05-31T08:59:49.980000 | 2011-05-31T09:03:58.220000 |
6,185,224 | 6,187,895 | C++0x using <ratio> for a safer Length-type | When reading and I tried to imagine a Length -type that protects against accidental conversion errors. This is what I got: #include #include using namespace std;
template struct Length { long long val_; Length(long long val): val_{val} {} Length() = default; Length(const Length&) = default; Length& operator=(const Len... | Is there an easier access to the arithmetic facilities that duration and time_point define in anyway? Can I use those reduce the effort for Length? For "mixed mode" arithmetic and comparisons you can take advantage of common_type::type for defining return types. duration specializes common_type to be the greatest commo... | C++0x using <ratio> for a safer Length-type When reading and I tried to imagine a Length -type that protects against accidental conversion errors. This is what I got: #include #include using namespace std;
template struct Length { long long val_; Length(long long val): val_{val} {} Length() = default; Length(const Len... | TITLE:
C++0x using <ratio> for a safer Length-type
QUESTION:
When reading and I tried to imagine a Length -type that protects against accidental conversion errors. This is what I got: #include #include using namespace std;
template struct Length { long long val_; Length(long long val): val_{val} {} Length() = default... | [
"c++11",
"metaprogramming",
"std"
] | 1 | 2 | 309 | 2 | 0 | 2011-05-31T09:00:21.870000 | 2011-05-31T12:56:40.037000 |
6,185,227 | 6,242,312 | jython zxJDBC: How to get a dictionary from a cursor? | I am using JDBC to connect my jython to a heterogeneous set of databases. Using a cursor I get the rows in list form, and the cursor also knows the metadata (cursor.description). Usually you get a row as list as result of a query: print resultlist(4) And you have to know the order of the Columns in the schema beforehan... | How about dict_cursor from this question: Django Backend-neutral DictCursor? Outline of what works for me (Jython 2.5.2): def dict_cursor(cursor): description = [x[0] for x in cursor.description] for row in cursor: yield dict(zip(description, row))
conn = zxJDBC.connect(db, user, pwd, driver) cursor = conn.cursor()
q... | jython zxJDBC: How to get a dictionary from a cursor? I am using JDBC to connect my jython to a heterogeneous set of databases. Using a cursor I get the rows in list form, and the cursor also knows the metadata (cursor.description). Usually you get a row as list as result of a query: print resultlist(4) And you have to... | TITLE:
jython zxJDBC: How to get a dictionary from a cursor?
QUESTION:
I am using JDBC to connect my jython to a heterogeneous set of databases. Using a cursor I get the rows in list form, and the cursor also knows the metadata (cursor.description). Usually you get a row as list as result of a query: print resultlist(... | [
"jdbc",
"jython"
] | 3 | 2 | 1,021 | 1 | 0 | 2011-05-31T09:00:29.107000 | 2011-06-05T10:22:40.597000 |
6,185,232 | 6,185,367 | EntityFramework create object | Ladislav, sorry maybe i'm not correctly posed question. Suppose in WinForm application i'm creating new object: var newEmission = _emissionBindingSource.Current as Emission; if (newEmission == null) return; newEmission.SharesNumber = _context.GetNewSharesNumber();
public int GetNewSharesNumber() { return Shares.Max(s ... | var newEmission = _emissionBindingSource.Current as Emission; if (newEmission == null) return; newEmission.SharesNumber = _context.GetNewSharesNumber();
public int GetNewSharesNumber() { // this will always query DB for max value return Shares.CreateSourceQuery().Max(s => s.Number)+1; } But I believe you should use so... | EntityFramework create object Ladislav, sorry maybe i'm not correctly posed question. Suppose in WinForm application i'm creating new object: var newEmission = _emissionBindingSource.Current as Emission; if (newEmission == null) return; newEmission.SharesNumber = _context.GetNewSharesNumber();
public int GetNewSharesN... | TITLE:
EntityFramework create object
QUESTION:
Ladislav, sorry maybe i'm not correctly posed question. Suppose in WinForm application i'm creating new object: var newEmission = _emissionBindingSource.Current as Emission; if (newEmission == null) return; newEmission.SharesNumber = _context.GetNewSharesNumber();
public... | [
"entity-framework"
] | 0 | 1 | 474 | 1 | 0 | 2011-05-31T09:01:00.110000 | 2011-05-31T09:11:28.527000 |
6,185,254 | 6,225,262 | How to apply cameraViewTransform to a UIImagePickerController originalImage | I made my custom UIImagePickerController camera controls (flash, front/rear, zoom, takepicture and others). My issue is related to zooming. By clicking plus and minus buttons, I change the imagePicker.cameraViewTransform with a scale. All right here. When the user pick the photos, in the delegate method didFinishPickin... | The cameraViewTransform is just for the (live)image being shown but not the image captured. Hence that wont be reflected on the image captured. In order to Scale (Zoom in/out ) the captured image you need to work on the captured image (remember the scale applied while taking picture). As a matter of fact you need to sc... | How to apply cameraViewTransform to a UIImagePickerController originalImage I made my custom UIImagePickerController camera controls (flash, front/rear, zoom, takepicture and others). My issue is related to zooming. By clicking plus and minus buttons, I change the imagePicker.cameraViewTransform with a scale. All right... | TITLE:
How to apply cameraViewTransform to a UIImagePickerController originalImage
QUESTION:
I made my custom UIImagePickerController camera controls (flash, front/rear, zoom, takepicture and others). My issue is related to zooming. By clicking plus and minus buttons, I change the imagePicker.cameraViewTransform with ... | [
"ios",
"core-graphics",
"uiimagepickercontroller",
"transform"
] | 2 | 2 | 4,563 | 1 | 0 | 2011-05-31T09:02:29.060000 | 2011-06-03T09:27:56.110000 |
6,185,256 | 6,185,298 | Is the order in which combining diacritic marks appear after a codepoint important? | I wonder if the order in which combining diacritic marks appear after a codepoint changes the way how the diacritics should be stacked above or below the character; or if there is another semantic difference. Does normalization specify some way to reorder diacritics, e. g. to speed up String comparison? | According to this Wikipedia article the order of combining characters is relevant in some cases and should be normalized as specified in other cases. Concretely the order of combining characters with the same combining class must be preserved (i.e. it is relevant), while the groups of characters must be sorted by their... | Is the order in which combining diacritic marks appear after a codepoint important? I wonder if the order in which combining diacritic marks appear after a codepoint changes the way how the diacritics should be stacked above or below the character; or if there is another semantic difference. Does normalization specify ... | TITLE:
Is the order in which combining diacritic marks appear after a codepoint important?
QUESTION:
I wonder if the order in which combining diacritic marks appear after a codepoint changes the way how the diacritics should be stacked above or below the character; or if there is another semantic difference. Does norm... | [
"string",
"unicode",
"standards",
"semantics",
"diacritics"
] | 5 | 7 | 456 | 2 | 0 | 2011-05-31T09:02:39.843000 | 2011-05-31T09:06:35.910000 |
6,185,266 | 6,185,295 | query ilist with linq | I would like to get data with linq from ilist which has type of one class - for example - iList - everything I know, that in this iList are saved emails and names, but this iList has no string type, but this class. How can I get them? It would be great to put this data to my own List Any hint how to do that? | IList myList = GetMyList(); var emailList = myList.Select(x => x.EmailAddress).ToList(); emailList will now contain only the email addresses. | query ilist with linq I would like to get data with linq from ilist which has type of one class - for example - iList - everything I know, that in this iList are saved emails and names, but this iList has no string type, but this class. How can I get them? It would be great to put this data to my own List Any hint how ... | TITLE:
query ilist with linq
QUESTION:
I would like to get data with linq from ilist which has type of one class - for example - iList - everything I know, that in this iList are saved emails and names, but this iList has no string type, but this class. How can I get them? It would be great to put this data to my own ... | [
"c#",
"linq",
"ilist"
] | 2 | 5 | 8,092 | 2 | 0 | 2011-05-31T09:03:13.837000 | 2011-05-31T09:06:02.947000 |
6,185,267 | 6,185,385 | Data not sending between classes - Objective-C | I'm trying to send data between two classes. I've done it using the properties method, but the data keeps coming back on the other side empty. FrameGallery.h (class that's sending data): @interface FrameGallery{ NSMutableArray *filesArray; }
@property (nonatomic, retain) NSMutableArray *filesArray;
@end FrameGallery.... | Create an array in your LoadFilePopOverController and make it a property, synthesize it. Now when you navigate to LoadFilePopOverController from FrameGallery, assign the array to the one that was created in LoadFilePopOverController. For e.g. in LoadFilePopOverController.h NSMutableArray *getdata;
@property (nonatomic... | Data not sending between classes - Objective-C I'm trying to send data between two classes. I've done it using the properties method, but the data keeps coming back on the other side empty. FrameGallery.h (class that's sending data): @interface FrameGallery{ NSMutableArray *filesArray; }
@property (nonatomic, retain) ... | TITLE:
Data not sending between classes - Objective-C
QUESTION:
I'm trying to send data between two classes. I've done it using the properties method, but the data keeps coming back on the other side empty. FrameGallery.h (class that's sending data): @interface FrameGallery{ NSMutableArray *filesArray; }
@property (n... | [
"iphone",
"objective-c",
"class",
"variables"
] | 0 | 0 | 257 | 1 | 0 | 2011-05-31T09:03:15.507000 | 2011-05-31T09:13:07.340000 |
6,185,272 | 6,198,296 | Android Honeycomb: How to change Fragments in a FrameLayout, without re-creating them? | is it possible to switch between Fragments without re-creating them all the time? If so, how? In the documentation I found an example of how to replace Fragments. // Create new fragment and transaction Fragment newFragment = new ExampleFragment(); FragmentTransaction transaction = getFragmentManager().beginTransaction(... | It could depend on what you are trying to avoid being re-created. // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack(null); In your example example when you hit the b... | Android Honeycomb: How to change Fragments in a FrameLayout, without re-creating them? is it possible to switch between Fragments without re-creating them all the time? If so, how? In the documentation I found an example of how to replace Fragments. // Create new fragment and transaction Fragment newFragment = new Exam... | TITLE:
Android Honeycomb: How to change Fragments in a FrameLayout, without re-creating them?
QUESTION:
is it possible to switch between Fragments without re-creating them all the time? If so, how? In the documentation I found an example of how to replace Fragments. // Create new fragment and transaction Fragment newF... | [
"android",
"android-3.0-honeycomb",
"android-fragments"
] | 14 | 5 | 24,991 | 4 | 0 | 2011-05-31T09:03:36.470000 | 2011-06-01T08:28:02.657000 |
6,185,277 | 6,189,540 | Multiple settings for separate Live Wallpapers | I have two Live Wallpapers that belong to the same Application and I am trying to have separate Preference settings for each one but I have run into the issue of the first settings being used by both Wallpapers. Am I missing something simple or is it not possible to do this without making 2 separate applications? Here'... | Moonblink (creator of Android Tricorder) also has a collection of live wallpapers called Substrate. Substrate does indeed combine multiple wallpapers into a single package, and more than one of the wallpapers has a settings activity. I suggest you examine his structure. Start here http://code.google.com/p/moonblink/sou... | Multiple settings for separate Live Wallpapers I have two Live Wallpapers that belong to the same Application and I am trying to have separate Preference settings for each one but I have run into the issue of the first settings being used by both Wallpapers. Am I missing something simple or is it not possible to do thi... | TITLE:
Multiple settings for separate Live Wallpapers
QUESTION:
I have two Live Wallpapers that belong to the same Application and I am trying to have separate Preference settings for each one but I have run into the issue of the first settings being used by both Wallpapers. Am I missing something simple or is it not ... | [
"android",
"live-wallpaper"
] | 0 | 1 | 1,239 | 1 | 0 | 2011-05-31T09:04:05.113000 | 2011-05-31T14:59:06.407000 |
6,185,278 | 6,185,315 | Problem with form submit jquery ajax | I have a code like this. Captcha With Refresh Feature Name Security Code: My ajax response will be either success or failure. I can alert and check my ajax response. Now, i have problem with form submit. I am getting this below error: document.myform.submit is not a function How to force or make my form submit if the r... | document.myform.submit is finding the control called "submit" within the form called "myform". Rename your button and see if the standard submit() function comes back. | Problem with form submit jquery ajax I have a code like this. Captcha With Refresh Feature Name Security Code: My ajax response will be either success or failure. I can alert and check my ajax response. Now, i have problem with form submit. I am getting this below error: document.myform.submit is not a function How to ... | TITLE:
Problem with form submit jquery ajax
QUESTION:
I have a code like this. Captcha With Refresh Feature Name Security Code: My ajax response will be either success or failure. I can alert and check my ajax response. Now, i have problem with form submit. I am getting this below error: document.myform.submit is not ... | [
"php",
"jquery",
"ajax"
] | 0 | 1 | 664 | 6 | 0 | 2011-05-31T09:04:08.340000 | 2011-05-31T09:07:55.410000 |
6,185,279 | 6,185,464 | How can I assign hex string to a char[] variable? | Assume my hex string. hexStr = "aecf" How can I assign the hex string value to unsigned char myChar[] as below. Thanks. myChar[0] = 0xae; myChar[1] = 0xcf; | You may convert data as follows: char* hexstr="aecf"; int hexsize=strlen(hexstr); unsigned char* myChar = new unsigned char[hexsize/2+1]; myChar[hexsize/2]='\0' for (int i=0,intj=0;i this is in case you do not use static strings, otherwise use other answers. | How can I assign hex string to a char[] variable? Assume my hex string. hexStr = "aecf" How can I assign the hex string value to unsigned char myChar[] as below. Thanks. myChar[0] = 0xae; myChar[1] = 0xcf; | TITLE:
How can I assign hex string to a char[] variable?
QUESTION:
Assume my hex string. hexStr = "aecf" How can I assign the hex string value to unsigned char myChar[] as below. Thanks. myChar[0] = 0xae; myChar[1] = 0xcf;
ANSWER:
You may convert data as follows: char* hexstr="aecf"; int hexsize=strlen(hexstr); unsig... | [
"c++",
"hex",
"arrays"
] | 2 | 3 | 10,437 | 7 | 0 | 2011-05-31T09:04:08.480000 | 2011-05-31T09:20:45.123000 |
6,185,286 | 6,185,560 | How to limit user for access only the information of his own | I follow Acl example in manual of cake. When success I have more question for apply Acl to My project function initDB() { $group = & $this->User->Group; //Allow admins to everything $group->id = 1; $this->Acl->allow($group, 'controllers');
//allow managers to posts and widgets $group->id = 2; $this->Acl->deny($group, ... | you need row based acl, not the action based one you have shown http://jmcneese.wordpress.com/2009/04/07/update-row-level-model-access-control-for-cakephp/ | How to limit user for access only the information of his own I follow Acl example in manual of cake. When success I have more question for apply Acl to My project function initDB() { $group = & $this->User->Group; //Allow admins to everything $group->id = 1; $this->Acl->allow($group, 'controllers');
//allow managers t... | TITLE:
How to limit user for access only the information of his own
QUESTION:
I follow Acl example in manual of cake. When success I have more question for apply Acl to My project function initDB() { $group = & $this->User->Group; //Allow admins to everything $group->id = 1; $this->Acl->allow($group, 'controllers');
... | [
"cakephp",
"acl"
] | 1 | 2 | 746 | 2 | 0 | 2011-05-31T09:04:56.063000 | 2011-05-31T09:28:16.097000 |
6,185,292 | 6,185,496 | How to create a pageContext in google app engine? | To create a page context programmatically in our servlets we do the following: JspFactory factory = JspFactory.getDefaultFactory();
PageContext pageContext = factory.getPageContext(this, request, response, "404", true, 4096, false); This works fine on tomcat and the dev gae environment. However when deploying the app ... | Read it somewhere. Google APP Engine looks to use Tomcat behind.This looks like a bug. A workaround would be is set the default factory using Class.forName("org.apache.jasper.compiler.JspRuntimeContext"); | How to create a pageContext in google app engine? To create a page context programmatically in our servlets we do the following: JspFactory factory = JspFactory.getDefaultFactory();
PageContext pageContext = factory.getPageContext(this, request, response, "404", true, 4096, false); This works fine on tomcat and the de... | TITLE:
How to create a pageContext in google app engine?
QUESTION:
To create a page context programmatically in our servlets we do the following: JspFactory factory = JspFactory.getDefaultFactory();
PageContext pageContext = factory.getPageContext(this, request, response, "404", true, 4096, false); This works fine on... | [
"java",
"google-app-engine",
"servlets"
] | 1 | 2 | 483 | 1 | 0 | 2011-05-31T09:05:45.077000 | 2011-05-31T09:23:37.603000 |
6,185,296 | 6,185,318 | jQuery selector - code correctness question | I'm new to jQuery. I'm trying to use this code: var ThisTableWrapper = $('#switch1').parent().next(); var ThisTable = $(ThisTableWrapper > '.table-data'); But it doesn't seems to work. What is the correct way to write that in one line? I've tried something like this - but with no success $( $('#switch1').parent().next(... | jQuery selectors must always be strings, or other jQuery / DOM elements, but not a combination / concatenation of both. The second line should be: var ThisTable = ThisTableWrapper.children('.table-data'); Or in one line: var ThisTable = $('#switch1').parent().next().children('.table-data'); The documentation provides a... | jQuery selector - code correctness question I'm new to jQuery. I'm trying to use this code: var ThisTableWrapper = $('#switch1').parent().next(); var ThisTable = $(ThisTableWrapper > '.table-data'); But it doesn't seems to work. What is the correct way to write that in one line? I've tried something like this - but wit... | TITLE:
jQuery selector - code correctness question
QUESTION:
I'm new to jQuery. I'm trying to use this code: var ThisTableWrapper = $('#switch1').parent().next(); var ThisTable = $(ThisTableWrapper > '.table-data'); But it doesn't seems to work. What is the correct way to write that in one line? I've tried something l... | [
"jquery",
"jquery-selectors"
] | 0 | 3 | 98 | 3 | 0 | 2011-05-31T09:06:21.230000 | 2011-05-31T09:08:16.060000 |
6,185,299 | 6,185,351 | c#. Parse and find some word in string | I have some string bla bla bla bla What is the best and fastest way to get text inside <>? | var input = "bla bla bla bla ";
var match = Regex.Match(input, @".*?<(?.*?)>"); if (match.Success) var text = match.Groups["MyGroup"].Value; | c#. Parse and find some word in string I have some string bla bla bla bla What is the best and fastest way to get text inside <>? | TITLE:
c#. Parse and find some word in string
QUESTION:
I have some string bla bla bla bla What is the best and fastest way to get text inside <>?
ANSWER:
var input = "bla bla bla bla ";
var match = Regex.Match(input, @".*?<(?.*?)>"); if (match.Success) var text = match.Groups["MyGroup"].Value; | [
"c#",
".net",
"string",
"string-parsing"
] | 10 | 2 | 6,786 | 9 | 0 | 2011-05-31T09:06:36.933000 | 2011-05-31T09:10:12.677000 |
6,185,305 | 6,186,256 | awk, regroup by lines pattern | i have this input file 1.00 3 4 93.00 2 3 105.00 0 2 119.00 0 2 122.00 1 4 202.00 1 3 207.00 1 2 210.00 1 4 236.00 0 1 237.00 0 4 237.00 0 2 240.00 1 3 243.00 2 3 243.00 3 4 243.00 0 3 275.00 0 4 275.00 2 4 353.00 0 3 361.00 1 4 411.00 0 1 412.00 1 3 425.00 0 3 426.00 0 4 455.00 1 4 464.00 0 3 520.00 0 4 560.00 1 3 561... | A perl version: use strict; use warnings;
my %data; while (my $line = ) { chomp($line); my @row = split(/\s/, $line); my $key = $row[1]. $row[2]; push @{$data{$key}}, $row[0]; }
my $max = 0; for my $key (keys %data) { if (scalar @{$data{$key}} > $max) { $max = scalar @{$data{$key}}; } }
{ my @times; push @times, "ti... | awk, regroup by lines pattern i have this input file 1.00 3 4 93.00 2 3 105.00 0 2 119.00 0 2 122.00 1 4 202.00 1 3 207.00 1 2 210.00 1 4 236.00 0 1 237.00 0 4 237.00 0 2 240.00 1 3 243.00 2 3 243.00 3 4 243.00 0 3 275.00 0 4 275.00 2 4 353.00 0 3 361.00 1 4 411.00 0 1 412.00 1 3 425.00 0 3 426.00 0 4 455.00 1 4 464.00... | TITLE:
awk, regroup by lines pattern
QUESTION:
i have this input file 1.00 3 4 93.00 2 3 105.00 0 2 119.00 0 2 122.00 1 4 202.00 1 3 207.00 1 2 210.00 1 4 236.00 0 1 237.00 0 4 237.00 0 2 240.00 1 3 243.00 2 3 243.00 3 4 243.00 0 3 275.00 0 4 275.00 2 4 353.00 0 3 361.00 1 4 411.00 0 1 412.00 1 3 425.00 0 3 426.00 0 4... | [
"perl",
"awk"
] | 2 | 0 | 185 | 3 | 0 | 2011-05-31T09:06:49.993000 | 2011-05-31T10:31:51.340000 |
6,185,306 | 6,185,399 | Can I "redeclare" (UPDATE) a table add some new columns? | I am using PHP and have a constant declaring the table column details. I currently $sql = "CREATE TABLE '. $table_name. ' '. TABLE_COLUMNS; and odbc exec it, where TABLE_COLUMNS is a DEFINE() (constant literal string). This is more of an SQL question than coding. I don't want to change any code other than the DEFINE; I... | You won't get there with a single define. You should try to create the table. If that fails, try to create each of the columns. Not that adding columns one by one can be very time consuming on large tables, because MySQL is actually recreating the whole table and copying all the data. It is better to get the current st... | Can I "redeclare" (UPDATE) a table add some new columns? I am using PHP and have a constant declaring the table column details. I currently $sql = "CREATE TABLE '. $table_name. ' '. TABLE_COLUMNS; and odbc exec it, where TABLE_COLUMNS is a DEFINE() (constant literal string). This is more of an SQL question than coding.... | TITLE:
Can I "redeclare" (UPDATE) a table add some new columns?
QUESTION:
I am using PHP and have a constant declaring the table column details. I currently $sql = "CREATE TABLE '. $table_name. ' '. TABLE_COLUMNS; and odbc exec it, where TABLE_COLUMNS is a DEFINE() (constant literal string). This is more of an SQL que... | [
"php",
"mysql",
"sql",
"odbc"
] | 0 | 1 | 138 | 1 | 0 | 2011-05-31T09:07:01.887000 | 2011-05-31T09:14:04.923000 |
6,185,314 | 6,187,461 | Can I profile my code to see what is creating a lot of threads? | I'm running Embarcadero RAD Studio 2010 (C++) and have used AQTime a bit to check for some leaks. I wonder if there is a good way to pinpoint the origin in my code of a large amount of threads that seem to never die. They are created during the night so I don't see them as it happens but I would like to be able to go b... | I would try using the Allocation Profiler with only one active area containing only the TTHread class. Start profiling and let it work overnight. When you come in next morning, click Get Results in AQtime. As a result, you will see all TTHread instances in the report, and the Details panel will show the creation call s... | Can I profile my code to see what is creating a lot of threads? I'm running Embarcadero RAD Studio 2010 (C++) and have used AQTime a bit to check for some leaks. I wonder if there is a good way to pinpoint the origin in my code of a large amount of threads that seem to never die. They are created during the night so I ... | TITLE:
Can I profile my code to see what is creating a lot of threads?
QUESTION:
I'm running Embarcadero RAD Studio 2010 (C++) and have used AQTime a bit to check for some leaks. I wonder if there is a good way to pinpoint the origin in my code of a large amount of threads that seem to never die. They are created duri... | [
"multithreading",
"profiling",
"c++builder",
"aqtime"
] | 0 | 0 | 178 | 2 | 0 | 2011-05-31T09:07:53.580000 | 2011-05-31T12:18:12.573000 |
6,185,320 | 6,185,363 | Read multidimensional array with Condition using PHP | I have a multidimensional array as follows, array('Hundai'=>array('Sonata','i20','Santro','Verna'),'Suzuki'=>array('Alto','Ritz'),'WW'=>array('Polo','Passat','Vento')) I would like to retrieve only Sonata, i20, Santro and Verna when Hundai is my input. Anybody suggest me solution with minimum number of loop | $arr = array( 'Hyundai' => array('Sonata', 'i20', 'Santro', 'Verna'), 'Suzuki' => array('Alto', 'Ritz'), 'VW' => array('Polo', 'Passat', 'Vento') );
$key = 'Hyundai';
if (isset($arr[$key]) && is_array($arr[$key])) { echo implode(', ', $arr[$key]); } | Read multidimensional array with Condition using PHP I have a multidimensional array as follows, array('Hundai'=>array('Sonata','i20','Santro','Verna'),'Suzuki'=>array('Alto','Ritz'),'WW'=>array('Polo','Passat','Vento')) I would like to retrieve only Sonata, i20, Santro and Verna when Hundai is my input. Anybody sugges... | TITLE:
Read multidimensional array with Condition using PHP
QUESTION:
I have a multidimensional array as follows, array('Hundai'=>array('Sonata','i20','Santro','Verna'),'Suzuki'=>array('Alto','Ritz'),'WW'=>array('Polo','Passat','Vento')) I would like to retrieve only Sonata, i20, Santro and Verna when Hundai is my inp... | [
"php",
"arrays"
] | 1 | 1 | 2,711 | 6 | 0 | 2011-05-31T09:08:24.493000 | 2011-05-31T09:11:16.537000 |
6,185,337 | 6,185,736 | How do I pretty-print existing JSON data with Java? | I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides this? A similar solution for XML would also be nice. | I think for pretty-printing something, it's very helpful to know its structure. To get the structure you have to parse it. Because of this, I don't think it gets much easier than first parsing the JSON string you have and then using the pretty-printing method toString mentioned in the comments above. Of course you can ... | How do I pretty-print existing JSON data with Java? I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides this? A similar solution for XML would also be nice. | TITLE:
How do I pretty-print existing JSON data with Java?
QUESTION:
I have a compact JSON string, and I want to format it nicely in Java without having to deserialize it first -- e.g. just like jsonlint.org does it. Are there any libraries out there that provides this? A similar solution for XML would also be nice.
... | [
"java",
"json",
"formatting",
"pretty-print"
] | 67 | 4 | 154,054 | 7 | 0 | 2011-05-31T09:09:15.187000 | 2011-05-31T09:45:32.617000 |
6,185,340 | 6,185,410 | specifying type of a class member in template function | I have this template function: template double Determinant(const P & a, const P & b, const P & c) { return (b.x-a.x)*(c.y-a.y) - (c.x-a.x)*(b.y-a.y); } but I want to avoid forcing the return type to double all the time -- P::x and P::y could be ints too, and I need this function in both situations. Is there a way to sp... | Compiler cannot deduce return-type of function template, from function argument. Type deduction is done with function arguments only. In C++03, you can define typedef in your class as: struct A //suppose A is going to be type argument to your function template { int x, y; //I'm assuming type of x and y is same! typedef... | specifying type of a class member in template function I have this template function: template double Determinant(const P & a, const P & b, const P & c) { return (b.x-a.x)*(c.y-a.y) - (c.x-a.x)*(b.y-a.y); } but I want to avoid forcing the return type to double all the time -- P::x and P::y could be ints too, and I need... | TITLE:
specifying type of a class member in template function
QUESTION:
I have this template function: template double Determinant(const P & a, const P & b, const P & c) { return (b.x-a.x)*(c.y-a.y) - (c.x-a.x)*(b.y-a.y); } but I want to avoid forcing the return type to double all the time -- P::x and P::y could be in... | [
"c++",
"templates",
"traits"
] | 1 | 7 | 1,569 | 4 | 0 | 2011-05-31T09:09:30.913000 | 2011-05-31T09:15:24.123000 |
6,185,342 | 6,223,054 | Error on uploading image in django: "coercing to Unicode: need string or buffer, tuple found" | Trying to work with ImageField in django. Here are my models class Album(models.Model): title = models.CharField(max_length=100)
def __unicode__(self): return self.title
class Photo(models.Model): image = models.ImageField(upload_to='photos/') album = models.ForeignKey(Album) title = models.CharField(max_length=100, ... | I've got it myself. In settings.py there is MEDIA_ROOT setting, which was MEDIA_ROOT = 'd:/dev/python/scripts/app/media/', Python makes the object tuple because of the comma at the end. That's why it couldn't save the object. Watch your commas next time! | Error on uploading image in django: "coercing to Unicode: need string or buffer, tuple found" Trying to work with ImageField in django. Here are my models class Album(models.Model): title = models.CharField(max_length=100)
def __unicode__(self): return self.title
class Photo(models.Model): image = models.ImageField(u... | TITLE:
Error on uploading image in django: "coercing to Unicode: need string or buffer, tuple found"
QUESTION:
Trying to work with ImageField in django. Here are my models class Album(models.Model): title = models.CharField(max_length=100)
def __unicode__(self): return self.title
class Photo(models.Model): image = m... | [
"django",
"image-uploading",
"modelform",
"imagefield"
] | 2 | 9 | 4,121 | 1 | 0 | 2011-05-31T09:09:39.087000 | 2011-06-03T04:46:59.250000 |
6,185,346 | 6,185,460 | Parsing calculation tree from string | I there any built in library in c# or automatic code generator which recieves configuration file and builds parser of calculaton tree from string if there is no could you please help me with advice Example: "-2+5>3" I would like to build calculation tree where < is root '+' is its right son 3 is left son '-2' is left s... | Have you looked at the System.Linq.Expressions? for example How to convert string into System.Linq.Expressions.Expression in C#? | Parsing calculation tree from string I there any built in library in c# or automatic code generator which recieves configuration file and builds parser of calculaton tree from string if there is no could you please help me with advice Example: "-2+5>3" I would like to build calculation tree where < is root '+' is its r... | TITLE:
Parsing calculation tree from string
QUESTION:
I there any built in library in c# or automatic code generator which recieves configuration file and builds parser of calculaton tree from string if there is no could you please help me with advice Example: "-2+5>3" I would like to build calculation tree where < is... | [
"c#",
"parsing",
"compiler-construction"
] | 4 | 4 | 3,430 | 4 | 0 | 2011-05-31T09:09:56.470000 | 2011-05-31T09:20:09.693000 |
6,185,349 | 6,185,449 | warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0 | Does anyone know what this means:.../...ViewController.xib: warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0 | check below SO post The Address data detector type is not supported on iOS versions prior to 4.0 | warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0 Does anyone know what this means:.../...ViewController.xib: warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0 | TITLE:
warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0
QUESTION:
Does anyone know what this means:.../...ViewController.xib: warning: Attribute Unavailable: Addresses Detection on iOS versions prior to 4.0
ANSWER:
check below SO post The Address data detector type is not supported on ... | [
"iphone",
"cocoa-touch"
] | 0 | 2 | 591 | 1 | 0 | 2011-05-31T09:10:09.793000 | 2011-05-31T09:19:29.647000 |
6,185,387 | 6,186,680 | Using Spring HttpInvoker over SSL from command line | I have a command line spring application that uses a remote webservice via Spring's HttpInvoker. The connection URL is configured in a property file: foo.bar.service.Interface All OK, but now our partner would like to use it over HTTPS to reach the service running on his Weblogic 10.3 server. As far as I know the appli... | Yes, since you are already using CommonsHttpInvokerRequestExecutor which has support for https. | Using Spring HttpInvoker over SSL from command line I have a command line spring application that uses a remote webservice via Spring's HttpInvoker. The connection URL is configured in a property file: foo.bar.service.Interface All OK, but now our partner would like to use it over HTTPS to reach the service running on ... | TITLE:
Using Spring HttpInvoker over SSL from command line
QUESTION:
I have a command line spring application that uses a remote webservice via Spring's HttpInvoker. The connection URL is configured in a property file: foo.bar.service.Interface All OK, but now our partner would like to use it over HTTPS to reach the s... | [
"java",
"spring",
"ssl",
"httpinvoker"
] | 0 | 1 | 1,589 | 1 | 0 | 2011-05-31T09:13:14.047000 | 2011-05-31T11:10:13.773000 |
6,185,401 | 6,187,219 | how can i access alarm content provider | i'm trying to access alarm provider to get all enabled alarm information. so i wrote this: public static final Uri CONTENT_URI = Uri.parse("content://com.android.deskclock/alarm"); ContentResolver cr = getContentResolver(); Cursor c = null;
c = cr.query( CONTENT_URI, ALARM_QUERY_COLUMNS, null, null, DEFAULT_SORT_ORDER... | As @CommonsWare points out this only works on certain devices. Although with the other alarm URIs it was possible to read on most platforms. However in Honeycomb they have changed the access required and you can no longer use a content provider to get to the alarms. | how can i access alarm content provider i'm trying to access alarm provider to get all enabled alarm information. so i wrote this: public static final Uri CONTENT_URI = Uri.parse("content://com.android.deskclock/alarm"); ContentResolver cr = getContentResolver(); Cursor c = null;
c = cr.query( CONTENT_URI, ALARM_QUERY... | TITLE:
how can i access alarm content provider
QUESTION:
i'm trying to access alarm provider to get all enabled alarm information. so i wrote this: public static final Uri CONTENT_URI = Uri.parse("content://com.android.deskclock/alarm"); ContentResolver cr = getContentResolver(); Cursor c = null;
c = cr.query( CONTEN... | [
"android"
] | 1 | 1 | 1,756 | 1 | 0 | 2011-05-31T09:14:26.827000 | 2011-05-31T11:57:16.983000 |
6,185,426 | 6,185,691 | Cross Platform Apps | I am not much clear with the " Cross Platform Apps." Can we really built up some apps which can run on iPhone/iPad, Android Phones/Tabs, Blackberry, Nokia (Any platform or more than one platform at least)? I have heard something like WAC, Titanium but really not clear with all these. Please help me out. | There are some good frameworks out there to build cross-platform mobile applications: Titanium: It is a framework to build Android, IPhone (and BlackBerry, still in beta it seems) using javascript, that will compile to native applications for the platforms specified. Rhodes: A ruby framework, that supports almost all t... | Cross Platform Apps I am not much clear with the " Cross Platform Apps." Can we really built up some apps which can run on iPhone/iPad, Android Phones/Tabs, Blackberry, Nokia (Any platform or more than one platform at least)? I have heard something like WAC, Titanium but really not clear with all these. Please help me ... | TITLE:
Cross Platform Apps
QUESTION:
I am not much clear with the " Cross Platform Apps." Can we really built up some apps which can run on iPhone/iPad, Android Phones/Tabs, Blackberry, Nokia (Any platform or more than one platform at least)? I have heard something like WAC, Titanium but really not clear with all thes... | [
"iphone",
"android",
"ios",
"cross-platform"
] | 0 | 2 | 519 | 1 | 0 | 2011-05-31T09:17:48.963000 | 2011-05-31T09:40:07.610000 |
6,185,431 | 6,185,604 | NewGlobalRef of a weak reference still prevent a object from garbage collected | To implement a callback function from the native code to Java code, I have to create a global reference using NewGloabRef. From the memory profile, I found that,once I called env->NewGlobalRef(weak_this), even it was a weak reference of the player object, the Player object will be available as Root Objects, which I thi... | A WeakReference is a Java object with an ordinary reference to it. It contains a reference to another object. It is the contained reference that is "weak", not the reference to the WeakReference itself. So when you call env->NewGlobalRef(weak_this) (assuming weak_this is a WeakReference ), the effect is the same as ass... | NewGlobalRef of a weak reference still prevent a object from garbage collected To implement a callback function from the native code to Java code, I have to create a global reference using NewGloabRef. From the memory profile, I found that,once I called env->NewGlobalRef(weak_this), even it was a weak reference of the ... | TITLE:
NewGlobalRef of a weak reference still prevent a object from garbage collected
QUESTION:
To implement a callback function from the native code to Java code, I have to create a global reference using NewGloabRef. From the memory profile, I found that,once I called env->NewGlobalRef(weak_this), even it was a weak... | [
"java",
"garbage-collection",
"java-native-interface"
] | 2 | 1 | 2,212 | 1 | 0 | 2011-05-31T09:18:16.573000 | 2011-05-31T09:31:20.407000 |
6,185,432 | 6,187,413 | Good alternative to FOP? | I'm currently using FOP to generate PDF from an XML file. But I am facing two big issues: First: FOP cannot manage OpenType Font files Second: fo:float is not implemented yet So it's impossible for me to produce the PDF I want with FOP. I need to change FO processor and I would like to know what is the best processor t... | I've had very positive experiences with Antenna House Formatter for XSL - FO formatting. If you can go with the price tag that is. It supports both fo:float and OpenType | Good alternative to FOP? I'm currently using FOP to generate PDF from an XML file. But I am facing two big issues: First: FOP cannot manage OpenType Font files Second: fo:float is not implemented yet So it's impossible for me to produce the PDF I want with FOP. I need to change FO processor and I would like to know wha... | TITLE:
Good alternative to FOP?
QUESTION:
I'm currently using FOP to generate PDF from an XML file. But I am facing two big issues: First: FOP cannot manage OpenType Font files Second: fo:float is not implemented yet So it's impossible for me to produce the PDF I want with FOP. I need to change FO processor and I woul... | [
"xml",
"xsl-fo",
"apache-fop"
] | 6 | 3 | 3,279 | 2 | 0 | 2011-05-31T09:18:16.883000 | 2011-05-31T12:13:55.780000 |
6,185,438 | 6,187,080 | AND operator in regular expressions | I've searched for a while how to use logical operation AND in regular expressions in Java, and have failed. I've tried to do as recommended in similar topic: (?=match this expression)(?=match this too)(?=oh, and this) and it doesn't work. Even simple examples with?= returns false: String b = "aaadcd"; System.out.printl... | I think what you need is (?=X)Y (?=X) matches X, without consuming it (zero-width) Y and matches Y The main problem: X and Y are wrong, they should be (assuming 4 digits): X: 119[0-9]|1[2-9][0-9]{2}|[2-9][0-9]{3} 1190-1199, or 1200-1999, or 2000-9999 Y: 1[0-8][0-9]{2}|19[0-8][0-9]|199[0-2] 1000-1899, or 1900-1980, or 1... | AND operator in regular expressions I've searched for a while how to use logical operation AND in regular expressions in Java, and have failed. I've tried to do as recommended in similar topic: (?=match this expression)(?=match this too)(?=oh, and this) and it doesn't work. Even simple examples with?= returns false: St... | TITLE:
AND operator in regular expressions
QUESTION:
I've searched for a while how to use logical operation AND in regular expressions in Java, and have failed. I've tried to do as recommended in similar topic: (?=match this expression)(?=match this too)(?=oh, and this) and it doesn't work. Even simple examples with?=... | [
"java",
"regex"
] | 9 | 12 | 31,270 | 3 | 0 | 2011-05-31T09:18:47.797000 | 2011-05-31T11:47:17.937000 |
6,185,462 | 6,186,657 | How contruct in xslt a tree in a variable | I want to create a variable like that: bar bar bar bar to use it like in: [My code that treat $aTree like a Tree] My question is: is it possible to create a Tree variable and How? | To achieve this, you probably need to make use of an extension function, namely the node-set function, which returns a set of nodes from a result tree fragment. First you would need to define the namespace for the extension functions like so In this case, I am using the Microsoft extension functions, but others are ava... | How contruct in xslt a tree in a variable I want to create a variable like that: bar bar bar bar to use it like in: [My code that treat $aTree like a Tree] My question is: is it possible to create a Tree variable and How? | TITLE:
How contruct in xslt a tree in a variable
QUESTION:
I want to create a variable like that: bar bar bar bar to use it like in: [My code that treat $aTree like a Tree] My question is: is it possible to create a Tree variable and How?
ANSWER:
To achieve this, you probably need to make use of an extension function... | [
"xslt"
] | 0 | 4 | 1,174 | 1 | 0 | 2011-05-31T09:20:17.573000 | 2011-05-31T11:08:16.397000 |
6,185,463 | 6,205,596 | Delphi XE takes one full core (100% CPU utilization) | My Delphi started to overheat the CPU. As soon as I start Delphi, it will take a full core for itself and the coolers start to work really hard. There is any trick to fix this? I know that some people here on Stack Overflow will start to release hot steam if I use the words 'Delphi' and 'bug' together, but this is a re... | I found a way to reproduce a problem very much like your problem. Create a new delphi project and add to the.DPR (main project source) an ifdef condition that contains some code like this that won't parse... program IdeTestProject1; {$ifdef FOO} bar {$endif}
uses Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pa... | Delphi XE takes one full core (100% CPU utilization) My Delphi started to overheat the CPU. As soon as I start Delphi, it will take a full core for itself and the coolers start to work really hard. There is any trick to fix this? I know that some people here on Stack Overflow will start to release hot steam if I use th... | TITLE:
Delphi XE takes one full core (100% CPU utilization)
QUESTION:
My Delphi started to overheat the CPU. As soon as I start Delphi, it will take a full core for itself and the coolers start to work really hard. There is any trick to fix this? I know that some people here on Stack Overflow will start to release hot... | [
"delphi",
"delphi-xe",
"delphi-ide"
] | 2 | 4 | 2,635 | 3 | 0 | 2011-05-31T09:20:40.257000 | 2011-06-01T17:56:46.640000 |
6,185,468 | 6,185,559 | How create beta (testing) website? | How create beta (testing) website use same webroot and cake folder? That beta (testing) website probably is at http://beta.example.com or http://example.com/beta | A testing or "staging" server should be set up completely independently of the production server. You should not reuse any component of the live system, which even includes the database. Just set up a copy of the production system with a separate database, separate files, if possible a separate (but identical) server. ... | How create beta (testing) website? How create beta (testing) website use same webroot and cake folder? That beta (testing) website probably is at http://beta.example.com or http://example.com/beta | TITLE:
How create beta (testing) website?
QUESTION:
How create beta (testing) website use same webroot and cake folder? That beta (testing) website probably is at http://beta.example.com or http://example.com/beta
ANSWER:
A testing or "staging" server should be set up completely independently of the production server... | [
"php",
"cakephp"
] | 2 | 5 | 2,460 | 2 | 0 | 2011-05-31T09:21:12.127000 | 2011-05-31T09:28:08.957000 |
6,185,475 | 6,186,450 | Custom placeholder like None in python | I'm using argspec in a function that takes another function or method as the argument, and returns a tuple like this: (("arg1", obj1), ("arg2", obj2),...) This means that the first argument to the passed function is arg1 and it has a default value of obj1, and so on. Here's the rub: if it has no default value, I need a... | My favourite sentinel is Ellipsis, and if I may quote myself: it's there, it's an object, it's a singleton, and its name means "lack of", and it's not the overused None (which could be put in a queue as part of normal data flow). YMMV. | Custom placeholder like None in python I'm using argspec in a function that takes another function or method as the argument, and returns a tuple like this: (("arg1", obj1), ("arg2", obj2),...) This means that the first argument to the passed function is arg1 and it has a default value of obj1, and so on. Here's the ru... | TITLE:
Custom placeholder like None in python
QUESTION:
I'm using argspec in a function that takes another function or method as the argument, and returns a tuple like this: (("arg1", obj1), ("arg2", obj2),...) This means that the first argument to the passed function is arg1 and it has a default value of obj1, and so... | [
"python",
"metaclass"
] | 8 | 4 | 3,249 | 4 | 0 | 2011-05-31T09:21:53.920000 | 2011-05-31T10:50:51.847000 |
6,185,478 | 6,187,859 | openGL textures beginner question - 1D Texture creation? | EDIT Ok I added some changes to my texture rendering, and I'm now at a point that it doesn't look how I want it but before I try to change anything I just want to be sure I'm on the right path. The problem I'm trying to fix is: I have 180000 vertices. Each of them can be from one of 190 "classes". Each class can have a... | At the moment you use your normals as texture coordinates, because self.bufferNormals was bound when calling glTexCoordPointer. 1D textures aren't just per vertex colors. they are accessed by per-vertex texture coordinates, like 2D textures, otherwise they would be a useless substitute for per-vertex colors. Read some ... | openGL textures beginner question - 1D Texture creation? EDIT Ok I added some changes to my texture rendering, and I'm now at a point that it doesn't look how I want it but before I try to change anything I just want to be sure I'm on the right path. The problem I'm trying to fix is: I have 180000 vertices. Each of the... | TITLE:
openGL textures beginner question - 1D Texture creation?
QUESTION:
EDIT Ok I added some changes to my texture rendering, and I'm now at a point that it doesn't look how I want it but before I try to change anything I just want to be sure I'm on the right path. The problem I'm trying to fix is: I have 180000 ver... | [
"opengl",
"pyopengl"
] | 1 | 1 | 1,034 | 1 | 0 | 2011-05-31T09:22:23.613000 | 2011-05-31T12:53:09.987000 |
6,185,483 | 6,187,038 | Rails contact form not working | I am trying to create a contact the form gets submitted. But I don't receive any email. In my config/application.rb I have addded. config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method =:smtp ActionMailer::Base.smtp_settings = {:address => "mail.vinderhimlen.dk",:port => 587,:user_name ... | To trigger mails in dev mode, add this to your development.yml file: config.action_mailer.perform_deliveries = true | Rails contact form not working I am trying to create a contact the form gets submitted. But I don't receive any email. In my config/application.rb I have addded. config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method =:smtp ActionMailer::Base.smtp_settings = {:address => "mail.vinderhiml... | TITLE:
Rails contact form not working
QUESTION:
I am trying to create a contact the form gets submitted. But I don't receive any email. In my config/application.rb I have addded. config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method =:smtp ActionMailer::Base.smtp_settings = {:address =... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3"
] | 0 | 2 | 531 | 1 | 0 | 2011-05-31T09:22:38.270000 | 2011-05-31T11:43:34.517000 |
6,185,493 | 6,185,594 | Django order of execution | In what order does django execute the various components when it receives a request? Specifically when does the middleware get invoked compared to the function that a route resolves to? And when do context processors get called? Thanks | The middlewares are executed before the view and when returning the response. The context processor is executed when rendering a template, usually at the end of the view. So: (request) -> middleware, from top to bottom -> view -> context_processor -> (response) -> middleware, from bottom to top | Django order of execution In what order does django execute the various components when it receives a request? Specifically when does the middleware get invoked compared to the function that a route resolves to? And when do context processors get called? Thanks | TITLE:
Django order of execution
QUESTION:
In what order does django execute the various components when it receives a request? Specifically when does the middleware get invoked compared to the function that a route resolves to? And when do context processors get called? Thanks
ANSWER:
The middlewares are executed be... | [
"django"
] | 1 | 4 | 1,692 | 1 | 0 | 2011-05-31T09:23:23.937000 | 2011-05-31T09:30:40.183000 |
6,185,497 | 6,185,591 | What do these weird characters mean? | I'm reading a Ruby book but it doesn't explain the following: What is this: validates:name,:presence => true I mean I know what it does but what's validates? Is it a method of the validator class? If so, how come it's called without mentioning the class name first? What's the meaning of: in the previous code and in Rai... | validates is a method, part of the validators in Rails. It is declared in (actually, included to) a superclass, that is why it does not have to be declared in the model. The: in front of anything signifies a symbol, not a variable. Symbols are part of Ruby, somewhat similar to strings. form_for is a method, which takes... | What do these weird characters mean? I'm reading a Ruby book but it doesn't explain the following: What is this: validates:name,:presence => true I mean I know what it does but what's validates? Is it a method of the validator class? If so, how come it's called without mentioning the class name first? What's the meanin... | TITLE:
What do these weird characters mean?
QUESTION:
I'm reading a Ruby book but it doesn't explain the following: What is this: validates:name,:presence => true I mean I know what it does but what's validates? Is it a method of the validator class? If so, how come it's called without mentioning the class name first?... | [
"ruby-on-rails",
"ruby",
"symbols",
"block"
] | 2 | 6 | 367 | 1 | 0 | 2011-05-31T09:23:38.787000 | 2011-05-31T09:30:22.557000 |
6,185,502 | 6,189,460 | AutoIt Script to run .exe file | I want to run an application which is located in the following directory: C:\LCR 12\stu.exe With AutoIt, what would be the code to run the above stu.exe file? | Like this: Run("C:\LCR 12\stu.exe") Hope this is what you were after. | AutoIt Script to run .exe file I want to run an application which is located in the following directory: C:\LCR 12\stu.exe With AutoIt, what would be the code to run the above stu.exe file? | TITLE:
AutoIt Script to run .exe file
QUESTION:
I want to run an application which is located in the following directory: C:\LCR 12\stu.exe With AutoIt, what would be the code to run the above stu.exe file?
ANSWER:
Like this: Run("C:\LCR 12\stu.exe") Hope this is what you were after. | [
"exe",
"autoit"
] | 3 | 7 | 24,125 | 2 | 0 | 2011-05-31T09:23:57.763000 | 2011-05-31T14:53:19.983000 |
6,185,507 | 6,185,629 | IOS: fill a popover with a tableview | How can I create a popover and fill it with a tableview? I have a button on a toolbar in bottom of my view, and when i push this button I want to show this popover | Create pushviewcontroller and in the pushviewcontroller you have to give the tableview. like this. UIViewController *myPopOver = [[UIViewController alloc] initWithNibName:@"MyPopOverView" bundle:nil]; //(asper your requirement take thiscontroller as tableview) popoverController = [[[UIPopoverController alloc] initWithC... | IOS: fill a popover with a tableview How can I create a popover and fill it with a tableview? I have a button on a toolbar in bottom of my view, and when i push this button I want to show this popover | TITLE:
IOS: fill a popover with a tableview
QUESTION:
How can I create a popover and fill it with a tableview? I have a button on a toolbar in bottom of my view, and when i push this button I want to show this popover
ANSWER:
Create pushviewcontroller and in the pushviewcontroller you have to give the tableview. like... | [
"xcode",
"ios",
"uitableview",
"uipopovercontroller"
] | 1 | 5 | 4,771 | 1 | 0 | 2011-05-31T09:24:13.110000 | 2011-05-31T09:34:47.050000 |
6,185,508 | 6,185,561 | Confused with Model vs ViewModel | I am Learning ASP.NET MVC and downloaded a couple of sample apps. MusicStore etc... I am coming from a wpf background where we had the MVVM Pattern. I have noticed that they used the concept of model and ViewModel. In MVVM is pretty clear that you bind the view to the ViewModel injecting the model into the viewModel. I... | Use ViewModels to simplify the View. For instance, you might have a deep object graph with Products, Order, Customers, etc - and some information from each of these objects are required on a particular View. A ViewModel provides a way to aggregate the information required for a View into a single object. ViewModels als... | Confused with Model vs ViewModel I am Learning ASP.NET MVC and downloaded a couple of sample apps. MusicStore etc... I am coming from a wpf background where we had the MVVM Pattern. I have noticed that they used the concept of model and ViewModel. In MVVM is pretty clear that you bind the view to the ViewModel injectin... | TITLE:
Confused with Model vs ViewModel
QUESTION:
I am Learning ASP.NET MVC and downloaded a couple of sample apps. MusicStore etc... I am coming from a wpf background where we had the MVVM Pattern. I have noticed that they used the concept of model and ViewModel. In MVVM is pretty clear that you bind the view to the ... | [
"c#",
".net",
"asp.net",
"asp.net-mvc",
"asp.net-mvc-3"
] | 24 | 39 | 33,469 | 3 | 0 | 2011-05-31T09:24:13.810000 | 2011-05-31T09:28:17.503000 |
6,185,513 | 6,186,116 | Rolling count in MySQL | I need to get the following ratio (daily sign up count)/(last 30 days rolling sign up count for each day) The daily numbers are straight forward SELECT a.DailySignup FROM ( SELECT COUNT(1) AS DailySignup, date FROM users WHERE date BETWEEN datestart and dateend GROUP BY date ) a but how can I compute the last 30 days c... | You could try a subquery: SELECT DISTINCT t.date, (SELECT COUNT(*) FROM users u where u.date BETWEEN DATE_ADD(t.date, INTERVAL -30 day) AND t.date) as c FROM users t For a given date t.date, the subquery calculates the count for the 30-day period ending with t.date. EDIT: To calculate the ratio (logins per day)/(logins... | Rolling count in MySQL I need to get the following ratio (daily sign up count)/(last 30 days rolling sign up count for each day) The daily numbers are straight forward SELECT a.DailySignup FROM ( SELECT COUNT(1) AS DailySignup, date FROM users WHERE date BETWEEN datestart and dateend GROUP BY date ) a but how can I com... | TITLE:
Rolling count in MySQL
QUESTION:
I need to get the following ratio (daily sign up count)/(last 30 days rolling sign up count for each day) The daily numbers are straight forward SELECT a.DailySignup FROM ( SELECT COUNT(1) AS DailySignup, date FROM users WHERE date BETWEEN datestart and dateend GROUP BY date ) a... | [
"mysql"
] | 2 | 2 | 1,959 | 2 | 0 | 2011-05-31T09:24:38.240000 | 2011-05-31T10:20:06.280000 |
6,185,526 | 6,193,713 | how do you insert multiple rows in a loop using doctrine 2 | i want to insert multiple rows in a loop using doctrine 2.. i usually insert 1 record using this: $Entity->setData($posted); $this->_doctrine->persist($Entity); $this->_doctrine->flush(); | Simply persist all your objects and then call flush() after the loop. $entityDataArray = array(); // let's assume this is an array containing data for each entity foreach ($entityDataArray AS $entityData) { $entity = new \Entity(); $entity->setData($entityData); $this->_doctrine->persist($entity); } $this->_doctrine->f... | how do you insert multiple rows in a loop using doctrine 2 i want to insert multiple rows in a loop using doctrine 2.. i usually insert 1 record using this: $Entity->setData($posted); $this->_doctrine->persist($Entity); $this->_doctrine->flush(); | TITLE:
how do you insert multiple rows in a loop using doctrine 2
QUESTION:
i want to insert multiple rows in a loop using doctrine 2.. i usually insert 1 record using this: $Entity->setData($posted); $this->_doctrine->persist($Entity); $this->_doctrine->flush();
ANSWER:
Simply persist all your objects and then call ... | [
"zend-framework",
"doctrine"
] | 5 | 4 | 4,667 | 2 | 0 | 2011-05-31T09:25:57.323000 | 2011-05-31T21:21:43.827000 |
6,185,530 | 6,185,666 | Using XMLSerializer deserialise with array of elements the same type as the root element | I've got the following XML i'm trying to deserialise with XmlSerialiser: 43712 Eleven | Eleven Eleven 2010-12-01T17:54:44 2011-05-27T01:32:58 ACTIVE 43781 TV Shows | TV Shows 2010-12-10T16:37:00 2011-05-09T06:03:09 ACTIVE http://media.movideo.com/images/112/playlist/43781/ http://media.movideo.com/images/112/playlist/4... | See this question and answer. [XmlRootAttribute("playlist")] public class PlaylistResponse { public int id; public string title; public string description;
[XmlArray(ElementName="childPlaylists")] [XmlArrayItem(typeof(PlaylistResponse), ElementName="playlist")] public PlaylistResponse[] ChildPlaylists; }
XmlReader re... | Using XMLSerializer deserialise with array of elements the same type as the root element I've got the following XML i'm trying to deserialise with XmlSerialiser: 43712 Eleven | Eleven Eleven 2010-12-01T17:54:44 2011-05-27T01:32:58 ACTIVE 43781 TV Shows | TV Shows 2010-12-10T16:37:00 2011-05-09T06:03:09 ACTIVE http://me... | TITLE:
Using XMLSerializer deserialise with array of elements the same type as the root element
QUESTION:
I've got the following XML i'm trying to deserialise with XmlSerialiser: 43712 Eleven | Eleven Eleven 2010-12-01T17:54:44 2011-05-27T01:32:58 ACTIVE 43781 TV Shows | TV Shows 2010-12-10T16:37:00 2011-05-09T06:03:0... | [
"c#",
"xml",
"serialization",
"mono",
"xml-deserialization"
] | 1 | 1 | 3,241 | 3 | 0 | 2011-05-31T09:26:02.923000 | 2011-05-31T09:37:50.057000 |
6,185,532 | 6,185,912 | Android: animated text inside edittext | Is there any way to animate text inside edittext? In my app i use editetext to show and edit some info. | We can put animation to any view. Text inside EditText is not a view. It is a string. We can give animation yo whole EditText but not to a string. Thanks Deepak | Android: animated text inside edittext Is there any way to animate text inside edittext? In my app i use editetext to show and edit some info. | TITLE:
Android: animated text inside edittext
QUESTION:
Is there any way to animate text inside edittext? In my app i use editetext to show and edit some info.
ANSWER:
We can put animation to any view. Text inside EditText is not a view. It is a string. We can give animation yo whole EditText but not to a string. Tha... | [
"android",
"animation",
"android-edittext"
] | 2 | 2 | 2,273 | 3 | 0 | 2011-05-31T09:26:06.243000 | 2011-05-31T09:59:54.167000 |
6,185,537 | 6,210,854 | unable to load data in treepanel of extjs4 | I am new to extjs and I am creating MVC application. I am trying to create tree panel as following. Following is my model file Ext.define('rt.model.userinproject', { extend: 'Ext.data.Model',
proxy: { type: 'memory' },
fields: [ { name: 'text', type: 'string'}, { name: 'id', type: 'Number'}
] }); Following is my sto... | I was able to solve above problem by replacing following line in my view file store: this.store, as following, store: Ext.data.StoreManager.lookup('userinproject'), Hope this will help someone. Thanks. | unable to load data in treepanel of extjs4 I am new to extjs and I am creating MVC application. I am trying to create tree panel as following. Following is my model file Ext.define('rt.model.userinproject', { extend: 'Ext.data.Model',
proxy: { type: 'memory' },
fields: [ { name: 'text', type: 'string'}, { name: 'id',... | TITLE:
unable to load data in treepanel of extjs4
QUESTION:
I am new to extjs and I am creating MVC application. I am trying to create tree panel as following. Following is my model file Ext.define('rt.model.userinproject', { extend: 'Ext.data.Model',
proxy: { type: 'memory' },
fields: [ { name: 'text', type: 'strin... | [
"tree",
"extjs4",
"extjs-mvc"
] | 0 | 2 | 3,579 | 1 | 0 | 2011-05-31T09:26:19.460000 | 2011-06-02T05:37:53.283000 |
6,185,543 | 6,185,599 | Is "tail +2" supported by Linux? | I noticed that tail +2 is supported in Solaris ksh, but in Red Hat Linux, an error will occur: c008>> ps -p 4009,6282,31401,31409 | tail +2 tail: cannot open `+2' for reading: No such file or directory While in Solaris, bjbldd>> ps -p 2622,16589,11719,846 |tail +2 16589?? 0:00 xterm 846 pts/180 0:00 cscope 11719 pts/18... | From tail(1): -n, --lines=K output the last K lines, instead of the last 10; or use -n +K to output lines starting with the Kth So try -n +2 or --lines=+2: $ ps -p 20085 9530 29993 2069 2012 | tail -n +2 2012? Sl 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login 2069? S 0:00 /usr/bin/dbus-launch --exit-with-sessio... | Is "tail +2" supported by Linux? I noticed that tail +2 is supported in Solaris ksh, but in Red Hat Linux, an error will occur: c008>> ps -p 4009,6282,31401,31409 | tail +2 tail: cannot open `+2' for reading: No such file or directory While in Solaris, bjbldd>> ps -p 2622,16589,11719,846 |tail +2 16589?? 0:00 xterm 846... | TITLE:
Is "tail +2" supported by Linux?
QUESTION:
I noticed that tail +2 is supported in Solaris ksh, but in Red Hat Linux, an error will occur: c008>> ps -p 4009,6282,31401,31409 | tail +2 tail: cannot open `+2' for reading: No such file or directory While in Solaris, bjbldd>> ps -p 2622,16589,11719,846 |tail +2 1658... | [
"tail"
] | 9 | 22 | 19,557 | 2 | 0 | 2011-05-31T09:26:55.653000 | 2011-05-31T09:31:05.873000 |
6,185,544 | 6,185,728 | Log4J NTEventLogAppender DLL not found | Hy ppl, I'm having a problem trying to use Log4J's NTEventLogAppender. I've set my Log4J properties like this: log4j.rootLogger=DEBUG, CA, NTEventLog
#Console Appender log4j.appender.CA=org.apache.log4j.ConsoleAppender log4j.appender.CA.layout=org.apache.log4j.PatternLayout log4j.appender.CA.layout.ConversionPattern=%... | This is to allow you to debug easily: If you did add the dll in the System32 folder, make sure that the directory is also included in Java's library path java.library.path: To test (via code): System.out.println(System.getProperty("java.library.path")); Output (partial): C:\Program Files\Java\jdk1.6.0_21\bin;.;C:\Windo... | Log4J NTEventLogAppender DLL not found Hy ppl, I'm having a problem trying to use Log4J's NTEventLogAppender. I've set my Log4J properties like this: log4j.rootLogger=DEBUG, CA, NTEventLog
#Console Appender log4j.appender.CA=org.apache.log4j.ConsoleAppender log4j.appender.CA.layout=org.apache.log4j.PatternLayout log4j... | TITLE:
Log4J NTEventLogAppender DLL not found
QUESTION:
Hy ppl, I'm having a problem trying to use Log4J's NTEventLogAppender. I've set my Log4J properties like this: log4j.rootLogger=DEBUG, CA, NTEventLog
#Console Appender log4j.appender.CA=org.apache.log4j.ConsoleAppender log4j.appender.CA.layout=org.apache.log4j.P... | [
"java",
"dll",
"log4j",
"event-log"
] | 0 | 2 | 8,696 | 2 | 0 | 2011-05-31T09:26:56.993000 | 2011-05-31T09:44:12.033000 |
6,185,545 | 6,223,878 | Week picker in JQuery Mobile | I found in demos section about the Data picker. But do we have a picker that will act as a week picker letting us just select a week. UPDATE: I want the calendar view to be be looking this way but with the theming of JQuery Mobile: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerSelectWeek.html | Jonathan has provided a solution for this: In his words: I've added a demo of this working on the main demo page, it is the last one under 'Advanced Demos': http://dev.jtsage.com/jQM-DateBox/ | Week picker in JQuery Mobile I found in demos section about the Data picker. But do we have a picker that will act as a week picker letting us just select a week. UPDATE: I want the calendar view to be be looking this way but with the theming of JQuery Mobile: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/... | TITLE:
Week picker in JQuery Mobile
QUESTION:
I found in demos section about the Data picker. But do we have a picker that will act as a week picker letting us just select a week. UPDATE: I want the calendar view to be be looking this way but with the theming of JQuery Mobile: http://www.kelvinluck.com/assets/jquery/d... | [
"jquery-mobile"
] | 2 | 0 | 1,961 | 2 | 0 | 2011-05-31T09:27:01.533000 | 2011-06-03T06:46:28.493000 |
6,185,571 | 6,185,605 | make the user can't control the size of text area | Possible Duplicate: Hiding textarea resize handle in Safari in textarea input the user can change the size of the input area how to make him can't do that,if it is no possible,then how i can make the text input field add new line,that is when the user add to the end of the text field a new line entered and the size of ... | CSS: textarea { resize: none; } Source: Google(disable textarea resize) | make the user can't control the size of text area Possible Duplicate: Hiding textarea resize handle in Safari in textarea input the user can change the size of the input area how to make him can't do that,if it is no possible,then how i can make the text input field add new line,that is when the user add to the end of ... | TITLE:
make the user can't control the size of text area
QUESTION:
Possible Duplicate: Hiding textarea resize handle in Safari in textarea input the user can change the size of the input area how to make him can't do that,if it is no possible,then how i can make the text input field add new line,that is when the user ... | [
"javascript",
"jquery",
"html",
"css"
] | 1 | 0 | 371 | 1 | 0 | 2011-05-31T09:28:53.830000 | 2011-05-31T09:31:31.823000 |
6,185,572 | 6,185,631 | How to save string with code page 1250 into RandomAccessFile in java | I have text file with string which code page is 1250. I want to save text into RandomAccessFile. When I read bytes from RandomAccessFile I get string with different character. Some solution... | If you're using writeUTF() then you should read its JavaDoc to learn that it always writes modified UTF-8. If you want to use another encoding, then you'll have to "manually" do the encoding and somehow store the length of the byte[] as well. For example: RandomAccessFile raf =...; String writeThis =...; byte[] cp1250D... | How to save string with code page 1250 into RandomAccessFile in java I have text file with string which code page is 1250. I want to save text into RandomAccessFile. When I read bytes from RandomAccessFile I get string with different character. Some solution... | TITLE:
How to save string with code page 1250 into RandomAccessFile in java
QUESTION:
I have text file with string which code page is 1250. I want to save text into RandomAccessFile. When I read bytes from RandomAccessFile I get string with different character. Some solution...
ANSWER:
If you're using writeUTF() then... | [
"java",
"file"
] | 2 | 2 | 2,188 | 2 | 0 | 2011-05-31T09:28:54.967000 | 2011-05-31T09:34:54.707000 |
6,185,573 | 6,185,763 | MVC-3 ASP.NET Shared Views-Redirect-Razor | I have a shared view called NotAuthorised in the folder 'Views/Shared'. I want to redirect the users to this view when they are not authorised to see the page. Initially, this view was in a folder called Account. But I moved it into the Shared folder as I am not using the Account anymore. I have deleted the Account fol... | You can't redirect to a View, only to an Action of a Controller. You have to specify an controller action for your redirect and there you can render your shared view. public class AuthorizeController: Controller { public ActionResult NotAuthorised() { return View("NotAuthorised"); } } and later redirect to this new act... | MVC-3 ASP.NET Shared Views-Redirect-Razor I have a shared view called NotAuthorised in the folder 'Views/Shared'. I want to redirect the users to this view when they are not authorised to see the page. Initially, this view was in a folder called Account. But I moved it into the Shared folder as I am not using the Accou... | TITLE:
MVC-3 ASP.NET Shared Views-Redirect-Razor
QUESTION:
I have a shared view called NotAuthorised in the folder 'Views/Shared'. I want to redirect the users to this view when they are not authorised to see the page. Initially, this view was in a folder called Account. But I moved it into the Shared folder as I am n... | [
"c#",
"asp.net-mvc-3",
"view",
"shared"
] | 3 | 9 | 8,256 | 1 | 0 | 2011-05-31T09:28:56.543000 | 2011-05-31T09:47:22.507000 |
6,185,578 | 6,219,087 | Android Webviews and internal querystrings | I'm using Android, and I've created a Webview which nicely opens my HTML page (page "A"). Now, I want to follow some links I have on page "A", which go to page "B". If I click on a linkl defined with everything is fine, and the Webview behaves just like a normal browser, goinmg to the selected page. But if I click a li... | In the end, I discovered I had to set settings.setDomStorageEnabled(true) in the WebView, and the easiest solution for my problem I found was: In "Page A.html", I intercept the onClick event of the links, and use localStorage to store the id: $(".link").each( function() { divId=+$(this).attr('id'); $('#'+divId).click(f... | Android Webviews and internal querystrings I'm using Android, and I've created a Webview which nicely opens my HTML page (page "A"). Now, I want to follow some links I have on page "A", which go to page "B". If I click on a linkl defined with everything is fine, and the Webview behaves just like a normal browser, goinm... | TITLE:
Android Webviews and internal querystrings
QUESTION:
I'm using Android, and I've created a Webview which nicely opens my HTML page (page "A"). Now, I want to follow some links I have on page "A", which go to page "B". If I click on a linkl defined with everything is fine, and the Webview behaves just like a nor... | [
"android",
"webview",
"android-webview"
] | 0 | 1 | 579 | 2 | 0 | 2011-05-31T09:29:09.697000 | 2011-06-02T19:01:33.713000 |
6,185,592 | 6,185,624 | Django passing arguments to custom method in models (or accessing request) | I'm trying to implement some customize login through the custom methods in Django's models. I want to know if its possible to: Get request.user in a custom method Get the user that made the request in the method Or pass an argument to the custom method Thinking in doing something like this: class OneModel(models.Model)... | Second one is correct. def viewed(self, user): return self.viewed_episodes.filter(user=user.profile).exists() or None | Django passing arguments to custom method in models (or accessing request) I'm trying to implement some customize login through the custom methods in Django's models. I want to know if its possible to: Get request.user in a custom method Get the user that made the request in the method Or pass an argument to the custom... | TITLE:
Django passing arguments to custom method in models (or accessing request)
QUESTION:
I'm trying to implement some customize login through the custom methods in Django's models. I want to know if its possible to: Get request.user in a custom method Get the user that made the request in the method Or pass an argu... | [
"django",
"django-models"
] | 4 | 5 | 4,566 | 1 | 0 | 2011-05-31T09:30:29.723000 | 2011-05-31T09:34:14.343000 |
6,185,598 | 6,185,769 | php, jquery pagination, storing current page | i'm having a shop system which is displaying articles using a jquery slider plugin, so there's pagination. i'm having an item with record id 123 on "page" 3 - that item has a unique modrewrite url like www.domain.com/myitem-123.html the problem: when displaying the article details i need to somehow store the current pa... | I believe a better and easier approach is to simply store that page number in a cookie and retrieve it on the slider/listing page. But if you want to get on with your idea and need an improvement, I'd suggest to store the page number in a global variable in JavaScript and only make that request to the server right befo... | php, jquery pagination, storing current page i'm having a shop system which is displaying articles using a jquery slider plugin, so there's pagination. i'm having an item with record id 123 on "page" 3 - that item has a unique modrewrite url like www.domain.com/myitem-123.html the problem: when displaying the article d... | TITLE:
php, jquery pagination, storing current page
QUESTION:
i'm having a shop system which is displaying articles using a jquery slider plugin, so there's pagination. i'm having an item with record id 123 on "page" 3 - that item has a unique modrewrite url like www.domain.com/myitem-123.html the problem: when displa... | [
"php",
"jquery"
] | 0 | 1 | 288 | 1 | 0 | 2011-05-31T09:30:56.263000 | 2011-05-31T09:48:03.410000 |
6,185,608 | 6,185,716 | Getting server restart count in a day using c#? | Is it possible to get the number of times a server gets restarted in a period of time using c#? I have seen this post which is getting windows last shutdown time Get the date-time of last windows shutdown event using.NET Any suggestion? | Have you considered reading from the server's event log? The 'USER32' system event source records shutdowns. From what I've read it seem that you should be able to read a remote machine's event log programmatically as well ( See How to manage event logs using Visual C#.NET or Visual C# 2005 ) EDIT The following console... | Getting server restart count in a day using c#? Is it possible to get the number of times a server gets restarted in a period of time using c#? I have seen this post which is getting windows last shutdown time Get the date-time of last windows shutdown event using.NET Any suggestion? | TITLE:
Getting server restart count in a day using c#?
QUESTION:
Is it possible to get the number of times a server gets restarted in a period of time using c#? I have seen this post which is getting windows last shutdown time Get the date-time of last windows shutdown event using.NET Any suggestion?
ANSWER:
Have you... | [
"c#",
"windows-services"
] | 3 | 3 | 3,382 | 2 | 0 | 2011-05-31T09:32:11.700000 | 2011-05-31T09:42:54.137000 |
6,185,609 | 6,186,016 | IPHONE - How to make a disclaimer? | my app is almost finished and since is for airline pilots I would like to add a disclamer (like an alert view...but more like a scroll view) that pop up as soon as they start the app and if they don't press ok I want to exit from the app. Any advice would be really appreciated. thanks | Just use a UIAlertView — if you put a lot of text in it, it automatically scrolls. If the user presses the "No" button, you need to just disable the app rather than exit — apps aren't allowed to exit unless the user presses the home button. You could pop up a modal view controller (with no way of dismissing it) with a ... | IPHONE - How to make a disclaimer? my app is almost finished and since is for airline pilots I would like to add a disclamer (like an alert view...but more like a scroll view) that pop up as soon as they start the app and if they don't press ok I want to exit from the app. Any advice would be really appreciated. thanks | TITLE:
IPHONE - How to make a disclaimer?
QUESTION:
my app is almost finished and since is for airline pilots I would like to add a disclamer (like an alert view...but more like a scroll view) that pop up as soon as they start the app and if they don't press ok I want to exit from the app. Any advice would be really a... | [
"iphone",
"ios4"
] | 0 | 1 | 262 | 1 | 0 | 2011-05-31T09:32:12.843000 | 2011-05-31T10:10:09.057000 |
6,185,610 | 6,198,862 | How to handle COM events from a console application? | I'm using a COM object from a third party library that generates periodic events. When I use the library from a Winforms app, having the object as a class member and creating it in the main form thread, everything works. However, if I create the object from another thread, I don't receive any event. My guess is that I ... | As already stated in other answers STA COM components require a message loop to be run in order for calls happening in other threads be correctly marshaled to the STA thread that owns the component. In Windows Forms you get the message loop for free, but in a console application you must do it explicitly by calling Thr... | How to handle COM events from a console application? I'm using a COM object from a third party library that generates periodic events. When I use the library from a Winforms app, having the object as a class member and creating it in the main form thread, everything works. However, if I create the object from another t... | TITLE:
How to handle COM events from a console application?
QUESTION:
I'm using a COM object from a third party library that generates periodic events. When I use the library from a Winforms app, having the object as a class member and creating it in the main form thread, everything works. However, if I create the obj... | [
"c#",
"events",
"com",
"interop"
] | 14 | 4 | 6,683 | 6 | 0 | 2011-05-31T09:32:19.790000 | 2011-06-01T09:18:59.867000 |
6,185,612 | 6,187,249 | How to calculate the average altitude through gps location manager in iphone | I want to calculate the maximum altitude, minimum altitude, and average altitude of the current location through CLLocationManager. I know how to calculate the altitude using the following code: #import #import @interface test: UIViewController { CLLocationManager *locationManager;
CLLocation *startingPoint;
IBOutlet... | I describe how to get min in the minAltitude method. I'll leave it to you to find max and average. in.h: NSMutableArray *altitudes; in.m: - (void) viewDidLoad { [super viewDidLoad]; altitudes = [[NSMutableArray alloc] init]; }
- (void) dealloc { [altitudes release]; [super dealloc]; }
- (void)locationManager:(CLLocat... | How to calculate the average altitude through gps location manager in iphone I want to calculate the maximum altitude, minimum altitude, and average altitude of the current location through CLLocationManager. I know how to calculate the altitude using the following code: #import #import @interface test: UIViewControlle... | TITLE:
How to calculate the average altitude through gps location manager in iphone
QUESTION:
I want to calculate the maximum altitude, minimum altitude, and average altitude of the current location through CLLocationManager. I know how to calculate the altitude using the following code: #import #import @interface tes... | [
"iphone",
"objective-c",
"locationmanager"
] | 2 | 2 | 1,851 | 2 | 0 | 2011-05-31T09:32:34.073000 | 2011-05-31T11:59:33.063000 |
6,185,614 | 6,185,930 | iOS Objective-C accessing ivars from different classes | What is the preferred method of accessing ivars from different classes? Application Delegate Class Say I want to access the root controller (@synthesized as rootController) from the Application Delegate class in another UIViewController class. I've read somewhere that you access ivars from the Application Delegate clas... | The application delegate is a singleton so you can access those properties from anywhere. In the case of a 'normal' class, and assuming you don't want to make it a singleton, you would normally use the delegate pattern. This means that class A becomes the delegate for class B and class B can call methods that class A w... | iOS Objective-C accessing ivars from different classes What is the preferred method of accessing ivars from different classes? Application Delegate Class Say I want to access the root controller (@synthesized as rootController) from the Application Delegate class in another UIViewController class. I've read somewhere t... | TITLE:
iOS Objective-C accessing ivars from different classes
QUESTION:
What is the preferred method of accessing ivars from different classes? Application Delegate Class Say I want to access the root controller (@synthesized as rootController) from the Application Delegate class in another UIViewController class. I'v... | [
"objective-c",
"cocoa-touch",
"ios",
"instance-variables"
] | 1 | 1 | 1,053 | 3 | 0 | 2011-05-31T09:32:45.163000 | 2011-05-31T10:01:42.703000 |
6,185,618 | 6,185,828 | how can I store different times from stopwatch | I am confused regarding to calculation of two different times. In my game, when game starts then timer gets started (like stop watch) and it stops when game gets finished. Now I have to store best low time among previous time list. I am getting time in hh:mm:ss format. how can I store this time so that i can compare it... | Take two NSDates, one at the game start and one at game finish, then calculate the difference. NSDate *startDate = [NSDate date]; // At game start
NSTimeInterval interval = [[NSDate date] timeIntervalSinceDate:startDate]; // At game finish
NSlog(@"interval: %.2f", interval); | how can I store different times from stopwatch I am confused regarding to calculation of two different times. In my game, when game starts then timer gets started (like stop watch) and it stops when game gets finished. Now I have to store best low time among previous time list. I am getting time in hh:mm:ss format. how... | TITLE:
how can I store different times from stopwatch
QUESTION:
I am confused regarding to calculation of two different times. In my game, when game starts then timer gets started (like stop watch) and it stops when game gets finished. Now I have to store best low time among previous time list. I am getting time in hh... | [
"iphone",
"objective-c",
"nstimer"
] | 0 | 3 | 160 | 2 | 0 | 2011-05-31T09:33:30.593000 | 2011-05-31T09:53:13.223000 |
6,185,621 | 6,185,670 | zend db select join help | so I have this code: $sql = new Zend_Db_Select($db); $sql->from("j"); $sql->join("k","k.id = j.id",array()); echo $sql; which results in the query: SELECT `j`.* FROM `j` INNER JOIN `k` ON k.id = j.id but I don't just want j.* I also want k.* how do I specify zend_db_select for this? | The third parameter for join() is columns for select. You have passed an empty array. $sql = new Zend_Db_Select($db); $sql->from('j'); $sql->join('k','k.id = j.id',array()); echo $sql; Note: for this condition k.id = j.id you should use LEFT JOIN(->joinLeft(...)) | zend db select join help so I have this code: $sql = new Zend_Db_Select($db); $sql->from("j"); $sql->join("k","k.id = j.id",array()); echo $sql; which results in the query: SELECT `j`.* FROM `j` INNER JOIN `k` ON k.id = j.id but I don't just want j.* I also want k.* how do I specify zend_db_select for this? | TITLE:
zend db select join help
QUESTION:
so I have this code: $sql = new Zend_Db_Select($db); $sql->from("j"); $sql->join("k","k.id = j.id",array()); echo $sql; which results in the query: SELECT `j`.* FROM `j` INNER JOIN `k` ON k.id = j.id but I don't just want j.* I also want k.* how do I specify zend_db_select for... | [
"php",
"mysql",
"zend-framework",
"select",
"join"
] | 1 | 2 | 1,310 | 5 | 0 | 2011-05-31T09:33:42.243000 | 2011-05-31T09:38:28.790000 |
6,185,625 | 6,185,988 | SQL/SSRS select first weekday on or prior to date | Hello I've converted a spreadsheet into a SSRS report which is run on the 20th of month and I need to pass the 20th of the current month as a default value (start date) either through a custom expression or dataset. If the 20th falls on a Saturday, default to friday 19th. If the 20th falls on Sunday default to Friday 1... | How about this: DECLARE @daytwenty date; SET @daytwenty = DATEADD(mm, DATEDIFF(mm, 0, getdate()),19) --Get Twentieth Day of current month
SELECT CASE DATEPART(DW,@daytwenty) WHEN 1 THEN DATEADD(dd, -2, @daytwenty) --When the twentieth day is a Sunday, take two days off WHEN 7 THEN DATEADD(dd, -1, @daytwenty) --When th... | SQL/SSRS select first weekday on or prior to date Hello I've converted a spreadsheet into a SSRS report which is run on the 20th of month and I need to pass the 20th of the current month as a default value (start date) either through a custom expression or dataset. If the 20th falls on a Saturday, default to friday 19t... | TITLE:
SQL/SSRS select first weekday on or prior to date
QUESTION:
Hello I've converted a spreadsheet into a SSRS report which is run on the 20th of month and I need to pass the 20th of the current month as a default value (start date) either through a custom expression or dataset. If the 20th falls on a Saturday, def... | [
"sql",
"sql-server",
"sql-server-2008"
] | 0 | 2 | 1,037 | 3 | 0 | 2011-05-31T09:34:17.800000 | 2011-05-31T10:07:06.303000 |
6,185,634 | 6,185,697 | How to Convert the Following string into Date Object? | I am New to Android Development.How to convert the Following string(5/31/2011) in to the Date Object I tried different ways But Couldn't get any Luck?? | String dateStr = "5/31/2011"; DateFormat df = new SimpleDateFormat("M/dd/yyyy"); Date date = df.parse(dateStr); | How to Convert the Following string into Date Object? I am New to Android Development.How to convert the Following string(5/31/2011) in to the Date Object I tried different ways But Couldn't get any Luck?? | TITLE:
How to Convert the Following string into Date Object?
QUESTION:
I am New to Android Development.How to convert the Following string(5/31/2011) in to the Date Object I tried different ways But Couldn't get any Luck??
ANSWER:
String dateStr = "5/31/2011"; DateFormat df = new SimpleDateFormat("M/dd/yyyy"); Date d... | [
"java",
"android",
"string",
"date"
] | 1 | 2 | 1,475 | 3 | 0 | 2011-05-31T09:35:03.373000 | 2011-05-31T09:41:00.043000 |
6,185,641 | 6,185,832 | Wordpress css navigation menu using nested lists | I'm having some trouble with Internet Explorer with my code not working. Its for a horizontal drop down menu Home Our Services Maintenance Nidagravel Timber Tech Galleries Garden 1 Garden 2 Garden 3 Garden 4 Project Videos About Us Contact and here is my css bit.nav-bg { background-color:#ebebeb; /* -- Your navegation ... | Internet Explorer (version 6 and below and 7 in certain cases) does not allow the pseudo element:hover on then the anchor (a) element. Internet Explorer 7 and later, in standards-compliant mode (strict!DOCTYPE), can apply the:hover pseudo-class to any element, not merely links. For other versions (6 and below) you can ... | Wordpress css navigation menu using nested lists I'm having some trouble with Internet Explorer with my code not working. Its for a horizontal drop down menu Home Our Services Maintenance Nidagravel Timber Tech Galleries Garden 1 Garden 2 Garden 3 Garden 4 Project Videos About Us Contact and here is my css bit.nav-bg {... | TITLE:
Wordpress css navigation menu using nested lists
QUESTION:
I'm having some trouble with Internet Explorer with my code not working. Its for a horizontal drop down menu Home Our Services Maintenance Nidagravel Timber Tech Galleries Garden 1 Garden 2 Garden 3 Garden 4 Project Videos About Us Contact and here is m... | [
"css",
"wordpress",
"list",
"menu"
] | 0 | 1 | 1,012 | 2 | 0 | 2011-05-31T09:36:03.267000 | 2011-05-31T09:53:43.270000 |
6,185,647 | 6,185,803 | Reg. Meta Tags for SEO | Can anyone tell me the meta tags that should be included in a page for SEO friendly? Is this meta tags throughout same for all the pages of a site or differs from page to page? [EDIT] Also can anyone tell me the steps I've to do for my site to better SEO friendly like registering my domain in some websites? | Well, this is really a very broad question. To start with the first part of your question: at least DIFFERENT meta tags per page for: title keywords description Apart from that, it depends a bit on the search engine. If you are looking for Google I suggest you watch their series on Youtube where they provide excellent ... | Reg. Meta Tags for SEO Can anyone tell me the meta tags that should be included in a page for SEO friendly? Is this meta tags throughout same for all the pages of a site or differs from page to page? [EDIT] Also can anyone tell me the steps I've to do for my site to better SEO friendly like registering my domain in som... | TITLE:
Reg. Meta Tags for SEO
QUESTION:
Can anyone tell me the meta tags that should be included in a page for SEO friendly? Is this meta tags throughout same for all the pages of a site or differs from page to page? [EDIT] Also can anyone tell me the steps I've to do for my site to better SEO friendly like registerin... | [
"seo",
"search-engine",
"meta-tags"
] | 0 | 1 | 242 | 3 | 0 | 2011-05-31T09:36:24.833000 | 2011-05-31T09:50:58.933000 |
6,185,655 | 6,187,163 | Fluent Nhibernate 3 Mapping Composite Field (Custom Type) | HI all, my scenario public class Permission { public virtual Function Function { get; set; } public virtual Profile Profile { get; set; } }
public class MapPermission: ClassMap { public MapPermission() { Table("Permissions".ToUpper()); CompositeId().KeyProperty(x => x.Function, "FunctionID").KeyProperty(x => x.Profile... | Use KeyReference instead of KeyProperty public class MapPermission: ClassMap { public MapPermission() { Table("Permissions".ToUpper()); CompositeId().KeyReference(x => x.Function, "FunctionID").KeyReference(x => x.Profile, "ProfileID");
} } | Fluent Nhibernate 3 Mapping Composite Field (Custom Type) HI all, my scenario public class Permission { public virtual Function Function { get; set; } public virtual Profile Profile { get; set; } }
public class MapPermission: ClassMap { public MapPermission() { Table("Permissions".ToUpper()); CompositeId().KeyProperty... | TITLE:
Fluent Nhibernate 3 Mapping Composite Field (Custom Type)
QUESTION:
HI all, my scenario public class Permission { public virtual Function Function { get; set; } public virtual Profile Profile { get; set; } }
public class MapPermission: ClassMap { public MapPermission() { Table("Permissions".ToUpper()); Composi... | [
"fluent-nhibernate",
"composite-id",
"custom-type"
] | 1 | 6 | 1,324 | 1 | 0 | 2011-05-31T09:36:53.420000 | 2011-05-31T11:53:29.980000 |
6,185,662 | 6,186,322 | Qt - A simple echo server | How in Qt would you keep a thread alive in the QThreadPool; as far as I've seen there is only an option to run a QRunnable and I've been told they can't control the thread they are within. How would I, using the thread pool keep a socket alive and ready to read and write? | QThreadPool manages its own threads. QT Doc says that QThreadPool manages and recyles individual QThread objects to help reduce thread creation costs in programs that use threads. So you should not try to keep a thread alive. That breaks the purpose of thread pool. Also QT sockets are designed to work well with the mai... | Qt - A simple echo server How in Qt would you keep a thread alive in the QThreadPool; as far as I've seen there is only an option to run a QRunnable and I've been told they can't control the thread they are within. How would I, using the thread pool keep a socket alive and ready to read and write? | TITLE:
Qt - A simple echo server
QUESTION:
How in Qt would you keep a thread alive in the QThreadPool; as far as I've seen there is only an option to run a QRunnable and I've been told they can't control the thread they are within. How would I, using the thread pool keep a socket alive and ready to read and write?
AN... | [
"c++",
"qt4",
"qthread",
"qtcpserver"
] | 0 | 1 | 968 | 2 | 0 | 2011-05-31T09:37:41.580000 | 2011-05-31T10:40:13.620000 |
6,185,667 | 6,185,698 | Restriction based on IP ranges | I am building an admin panel. and I want to block certain IP ranges. I'm testing this on my localhost wamp server but ir doesn't seem to redirect me. Any input is appreciated. | Is sufficient to use string comparison if (strncmp('127.0.0.', $_SERVER['REMOTE_ADDR'], 8) === 0) header("Location: http://google.com"); else echo "Hai"; Update: Taken from the comments of inits answer Suppose i want to block any IP coming from this range: 192.168.0.1-255. What would be the best solution for it? Thanks... | Restriction based on IP ranges I am building an admin panel. and I want to block certain IP ranges. I'm testing this on my localhost wamp server but ir doesn't seem to redirect me. Any input is appreciated. | TITLE:
Restriction based on IP ranges
QUESTION:
I am building an admin panel. and I want to block certain IP ranges. I'm testing this on my localhost wamp server but ir doesn't seem to redirect me. Any input is appreciated.
ANSWER:
Is sufficient to use string comparison if (strncmp('127.0.0.', $_SERVER['REMOTE_ADDR']... | [
"php",
"ip",
"range"
] | 0 | 4 | 8,376 | 4 | 0 | 2011-05-31T09:37:53.583000 | 2011-05-31T09:41:04.693000 |
6,185,668 | 6,187,365 | How to stop the Rails debugger for the current request | Say I have a loop in my code that calls the rails debugger a few times def show animals = ['dog', 'cat', 'owl', 'tiger'] for animal in animals debugger # do something else end Assuming I started my server with the --debugger option, when this page is viewed, the debugger is going to stop for every run of the loop. I ca... | Just put conditions on the debugger statement so that it stops only when you want it to, e.g.: debugger if animal == 'tiger' or if, say, you want to examine the code only on loop 384: animals.each_with_index do |animal, i| debugger if i == 384 # do something end or put in a variable that will let you continue ad hoc: c... | How to stop the Rails debugger for the current request Say I have a loop in my code that calls the rails debugger a few times def show animals = ['dog', 'cat', 'owl', 'tiger'] for animal in animals debugger # do something else end Assuming I started my server with the --debugger option, when this page is viewed, the de... | TITLE:
How to stop the Rails debugger for the current request
QUESTION:
Say I have a loop in my code that calls the rails debugger a few times def show animals = ['dog', 'cat', 'owl', 'tiger'] for animal in animals debugger # do something else end Assuming I started my server with the --debugger option, when this page... | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"debugging",
"ruby-debug"
] | 15 | 16 | 8,378 | 9 | 0 | 2011-05-31T09:37:54.830000 | 2011-05-31T12:09:33.277000 |
6,185,669 | 6,185,700 | Malicious Code Through Image Upload | There is a part of my website that allows users to upload profile photos. I'm worried about people uploading malicious code. I'm planning on limiting the the file types to.jpg/.png/.gif/.jpeg I'm worried that it won't be enough. I'm going to be resize thing images on the server. Would the process of resizing the photos... | Simply doing this will ensure you're working on an image: if (getimagesize($sourcePath) === false) { die("Not an image!"); } For more safety you should disable PHP execution in the upload folder. In.htaccess: php_value engine off | Malicious Code Through Image Upload There is a part of my website that allows users to upload profile photos. I'm worried about people uploading malicious code. I'm planning on limiting the the file types to.jpg/.png/.gif/.jpeg I'm worried that it won't be enough. I'm going to be resize thing images on the server. Woul... | TITLE:
Malicious Code Through Image Upload
QUESTION:
There is a part of my website that allows users to upload profile photos. I'm worried about people uploading malicious code. I'm planning on limiting the the file types to.jpg/.png/.gif/.jpeg I'm worried that it won't be enough. I'm going to be resize thing images o... | [
"php",
"validation",
"image-processing"
] | 6 | 9 | 2,888 | 3 | 0 | 2011-05-31T09:37:59.223000 | 2011-05-31T09:41:07.447000 |
6,185,676 | 6,201,127 | Cut, copy, paste in android | I want to implement the cut,copy, paste functionality in my EditText,i tried with the following code: ClipMan = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); editbox1.setText(ClipMan.getText()); for paste the text,but it paste the whole text in another Editbox..I want to copy the selected text and pas... | Finally i am able to copy,paste in my application..now i can paste only selected text by using this code: Editable s1; EditText editbox2; to copy the selected text: if(editbox2.getSelectionEnd() > editbox2.getSelectionStart()) { s1 = (Editable) editbox2.getText().subSequence(editbox2.getSelectionStart(), editbox2.getSe... | Cut, copy, paste in android I want to implement the cut,copy, paste functionality in my EditText,i tried with the following code: ClipMan = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); editbox1.setText(ClipMan.getText()); for paste the text,but it paste the whole text in another Editbox..I want to co... | TITLE:
Cut, copy, paste in android
QUESTION:
I want to implement the cut,copy, paste functionality in my EditText,i tried with the following code: ClipMan = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); editbox1.setText(ClipMan.getText()); for paste the text,but it paste the whole text in another Edi... | [
"android",
"clipboard",
"android-edittext"
] | 8 | 3 | 11,307 | 3 | 0 | 2011-05-31T09:38:47.747000 | 2011-06-01T12:27:47.697000 |
6,185,678 | 6,185,724 | select a child of a selector with specific class | im using jQuery and im trying to create a menu using a list of divs which have the class "menuElement". each menuElment div has an id corresponding to the particular menu item. each div menuElement has two divs with classes menuElementHeader and menuElementBody. i want to display the menuElementHeader div initially, an... | Note that two elements cannot have the same ID! Edit: This is corrected now. Based on your description I think you want: $('.menuElementHeader').click(function() { $(this).next('.menuElementBody').toggle(); }); Hide all.menuElementBody initially with CSS:.menuElementBody { display: none; } Alternatively, you can bind t... | select a child of a selector with specific class im using jQuery and im trying to create a menu using a list of divs which have the class "menuElement". each menuElment div has an id corresponding to the particular menu item. each div menuElement has two divs with classes menuElementHeader and menuElementBody. i want t... | TITLE:
select a child of a selector with specific class
QUESTION:
im using jQuery and im trying to create a menu using a list of divs which have the class "menuElement". each menuElment div has an id corresponding to the particular menu item. each div menuElement has two divs with classes menuElementHeader and menuEle... | [
"jquery",
"jquery-selectors"
] | 0 | 2 | 1,689 | 3 | 0 | 2011-05-31T09:38:56.913000 | 2011-05-31T09:43:25.637000 |
6,185,695 | 6,185,857 | How to combine multiple commits in to one without losing history | I have multiple commits in one branch. When I push these commits for code review, our code review tool creates one review for each commit. To avoid this I want to merge multiple commits to a single commit. At the same time I don't want to lose the history of commits. Is it possible to create a new branch only for revie... | I dont know your review tool, but this may work git checkout review git merge --squash master http://www.kernel.org/pub/software/scm/git/docs/git-merge.html | How to combine multiple commits in to one without losing history I have multiple commits in one branch. When I push these commits for code review, our code review tool creates one review for each commit. To avoid this I want to merge multiple commits to a single commit. At the same time I don't want to lose the history... | TITLE:
How to combine multiple commits in to one without losing history
QUESTION:
I have multiple commits in one branch. When I push these commits for code review, our code review tool creates one review for each commit. To avoid this I want to merge multiple commits to a single commit. At the same time I don't want t... | [
"git",
"git-branch",
"git-commit"
] | 6 | 6 | 2,423 | 2 | 0 | 2011-05-31T09:40:39.457000 | 2011-05-31T09:55:15.060000 |
6,185,709 | 6,185,753 | Unable to figure out XPath in HtmlAgilityPack | I have trying to get around making my first C# application(that can do more than just say "Hello world"), now the html file got lots of tags,(but got only two h4 tags that are given below.) but here is the part that i am interested in: UNWANTED TEXT Name: {NAME HERE} Number: {NUMBERS HERE} Number2: {NUMBERS2} UNWANTED ... | Firefox adds tbody tag to table (in original html this tag can be absent). So, I would suggest do not write all path, find most characterizing path and use //. For example, //div[@class='data']/table//tr/td | Unable to figure out XPath in HtmlAgilityPack I have trying to get around making my first C# application(that can do more than just say "Hello world"), now the html file got lots of tags,(but got only two h4 tags that are given below.) but here is the part that i am interested in: UNWANTED TEXT Name: {NAME HERE} Number... | TITLE:
Unable to figure out XPath in HtmlAgilityPack
QUESTION:
I have trying to get around making my first C# application(that can do more than just say "Hello world"), now the html file got lots of tags,(but got only two h4 tags that are given below.) but here is the part that i am interested in: UNWANTED TEXT Name: ... | [
"c#",
"xpath",
"html-agility-pack"
] | 2 | 4 | 2,665 | 2 | 0 | 2011-05-31T09:42:13.903000 | 2011-05-31T09:46:47.833000 |
6,185,713 | 6,185,747 | How do i put a count down timer on my webpage | I want a count down timer of 60 seconds after which the page refreshes edit: i need a visible count down on the webpage. but obviously the page cant refresh each second for the timer to change | Here is a simple recursive countdown function: function countdown(time,endcallback,stepcallback) { if (time == 0) endcallback(); else { time--; stepcallback(time); window.setTimeout(function() { countdown(time,callback); },1000); } }
countdown(60,function() { window.location.reload(); },function(time) { // display cou... | How do i put a count down timer on my webpage I want a count down timer of 60 seconds after which the page refreshes edit: i need a visible count down on the webpage. but obviously the page cant refresh each second for the timer to change | TITLE:
How do i put a count down timer on my webpage
QUESTION:
I want a count down timer of 60 seconds after which the page refreshes edit: i need a visible count down on the webpage. but obviously the page cant refresh each second for the timer to change
ANSWER:
Here is a simple recursive countdown function: functio... | [
"javascript",
"jquery"
] | 0 | 2 | 5,390 | 5 | 0 | 2011-05-31T09:42:36.143000 | 2011-05-31T09:46:22.033000 |
6,185,717 | 6,192,835 | Use GridFieldManager or TableLayoutManager | I've been using TableLayoutManager as defined in the BlackBerry KnowledgeBase article Create a rich UI layout with TableLayoutManager I'm considering using GridFieldManager instead. Is GridFieldManager used for the same purpose? Are there advantages that GridFieldManager has over TableLayoutManager and vice versa? | This is not a complete answer, however here is what I have: Are there advantages that GridFieldManager has over TableLayoutManager and vice versa? At a glance - GridFieldManager is a comparatively new component (since API 5.0.0), while you can use TableLayoutManager on much older APIs (since 4.2). So if you're writting... | Use GridFieldManager or TableLayoutManager I've been using TableLayoutManager as defined in the BlackBerry KnowledgeBase article Create a rich UI layout with TableLayoutManager I'm considering using GridFieldManager instead. Is GridFieldManager used for the same purpose? Are there advantages that GridFieldManager has o... | TITLE:
Use GridFieldManager or TableLayoutManager
QUESTION:
I've been using TableLayoutManager as defined in the BlackBerry KnowledgeBase article Create a rich UI layout with TableLayoutManager I'm considering using GridFieldManager instead. Is GridFieldManager used for the same purpose? Are there advantages that Grid... | [
"blackberry",
"java-me"
] | 0 | 0 | 1,242 | 1 | 0 | 2011-05-31T09:42:58.827000 | 2011-05-31T19:57:49.170000 |
6,185,720 | 6,186,021 | C array usage problems | I'm very new to C. I want to add two one dimensional integer array name a[10] b[10]. I want to put the result in a 2dimentional array c[5][2] like c[i][j] = a[i]+b[i]; But if I use 2 for loops then how can I access a[9], b[9] value. So I want to use a single for loop which perform a[i]+b[i] and puts the result in c[i][... | This may help (if I understood right): for ( int i = 0; i < 10; ++i) { c[i%5][i/5] = a[i] + b[i]; } | C array usage problems I'm very new to C. I want to add two one dimensional integer array name a[10] b[10]. I want to put the result in a 2dimentional array c[5][2] like c[i][j] = a[i]+b[i]; But if I use 2 for loops then how can I access a[9], b[9] value. So I want to use a single for loop which perform a[i]+b[i] and p... | TITLE:
C array usage problems
QUESTION:
I'm very new to C. I want to add two one dimensional integer array name a[10] b[10]. I want to put the result in a 2dimentional array c[5][2] like c[i][j] = a[i]+b[i]; But if I use 2 for loops then how can I access a[9], b[9] value. So I want to use a single for loop which perfo... | [
"c",
"arrays",
"multidimensional-array"
] | 0 | 0 | 158 | 4 | 0 | 2011-05-31T09:43:03.950000 | 2011-05-31T10:10:46.103000 |
6,185,722 | 6,226,021 | android audio player | I want to develope audio player that has seek functionality. Right now I am doing only play and stop functionality. How can I add seek to functionality to it? Thanks in advance | setContentView(R.layout.playingactivity); Toast.LENGTH_LONG).show(); mPath = (EditText) findViewById(R.id.path); mPath.setText(GlobalVariable.getstrEmail()); mVideoView = (VideoView) findViewById(R.id.surface_view); Uri uri = Uri.parse("/sdcard/download/test.mp3"); mediaController = new MediaController(this); mediaCont... | android audio player I want to develope audio player that has seek functionality. Right now I am doing only play and stop functionality. How can I add seek to functionality to it? Thanks in advance | TITLE:
android audio player
QUESTION:
I want to develope audio player that has seek functionality. Right now I am doing only play and stop functionality. How can I add seek to functionality to it? Thanks in advance
ANSWER:
setContentView(R.layout.playingactivity); Toast.LENGTH_LONG).show(); mPath = (EditText) findVie... | [
"android",
"seek",
"audio-player"
] | 2 | 0 | 803 | 3 | 0 | 2011-05-31T09:43:19.917000 | 2011-06-03T10:39:59.660000 |
6,185,744 | 6,186,410 | Can the ActionBar drop-down navigation list be customized to include an icon? | Can the drop-down navigation list in an ActionBar be modified to include an icon on its left-hand side? Basically I want an icon alongside the action bar entry itself, and not on the individual list items. Thanks in advance, Peter. | You supply the SpinnerAdapter for use with the drop-down navigation list. Choose an appropriate resource for the closed state (i.e., the resource you supply to the ArrayAdapter constructor), one that has your desired icon in the desired position. | Can the ActionBar drop-down navigation list be customized to include an icon? Can the drop-down navigation list in an ActionBar be modified to include an icon on its left-hand side? Basically I want an icon alongside the action bar entry itself, and not on the individual list items. Thanks in advance, Peter. | TITLE:
Can the ActionBar drop-down navigation list be customized to include an icon?
QUESTION:
Can the drop-down navigation list in an ActionBar be modified to include an icon on its left-hand side? Basically I want an icon alongside the action bar entry itself, and not on the individual list items. Thanks in advance,... | [
"android",
"android-3.0-honeycomb"
] | 0 | 0 | 1,014 | 1 | 0 | 2011-05-31T09:46:08.073000 | 2011-05-31T10:47:01.467000 |
6,185,746 | 6,185,926 | Groovy :: Map Find Recursive | Edit See @tim's solution below for the "correct" Groovy-esque approach to map recursion. Since Map findRecursive does not yet exist in Groovy, if you find yourself needing this functionality in various parts of your app, just add it to Map metaClass: Map.metaClass.findRecursive = {String key-> if(delegate.containsKey(k... | With Groovy 1.8 (reqd for the findResult method), you could do something like this: class DeepFinder { static Object findDeep( Map map, Object key ) { map.get( key )?: map.findResult { k, v -> if( v in Map ) v.findDeep( key ) } } }
use( DeepFinder ) { println map.findDeep( 'team' ) } There's no recursing default Groov... | Groovy :: Map Find Recursive Edit See @tim's solution below for the "correct" Groovy-esque approach to map recursion. Since Map findRecursive does not yet exist in Groovy, if you find yourself needing this functionality in various parts of your app, just add it to Map metaClass: Map.metaClass.findRecursive = {String ke... | TITLE:
Groovy :: Map Find Recursive
QUESTION:
Edit See @tim's solution below for the "correct" Groovy-esque approach to map recursion. Since Map findRecursive does not yet exist in Groovy, if you find yourself needing this functionality in various parts of your app, just add it to Map metaClass: Map.metaClass.findRecu... | [
"recursion",
"groovy",
"dictionary",
"find"
] | 4 | 10 | 5,625 | 1 | 0 | 2011-05-31T09:46:21.987000 | 2011-05-31T10:01:22.280000 |
6,185,750 | 6,185,796 | document getelementid is returning null | I am getting document.getElementById("#toHide") is null. How can solve this? how to convert this statement to jquery? html: Java code creating JavaScript code in string buffer: if(flag == false){ flag = true; buffer.append("$('#toHide').doTimeout(1000, "); buffer.append("function() { "); buffer.append("$('#").append(co... | For jQuery, try: buffer.append("\n $(\'#toHide\').hide();\n"); instead of buffer.append("\n document.getElementById(\'#toHide\').style.display='none';\n"); | document getelementid is returning null I am getting document.getElementById("#toHide") is null. How can solve this? how to convert this statement to jquery? html: Java code creating JavaScript code in string buffer: if(flag == false){ flag = true; buffer.append("$('#toHide').doTimeout(1000, "); buffer.append("function... | TITLE:
document getelementid is returning null
QUESTION:
I am getting document.getElementById("#toHide") is null. How can solve this? how to convert this statement to jquery? html: Java code creating JavaScript code in string buffer: if(flag == false){ flag = true; buffer.append("$('#toHide').doTimeout(1000, "); buffe... | [
"javascript",
"jquery"
] | 2 | 0 | 233 | 3 | 0 | 2011-05-31T09:46:30.363000 | 2011-05-31T09:50:35.277000 |
6,185,761 | 6,197,568 | Customizing QHeaderView resize handle | I use the cleanlooks style for my application which fits best the look and feel I want. The annoying thing a stumbled on is that the QHeaderView (horizontal header of a QTableWidget for instance) doesn't paint the resize handle between sections when running uner an Unix host. what I want: what I get: I started to searc... | Here is what i found so far: QHeaderView::section:horizontal{ margin-top: 4px; margin-bottom: 4px; border-style: solid; border-left-width: 1px; border-left-color: white; border-right-color: darkgray; border-right-width: 1px; } QHeaderView::section:horizontal:first{ border-left-color: darkgray; } which gives this result... | Customizing QHeaderView resize handle I use the cleanlooks style for my application which fits best the look and feel I want. The annoying thing a stumbled on is that the QHeaderView (horizontal header of a QTableWidget for instance) doesn't paint the resize handle between sections when running uner an Unix host. what ... | TITLE:
Customizing QHeaderView resize handle
QUESTION:
I use the cleanlooks style for my application which fits best the look and feel I want. The annoying thing a stumbled on is that the QHeaderView (horizontal header of a QTableWidget for instance) doesn't paint the resize handle between sections when running uner a... | [
"css",
"qt",
"customization",
"qheaderview"
] | 1 | 2 | 2,661 | 1 | 0 | 2011-05-31T09:47:13.373000 | 2011-06-01T07:17:12.353000 |
6,185,767 | 6,186,438 | UDP threading infinite loop in Java | I've written two programs. Now each program uses threading to send and receive packets at the same time. Whenever I send packets from the server to the client, the message at the client ends gets received in an infinite loop. I.e; I've added a print statement that prints the message sent and this goes forever in an inf... | Looking at UDPClientServer: When you create the Datagram packet, you give it the port to send it to, not the port that you are sending it from. When I ran your code, nothing happened. The server is waiting on port port, while the client sends to port port1. If you instead send to port port (not accessible from the main... | UDP threading infinite loop in Java I've written two programs. Now each program uses threading to send and receive packets at the same time. Whenever I send packets from the server to the client, the message at the client ends gets received in an infinite loop. I.e; I've added a print statement that prints the message ... | TITLE:
UDP threading infinite loop in Java
QUESTION:
I've written two programs. Now each program uses threading to send and receive packets at the same time. Whenever I send packets from the server to the client, the message at the client ends gets received in an infinite loop. I.e; I've added a print statement that p... | [
"java",
"loops",
"udp",
"infinite"
] | 1 | 1 | 6,158 | 3 | 0 | 2011-05-31T09:47:45.047000 | 2011-05-31T10:49:38.447000 |
6,185,770 | 6,212,246 | What is best way to updating tree Panel | I would like know, what is the best way to sync/load tree panel after updating database. Today, i do an Ajax Request to make an updates. If the response is successful i use method load of my treeStore. myTreePanel.getStore.load(); But this technic waste times. Maybe is not the best technic to do this?! Thanks:) | if user updates a node & you commit changes to server/database you don't need to reload tree, just update that node node.setText('BlahBlah') but if it's more than one node or updates are comming from server & current user hasn't changed them (tree changes by other users & current user just sees changes) i would update ... | What is best way to updating tree Panel I would like know, what is the best way to sync/load tree panel after updating database. Today, i do an Ajax Request to make an updates. If the response is successful i use method load of my treeStore. myTreePanel.getStore.load(); But this technic waste times. Maybe is not the be... | TITLE:
What is best way to updating tree Panel
QUESTION:
I would like know, what is the best way to sync/load tree panel after updating database. Today, i do an Ajax Request to make an updates. If the response is successful i use method load of my treeStore. myTreePanel.getStore.load(); But this technic waste times. M... | [
"extjs",
"store",
"treepanel"
] | 2 | 1 | 818 | 1 | 0 | 2011-05-31T09:48:03.533000 | 2011-06-02T08:39:26.267000 |
6,185,771 | 6,185,973 | NameError:Admin not found in django | The urls.py of the project is this from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover()
urlpatterns = patterns('', # Examples: # url(r'^$', 'Sdr.views.home', name='home'), # url(r'^Sdr/', include('Sdr... | You forgot to import admin in the project's urls.py. Read harder. | NameError:Admin not found in django The urls.py of the project is this from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover()
urlpatterns = patterns('', # Examples: # url(r'^$', 'Sdr.views.home', name='... | TITLE:
NameError:Admin not found in django
QUESTION:
The urls.py of the project is this from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover()
urlpatterns = patterns('', # Examples: # url(r'^$', 'Sdr.v... | [
"django"
] | 15 | 25 | 9,387 | 3 | 0 | 2011-05-31T09:48:05.543000 | 2011-05-31T10:05:55.773000 |
6,185,772 | 6,185,869 | dynamic gridview column autocalculation | I have a Gridview, with textboxes in templatefields, where i dynamically add columns to it. protected void grid() { DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("SerialNumber", typeof(string))); dt.Columns.Add(new DataColumn("Material", typeof(string))); dt.Columns.Add(new DataColumn("Bags", typeof(st... | protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e){ if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Cells[5] = (e.Row.Cells[3].Text - e.Row.Cells[4].Text)/1000 } } Try this | dynamic gridview column autocalculation I have a Gridview, with textboxes in templatefields, where i dynamically add columns to it. protected void grid() { DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("SerialNumber", typeof(string))); dt.Columns.Add(new DataColumn("Material", typeof(string))); dt.Colu... | TITLE:
dynamic gridview column autocalculation
QUESTION:
I have a Gridview, with textboxes in templatefields, where i dynamically add columns to it. protected void grid() { DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("SerialNumber", typeof(string))); dt.Columns.Add(new DataColumn("Material", typeof(... | [
"c#",
"asp.net",
"gridview"
] | 0 | 1 | 1,424 | 2 | 0 | 2011-05-31T09:48:07.053000 | 2011-05-31T09:56:23.983000 |
6,185,774 | 6,185,813 | embed PDF file in html using object tag | I m embeding a pdf document into my html code. For this i have wrote this code. It appears you don't have a PDF plugin for this browser. No biggie... you can click here to download the PDF file. But result is empty page on FF4 and IE9 embeds pdf file but its container is very small almost 30% of page. if I remove first... | I would try with an element. If not, maybe transforming it into flash and then embedding the flash. Also, try and see what it does, that's the standard doctype for HTML5 | embed PDF file in html using object tag I m embeding a pdf document into my html code. For this i have wrote this code. It appears you don't have a PDF plugin for this browser. No biggie... you can click here to download the PDF file. But result is empty page on FF4 and IE9 embeds pdf file but its container is very sma... | TITLE:
embed PDF file in html using object tag
QUESTION:
I m embeding a pdf document into my html code. For this i have wrote this code. It appears you don't have a PDF plugin for this browser. No biggie... you can click here to download the PDF file. But result is empty page on FF4 and IE9 embeds pdf file but its con... | [
"html",
"pdf",
"embed"
] | 11 | 5 | 91,153 | 4 | 0 | 2011-05-31T09:48:17.633000 | 2011-05-31T09:52:11.523000 |
6,185,775 | 6,191,179 | How can I automatically upload files to my live Server? | I am using WAMP for my Local Server in Windows 7. I want to upload my files from a particular folder to my Live Server automatically. Is there any freeware software or anything that will serve my purpose. Thanks in advance for helping me. | You can use WatchDirectory to scan your defined folder and upload only if the file is edited or new file is added to the folder. You can use this for 30 Days trial period. | How can I automatically upload files to my live Server? I am using WAMP for my Local Server in Windows 7. I want to upload my files from a particular folder to my Live Server automatically. Is there any freeware software or anything that will serve my purpose. Thanks in advance for helping me. | TITLE:
How can I automatically upload files to my live Server?
QUESTION:
I am using WAMP for my Local Server in Windows 7. I want to upload my files from a particular folder to my Live Server automatically. Is there any freeware software or anything that will serve my purpose. Thanks in advance for helping me.
ANSWER... | [
"windows-7",
"file-upload",
"upload",
"automation"
] | 0 | 0 | 164 | 1 | 0 | 2011-05-31T09:48:22.140000 | 2011-05-31T17:24:14.943000 |
6,185,777 | 6,186,757 | iPhone App :Can we change label backgroundcolor of more then one labels in a single or minimum steps | In my iPhone App there are almost 40 nib files (xibs) and in All of them there is a label as a footer is there any way to change the background color of all that label in a faster way instead of changing them in all xib one bty one? | Why you are using 40 labels for 40 nibs. You can add that label to main window and make your viewController a little bit smaller so that the label is visible everytime and thus you don't need to change color in 40 nib files. | iPhone App :Can we change label backgroundcolor of more then one labels in a single or minimum steps In my iPhone App there are almost 40 nib files (xibs) and in All of them there is a label as a footer is there any way to change the background color of all that label in a faster way instead of changing them in all xi... | TITLE:
iPhone App :Can we change label backgroundcolor of more then one labels in a single or minimum steps
QUESTION:
In my iPhone App there are almost 40 nib files (xibs) and in All of them there is a label as a footer is there any way to change the background color of all that label in a faster way instead of chang... | [
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
] | 0 | 3 | 222 | 3 | 0 | 2011-05-31T09:48:31.660000 | 2011-05-31T11:16:28.517000 |
6,185,778 | 6,189,735 | How do you get to the underlying data in an MVC3 WebGrid using jQuery? | I have a simple MVC WebGrid. When a user clicks on a row, I'd like to do something based on the row he clicked. Its pretty simple in jqGrid and even using jquery templates, but I'd like to get it right using the MVC WebGrid. I have the following: OrderList @{ var grid = new WebGrid(canPage: true, rowsPerPage: 20, canSo... | Unfortunately you will need to use jQuery in order to access each row's html data - there is no rich programming model against it that Im aware of (the beauty of MVC at times as well ha) The same scenario applies here: MVC WebGrid - How to programatically get the current page, sort column etc | How do you get to the underlying data in an MVC3 WebGrid using jQuery? I have a simple MVC WebGrid. When a user clicks on a row, I'd like to do something based on the row he clicked. Its pretty simple in jqGrid and even using jquery templates, but I'd like to get it right using the MVC WebGrid. I have the following: Or... | TITLE:
How do you get to the underlying data in an MVC3 WebGrid using jQuery?
QUESTION:
I have a simple MVC WebGrid. When a user clicks on a row, I'd like to do something based on the row he clicked. Its pretty simple in jqGrid and even using jquery templates, but I'd like to get it right using the MVC WebGrid. I have... | [
"asp.net-mvc",
"asp.net-mvc-3",
"select",
"webgrid"
] | 0 | 0 | 1,934 | 1 | 0 | 2011-05-31T09:48:39.473000 | 2011-05-31T15:13:48.560000 |
6,185,790 | 6,185,867 | Expand / Collapse jQuery | I'm working on an online shopping website. I have an expand / collapse jQuery setup. But ideally I would like it to be when the user clicks collapse, the full list of shopping cart items collapses to be invisible. At the moment, if the user has more than one item in their shopping cart, it only closes the 1 item. How d... | Try using: $(".toggle_container").slideToggle('2000'); At the moment your code just finds the first item and slides it up. You could also enclose all the items in a master div and animate that instead for the same effect:......... With the following JS: $(".order_items").slideToggle('2000'); | Expand / Collapse jQuery I'm working on an online shopping website. I have an expand / collapse jQuery setup. But ideally I would like it to be when the user clicks collapse, the full list of shopping cart items collapses to be invisible. At the moment, if the user has more than one item in their shopping cart, it only... | TITLE:
Expand / Collapse jQuery
QUESTION:
I'm working on an online shopping website. I have an expand / collapse jQuery setup. But ideally I would like it to be when the user clicks collapse, the full list of shopping cart items collapses to be invisible. At the moment, if the user has more than one item in their shop... | [
"jquery",
"css"
] | 0 | 2 | 2,064 | 3 | 0 | 2011-05-31T09:50:01.643000 | 2011-05-31T09:55:55.357000 |
6,185,791 | 6,188,339 | problems when make a web service as an alternative to dll | Q: Recently, i face some problems, i have a dll common among a lot of applications,and any change to this dll require to build it, copy and paste it in each bin folder of these applications,and add the new reference so i decided to convert this dll to a web service in stead to overcome this overload.. I make a web serv... | In my applications I usually have all related projects in the same solution. But when I need to use projects across applications I replace the project for a dll reference. Because I use Subversion I solve the problem of copying the dll by adding an external property do my libs folder, referencing the build of the dll. ... | problems when make a web service as an alternative to dll Q: Recently, i face some problems, i have a dll common among a lot of applications,and any change to this dll require to build it, copy and paste it in each bin folder of these applications,and add the new reference so i decided to convert this dll to a web serv... | TITLE:
problems when make a web service as an alternative to dll
QUESTION:
Q: Recently, i face some problems, i have a dll common among a lot of applications,and any change to this dll require to build it, copy and paste it in each bin folder of these applications,and add the new reference so i decided to convert this... | [
"asp.net",
"wcf",
"web-services",
"visual-studio-2008",
"dll"
] | 1 | 1 | 289 | 2 | 0 | 2011-05-31T09:50:10.103000 | 2011-05-31T13:30:19.277000 |
6,185,792 | 6,185,897 | posting array to MySQL | How can insert a array into my MySQL database? I have managed to insert some of this data into the database already. Below is part of my code: $depart=serialize($_POST['departure']); $sql="INSERT INTO bookings VALUES('$depart'); I am trying to insert [departure] => Array ( [0] => 30 [1] => 05 [2] => 2011 [3] => 17 [4] ... | Assuming 'depart' is a datetime field: $timestamp = mktime($depart[3], $depart[4], 0, $depart[2], $depart[1], $depart[0]);
$sql = "insert into bookings(depart) values (from_unixtime($timestamp))";
// Execute the sql as normal | posting array to MySQL How can insert a array into my MySQL database? I have managed to insert some of this data into the database already. Below is part of my code: $depart=serialize($_POST['departure']); $sql="INSERT INTO bookings VALUES('$depart'); I am trying to insert [departure] => Array ( [0] => 30 [1] => 05 [2]... | TITLE:
posting array to MySQL
QUESTION:
How can insert a array into my MySQL database? I have managed to insert some of this data into the database already. Below is part of my code: $depart=serialize($_POST['departure']); $sql="INSERT INTO bookings VALUES('$depart'); I am trying to insert [departure] => Array ( [0] =... | [
"php",
"mysql"
] | 0 | 1 | 183 | 2 | 0 | 2011-05-31T09:50:12.350000 | 2011-05-31T09:58:48.270000 |
6,185,794 | 6,185,874 | Adding a button to the ExpandableListView Group item | I am customizing an ExapndableListView,, I am trying to add a Button to the Group Item,, The problem is that if the button is focussable the group does't expand on click. I want the group to expand normally and the button to be clicked normally. Anybody knows how I could accomplish that? | Set the button not focusable. button. setFocusable(false) This should to the job. | Adding a button to the ExpandableListView Group item I am customizing an ExapndableListView,, I am trying to add a Button to the Group Item,, The problem is that if the button is focussable the group does't expand on click. I want the group to expand normally and the button to be clicked normally. Anybody knows how I c... | TITLE:
Adding a button to the ExpandableListView Group item
QUESTION:
I am customizing an ExapndableListView,, I am trying to add a Button to the Group Item,, The problem is that if the button is focussable the group does't expand on click. I want the group to expand normally and the button to be clicked normally. Any... | [
"android",
"expandablelistview",
"custom-view"
] | 4 | 12 | 4,253 | 1 | 0 | 2011-05-31T09:50:27.570000 | 2011-05-31T09:56:44.840000 |
6,185,800 | 6,185,836 | Using foreach for insert gridview data into sql database | I have a client side gridview data and I want to insert gridview data to sql database. at first I import data from excel to gridview and now I want to insert it into sql database. I use foreach loop to insert records one by one. but foreach loop just select first record and I can't increase row index. how can I do this... | It's taking first record only because there is break written in you foreach loop... following is code for you foreach (GridViewRow GVRow in GridView1.Rows) { Name = GVRow.Cells[1].Text; CarType = GVRow.Cells[2].Text; TechnicalNo = GVRow.Cells[3].Text; ProductionDate = GVRow.Cells[4].Text; EngaineType = GVRow.Cells[5].T... | Using foreach for insert gridview data into sql database I have a client side gridview data and I want to insert gridview data to sql database. at first I import data from excel to gridview and now I want to insert it into sql database. I use foreach loop to insert records one by one. but foreach loop just select first... | TITLE:
Using foreach for insert gridview data into sql database
QUESTION:
I have a client side gridview data and I want to insert gridview data to sql database. at first I import data from excel to gridview and now I want to insert it into sql database. I use foreach loop to insert records one by one. but foreach loop... | [
"c#",
"asp.net",
"gridview"
] | 1 | 3 | 24,658 | 5 | 0 | 2011-05-31T09:50:51.470000 | 2011-05-31T09:53:53.670000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.