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,204,885 | 6,205,038 | Get checkbox status using javascript | This is my checkbox HTML code class="checkbox"> this is javascript code var terms = $("#termsCheckbox");
function validateTerms(){ if(termsCheckbox.checked == false){ terms_div.addClass("terms_error"); return false; } else{ terms_div.removeClass("terms_error"); return true; } } I want to check whether checkbox checked... | You need to access the className variable (pure JS) the following assumes your div has an ID of terms_div, that terms_error is the only class you might want on the div, and that you setup your checkbox with onClick="validateTerms();" function validateTerms(){ var c=document.getElementById('termsCheckbox'); var d=docume... | Get checkbox status using javascript This is my checkbox HTML code class="checkbox"> this is javascript code var terms = $("#termsCheckbox");
function validateTerms(){ if(termsCheckbox.checked == false){ terms_div.addClass("terms_error"); return false; } else{ terms_div.removeClass("terms_error"); return true; } } I w... | TITLE:
Get checkbox status using javascript
QUESTION:
This is my checkbox HTML code class="checkbox"> this is javascript code var terms = $("#termsCheckbox");
function validateTerms(){ if(termsCheckbox.checked == false){ terms_div.addClass("terms_error"); return false; } else{ terms_div.removeClass("terms_error"); re... | [
"javascript",
"checkbox",
"using",
"status"
] | 15 | 20 | 94,237 | 5 | 0 | 2011-06-01T16:57:05.553000 | 2011-06-01T17:07:37.690000 |
6,204,896 | 6,205,403 | respond_with & Flash Notice | I have the following in one of my controllers: def create
photo.user = current_user if current_user flash[:notice] = "The photos was saved" if photo.save respond_with photo,:location => photo_path(photo)
end This code works with one exception. If I access this action w/ some kind of AJAX, and then visit another page,... | You can put condition like: flash[:notice] = "The photos was saved" if photo.save &&!request.xhr? Also, if some day you will decide use generated notice when responding to AJAX request, you can use flash.discard to clear flash. | respond_with & Flash Notice I have the following in one of my controllers: def create
photo.user = current_user if current_user flash[:notice] = "The photos was saved" if photo.save respond_with photo,:location => photo_path(photo)
end This code works with one exception. If I access this action w/ some kind of AJAX, ... | TITLE:
respond_with & Flash Notice
QUESTION:
I have the following in one of my controllers: def create
photo.user = current_user if current_user flash[:notice] = "The photos was saved" if photo.save respond_with photo,:location => photo_path(photo)
end This code works with one exception. If I access this action w/ s... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 7 | 9 | 4,788 | 2 | 0 | 2011-06-01T16:58:01.327000 | 2011-06-01T17:38:52.440000 |
6,204,898 | 6,205,325 | plotting on the y-axis in Mathematica | I have another question about Wolfram Mathematica. Is there someone that knows how I can plot a graphic on the y axis? I hope that the figure helps. | One possibility is to use a ParametricPlot like this: ParametricPlot[ {-y*Exp[-y^2], y}, {y, -0.3, 4}, PlotRange -> {{-2, 2}, All}, AxesLabel -> {"x", "y"}, AspectRatio -> 1/4 ] | plotting on the y-axis in Mathematica I have another question about Wolfram Mathematica. Is there someone that knows how I can plot a graphic on the y axis? I hope that the figure helps. | TITLE:
plotting on the y-axis in Mathematica
QUESTION:
I have another question about Wolfram Mathematica. Is there someone that knows how I can plot a graphic on the y axis? I hope that the figure helps.
ANSWER:
One possibility is to use a ParametricPlot like this: ParametricPlot[ {-y*Exp[-y^2], y}, {y, -0.3, 4}, Plo... | [
"function",
"wolfram-mathematica",
"plot"
] | 9 | 8 | 13,197 | 5 | 0 | 2011-06-01T16:58:06.910000 | 2011-06-01T17:32:17.630000 |
6,204,917 | 6,204,963 | Invalid Qualifier error in Visual Basic 6.0 | In a Visual Basic 6.0 program, I have a string sTemp that I want to ensure does not contain a quotation mark. I have the line: If sTemp.Contains("""") Then But when I type the period after sTemp, I don't get anything from intellisense, and when I try to compile I get the following error: Compile error: Invalid qualifie... | VB6 strings are not objects, so there are no methods on the string variable that you can call. To test does the string contain quotes you need to use the InStr function i.e. if InStr(sTemp, """") > 0 then ' string contains at least one double quote Hope this helps UPDATE This has nothing to do with the original questio... | Invalid Qualifier error in Visual Basic 6.0 In a Visual Basic 6.0 program, I have a string sTemp that I want to ensure does not contain a quotation mark. I have the line: If sTemp.Contains("""") Then But when I type the period after sTemp, I don't get anything from intellisense, and when I try to compile I get the foll... | TITLE:
Invalid Qualifier error in Visual Basic 6.0
QUESTION:
In a Visual Basic 6.0 program, I have a string sTemp that I want to ensure does not contain a quotation mark. I have the line: If sTemp.Contains("""") Then But when I type the period after sTemp, I don't get anything from intellisense, and when I try to comp... | [
"string",
"vb6"
] | 6 | 9 | 20,068 | 2 | 0 | 2011-06-01T16:59:15.930000 | 2011-06-01T17:02:46.977000 |
6,204,941 | 6,205,058 | builder pattern alternative | I was reading about the benefits of the builder pattern here: http://drdobbs.com/java/208403883?pgno=2 I was wondering about the viability of the following, which seems simpler. public class NutritionFactParams { private int servingSize; private int servings; private int fat_ = 0; private int sodium_ = 0; NutritionFact... | The difference is not big, but there is one important differences i can think of: If you use builder, the client code does not need to know what Impl you actually return on build() meaning that, you have flexibility to return different Impls depending on the configuration (builder). On the other hand, using constructor... | builder pattern alternative I was reading about the benefits of the builder pattern here: http://drdobbs.com/java/208403883?pgno=2 I was wondering about the viability of the following, which seems simpler. public class NutritionFactParams { private int servingSize; private int servings; private int fat_ = 0; private in... | TITLE:
builder pattern alternative
QUESTION:
I was reading about the benefits of the builder pattern here: http://drdobbs.com/java/208403883?pgno=2 I was wondering about the viability of the following, which seems simpler. public class NutritionFactParams { private int servingSize; private int servings; private int fa... | [
"design-patterns"
] | 4 | 3 | 6,390 | 2 | 0 | 2011-06-01T17:00:52.790000 | 2011-06-01T17:09:04.620000 |
6,204,943 | 6,218,252 | Generic - Typed CompositeDataBound Control | I have a compositeDatabound control: MyGrid with MyItemTemplate with container of MyContainer. I have a class User. public class MyGrid: CompositeDataBoundControl { [TemplateContainer(typeof(MyGrid.MyContainer))] public ITemplate MyItemTemplate { //get;set; } public class MyContainer: Control, INamingContainer { //retu... | I changed the class MyGrid to an abstract MyGrid class and made the ITemplate property abstract as well. Then in my concrete derived class MyUserGrid:MyGrid I implemented the ITemplate property with TemplateContainer attribute like: [TemplateContainer(typeof(MyUserGrid.MyContainer))] It isn't that neat but still good e... | Generic - Typed CompositeDataBound Control I have a compositeDatabound control: MyGrid with MyItemTemplate with container of MyContainer. I have a class User. public class MyGrid: CompositeDataBoundControl { [TemplateContainer(typeof(MyGrid.MyContainer))] public ITemplate MyItemTemplate { //get;set; } public class MyCo... | TITLE:
Generic - Typed CompositeDataBound Control
QUESTION:
I have a compositeDatabound control: MyGrid with MyItemTemplate with container of MyContainer. I have a class User. public class MyGrid: CompositeDataBoundControl { [TemplateContainer(typeof(MyGrid.MyContainer))] public ITemplate MyItemTemplate { //get;set; }... | [
"c#",
"asp.net",
"custom-server-controls",
"databound-controls"
] | 1 | 0 | 140 | 1 | 0 | 2011-06-01T17:01:01.110000 | 2011-06-02T17:51:53.203000 |
6,204,944 | 6,205,356 | ToolStripMenuItem bigger vertical padding, or vertically centering text in a bigger ToolStripMenuItem | I'm trying to set a bigger vertical padding for ToolStripMenuItems in a ContextMenuStrip. However, changing the Padding.Top property adds padding to the bottom, instead of the top. I also tried setting a larger Height for the ToolStripMenuItem, it works, however, the text always gets aligned on top, even if the TextAli... | You can get the same effect using Margin instead of Padding which will keep the Text of the ToolStripMenuItem aligned. The drawback is that this wont modify the size of the highlight rectangle when the item is selected so it can look a little strange if you increase a lot the height. | ToolStripMenuItem bigger vertical padding, or vertically centering text in a bigger ToolStripMenuItem I'm trying to set a bigger vertical padding for ToolStripMenuItems in a ContextMenuStrip. However, changing the Padding.Top property adds padding to the bottom, instead of the top. I also tried setting a larger Height ... | TITLE:
ToolStripMenuItem bigger vertical padding, or vertically centering text in a bigger ToolStripMenuItem
QUESTION:
I'm trying to set a bigger vertical padding for ToolStripMenuItems in a ContextMenuStrip. However, changing the Padding.Top property adds padding to the bottom, instead of the top. I also tried settin... | [
"c#",
"winforms",
"menu",
"padding",
"toolstripmenu"
] | 7 | 2 | 3,009 | 3 | 0 | 2011-06-01T17:01:04.260000 | 2011-06-01T17:34:51.187000 |
6,204,950 | 6,205,030 | SMTP Exception 5.7.1 | I am using ASP.NET Web forms and sending an automated email through our SMTP Emailing system. In my web.config I added this: Now I am writing this code to send an email: MailMessage message = new MailMessage(); message.From = new MailAddress("username@domain.com"); message.To.Add(new MailAddress("username1@domain.com")... | Perhaps there is authentication on the SMTP server? Try using client.Credentials = new System.Net.NetworkCredential(username, password); | SMTP Exception 5.7.1 I am using ASP.NET Web forms and sending an automated email through our SMTP Emailing system. In my web.config I added this: Now I am writing this code to send an email: MailMessage message = new MailMessage(); message.From = new MailAddress("username@domain.com"); message.To.Add(new MailAddress("u... | TITLE:
SMTP Exception 5.7.1
QUESTION:
I am using ASP.NET Web forms and sending an automated email through our SMTP Emailing system. In my web.config I added this: Now I am writing this code to send an email: MailMessage message = new MailMessage(); message.From = new MailAddress("username@domain.com"); message.To.Add(... | [
"c#",
"asp.net",
"smtp",
"smtpclient"
] | 1 | 2 | 5,310 | 3 | 0 | 2011-06-01T17:01:29.827000 | 2011-06-01T17:06:59.620000 |
6,204,967 | 6,205,602 | How to Spoof ip in java | How to change tcp information in layer 3 in java?(ip spoofing) how to change layer 2 information? is there any good library for it in java? it need raw socket? | JpCap may be what you want http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/ | How to Spoof ip in java How to change tcp information in layer 3 in java?(ip spoofing) how to change layer 2 information? is there any good library for it in java? it need raw socket? | TITLE:
How to Spoof ip in java
QUESTION:
How to change tcp information in layer 3 in java?(ip spoofing) how to change layer 2 information? is there any good library for it in java? it need raw socket?
ANSWER:
JpCap may be what you want http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/ | [
"java",
"ip",
"spoofing"
] | 5 | 5 | 8,570 | 2 | 0 | 2011-06-01T17:02:58.533000 | 2011-06-01T17:57:09.200000 |
6,204,969 | 6,210,360 | Conditionally set viewport for iPhone4? | I was hoping to just use, and then call different style sheets based on the width. The only problem is that the iPhone4 reports a width of 320px even tho its 640px. How would I conditionally set the content width to 640px for iPhone4s? | I would look into Media Queries to achieve what you are asking. Here are some really good articles related to building responsive, fluid, multi-device websites: Smashing Magazine's 'How to use Media Queries': http://www.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-web... | Conditionally set viewport for iPhone4? I was hoping to just use, and then call different style sheets based on the width. The only problem is that the iPhone4 reports a width of 320px even tho its 640px. How would I conditionally set the content width to 640px for iPhone4s? | TITLE:
Conditionally set viewport for iPhone4?
QUESTION:
I was hoping to just use, and then call different style sheets based on the width. The only problem is that the iPhone4 reports a width of 320px even tho its 640px. How would I conditionally set the content width to 640px for iPhone4s?
ANSWER:
I would look into... | [
"javascript",
"jquery",
"iphone",
"html",
"css"
] | 0 | 1 | 792 | 1 | 0 | 2011-06-01T17:03:00.217000 | 2011-06-02T04:27:03.420000 |
6,204,972 | 6,205,043 | Override dialog onBackPressed()? | How would I override a Dialog 's onBackPressed to close the dialog as well as calling finish() on the Activity it is located in? | You can use setOnCancelListener: dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { MyActivity.this.finish(); } }); You need to finish only your activity. Dialog will be dismissed automatically. | Override dialog onBackPressed()? How would I override a Dialog 's onBackPressed to close the dialog as well as calling finish() on the Activity it is located in? | TITLE:
Override dialog onBackPressed()?
QUESTION:
How would I override a Dialog 's onBackPressed to close the dialog as well as calling finish() on the Activity it is located in?
ANSWER:
You can use setOnCancelListener: dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel... | [
"android",
"dialog"
] | 32 | 66 | 31,484 | 5 | 0 | 2011-06-01T17:03:13.413000 | 2011-06-01T17:08:21.777000 |
6,204,974 | 6,205,578 | Convert parent/child php array to html table | I have the following PHP array. Array ( [168] => Array ( [link] => asdfasdf [children] => Array ( [239] => Array ( [link] => tascatestlalal [children] => Array ( ) ) [240] => Array ( [link] => otrotestttt [children] => Array ( ) ) ) ) [229] => Array ( [link] => Sub-task ex [children] => Array ( ) )
[230] => Array ( [l... | function nestedArrayToFlatList($node, $indent) { $str = '';
if (isset($node['link'])) { $str.= ' '. $indent. $node['link']. ' '; }
if (isset($node['children']) && count($node['children']) > 0) { foreach ($node['children'] as $child) { $str.= nestedArrayToFlatList($child, '--'. $indent); } }
return $str; }
$myList =... | Convert parent/child php array to html table I have the following PHP array. Array ( [168] => Array ( [link] => asdfasdf [children] => Array ( [239] => Array ( [link] => tascatestlalal [children] => Array ( ) ) [240] => Array ( [link] => otrotestttt [children] => Array ( ) ) ) ) [229] => Array ( [link] => Sub-task ex [... | TITLE:
Convert parent/child php array to html table
QUESTION:
I have the following PHP array. Array ( [168] => Array ( [link] => asdfasdf [children] => Array ( [239] => Array ( [link] => tascatestlalal [children] => Array ( ) ) [240] => Array ( [link] => otrotestttt [children] => Array ( ) ) ) ) [229] => Array ( [link... | [
"php",
"html"
] | 0 | 1 | 730 | 1 | 0 | 2011-06-01T17:03:20.497000 | 2011-06-01T17:55:33.913000 |
6,204,978 | 6,207,133 | Enterprise Library 4.1 logging timestamp how to display millisecond | The following is in config file. which displays 31/05/2011 11:43:24 Information... But there is no millisecond displayed which would be useful for perf instrumentation, anyone knows how to display? Thanks. | You can specify Standard or Custom DateTime Format strings to the timestamp template token: This would output something like: 06/01/2011 20:12:43.3405776 Information General This is the message By default the DateTime will be in UTC time. If you wish to use local time then prefix the format string with "local:". e.g. {... | Enterprise Library 4.1 logging timestamp how to display millisecond The following is in config file. which displays 31/05/2011 11:43:24 Information... But there is no millisecond displayed which would be useful for perf instrumentation, anyone knows how to display? Thanks. | TITLE:
Enterprise Library 4.1 logging timestamp how to display millisecond
QUESTION:
The following is in config file. which displays 31/05/2011 11:43:24 Information... But there is no millisecond displayed which would be useful for perf instrumentation, anyone knows how to display? Thanks.
ANSWER:
You can specify Sta... | [
"logging",
"enterprise-library",
"app-config"
] | 10 | 19 | 9,513 | 2 | 0 | 2011-06-01T17:03:40.827000 | 2011-06-01T20:19:01.057000 |
6,204,983 | 6,205,863 | How do I view the Load Test Analyzer in VS2008? | I'm running my first load test, but I can't see the Load Test Analyzer. Been through the toolbars, view menu, etc.. I find plenty of documentation of what it is and what it does, but nothing on how to view the darned thing! Any help would be greatly appreciated! Thanks, Jason | Nevermind. Apparently after the first test is completed the analyzer/monitor pops up all by itself. Just wouldn't do it on the first run. Weird. | How do I view the Load Test Analyzer in VS2008? I'm running my first load test, but I can't see the Load Test Analyzer. Been through the toolbars, view menu, etc.. I find plenty of documentation of what it is and what it does, but nothing on how to view the darned thing! Any help would be greatly appreciated! Thanks, J... | TITLE:
How do I view the Load Test Analyzer in VS2008?
QUESTION:
I'm running my first load test, but I can't see the Load Test Analyzer. Been through the toolbars, view menu, etc.. I find plenty of documentation of what it is and what it does, but nothing on how to view the darned thing! Any help would be greatly appr... | [
"visual-studio-2008",
"testing",
"load",
"analyzer"
] | 0 | 0 | 164 | 1 | 0 | 2011-06-01T17:03:55.087000 | 2011-06-01T18:20:49.633000 |
6,204,998 | 6,205,186 | Pair together two arrays in PHP after posting from two fields in a form | I have two fields in a form (ip:port) seperately. I want to add them together to make one string eg 127.0.0.1:11111 to enter into a database. At the moment I have this form. IP:: Which submits to this for parsing. $ip = array(); foreach ($_POST['ip'] as &$value) { if ($value!= "") { if (preg_match("/[0-9]{1,3}\.[0-9]{1... | $x = 0 $ip_port = array(); foreach ($_POST['ip'] as &$value) { if ($value!= "") { if (preg_match("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]{1,5}/", $value)) { $ip_port[$x++]['ip'] = addslashes(htmlentities($value)); } else { $error = 'Invalid IP Address. Please go back and try again.'; } } }
$x = 0 foreac... | Pair together two arrays in PHP after posting from two fields in a form I have two fields in a form (ip:port) seperately. I want to add them together to make one string eg 127.0.0.1:11111 to enter into a database. At the moment I have this form. IP:: Which submits to this for parsing. $ip = array(); foreach ($_POST['ip... | TITLE:
Pair together two arrays in PHP after posting from two fields in a form
QUESTION:
I have two fields in a form (ip:port) seperately. I want to add them together to make one string eg 127.0.0.1:11111 to enter into a database. At the moment I have this form. IP:: Which submits to this for parsing. $ip = array(); f... | [
"php",
"html",
"arrays",
"append",
"field"
] | 1 | 0 | 304 | 3 | 0 | 2011-06-01T17:05:06.143000 | 2011-06-01T17:21:09.997000 |
6,204,999 | 6,205,110 | Saving JPG image from Documents to Photo Album - Sample Code | I have generated JPG image, saved to Documents folder, that not comes with bundle. Please help with the building class for saving it to Gallery. Finnaly with help of kviksilver To make complete solution: // tools.h #import #import @interface tools: NSObject {
}
@end // tools.m #import "tools.m"
@implementation tools... | try getting imagePath like this: NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory=[paths objectAtIndex:0]; NSString *imagePath=[documentsDirectory stringByAppendingPathComponent:@"Image.jpg"]; then setting image: UIImage *image=[UIImage imageWi... | Saving JPG image from Documents to Photo Album - Sample Code I have generated JPG image, saved to Documents folder, that not comes with bundle. Please help with the building class for saving it to Gallery. Finnaly with help of kviksilver To make complete solution: // tools.h #import #import @interface tools: NSObject {... | TITLE:
Saving JPG image from Documents to Photo Album - Sample Code
QUESTION:
I have generated JPG image, saved to Documents folder, that not comes with bundle. Please help with the building class for saving it to Gallery. Finnaly with help of kviksilver To make complete solution: // tools.h #import #import @interface... | [
"iphone",
"xcode",
"ios",
"photo-gallery"
] | 0 | 0 | 1,360 | 2 | 0 | 2011-06-01T17:05:13.473000 | 2011-06-01T17:14:02.870000 |
6,205,006 | 6,205,313 | Bing Static Map Image type | May I know how to determine the output of Bing map static image? Previously it used to be in png but now it is in jpeg. May I know how to revert back to png format? Example: Display the image with the link below: http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/space%20needle,seattle?mapLayer=TrafficFlow&mapVersion... | I don't think you can request the image in a different format. From http://msdn.microsoft.com/en-us/library/ff701724.aspx: This URL returns an image in one of the following formats: PNG (image/png) JPEG (image/jpeg) GIF (image/gif) You cannot specify the output format for the map image. The image type is chosen based o... | Bing Static Map Image type May I know how to determine the output of Bing map static image? Previously it used to be in png but now it is in jpeg. May I know how to revert back to png format? Example: Display the image with the link below: http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/space%20needle,seattle?mapL... | TITLE:
Bing Static Map Image type
QUESTION:
May I know how to determine the output of Bing map static image? Previously it used to be in png but now it is in jpeg. May I know how to revert back to png format? Example: Display the image with the link below: http://dev.virtualearth.net/REST/V1/Imagery/Map/Road/space%20n... | [
"static",
"dictionary",
"bing-maps"
] | 0 | 0 | 3,124 | 2 | 0 | 2011-06-01T17:05:33.710000 | 2011-06-01T17:31:16.627000 |
6,205,007 | 6,205,051 | oracle if 0, like if null (nvl) | oracle has a nice built in function for doing if null, however I want to do if = 0; is there a simple way to do this? nvl(instr(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5),' '), length(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5)))) This is going as a parameter to a substr function. If instr(... | I think you'll need to use CASE e.g. WHEN instr(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5),' ')!= 0 THEN length(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5)) ELSE Some Default END as foo | oracle if 0, like if null (nvl) oracle has a nice built in function for doing if null, however I want to do if = 0; is there a simple way to do this? nvl(instr(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5),' '), length(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5)))) This is going as a parameter... | TITLE:
oracle if 0, like if null (nvl)
QUESTION:
oracle has a nice built in function for doing if null, however I want to do if = 0; is there a simple way to do this? nvl(instr(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5),' '), length(substr(ovrflo_adrs_info,instr(ovrflo_adrs_info,'bldg')+5)))) This is go... | [
"oracle"
] | 8 | 5 | 39,711 | 4 | 0 | 2011-06-01T17:05:38.500000 | 2011-06-01T17:08:50.033000 |
6,205,010 | 6,205,389 | TThemeServices::DrawText unresolved link error | I'm creating a custom component (derived from TCustomCategoryPanelGroup) and performing some custom draw operations. I want to handle when Themes are enabled and draw text appropriately. Here is a snippet of some code I have in a draw function: int theBaseDrawFlags = DT_EXPANDTABS | DT_SINGLELINE | DT_VCENTER | DT_LEFT... | I guess you have #include d some header (windows.h?) that contains something like this #ifdef UNICODE #define DrawText DrawTextW #else #define DrawText DrawTextA #endif You can probably put an #undef DrawText in your file to work around this. (See also Conflict with DrawText function.) | TThemeServices::DrawText unresolved link error I'm creating a custom component (derived from TCustomCategoryPanelGroup) and performing some custom draw operations. I want to handle when Themes are enabled and draw text appropriately. Here is a snippet of some code I have in a draw function: int theBaseDrawFlags = DT_EX... | TITLE:
TThemeServices::DrawText unresolved link error
QUESTION:
I'm creating a custom component (derived from TCustomCategoryPanelGroup) and performing some custom draw operations. I want to handle when Themes are enabled and draw text appropriately. Here is a snippet of some code I have in a draw function: int theBas... | [
"c++builder",
"vcl"
] | 1 | 2 | 656 | 1 | 0 | 2011-06-01T17:05:57.690000 | 2011-06-01T17:37:32.600000 |
6,205,013 | 6,205,172 | mockito stubbing returns null | I am using mockito as mocking framework. I have a scenerio here, my when(abc.method()).thenReturn(value) does not return value, instead it returns null. Here is how my class and test looks like. public class foo(){ public boolean method(String userName) throws Exception { ClassA request = new ClassA(); request.setAbc(u... | the argument matcher for stub.callingmethod(request).thenReturn(response) is comparing for reference equality. You want a more loose matcher, like this I think: stub.callingmethod(isA(ClassA.class)).thenReturn(response); | mockito stubbing returns null I am using mockito as mocking framework. I have a scenerio here, my when(abc.method()).thenReturn(value) does not return value, instead it returns null. Here is how my class and test looks like. public class foo(){ public boolean method(String userName) throws Exception { ClassA request = ... | TITLE:
mockito stubbing returns null
QUESTION:
I am using mockito as mocking framework. I have a scenerio here, my when(abc.method()).thenReturn(value) does not return value, instead it returns null. Here is how my class and test looks like. public class foo(){ public boolean method(String userName) throws Exception {... | [
"java",
"junit",
"junit4",
"mockito"
] | 4 | 8 | 13,197 | 2 | 0 | 2011-06-01T17:06:03.260000 | 2011-06-01T17:19:22.953000 |
6,205,015 | 6,208,568 | Core Plot - Histogram | How could I realize a Histogram with corePlot. Actually I am trying that by using a Bar Chart. Is in the Bar-Chart any option to group my values. For example: so i can print just 3 bars. So that the values should group like this: X 0...5: Barline 1 6...10:Barline 2 11...15:Barline 3 Is in CorePlot-Bar any property to d... | No, you'll have to pre-process your data and do the grouping yourself before passing the data to Core Plot. | Core Plot - Histogram How could I realize a Histogram with corePlot. Actually I am trying that by using a Bar Chart. Is in the Bar-Chart any option to group my values. For example: so i can print just 3 bars. So that the values should group like this: X 0...5: Barline 1 6...10:Barline 2 11...15:Barline 3 Is in CorePlot... | TITLE:
Core Plot - Histogram
QUESTION:
How could I realize a Histogram with corePlot. Actually I am trying that by using a Bar Chart. Is in the Bar-Chart any option to group my values. For example: so i can print just 3 bars. So that the values should group like this: X 0...5: Barline 1 6...10:Barline 2 11...15:Barlin... | [
"iphone",
"ios",
"core-plot"
] | 1 | 1 | 638 | 1 | 0 | 2011-06-01T17:06:06.343000 | 2011-06-01T22:40:03.150000 |
6,205,016 | 6,205,215 | Cancellable NSOperation with NSURLConnection | I'm writing an NSOperation to make a web service request via a NSURLConnection. I would like to make the NSOperation able to be cancelled, so that a long-running HTTP request can be interrupted if necessary. If I make the HTTP request synchronously, it will block the thread and I can't check isCancelled to terminate ea... | I would suggest using ASIHTTPRequest for this type of problem. ASIHTTPRequest objects are NSOperation subclasses, and support cancelling, custom timeout periods, and blocks. | Cancellable NSOperation with NSURLConnection I'm writing an NSOperation to make a web service request via a NSURLConnection. I would like to make the NSOperation able to be cancelled, so that a long-running HTTP request can be interrupted if necessary. If I make the HTTP request synchronously, it will block the thread ... | TITLE:
Cancellable NSOperation with NSURLConnection
QUESTION:
I'm writing an NSOperation to make a web service request via a NSURLConnection. I would like to make the NSOperation able to be cancelled, so that a long-running HTTP request can be interrupted if necessary. If I make the HTTP request synchronously, it will... | [
"objective-c",
"ios",
"nsurlconnection",
"httprequest",
"nsoperation"
] | 2 | 4 | 602 | 1 | 0 | 2011-06-01T17:06:09.860000 | 2011-06-01T17:23:10.653000 |
6,205,017 | 6,205,047 | Parse a string of CSS declarations and convert it to an array | I have a ugly block of css declarations. ol{margin:0;padding:0}p{margin:0}.c5{width:468.0pt;background-color:#ffffff;padding:72.0pt 72.0pt 72.0pt 72.0pt}.c4{font-size:24pt;font-weight:bold}.c3{margin:0;padding:0}.c0{direction:ltr}.c1{height:11pt}.c2{font-style:italic}body{color:#000000;font-size:11pt;font-family:Arial}... | var css='ol{margin:0;padding:0}p{margin:0}.c5{width:468.0pt;background-color:#ffffff;padding:72.0pt 72.0pt 72.0pt 72.0pt}.c4{font-size:24pt;font-weight:bold}.c3{margin:0;padding:0}.c0{direction:ltr}.c1{height:11pt}.c2{font-style:italic}body{color:#000000;font-size:11pt;font-family:Arial}h1{padding-top:24.0pt;color:#000... | Parse a string of CSS declarations and convert it to an array I have a ugly block of css declarations. ol{margin:0;padding:0}p{margin:0}.c5{width:468.0pt;background-color:#ffffff;padding:72.0pt 72.0pt 72.0pt 72.0pt}.c4{font-size:24pt;font-weight:bold}.c3{margin:0;padding:0}.c0{direction:ltr}.c1{height:11pt}.c2{font-sty... | TITLE:
Parse a string of CSS declarations and convert it to an array
QUESTION:
I have a ugly block of css declarations. ol{margin:0;padding:0}p{margin:0}.c5{width:468.0pt;background-color:#ffffff;padding:72.0pt 72.0pt 72.0pt 72.0pt}.c4{font-size:24pt;font-weight:bold}.c3{margin:0;padding:0}.c0{direction:ltr}.c1{height... | [
"javascript",
"jquery"
] | 0 | 2 | 643 | 3 | 0 | 2011-06-01T17:06:10.123000 | 2011-06-01T17:08:36.083000 |
6,205,020 | 6,205,237 | NumPy types with underscore: `int_`, `float_`, etc | What is the significance of the underscore suffixing in int_, float_, etc.? | From page 21 of Guide to Numpy by TE Oliphant: Names for the data types that would clash with standard Python object names are followed by a trailing underscore, ’ ’. These data types are so named because they use the same underlying precision as the corresponding Python data types.... The array types bool_, int_, comp... | NumPy types with underscore: `int_`, `float_`, etc What is the significance of the underscore suffixing in int_, float_, etc.? | TITLE:
NumPy types with underscore: `int_`, `float_`, etc
QUESTION:
What is the significance of the underscore suffixing in int_, float_, etc.?
ANSWER:
From page 21 of Guide to Numpy by TE Oliphant: Names for the data types that would clash with standard Python object names are followed by a trailing underscore, ’ ’.... | [
"python",
"numpy",
"naming-conventions"
] | 28 | 26 | 11,966 | 2 | 0 | 2011-06-01T17:06:11.447000 | 2011-06-01T17:24:33.950000 |
6,205,029 | 6,209,126 | Comparing boxed value types | Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through a general setter. These properties can be value types or reference types. public void SetValue( TEnum property, object value ) { if ( _properties[ property ]!= value ) { // Only come here when the new value is differen... | If you need different behaviour when you're dealing with a value-type then you're obviously going to need to perform some kind of test. You don't need an explicit check for boxed value-types, since all value-types will be boxed** due to the parameter being typed as object. This code should meet your stated criteria: If... | Comparing boxed value types Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through a general setter. These properties can be value types or reference types. public void SetValue( TEnum property, object value ) { if ( _properties[ property ]!= value ) { // Only come here wh... | TITLE:
Comparing boxed value types
QUESTION:
Today I stumbled upon an interesting bug I wrote. I have a set of properties which can be set through a general setter. These properties can be value types or reference types. public void SetValue( TEnum property, object value ) { if ( _properties[ property ]!= value ) { //... | [
"c#",
"equality",
"boxing",
"unboxing"
] | 47 | 30 | 11,837 | 5 | 0 | 2011-06-01T17:06:59.357000 | 2011-06-02T00:10:09.370000 |
6,205,037 | 6,205,108 | Rectangular Java Swing Radio buttons? | I'd like to create a set of buttons in a Java Swing application like you get in a typical tool palette in a paint program. That is, a set of small square buttons, each containing an icon, only one of which is pressed down, and when you press another button, the first is deselected. I've thought of a number of solutions... | What about a plain JToggleButton in a ButtonGroup? It is not abstract, you can instantiate one with an Icon, and it stays depressed while selected. | Rectangular Java Swing Radio buttons? I'd like to create a set of buttons in a Java Swing application like you get in a typical tool palette in a paint program. That is, a set of small square buttons, each containing an icon, only one of which is pressed down, and when you press another button, the first is deselected.... | TITLE:
Rectangular Java Swing Radio buttons?
QUESTION:
I'd like to create a set of buttons in a Java Swing application like you get in a typical tool palette in a paint program. That is, a set of small square buttons, each containing an icon, only one of which is pressed down, and when you press another button, the fi... | [
"java",
"swing",
"jbutton",
"jradiobutton",
"jtogglebutton"
] | 5 | 9 | 2,121 | 2 | 0 | 2011-06-01T17:07:36.520000 | 2011-06-01T17:13:58.497000 |
6,205,044 | 6,205,116 | Server is resolving to some strange DNS | This is not a C# question. This has to do more with our servers. Basically we've been noticing that another DNS address is resolving to our server's address, example. Our DNS: www.bob.com The other mysterious DNS that resolves to our IP: thing.blah8.com This is actually a rather serious issue because some how this rand... | You can try contacting their technical domain contact (get it through a WHOIS request) and let them know their DNS is wrong. There's nothing you could forcefully do to stop them, outside of catching this hostname request with your web server and serving those visitors a different page. Some might say traffic is traffic... | Server is resolving to some strange DNS This is not a C# question. This has to do more with our servers. Basically we've been noticing that another DNS address is resolving to our server's address, example. Our DNS: www.bob.com The other mysterious DNS that resolves to our IP: thing.blah8.com This is actually a rather ... | TITLE:
Server is resolving to some strange DNS
QUESTION:
This is not a C# question. This has to do more with our servers. Basically we've been noticing that another DNS address is resolving to our server's address, example. Our DNS: www.bob.com The other mysterious DNS that resolves to our IP: thing.blah8.com This is ... | [
"dns"
] | 0 | 0 | 219 | 1 | 0 | 2011-06-01T17:08:22.167000 | 2011-06-01T17:14:20.007000 |
6,205,049 | 6,205,251 | Android devices with Environment.getExternalStorageDirectory() != /mnt/sdcard/? | Of course in my code I use Environment.getExternalStorageDirectory() instead of hardwiring /mnt/sdcard/. But I just realized that when I export data from my application via a database dump in an exchange format, file paths are /mnt/sdcard/... This may explain some strange errors that I have seen in the logs from users.... | No. I haven't seen any devices with sdcard mounted to different location. And I've played with more then 10 different devices from most popular vendors. Having said that, you shouldn't rely on this fact. Especially if you have such an easy way to get path to External storage. | Android devices with Environment.getExternalStorageDirectory() != /mnt/sdcard/? Of course in my code I use Environment.getExternalStorageDirectory() instead of hardwiring /mnt/sdcard/. But I just realized that when I export data from my application via a database dump in an exchange format, file paths are /mnt/sdcard/.... | TITLE:
Android devices with Environment.getExternalStorageDirectory() != /mnt/sdcard/?
QUESTION:
Of course in my code I use Environment.getExternalStorageDirectory() instead of hardwiring /mnt/sdcard/. But I just realized that when I export data from my application via a database dump in an exchange format, file paths... | [
"android",
"sd-card"
] | 9 | 2 | 9,541 | 3 | 0 | 2011-06-01T17:08:39.687000 | 2011-06-01T17:26:12.633000 |
6,205,053 | 6,205,094 | Android - Multiple items in a statelist? | I currently have a keypad in my application 0 - 9, I require an on and off state for each button. To do this I've used a StateList as follows: However this is only for one button, each button has a different on and off graphic, dialpad_2_off, dialpad_3_on etc... So do I have to create a Statelist for every single butto... | You could make the background of the image change state and use that common background for all of the buttons. Then you could use either text or an image as the button foreground. | Android - Multiple items in a statelist? I currently have a keypad in my application 0 - 9, I require an on and off state for each button. To do this I've used a StateList as follows: However this is only for one button, each button has a different on and off graphic, dialpad_2_off, dialpad_3_on etc... So do I have to ... | TITLE:
Android - Multiple items in a statelist?
QUESTION:
I currently have a keypad in my application 0 - 9, I require an on and off state for each button. To do this I've used a StateList as follows: However this is only for one button, each button has a different on and off graphic, dialpad_2_off, dialpad_3_on etc..... | [
"android",
"xml",
"selector",
"statelist"
] | 0 | 1 | 632 | 1 | 0 | 2011-06-01T17:08:57.363000 | 2011-06-01T17:12:20.160000 |
6,205,072 | 6,205,146 | Rspec Factory issue- conceptual problem? | I'm trying to test a case in our Ruby on Rails system where we lock a user out after x failed login attempts. The issue I'm having is trying to create a user has reached the number that 'locks' his account. I am using Factories to create a user like so- Factory.define:locked_user,:class => User do |user| user.name "Tes... | I would recommend you either set the login_count after creating the user, or stub the method that tells you if a user login is locked. For instance, use update_attribute to force the login_count after the user has been created: before(:each) do @user = Factory(:user) @user.update_attribute(:login_count, 5) @attr = {:em... | Rspec Factory issue- conceptual problem? I'm trying to test a case in our Ruby on Rails system where we lock a user out after x failed login attempts. The issue I'm having is trying to create a user has reached the number that 'locks' his account. I am using Factories to create a user like so- Factory.define:locked_use... | TITLE:
Rspec Factory issue- conceptual problem?
QUESTION:
I'm trying to test a case in our Ruby on Rails system where we lock a user out after x failed login attempts. The issue I'm having is trying to create a user has reached the number that 'locks' his account. I am using Factories to create a user like so- Factory... | [
"ruby-on-rails",
"factory-bot",
"rspec-rails"
] | 2 | 0 | 141 | 1 | 0 | 2011-06-01T17:09:53.763000 | 2011-06-01T17:17:12.743000 |
6,205,074 | 6,209,364 | Model validation in CakePHP check that atleast one or the other is set | Is there a way to validate data (using CakePHP's model validation) to make sure that at least "a" or "b" has data (does not have to have data in both). | In your model, do something like this. The function will be called when you perform a save operation. EDITED public $validate = array( 'a' => array( 'customCheck' => array( 'rule' => 'abCheck', 'message' => 'You must enter data in a or b.' ) ), 'b' => array( 'customCheck' => array( 'rule' => 'abCheck', 'message' => 'Yo... | Model validation in CakePHP check that atleast one or the other is set Is there a way to validate data (using CakePHP's model validation) to make sure that at least "a" or "b" has data (does not have to have data in both). | TITLE:
Model validation in CakePHP check that atleast one or the other is set
QUESTION:
Is there a way to validate data (using CakePHP's model validation) to make sure that at least "a" or "b" has data (does not have to have data in both).
ANSWER:
In your model, do something like this. The function will be called whe... | [
"validation",
"cakephp",
"model-validation"
] | 2 | 4 | 1,377 | 3 | 0 | 2011-06-01T17:09:57.113000 | 2011-06-02T01:00:23.637000 |
6,205,085 | 6,236,452 | KML: Is there a way to define a folder once and then reference it like you do with styles? | I'm working with KML and have a macro that generates a KML from an Excel spreadsheet. Right now, I loop through constructing the xml for each placemark. I'd like to be able to reference a folder id for each placemark instead of having to nest placemarks within the tags. If I could just predefine the Folder element and ... | The answer is No. It's not supported by the specs See http://code.google.com/intl/nl-NL/apis/kml/documentation/kmlreference.html#placemark | KML: Is there a way to define a folder once and then reference it like you do with styles? I'm working with KML and have a macro that generates a KML from an Excel spreadsheet. Right now, I loop through constructing the xml for each placemark. I'd like to be able to reference a folder id for each placemark instead of h... | TITLE:
KML: Is there a way to define a folder once and then reference it like you do with styles?
QUESTION:
I'm working with KML and have a macro that generates a KML from an Excel spreadsheet. Right now, I loop through constructing the xml for each placemark. I'd like to be able to reference a folder id for each plac... | [
"directory",
"kml"
] | 0 | 0 | 80 | 1 | 0 | 2011-06-01T17:11:37.920000 | 2011-06-04T11:22:37.523000 |
6,205,090 | 6,205,201 | Print a singly-linked list backwards, in constant space and linear time | I heard an interview question: "Print a singly-linked list backwards, in constant space and linear time." My solution was to reverse the linkedlist in place and then print it like that. Is there another solution that is nondestructive? | If you reverse it again after printing it will no longer be destructive, since the original order is restored. | Print a singly-linked list backwards, in constant space and linear time I heard an interview question: "Print a singly-linked list backwards, in constant space and linear time." My solution was to reverse the linkedlist in place and then print it like that. Is there another solution that is nondestructive? | TITLE:
Print a singly-linked list backwards, in constant space and linear time
QUESTION:
I heard an interview question: "Print a singly-linked list backwards, in constant space and linear time." My solution was to reverse the linkedlist in place and then print it like that. Is there another solution that is nondestruc... | [
"algorithm",
"language-agnostic",
"linked-list"
] | 9 | 8 | 3,676 | 5 | 0 | 2011-06-01T17:12:00.563000 | 2011-06-01T17:22:18.227000 |
6,205,096 | 6,205,189 | iPhone LocationManager - Getting Coordinates at App Start | I'm getting the location through - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation. It should work when you move (can't really test it in simulator, at least I don't know how) but when I first load the app, the mapview is focused on... | If your using mapkit: Have you tried setRegion:(MKCoordinateRegion)region animated:(BOOL)animated Example: CLLocationCoordinate2D coord = {latitude: 61.2180556, longitude: -149.9002778}; MKCoordinateSpan span = {latitudeDelta: 0.2, longitudeDelta: 0.2}; MKCoordinateRegion region = {coord, span};
[mapView setRegion:reg... | iPhone LocationManager - Getting Coordinates at App Start I'm getting the location through - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation. It should work when you move (can't really test it in simulator, at least I don't know how... | TITLE:
iPhone LocationManager - Getting Coordinates at App Start
QUESTION:
I'm getting the location through - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation. It should work when you move (can't really test it in simulator, at leas... | [
"iphone",
"dictionary",
"locationmanager"
] | 0 | 2 | 551 | 2 | 0 | 2011-06-01T17:12:28.047000 | 2011-06-01T17:21:20.700000 |
6,205,099 | 6,205,600 | Detect when two keys are pressed on the same time | I want to do something when two keys are pressed at the same time. This is not working for me. Don't know why. if(GetAsyncKeyState(VK_F12) && GetAsyncKeyState(VK_F1)) { MessageBoxA(0, "Injection is working!", "Succes!", MB_ICONINFORMATION | MB_OK); } I want to know how to achieve so that code is executed when I press t... | How do you know your code is getting called at the time the keys are getting pressed? For your code to be getting called your in ether: in the message pump, in which case handle the WM_KEYUP or WM_KEYDOWN events, and check if the keys are "down" at the same time. in a timer thread, not sure the best way here. | Detect when two keys are pressed on the same time I want to do something when two keys are pressed at the same time. This is not working for me. Don't know why. if(GetAsyncKeyState(VK_F12) && GetAsyncKeyState(VK_F1)) { MessageBoxA(0, "Injection is working!", "Succes!", MB_ICONINFORMATION | MB_OK); } I want to know how ... | TITLE:
Detect when two keys are pressed on the same time
QUESTION:
I want to do something when two keys are pressed at the same time. This is not working for me. Don't know why. if(GetAsyncKeyState(VK_F12) && GetAsyncKeyState(VK_F1)) { MessageBoxA(0, "Injection is working!", "Succes!", MB_ICONINFORMATION | MB_OK); } I... | [
"c++",
"winapi",
"keyboard"
] | 1 | 3 | 3,255 | 2 | 0 | 2011-06-01T17:12:51.667000 | 2011-06-01T17:56:56.160000 |
6,205,109 | 6,205,204 | Justify text to fill a div | What i want to do is something like this: 1 2 3 4 5 6 7 8 9 10 11 With this code: 1 2 3 4 5 6 7 8 9 10 11 But it doesn't work, and displays like this: 1 2 3 4 5 6 7 8 9 10 11 | In DTP and word processing applications, this option is known as 'force justify'. Unfortunately, this is not an option in CSS. | Justify text to fill a div What i want to do is something like this: 1 2 3 4 5 6 7 8 9 10 11 With this code: 1 2 3 4 5 6 7 8 9 10 11 But it doesn't work, and displays like this: 1 2 3 4 5 6 7 8 9 10 11 | TITLE:
Justify text to fill a div
QUESTION:
What i want to do is something like this: 1 2 3 4 5 6 7 8 9 10 11 With this code: 1 2 3 4 5 6 7 8 9 10 11 But it doesn't work, and displays like this: 1 2 3 4 5 6 7 8 9 10 11
ANSWER:
In DTP and word processing applications, this option is known as 'force justify'. Unfortuna... | [
"css",
"text-alignment",
"justify"
] | 3 | 6 | 21,878 | 4 | 0 | 2011-06-01T17:14:02.043000 | 2011-06-01T17:22:24.200000 |
6,205,114 | 6,205,385 | Hide things from the past in PHP/MySQL | I have several activities in my database, but I would like to hide the ones from the past, so I modified my MySQL request: $sql = "SELECT * FROM tblAgenda WHERE date <= CURDATE() order by date ASC"; But it doesn't do a thing except giving errors. What's wrong? | It seems like you're not getting any results, so that is throwing errors. You always need to check for results before looping, you cannot just assume that every query will return something. Also, if you want things from the present/future, your comparison operand is backward: $sql = "SELECT * FROM tblAgenda WHERE date ... | Hide things from the past in PHP/MySQL I have several activities in my database, but I would like to hide the ones from the past, so I modified my MySQL request: $sql = "SELECT * FROM tblAgenda WHERE date <= CURDATE() order by date ASC"; But it doesn't do a thing except giving errors. What's wrong? | TITLE:
Hide things from the past in PHP/MySQL
QUESTION:
I have several activities in my database, but I would like to hide the ones from the past, so I modified my MySQL request: $sql = "SELECT * FROM tblAgenda WHERE date <= CURDATE() order by date ASC"; But it doesn't do a thing except giving errors. What's wrong?
A... | [
"php",
"mysql",
"date"
] | 0 | 1 | 571 | 1 | 0 | 2011-06-01T17:14:16.050000 | 2011-06-01T17:37:14.193000 |
6,205,123 | 6,205,330 | Get Facebook news feed with iOS? | I am starting out with the Facebook SDK for iOS and in my app I am trying to get the users news feed and load it into a uitableview. This is proving tricky. I can't find any documentation on it either. | using the Facebook SDK, you can call Facebook Graph API using: [facebook requestWithGraphPath:@"me/home" andDelegate:self]; to get the current user's newsfeed. You can then use the returned data to populate your tableview. More info about TableView can be found at http://developer.apple.com/library/ios/#documentation/u... | Get Facebook news feed with iOS? I am starting out with the Facebook SDK for iOS and in my app I am trying to get the users news feed and load it into a uitableview. This is proving tricky. I can't find any documentation on it either. | TITLE:
Get Facebook news feed with iOS?
QUESTION:
I am starting out with the Facebook SDK for iOS and in my app I am trying to get the users news feed and load it into a uitableview. This is proving tricky. I can't find any documentation on it either.
ANSWER:
using the Facebook SDK, you can call Facebook Graph API us... | [
"iphone",
"objective-c",
"ios",
"facebook"
] | 3 | 8 | 4,648 | 2 | 0 | 2011-06-01T17:15:16.090000 | 2011-06-01T17:32:50.887000 |
6,205,142 | 6,209,347 | Any way to see map results in a mapreduce function? | For debugging purposes it would be great to be able to see just what you are getting back from the map method. Is this possible in ruby? | To do this in the Mongo shell, you can define you own debug version of the emit() function to print trace information. function emit(k, v) { print("emit"); print(" k:" + k + " v:" + tojson(v)); } Check out Troubleshooting MapReduce in the MongoDB docs for more info. | Any way to see map results in a mapreduce function? For debugging purposes it would be great to be able to see just what you are getting back from the map method. Is this possible in ruby? | TITLE:
Any way to see map results in a mapreduce function?
QUESTION:
For debugging purposes it would be great to be able to see just what you are getting back from the map method. Is this possible in ruby?
ANSWER:
To do this in the Mongo shell, you can define you own debug version of the emit() function to print trac... | [
"ruby-on-rails",
"ruby",
"mongodb"
] | 0 | 2 | 316 | 2 | 0 | 2011-06-01T17:16:40.107000 | 2011-06-02T00:56:42.250000 |
6,205,148 | 6,205,333 | changing visibility using javascript | hi i have web page which uses ajax to retrieving data from another pages and while doing that i want to show a loading gif in the page so i've create a div with my gif on it. here is my css code: #content #loading { visibility:hidden; position: fixed; width: 48px; top: 0px; } now i figured all i need to do is to set th... | function loadpage (page_request, containerid) { var loading = document.getElementById ( "loading" );
// when connecting to server if ( page_request.readyState == 1 ) loading.style.visibility = "visible";
// when loaded successfully if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.... | changing visibility using javascript hi i have web page which uses ajax to retrieving data from another pages and while doing that i want to show a loading gif in the page so i've create a div with my gif on it. here is my css code: #content #loading { visibility:hidden; position: fixed; width: 48px; top: 0px; } now i ... | TITLE:
changing visibility using javascript
QUESTION:
hi i have web page which uses ajax to retrieving data from another pages and while doing that i want to show a loading gif in the page so i've create a div with my gif on it. here is my css code: #content #loading { visibility:hidden; position: fixed; width: 48px; ... | [
"javascript",
"css"
] | 25 | 44 | 124,062 | 3 | 0 | 2011-06-01T17:17:34.607000 | 2011-06-01T17:32:58.783000 |
6,205,153 | 6,205,277 | Filter IENumerable of Interface with property of class outside of interface | I'm stuck trying to find a solution to this problem. Its a question taken from an exam for an interview. I will mark this as homework as my last question was tagged for me that way. I have this object model: Department: DepartmentId, Name Teacher: TeacherId, FirstName, LastName, DateOfBirth, AnnualSalary, DepartmentId ... | If you think of it in terms of a Course owning people rather than trying to discover courses from people, you won't face this problem. So in meta-code: Course course=.... foreach(IPeople person in course.Students) //or whatever | Filter IENumerable of Interface with property of class outside of interface I'm stuck trying to find a solution to this problem. Its a question taken from an exam for an interview. I will mark this as homework as my last question was tagged for me that way. I have this object model: Department: DepartmentId, Name Teach... | TITLE:
Filter IENumerable of Interface with property of class outside of interface
QUESTION:
I'm stuck trying to find a solution to this problem. Its a question taken from an exam for an interview. I will mark this as homework as my last question was tagged for me that way. I have this object model: Department: Depart... | [
"c#",
"linq",
"ienumerable"
] | 0 | 1 | 371 | 1 | 0 | 2011-06-01T17:18:07.300000 | 2011-06-01T17:28:25.243000 |
6,205,154 | 6,205,289 | linq filtering child collection | I have read over a bunch of different topics on this, but i havent found what I am looking for. I have an EF query that is this: var query = this.ObjectContext.Questions.Include("AnswerKey").Include("QuestionTypes").Where(o => o.SurveyQuestions.Any(o2 => o2.SurveyID == id)); This was working fine until i realized that ... | You could just use Distinct() at the end to filter out the duplicates:.AsEnumerable().Select(ak => ak.Questions).Distinct().AsQueryable(); | linq filtering child collection I have read over a bunch of different topics on this, but i havent found what I am looking for. I have an EF query that is this: var query = this.ObjectContext.Questions.Include("AnswerKey").Include("QuestionTypes").Where(o => o.SurveyQuestions.Any(o2 => o2.SurveyID == id)); This was wor... | TITLE:
linq filtering child collection
QUESTION:
I have read over a bunch of different topics on this, but i havent found what I am looking for. I have an EF query that is this: var query = this.ObjectContext.Questions.Include("AnswerKey").Include("QuestionTypes").Where(o => o.SurveyQuestions.Any(o2 => o2.SurveyID == ... | [
"linq",
"entity-framework",
"linq-to-entities"
] | 3 | 2 | 2,743 | 2 | 0 | 2011-06-01T17:18:07.603000 | 2011-06-01T17:28:57.703000 |
6,205,156 | 6,205,286 | Can chrome.tabs.executeScript() be called from within a content script? | I tried to look for this in the chrome documentation but I didn't see anything, especially in the "Security" section in the chrome.tabs documentation. The typical approach in examples I've seen is to send a message to the background page. The background page then calls chrome.tabs.executeScript(). If I can do it from t... | Content scripts cannot call any Chrome API methods except couple from chrome.extension.* package. Unless you are doing this to save content script filesize, why not just have that code you are planning to execute in a content script from the beginning? | Can chrome.tabs.executeScript() be called from within a content script? I tried to look for this in the chrome documentation but I didn't see anything, especially in the "Security" section in the chrome.tabs documentation. The typical approach in examples I've seen is to send a message to the background page. The backg... | TITLE:
Can chrome.tabs.executeScript() be called from within a content script?
QUESTION:
I tried to look for this in the chrome documentation but I didn't see anything, especially in the "Security" section in the chrome.tabs documentation. The typical approach in examples I've seen is to send a message to the backgrou... | [
"google-chrome-extension"
] | 5 | 6 | 3,429 | 1 | 0 | 2011-06-01T17:18:23.647000 | 2011-06-01T17:28:53.773000 |
6,205,162 | 6,205,200 | Flex 3: Possible to call child function from within parent? | Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child? | Yes, a component should have specific references to it's children: myChild.function(functionArguments); The function needs to public, though. I don't recommend calling methods in the parent from the child, though. That is a break of encapsulation. | Flex 3: Possible to call child function from within parent? Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child? | TITLE:
Flex 3: Possible to call child function from within parent?
QUESTION:
Is it possible to call a child function from within the parent? I know to go child > parent, you can do parentApplication.functionName(parameters);, but what about going the other way... that is parent > child?
ANSWER:
Yes, a component shoul... | [
"apache-flex",
"parent-child"
] | 0 | 2 | 870 | 2 | 0 | 2011-06-01T17:18:38.863000 | 2011-06-01T17:22:03.757000 |
6,205,166 | 6,205,295 | Does every rails app have a default application.html.erb created in their layouts? | I just had a general doubt which I wanted to clear wrt Rails. I am currently working on Rails 2.0.2 for project specific purposes and I had a doubt especially related to this version of Rails. I did a basic scaffold in my rails app on "posts".. something like ruby script/generate scaffold posts. This created a posts.ht... | does Rails by default take my posts.html.erb in my layouts as the equivalent application.html.erb..? Yes. For the PostsController it will (by convention) take layouts/posts.html.erb as the overall layout template. If you remove this file it will fall back to the layouts/application.html.erb layout. My main concern behi... | Does every rails app have a default application.html.erb created in their layouts? I just had a general doubt which I wanted to clear wrt Rails. I am currently working on Rails 2.0.2 for project specific purposes and I had a doubt especially related to this version of Rails. I did a basic scaffold in my rails app on "p... | TITLE:
Does every rails app have a default application.html.erb created in their layouts?
QUESTION:
I just had a general doubt which I wanted to clear wrt Rails. I am currently working on Rails 2.0.2 for project specific purposes and I had a doubt especially related to this version of Rails. I did a basic scaffold in ... | [
"ruby-on-rails",
"layout",
"view"
] | 0 | 0 | 1,584 | 3 | 0 | 2011-06-01T17:18:48.037000 | 2011-06-01T17:29:24.350000 |
6,205,167 | 6,205,341 | Java: how to copy a directory but exclude some directories deep inside main directory | Using java, I want to copy whole directory excluding some sub-directories (and all files inside those sub-directories) down file path. How can I do that? I've seen several such questions on SO but using Perl/ANT etc but not using Java. | Try FileUtils.html#copyDirectory from Apache Commons IO. One of the overloaded versions take FileFilter instance with single straightforward method to be implemented by you: boolean accept(File pathname) Also look at the list of existing convenient FileFilter implementations in Commons IO: AgeFileFilter AndFileFilter C... | Java: how to copy a directory but exclude some directories deep inside main directory Using java, I want to copy whole directory excluding some sub-directories (and all files inside those sub-directories) down file path. How can I do that? I've seen several such questions on SO but using Perl/ANT etc but not using Java... | TITLE:
Java: how to copy a directory but exclude some directories deep inside main directory
QUESTION:
Using java, I want to copy whole directory excluding some sub-directories (and all files inside those sub-directories) down file path. How can I do that? I've seen several such questions on SO but using Perl/ANT etc ... | [
"java",
"directory",
"copy"
] | 1 | 1 | 3,332 | 2 | 0 | 2011-06-01T17:19:06.590000 | 2011-06-01T17:33:38.753000 |
6,205,171 | 6,205,214 | Correct way of making a singleton a Spring bean | I am converting a singleton to a Spring bean, so that if the singleton fails to initialize, then entire web application's spring context doesn't load properly. The advantage of making the Spring context not load properly, is that people will take notice and fix the configuration during deployment itself. As opposed to ... | You must declare the INSTANCE field as volatile for double-checked locking to work correctly. See Effective Java, Item 71. | Correct way of making a singleton a Spring bean I am converting a singleton to a Spring bean, so that if the singleton fails to initialize, then entire web application's spring context doesn't load properly. The advantage of making the Spring context not load properly, is that people will take notice and fix the config... | TITLE:
Correct way of making a singleton a Spring bean
QUESTION:
I am converting a singleton to a Spring bean, so that if the singleton fails to initialize, then entire web application's spring context doesn't load properly. The advantage of making the Spring context not load properly, is that people will take notice ... | [
"java",
"spring",
"singleton"
] | 21 | 19 | 105,258 | 7 | 0 | 2011-06-01T17:19:14.593000 | 2011-06-01T17:23:09.770000 |
6,205,173 | 6,215,698 | UserControl Storyboard objects moving out of UserControl | I have a UserControl that have a storyboard that moves a control (within my UserControl) out of the usercontrol (using a TranslateX RenderTransform). When I move the object out of the control it shows on the parent Page (that hosts my UserControl). Is there a way to just hide it when it reaches the boundaries of my Use... | What I finally did: Use a Canvas (instead of a Grid) as my LayoutRoot of my UserControl Added a Canvas.Clip that matches the size of my UserControl On the SizeChanged of my UserControl I resize my Clip to fit the new size. I'd like to post the XAML here but somehow the CodeSample does not work:/ Sorry | UserControl Storyboard objects moving out of UserControl I have a UserControl that have a storyboard that moves a control (within my UserControl) out of the usercontrol (using a TranslateX RenderTransform). When I move the object out of the control it shows on the parent Page (that hosts my UserControl). Is there a way... | TITLE:
UserControl Storyboard objects moving out of UserControl
QUESTION:
I have a UserControl that have a storyboard that moves a control (within my UserControl) out of the usercontrol (using a TranslateX RenderTransform). When I move the object out of the control it shows on the parent Page (that hosts my UserContro... | [
"silverlight",
"silverlight-4.0"
] | 0 | 0 | 296 | 4 | 0 | 2011-06-01T17:19:24.397000 | 2011-06-02T14:11:39.327000 |
6,205,176 | 6,205,461 | Finding custom attributes on view model properties when model binding | I've found a lot of information on implementing a custom model binder for validation purposes but I haven't seen much about what I'm attempting to do. I want to be able to manipulate the values that the model binder is going to set based on attributes on the property in the view model. For instance: public class FooVie... | The "correct" way (per the guy who wrote it) is to write a model metadata provider. There's an example at the link. Not precisely "simple," but it works, and you'll be doing what the rest of MVC does. | Finding custom attributes on view model properties when model binding I've found a lot of information on implementing a custom model binder for validation purposes but I haven't seen much about what I'm attempting to do. I want to be able to manipulate the values that the model binder is going to set based on attribute... | TITLE:
Finding custom attributes on view model properties when model binding
QUESTION:
I've found a lot of information on implementing a custom model binder for validation purposes but I haven't seen much about what I'm attempting to do. I want to be able to manipulate the values that the model binder is going to set ... | [
"asp.net-mvc",
"custom-attributes",
"model-binding"
] | 16 | 8 | 8,041 | 1 | 0 | 2011-06-01T17:19:50.143000 | 2011-06-01T17:45:23.740000 |
6,205,178 | 6,205,924 | Keyboard doesn't slide with view | When the view is dismissed the keyboard slides after the view. I created a video to demonstrate the problem. http://www.youtube.com/watch?v=ISFL5G17coU ' Does anyone know why this happens | In -(void) viewWillDisappear: make sure you call resignFirstResponder on your textfield. - (void)viewWillDisappear:(BOOL)animated { [textField resignFirstResponder]; } | Keyboard doesn't slide with view When the view is dismissed the keyboard slides after the view. I created a video to demonstrate the problem. http://www.youtube.com/watch?v=ISFL5G17coU ' Does anyone know why this happens | TITLE:
Keyboard doesn't slide with view
QUESTION:
When the view is dismissed the keyboard slides after the view. I created a video to demonstrate the problem. http://www.youtube.com/watch?v=ISFL5G17coU ' Does anyone know why this happens
ANSWER:
In -(void) viewWillDisappear: make sure you call resignFirstResponder on... | [
"iphone",
"objective-c",
"ios4"
] | 0 | 0 | 97 | 1 | 0 | 2011-06-01T17:20:08.960000 | 2011-06-01T18:25:57.860000 |
6,205,187 | 6,205,526 | Setup filter attribute for dependency injection to accept params in constructor | I'm following a ninject filter attribute setup on this page. For them, they have:.WithConstructorArgumentFromControllerAttribute ( "logLevel", attribute => attribute.LogLevel); The second parameter is expecting a Func callback. Their actual param list is setup as follows: Log(LogLevel = Level.Debug) But my filter attri... | You need to make roles into a property in your attribute. Attribute: public class AuthAttribute: FilterAttribute { public string[] Roles { get; set; }
public AuthAttribute(params string[] roles) { this.Roles = roles; } } Filter: public class AuthFilter: IAuthorizationFilter {
private readonly IUserService userService... | Setup filter attribute for dependency injection to accept params in constructor I'm following a ninject filter attribute setup on this page. For them, they have:.WithConstructorArgumentFromControllerAttribute ( "logLevel", attribute => attribute.LogLevel); The second parameter is expecting a Func callback. Their actual... | TITLE:
Setup filter attribute for dependency injection to accept params in constructor
QUESTION:
I'm following a ninject filter attribute setup on this page. For them, they have:.WithConstructorArgumentFromControllerAttribute ( "logLevel", attribute => attribute.LogLevel); The second parameter is expecting a Func call... | [
"asp.net-mvc",
"asp.net-mvc-3",
"ninject"
] | 8 | 18 | 2,278 | 1 | 0 | 2011-06-01T17:21:14.303000 | 2011-06-01T17:51:07.857000 |
6,205,190 | 6,205,206 | How to define constructor in C | How can one create a Haskell/C++ style constructor in C? Also, once I have this new object how can I define operations in it (such as LinkedList/Tree)? | C has no language support for objected-oriented concepts such as constructors. You could manually implement this, along the lines of: typedef struct { int field1; int field2; } MyObject;
MyObject *MyObject_new(int field1, int field2) { MyObject *p = malloc(sizeof(*p)); if (p!= NULL) { // "Initialise" fields p->field1 ... | How to define constructor in C How can one create a Haskell/C++ style constructor in C? Also, once I have this new object how can I define operations in it (such as LinkedList/Tree)? | TITLE:
How to define constructor in C
QUESTION:
How can one create a Haskell/C++ style constructor in C? Also, once I have this new object how can I define operations in it (such as LinkedList/Tree)?
ANSWER:
C has no language support for objected-oriented concepts such as constructors. You could manually implement th... | [
"c",
"haskell",
"constructor"
] | 0 | 17 | 761 | 2 | 0 | 2011-06-01T17:21:23.403000 | 2011-06-01T17:22:38.053000 |
6,205,195 | 6,205,211 | Given a starting and ending indices, how can I copy part of a string in C? | In C, how can I copy a string with begin and end indices, so that the string will only be partially copied (from begin index to end index)? This would be like 'C string copy' strcpy, but with a begin and an end index. | Have you checked strncpy? char * strncpy ( char * destination, const char * source, size_t num ); You must realize that begin and end actually defines a num of bytes to be copied from one place to another. | Given a starting and ending indices, how can I copy part of a string in C? In C, how can I copy a string with begin and end indices, so that the string will only be partially copied (from begin index to end index)? This would be like 'C string copy' strcpy, but with a begin and an end index. | TITLE:
Given a starting and ending indices, how can I copy part of a string in C?
QUESTION:
In C, how can I copy a string with begin and end indices, so that the string will only be partially copied (from begin index to end index)? This would be like 'C string copy' strcpy, but with a begin and an end index.
ANSWER:
... | [
"c",
"string",
"substring"
] | 40 | 25 | 149,490 | 3 | 0 | 2011-06-01T17:21:57.523000 | 2011-06-01T17:23:00.927000 |
6,205,210 | 6,205,260 | Is this how to schedule a java method to run 1 second later? | In my method, I want to call another method that will run 1 second later. This is what I have. final Timer timer = new Timer();
timer.schedule(new TimerTask() { public void run() { MyMethod(); Log.w("General", "This has been called one second later"); timer.cancel(); } }, 1000); Is this how it's supposed to be done? A... | Instead of a Timer, I'd recommend using a ScheduledExecutorService final ScheduledExecutorService exec = Executors.newScheduledThreadPool(1);
exec.schedule(new Runnable(){ @Override public void run(){ MyMethod(); } }, 1, TimeUnit.SECONDS); | Is this how to schedule a java method to run 1 second later? In my method, I want to call another method that will run 1 second later. This is what I have. final Timer timer = new Timer();
timer.schedule(new TimerTask() { public void run() { MyMethod(); Log.w("General", "This has been called one second later"); timer.... | TITLE:
Is this how to schedule a java method to run 1 second later?
QUESTION:
In my method, I want to call another method that will run 1 second later. This is what I have. final Timer timer = new Timer();
timer.schedule(new TimerTask() { public void run() { MyMethod(); Log.w("General", "This has been called one seco... | [
"java",
"android"
] | 13 | 17 | 14,920 | 4 | 0 | 2011-06-01T17:22:52.127000 | 2011-06-01T17:26:41.463000 |
6,205,221 | 6,205,381 | How do I make an app plugin-aware without a separate DLL for the plugin interface? | The traditional procedure to develop a plugin architecture seems to be to create a separate DLL containing only the common interface that all plugins will implement, and make both the core app and the plugins depend on that. I'm trying to do just the same, but without a separate interface dll. One obvious way is to mak... | You could load the assembly and access its types through Reflection. There are some examples here: http://www.csharp-examples.net/reflection-examples/, and I've extracted some of the more interesting ones: Assembly testAssembly = Assembly.LoadFile(@"c:\Test.dll"); Type calcType = testAssembly.GetType("Test.Calculator")... | How do I make an app plugin-aware without a separate DLL for the plugin interface? The traditional procedure to develop a plugin architecture seems to be to create a separate DLL containing only the common interface that all plugins will implement, and make both the core app and the plugins depend on that. I'm trying t... | TITLE:
How do I make an app plugin-aware without a separate DLL for the plugin interface?
QUESTION:
The traditional procedure to develop a plugin architecture seems to be to create a separate DLL containing only the common interface that all plugins will implement, and make both the core app and the plugins depend on ... | [
".net",
"plugins",
"dll",
"bundle"
] | 3 | 2 | 201 | 3 | 0 | 2011-06-01T17:23:39.083000 | 2011-06-01T17:37:02.330000 |
6,205,222 | 6,206,964 | MS Access: Filter/Search records in a form using main form and subform criteria from user input | I'm currently working on a database which is rather complex, at least for my ability level. Essentially it is a database of projects, structures and contacts. Within these structures there are sub structures each with unique attributes. Projects, structures and contacts are joined together in one main control form with... | Do you have any screenshots you could possibly post? This sounds to me like a larger design issue, perhaps mostly in your UI but possibly in your table structure as well. One my own principles I try to follow is to limit how many things a single screen/form does or shows. What your describing sounds quite confusing to ... | MS Access: Filter/Search records in a form using main form and subform criteria from user input I'm currently working on a database which is rather complex, at least for my ability level. Essentially it is a database of projects, structures and contacts. Within these structures there are sub structures each with unique... | TITLE:
MS Access: Filter/Search records in a form using main form and subform criteria from user input
QUESTION:
I'm currently working on a database which is rather complex, at least for my ability level. Essentially it is a database of projects, structures and contacts. Within these structures there are sub structure... | [
"ms-access",
"search",
"filter",
"vba"
] | 2 | 3 | 32,675 | 2 | 0 | 2011-06-01T17:23:46.127000 | 2011-06-01T20:03:01.377000 |
6,205,225 | 6,205,255 | link_to acting strangely in Rails | All my link_to's in my views seem to return the link text, but also the ink address in brackets. Why is this? E.g <%= link_to "Home", root_url %> and renders in the view Home (http://localhost:3000/) | Check your stylesheets. For example, I know plenty of print media css does that for the benefit of those who can't "click" their paper. | link_to acting strangely in Rails All my link_to's in my views seem to return the link text, but also the ink address in brackets. Why is this? E.g <%= link_to "Home", root_url %> and renders in the view Home (http://localhost:3000/) | TITLE:
link_to acting strangely in Rails
QUESTION:
All my link_to's in my views seem to return the link text, but also the ink address in brackets. Why is this? E.g <%= link_to "Home", root_url %> and renders in the view Home (http://localhost:3000/)
ANSWER:
Check your stylesheets. For example, I know plenty of print... | [
"ruby-on-rails",
"ruby",
"link-to"
] | 0 | 7 | 83 | 1 | 0 | 2011-06-01T17:23:54.070000 | 2011-06-01T17:26:24.543000 |
6,205,227 | 6,205,281 | respond to an ajax call in c# | I have some javascript files and an html file. The do some stuff, and I'd like to make an ajax call (using jQuery's $.post() method) to a server to get some info, and then do some more stuff. Do I need to set up some sort of scaffolding before I can do this? I have a.cs file now, can I just run that with VC# and have i... | If you're using webforms, you can look at Page Methods I'm guessing you might be using MVC though, which you may want to refer to this question: PageMethods with ASP.Net MVC | respond to an ajax call in c# I have some javascript files and an html file. The do some stuff, and I'd like to make an ajax call (using jQuery's $.post() method) to a server to get some info, and then do some more stuff. Do I need to set up some sort of scaffolding before I can do this? I have a.cs file now, can I jus... | TITLE:
respond to an ajax call in c#
QUESTION:
I have some javascript files and an html file. The do some stuff, and I'd like to make an ajax call (using jQuery's $.post() method) to a server to get some info, and then do some more stuff. Do I need to set up some sort of scaffolding before I can do this? I have a.cs f... | [
"c#",
"jquery",
"asp.net-mvc",
"ajax"
] | 0 | 0 | 364 | 2 | 0 | 2011-06-01T17:24:02.807000 | 2011-06-01T17:28:41.277000 |
6,205,232 | 6,208,142 | Preserving white space through XML/XSLT processing chain | User types text into a multi-line text box in the browser Data is stored as part of an XML snippet in a SQL Server xml column XML snippet is later incorporated into a larger xml document Document is processed via XSLT into an HTML email Recipient is expected to see the original line breaks I tried: CDATA (removed by SQ... | Reason for your problem was that you used when you actually needed only selects the string value of the selected node. What you actually wanted is to copy of whole node including the elements that it contained. Then you can save the data as a formatted XHTML snippet without the need of element syntax escaping (format n... | Preserving white space through XML/XSLT processing chain User types text into a multi-line text box in the browser Data is stored as part of an XML snippet in a SQL Server xml column XML snippet is later incorporated into a larger xml document Document is processed via XSLT into an HTML email Recipient is expected to s... | TITLE:
Preserving white space through XML/XSLT processing chain
QUESTION:
User types text into a multi-line text box in the browser Data is stored as part of an XML snippet in a SQL Server xml column XML snippet is later incorporated into a larger xml document Document is processed via XSLT into an HTML email Recipien... | [
"xml",
"xslt",
"whitespace"
] | 2 | 3 | 2,176 | 2 | 0 | 2011-06-01T17:24:22.763000 | 2011-06-01T21:48:44.340000 |
6,205,235 | 6,205,547 | Searching for Java class in a package recursively by name | Is there some easy, well-explored way to search for a given class by name in a package, and, recursively, in all sub-packages of a this package? I.e. given existing classes, such as: foo.MyClass foo.bar.baz.some.more.MyClass foo.bar.baz.some.more.OtherClass I'd like to run something like magicMethod("foo.bar.baz", "MyC... | Shameless plug for my own OSS software: https://bitbucket.org/stevevls/metapossum-scanner/wiki, available in maven central. The typical use cases for this library are for doing things like looking for implementing classes like this: Set > implementingClasses = new ClassesInPackageScanner().findImplementers("com.mypacka... | Searching for Java class in a package recursively by name Is there some easy, well-explored way to search for a given class by name in a package, and, recursively, in all sub-packages of a this package? I.e. given existing classes, such as: foo.MyClass foo.bar.baz.some.more.MyClass foo.bar.baz.some.more.OtherClass I'd ... | TITLE:
Searching for Java class in a package recursively by name
QUESTION:
Is there some easy, well-explored way to search for a given class by name in a package, and, recursively, in all sub-packages of a this package? I.e. given existing classes, such as: foo.MyClass foo.bar.baz.some.more.MyClass foo.bar.baz.some.mo... | [
"java",
"reflection"
] | 3 | 5 | 1,867 | 1 | 0 | 2011-06-01T17:24:25.933000 | 2011-06-01T17:52:47.417000 |
6,205,242 | 6,205,273 | JSON in C# (preferably without third-party tools) | I've seen quite a few ways to output JSON in C#. None of them, however, seem easy. This may very well be due to my lack of knowledge of C#, though. Question: If you were to write JSON (for use in JavaScript later on), how would you do it? I would prefer to not use third-party tools; however this is not an ultimatum of ... | How about JavaScriptSerializer? Nice integrated solution, allowed to be expanded upon with JavaScriptConverter s. Demo of what you were after: using System; using System.Web.Script.Serialization; using System.Text;
public class Stop { public String place { get; set; } public Int32 KMs { get; set; } }
public class Tri... | JSON in C# (preferably without third-party tools) I've seen quite a few ways to output JSON in C#. None of them, however, seem easy. This may very well be due to my lack of knowledge of C#, though. Question: If you were to write JSON (for use in JavaScript later on), how would you do it? I would prefer to not use third... | TITLE:
JSON in C# (preferably without third-party tools)
QUESTION:
I've seen quite a few ways to output JSON in C#. None of them, however, seem easy. This may very well be due to my lack of knowledge of C#, though. Question: If you were to write JSON (for use in JavaScript later on), how would you do it? I would prefe... | [
"asp.net",
"json",
"c#-4.0"
] | 0 | 3 | 2,703 | 3 | 0 | 2011-06-01T17:25:06.757000 | 2011-06-01T17:28:04.380000 |
6,205,254 | 6,230,570 | How to setup SysLogHandler with Django 1.3 logging dictionary configuration | I'm having no luck finding any information on setting up syslog logging with Django 1.3 dictionary configuration. The Django documents don't cover syslog and the python documentation is less than clear and doesn’t cover dictionary config at all. I've started with the following but I'm stuck on how to configure the SysL... | Finally found the answer, modify the configuration in the original question to have the following for 'syslog': from logging.handlers import SysLogHandler... 'syslog':{ 'level':'DEBUG', 'class': 'logging.handlers.SysLogHandler', 'formatter': 'verbose', 'facility': SysLogHandler.LOG_LOCAL2, },... Warning to future gener... | How to setup SysLogHandler with Django 1.3 logging dictionary configuration I'm having no luck finding any information on setting up syslog logging with Django 1.3 dictionary configuration. The Django documents don't cover syslog and the python documentation is less than clear and doesn’t cover dictionary config at all... | TITLE:
How to setup SysLogHandler with Django 1.3 logging dictionary configuration
QUESTION:
I'm having no luck finding any information on setting up syslog logging with Django 1.3 dictionary configuration. The Django documents don't cover syslog and the python documentation is less than clear and doesn’t cover dictio... | [
"django",
"syslog"
] | 19 | 22 | 11,529 | 3 | 0 | 2011-06-01T17:26:19.717000 | 2011-06-03T17:32:51.233000 |
6,205,256 | 6,233,194 | Binding a queue to an EJB 3.0 MDB in WebSphere 7 | I'm writing, or trying to write, Baby's First MDB on WebSphere 7. I have nearly no hair left, having pulled it all out trying to get the thing to work. It appears that I've got everything set up right, but I get no response when I put a message to the associated queue. Here's the EAR file setup: simplemdb.ear META-INF ... | I found the problem. It's specific to WebSphere running on z/OS. For an activation spec to be fully available in that environment, the Control Region Adjunct (CRA) process must be started. I told WAS to start it up, recycled the app server, and lo! My MDB started responding. To make the CRA start via the WebSphere Admi... | Binding a queue to an EJB 3.0 MDB in WebSphere 7 I'm writing, or trying to write, Baby's First MDB on WebSphere 7. I have nearly no hair left, having pulled it all out trying to get the thing to work. It appears that I've got everything set up right, but I get no response when I put a message to the associated queue. H... | TITLE:
Binding a queue to an EJB 3.0 MDB in WebSphere 7
QUESTION:
I'm writing, or trying to write, Baby's First MDB on WebSphere 7. I have nearly no hair left, having pulled it all out trying to get the thing to work. It appears that I've got everything set up right, but I get no response when I put a message to the a... | [
"deployment",
"queue",
"websphere",
"message-driven-bean",
"zos"
] | 0 | 1 | 9,081 | 2 | 0 | 2011-06-01T17:26:25.177000 | 2011-06-03T22:16:43.843000 |
6,205,258 | 6,205,324 | jQuery - Dynamically Create Button and Attach Event Handler | I would like to dynamically add a button control to a table using jQuery and attach a click event handler. I tried the following, without success: $("#myButton").click(function () { var test = $(' Test ').click(function () { alert('hi'); });
$("#nodeAttributeHeader").attr('style', 'display: table-row;'); $("#addNodeTa... | Calling.html() serializes the element to a string, so all event handlers and other associated data is lost. Here's how I'd do it: $("#myButton").click(function () { var test = $(' ', { text: 'Test', click: function () { alert('hi'); } });
var parent = $(' ').children().append(test).end();
$("#addNodeTable tr:last").b... | jQuery - Dynamically Create Button and Attach Event Handler I would like to dynamically add a button control to a table using jQuery and attach a click event handler. I tried the following, without success: $("#myButton").click(function () { var test = $(' Test ').click(function () { alert('hi'); });
$("#nodeAttribute... | TITLE:
jQuery - Dynamically Create Button and Attach Event Handler
QUESTION:
I would like to dynamically add a button control to a table using jQuery and attach a click event handler. I tried the following, without success: $("#myButton").click(function () { var test = $(' Test ').click(function () { alert('hi'); });
... | [
"javascript",
"jquery"
] | 48 | 63 | 141,922 | 5 | 0 | 2011-06-01T17:26:33.340000 | 2011-06-01T17:32:17.300000 |
6,205,282 | 6,205,727 | Network output from server can't be read by client | So, I have a simple socket server and a socket. I run the socket server, successfully. The client socket connects and sends a string - this works. I want the server to write back different information based on this string. I can check what the string is and get an OutputStream to the client, but whenever I write to it ... | Executed your code (after commenting the reference to StringQueue in SimbadAgent) and I got the following output. wrote get_cmd Input shutdown? false iS()iI()iM()iB()iA()iD()i ()iB()iO()iO()iY()iA()NETWORKAGENT: Response to "get_cmd": "SIMBAD BOOYA" | Network output from server can't be read by client So, I have a simple socket server and a socket. I run the socket server, successfully. The client socket connects and sends a string - this works. I want the server to write back different information based on this string. I can check what the string is and get an Outp... | TITLE:
Network output from server can't be read by client
QUESTION:
So, I have a simple socket server and a socket. I run the socket server, successfully. The client socket connects and sends a string - this works. I want the server to write back different information based on this string. I can check what the string ... | [
"java",
"network-programming"
] | 0 | 1 | 97 | 1 | 0 | 2011-06-01T17:28:43.150000 | 2011-06-01T18:07:43.660000 |
6,205,294 | 6,205,597 | Binary Serialization for Lists of Undefined Length in Haskell | I've been using Data.Binary to serialize data to files. In my application I incrementally add items to these files. The two most popular serialization packages, binary and cereal, both serialize lists as a count followed by the list items. Because of this, I can't append to my serialized files. I currently read in the ... | So I say stick with Data.Binary but write a new instance for growable lists. Here's the current (strict) instance: instance Binary a => Binary [a] where put l = put (length l) >> mapM_ put l get = do n <- get:: Get Int getMany n
-- | 'getMany n' get 'n' elements in order, without blowing the stack. getMany:: Binary a ... | Binary Serialization for Lists of Undefined Length in Haskell I've been using Data.Binary to serialize data to files. In my application I incrementally add items to these files. The two most popular serialization packages, binary and cereal, both serialize lists as a count followed by the list items. Because of this, I... | TITLE:
Binary Serialization for Lists of Undefined Length in Haskell
QUESTION:
I've been using Data.Binary to serialize data to files. In my application I incrementally add items to these files. The two most popular serialization packages, binary and cereal, both serialize lists as a count followed by the list items. ... | [
"serialization",
"haskell",
"binary",
"stream",
"lazy-evaluation"
] | 19 | 7 | 1,013 | 2 | 0 | 2011-06-01T17:29:21.497000 | 2011-06-01T17:56:48.437000 |
6,205,296 | 6,205,312 | How do I execute this GROUP BY mysql query? | Suppose I have a table called "Fruits" with a column called "name". name -------- apple orange orange orange apple grape How can I execute a query to produce this: orange 3 apple 2 grape 1 (Group by the name, and then sort them by their count) | SELECT name, COUNT(*) as cnt FROM Fruits GROUP BY name ORDER by cnt DESC | How do I execute this GROUP BY mysql query? Suppose I have a table called "Fruits" with a column called "name". name -------- apple orange orange orange apple grape How can I execute a query to produce this: orange 3 apple 2 grape 1 (Group by the name, and then sort them by their count) | TITLE:
How do I execute this GROUP BY mysql query?
QUESTION:
Suppose I have a table called "Fruits" with a column called "name". name -------- apple orange orange orange apple grape How can I execute a query to produce this: orange 3 apple 2 grape 1 (Group by the name, and then sort them by their count)
ANSWER:
SELEC... | [
"mysql",
"database"
] | 0 | 3 | 91 | 1 | 0 | 2011-06-01T17:29:37.600000 | 2011-06-01T17:31:06.857000 |
6,205,300 | 6,205,318 | Does using statement on SqlCommand.Connection behave the same? | Does placing a SqlCommand.Connection in a using block close the connection in the same way as placing the SqlConnection in it's own using block? (Is #1 = #2) Example 1 using (var cmd = GetCommandWithConnectionSetInternally(connString)) { using (cmd.Connection) {
} } Example 2 using(var conn = new SqlConnection(connStr... | I can't see it working any other way since using is just a short form of try {} finally {} with a Dispose call in the finally block. Since the resource object being used is cmd.Connection, it should get disposed. | Does using statement on SqlCommand.Connection behave the same? Does placing a SqlCommand.Connection in a using block close the connection in the same way as placing the SqlConnection in it's own using block? (Is #1 = #2) Example 1 using (var cmd = GetCommandWithConnectionSetInternally(connString)) { using (cmd.Connecti... | TITLE:
Does using statement on SqlCommand.Connection behave the same?
QUESTION:
Does placing a SqlCommand.Connection in a using block close the connection in the same way as placing the SqlConnection in it's own using block? (Is #1 = #2) Example 1 using (var cmd = GetCommandWithConnectionSetInternally(connString)) { u... | [
"c#",
"sql"
] | 1 | 4 | 428 | 1 | 0 | 2011-06-01T17:30:10.383000 | 2011-06-01T17:31:54.240000 |
6,205,306 | 6,205,331 | SQL Syntax help | What would be the SQL syntax to select 4 different columns in a single row in a table, add those together and then insert that value into a 5th different column in the same row? The columns are all numeric(11,2). For example- Table name is DataCheck there is an ID that is primary key so how do I select col1, col2, col3... | Unless I'm misunderstanding: UPDATE MyTable SET col5 = col1 + col2 + col3 + col4 WHERE id = 232 | SQL Syntax help What would be the SQL syntax to select 4 different columns in a single row in a table, add those together and then insert that value into a 5th different column in the same row? The columns are all numeric(11,2). For example- Table name is DataCheck there is an ID that is primary key so how do I select ... | TITLE:
SQL Syntax help
QUESTION:
What would be the SQL syntax to select 4 different columns in a single row in a table, add those together and then insert that value into a 5th different column in the same row? The columns are all numeric(11,2). For example- Table name is DataCheck there is an ID that is primary key s... | [
"sql",
"sql-server",
"syntax"
] | 0 | 2 | 154 | 5 | 0 | 2011-06-01T17:30:51.103000 | 2011-06-01T17:32:52.607000 |
6,205,307 | 6,206,559 | How to implement curl -u in Python? | I am trying to use http://developer.github.com/v3/ to retrieve project issues. This works: curl -u "Littlemaple:mypassword" https://api.github.com/repos/MyClient/project/issues It returns all private issues of my client's project. However, I am not able to find out how to implement this in Python. Both ways I have foun... | If it's 404, you probably just have the wrong URL. If it's 403, perhaps you have the realm wrong. For starters, you're passing the URL to add_password, when in fact you should only be passing the base URL. Also, instead of install_opener, you should probably just create a new opener. See this recipe for an example: cla... | How to implement curl -u in Python? I am trying to use http://developer.github.com/v3/ to retrieve project issues. This works: curl -u "Littlemaple:mypassword" https://api.github.com/repos/MyClient/project/issues It returns all private issues of my client's project. However, I am not able to find out how to implement t... | TITLE:
How to implement curl -u in Python?
QUESTION:
I am trying to use http://developer.github.com/v3/ to retrieve project issues. This works: curl -u "Littlemaple:mypassword" https://api.github.com/repos/MyClient/project/issues It returns all private issues of my client's project. However, I am not able to find out ... | [
"python",
"https",
"github-api"
] | 14 | 6 | 8,208 | 4 | 0 | 2011-06-01T17:30:51.853000 | 2011-06-01T19:25:51.220000 |
6,205,315 | 6,205,390 | What is the fastest way to find the bottleneck/optimize Magento? | Is there a way to identify quickly a faulty script in Magento that slows down the server? Magento has something like 35 000 files, so there are so many places it can go wrong, I just need a way to find quickly where to optimize. For example, could I install a script that would tell me all the files magento reads before... | xdebug and WebGrind will profile your application. Though it can be a bit tricky to set up, so I'll just post my configuration and you can take from it what you can (from my WampDeveloper installation)... php.ini [XDebug] zend_extension = "D:\WampDeveloper\Components\Php\ext\php_xdebug.dll" xdebug.profiler_enable = 1 x... | What is the fastest way to find the bottleneck/optimize Magento? Is there a way to identify quickly a faulty script in Magento that slows down the server? Magento has something like 35 000 files, so there are so many places it can go wrong, I just need a way to find quickly where to optimize. For example, could I insta... | TITLE:
What is the fastest way to find the bottleneck/optimize Magento?
QUESTION:
Is there a way to identify quickly a faulty script in Magento that slows down the server? Magento has something like 35 000 files, so there are so many places it can go wrong, I just need a way to find quickly where to optimize. For exam... | [
"php",
"magento"
] | 1 | 4 | 1,953 | 3 | 0 | 2011-06-01T17:31:37.973000 | 2011-06-01T17:37:34.417000 |
6,205,317 | 6,205,732 | Correct Way of Setting Up Static Object Required for Method | I'm creating a category on NSDate that that converts a NSDate into a NSString. It uses an NSDateFormatter to do so. I found that allocating then deallocating the formatter each time was causing noticeable delays in my application (this category is used very frequently), so I updated my 'format' method to look like this... | You are effectively creating a singleton. Unless it isn't going to be used throughout the entire running session of your application, don't worry about the memory use. Even if it is only going to be used intermittently, leaving one date formatter around isn't going to be an issue. I.e. just like a singleton, don't worr... | Correct Way of Setting Up Static Object Required for Method I'm creating a category on NSDate that that converts a NSDate into a NSString. It uses an NSDateFormatter to do so. I found that allocating then deallocating the formatter each time was causing noticeable delays in my application (this category is used very fr... | TITLE:
Correct Way of Setting Up Static Object Required for Method
QUESTION:
I'm creating a category on NSDate that that converts a NSDate into a NSString. It uses an NSDateFormatter to do so. I found that allocating then deallocating the formatter each time was causing noticeable delays in my application (this catego... | [
"iphone",
"objective-c",
"cocoa-touch",
"cocoa",
"macos"
] | 5 | 9 | 1,163 | 2 | 0 | 2011-06-01T17:31:44.743000 | 2011-06-01T18:08:16.427000 |
6,205,319 | 6,231,910 | GCC Cross Compiler can't pass a void main() test | I'm building a cross compiler that translates c code into assembly for this processor I'm working with. After several hours of work, I managed to get xgcc.exe to compile so that I can start getting it to spit out actual opcodes. However, I've hit a snag when trying to compile a simple void main code: void main(){} When... | After a bunch of hacking around, i resolved the issue with this: (define_expand "call" [(call (match_operand:SI 0 "memory_operand" "") (match_operand 1 "general_operand" ""))] "" { gcc_assert (MEM_P (operands[0])); })
(define_insn "*call" [(call (mem:SI (match_operand:SI 0 "nonmemory_operand" "i,r")) (match_operand 1 ... | GCC Cross Compiler can't pass a void main() test I'm building a cross compiler that translates c code into assembly for this processor I'm working with. After several hours of work, I managed to get xgcc.exe to compile so that I can start getting it to spit out actual opcodes. However, I've hit a snag when trying to co... | TITLE:
GCC Cross Compiler can't pass a void main() test
QUESTION:
I'm building a cross compiler that translates c code into assembly for this processor I'm working with. After several hours of work, I managed to get xgcc.exe to compile so that I can start getting it to spit out actual opcodes. However, I've hit a snag... | [
"gcc",
"cross-compiling"
] | 1 | 0 | 451 | 1 | 0 | 2011-06-01T17:31:55.570000 | 2011-06-03T19:44:27.707000 |
6,205,326 | 6,205,379 | Iphone, user created labels? | Usually When i want a object to be accesed by many different event calls i just declare it in the h file. However im making a app where i need to allow the user to create UILabels and drag and drop them where they want. So i have the code to make the labels and a alertview where they change the text. -(IBAction)AddText... | You could think about adding the newly created label to a NSMutableArray or, better, to a NSMutableDictionary. This latter solution gives you the possibility of creating a dictionary in which each label can be referred to using a string key. If you put such a dictionary in your.h file you'll be fine, I think. | Iphone, user created labels? Usually When i want a object to be accesed by many different event calls i just declare it in the h file. However im making a app where i need to allow the user to create UILabels and drag and drop them where they want. So i have the code to make the labels and a alertview where they change... | TITLE:
Iphone, user created labels?
QUESTION:
Usually When i want a object to be accesed by many different event calls i just declare it in the h file. However im making a app where i need to allow the user to create UILabels and drag and drop them where they want. So i have the code to make the labels and a alertview... | [
"iphone"
] | 0 | 2 | 59 | 3 | 0 | 2011-06-01T17:32:17.923000 | 2011-06-01T17:36:56.630000 |
6,205,336 | 6,205,702 | css cache problem | I am using gzip on my css to compress on page load. To do this I have made my css (stylesheet.css.php) file. This is my PHP script included inside file: /*css stuff*/ I understand that the ($offset = 60 * 60;) is "sending an 'Expires' header, to set an age on how long our cached file will last. Here we set it to expire... | To shorten the time the clients wait before requesting the file again, you can shorten your 'offset' like you said. The unit the time() function uses is seconds, so '60' would mean one minute. If you update your css regularly, maybe you should not use the expires header at all to save you the hassle, since most clients... | css cache problem I am using gzip on my css to compress on page load. To do this I have made my css (stylesheet.css.php) file. This is my PHP script included inside file: /*css stuff*/ I understand that the ($offset = 60 * 60;) is "sending an 'Expires' header, to set an age on how long our cached file will last. Here w... | TITLE:
css cache problem
QUESTION:
I am using gzip on my css to compress on page load. To do this I have made my css (stylesheet.css.php) file. This is my PHP script included inside file: /*css stuff*/ I understand that the ($offset = 60 * 60;) is "sending an 'Expires' header, to set an age on how long our cached file... | [
"php",
"css"
] | 2 | 1 | 687 | 3 | 0 | 2011-06-01T17:33:08.567000 | 2011-06-01T18:05:21.913000 |
6,205,337 | 6,205,554 | Should I use a unique index here? And why? | I read but I'm still confused when to use a normal index or a unique index in MySQL. I have a table that stores posts and responses (id, parentId). I have set up three normal indices for parentId, userId, and editorId. Would using unique indices benefit me in any way given the following types of queries I will generall... | When an index is created as UNIQUE, it only adds consistency to your table: inserting a new entry reusing the same key by error will fail, instead of being accepted and lead to strange errors later. So, you should use it for your IDs when you know there won't be duplicate (it's by default and mandatory for primary keys... | Should I use a unique index here? And why? I read but I'm still confused when to use a normal index or a unique index in MySQL. I have a table that stores posts and responses (id, parentId). I have set up three normal indices for parentId, userId, and editorId. Would using unique indices benefit me in any way given the... | TITLE:
Should I use a unique index here? And why?
QUESTION:
I read but I'm still confused when to use a normal index or a unique index in MySQL. I have a table that stores posts and responses (id, parentId). I have set up three normal indices for parentId, userId, and editorId. Would using unique indices benefit me in... | [
"mysql",
"indexing"
] | 0 | 2 | 1,840 | 3 | 0 | 2011-06-01T17:33:17.440000 | 2011-06-01T17:53:50.653000 |
6,205,339 | 6,207,213 | ListView Item Selected State not working | So I have a ListView and I want to change the color of each items background and text. This ListView is inside a ListFragment. My code inflates the layout in the onCreateView and inflates the layout of each item in the newView. The android:state_pressed="true" is working fine, whenever I press in one item the backgroun... | The answer is to use the android:state_activated="true" state, instead of the "selected" state. More on this here: ListFragment Item Selected Background | ListView Item Selected State not working So I have a ListView and I want to change the color of each items background and text. This ListView is inside a ListFragment. My code inflates the layout in the onCreateView and inflates the layout of each item in the newView. The android:state_pressed="true" is working fine, w... | TITLE:
ListView Item Selected State not working
QUESTION:
So I have a ListView and I want to change the color of each items background and text. This ListView is inside a ListFragment. My code inflates the layout in the onCreateView and inflates the layout of each item in the newView. The android:state_pressed="true" ... | [
"android",
"listview",
"android-layout"
] | 21 | 45 | 31,631 | 4 | 0 | 2011-06-01T17:33:32.203000 | 2011-06-01T20:27:00.373000 |
6,205,352 | 6,205,383 | Remove preceding numbers/symbols from a string | I'm trying to write a function in PHP that finds the first letter in a string and then returns the remainder of the string. So, for example, if you had a string: "8932? Test 14 String" The function would return "Test 14 String" I have written the following function that seems to do the job: function removenums($withnum... | You can simply use strpos with substr echo substr($string,strpos($string,'?')+1); And you are ready to go Please notice you should avoid whenever possibile preg_* functions because they are generally slower than the simpler str* functions After reading your comment echo preg_replace( '/^[^a-z]+/i','',$string ); | Remove preceding numbers/symbols from a string I'm trying to write a function in PHP that finds the first letter in a string and then returns the remainder of the string. So, for example, if you had a string: "8932? Test 14 String" The function would return "Test 14 String" I have written the following function that se... | TITLE:
Remove preceding numbers/symbols from a string
QUESTION:
I'm trying to write a function in PHP that finds the first letter in a string and then returns the remainder of the string. So, for example, if you had a string: "8932? Test 14 String" The function would return "Test 14 String" I have written the followin... | [
"php",
"numbers",
"substring"
] | 1 | 2 | 148 | 2 | 0 | 2011-06-01T17:34:46.627000 | 2011-06-01T17:37:09.210000 |
6,205,354 | 6,205,714 | Defining Drawable Shape with in JAVA code | Hi Can I define this shape without using xml code Thanks for your help | Yes use a ShapeDrawable to draw your rectangle with the padding you require using a Paint with the appropriate color and stroke width using a Linear gradient and adding this to the Paint as a shader | Defining Drawable Shape with in JAVA code Hi Can I define this shape without using xml code Thanks for your help | TITLE:
Defining Drawable Shape with in JAVA code
QUESTION:
Hi Can I define this shape without using xml code Thanks for your help
ANSWER:
Yes use a ShapeDrawable to draw your rectangle with the padding you require using a Paint with the appropriate color and stroke width using a Linear gradient and adding this to the... | [
"android",
"shapes"
] | 2 | 4 | 3,876 | 1 | 0 | 2011-06-01T17:34:49.103000 | 2011-06-01T18:06:37.667000 |
6,205,359 | 6,205,448 | send mail code not work for java EE 5 web project | I am using myeclipse 7, where i have added java EE 5 libraries witch i required.If i add the mail.jar externally to the application, it calling the javaee.jar from java EE 5 libraries.It's not using the mail.jar.If i remove java EE 5 libraries then it is working, But i require java EE 5 libraries. How can i send mail u... | You should not manually add container specific libraries like javaee.jar to your project. It would only lead to runtime troubles if you deploy and run the project on a container of a different make/version. The javaee.jar is specific to Glassfish. Since Glassfish by itself already ships with a mail.jar this suggests th... | send mail code not work for java EE 5 web project I am using myeclipse 7, where i have added java EE 5 libraries witch i required.If i add the mail.jar externally to the application, it calling the javaee.jar from java EE 5 libraries.It's not using the mail.jar.If i remove java EE 5 libraries then it is working, But i ... | TITLE:
send mail code not work for java EE 5 web project
QUESTION:
I am using myeclipse 7, where i have added java EE 5 libraries witch i required.If i add the mail.jar externally to the application, it calling the javaee.jar from java EE 5 libraries.It's not using the mail.jar.If i remove java EE 5 libraries then it ... | [
"java",
"email",
"java-ee-5"
] | 2 | 1 | 1,438 | 1 | 0 | 2011-06-01T17:35:18.873000 | 2011-06-01T17:44:02.990000 |
6,205,361 | 6,206,563 | WPF TabControl How to change Tab on mouse up rather than mouse down? | In the WPF TabControl the default behavior is to change the selected tab on mouse down. In my application changing the tab sometimes resizes things, and at times the mouse up event will get called on a another user control because the tabcontrol moved. If i can set the tab pages to switch only on mouse up rather than m... | You can use a custom TabItem like so: public class MyTabItem: TabItem {
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { if (e.Source == this ||!this.IsSelected) return;
base.OnMouseLeftButtonDown(e); }
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { if (e.Source == this ... | WPF TabControl How to change Tab on mouse up rather than mouse down? In the WPF TabControl the default behavior is to change the selected tab on mouse down. In my application changing the tab sometimes resizes things, and at times the mouse up event will get called on a another user control because the tabcontrol moved... | TITLE:
WPF TabControl How to change Tab on mouse up rather than mouse down?
QUESTION:
In the WPF TabControl the default behavior is to change the selected tab on mouse down. In my application changing the tab sometimes resizes things, and at times the mouse up event will get called on a another user control because th... | [
"c#",
"wpf",
"tabcontrol"
] | 5 | 2 | 1,301 | 2 | 0 | 2011-06-01T17:35:35.627000 | 2011-06-01T19:26:16.527000 |
6,205,364 | 6,209,154 | Javascript function works on postback but not page load | I'm using a Google Maps plugin, and I want it to show up on the page load as well as all postbacks. It seems to only work on postbacks though. Any ideas? I have the body onload tag as "body background="#ccccff" onload="initialize()"", but the function is not defined the first time. Why? Here is the code: | It is likely a timing issue with the onload function being called before the initialize function is ready. This is the reason libraries like jQuery have a document.ready function. You can try removing the onload and place a call to initialize() at the bottom of your HTML, just prior to the closing body tag. This will p... | Javascript function works on postback but not page load I'm using a Google Maps plugin, and I want it to show up on the page load as well as all postbacks. It seems to only work on postbacks though. Any ideas? I have the body onload tag as "body background="#ccccff" onload="initialize()"", but the function is not defin... | TITLE:
Javascript function works on postback but not page load
QUESTION:
I'm using a Google Maps plugin, and I want it to show up on the page load as well as all postbacks. It seems to only work on postbacks though. Any ideas? I have the body onload tag as "body background="#ccccff" onload="initialize()"", but the fun... | [
"javascript",
"asp.net-ajax"
] | 0 | 0 | 772 | 1 | 0 | 2011-06-01T17:36:10.200000 | 2011-06-02T00:13:42.800000 |
6,205,365 | 6,205,956 | jQuery - IE7 does not animate gif in modal dialogue | I have an animated gif that lets the user know a page is loading. The GIF does not animate in IE7. After some troubleshooting I know the problem can be caused by Preload event loading images in body tag (not the case). An IE Setting in Tools > Internet Options > Advanced tab > Multimedia section > "Play animations in w... | Nothing works. I've tried multiple workarounds. Similar questions on SO, the answers do not work if you need to POST. I didn't notice at first, but IE just stops all the animations (including the one I said was working) when the POST begins. Its impractical to convert everything to an ajax request. I'm agreeing with An... | jQuery - IE7 does not animate gif in modal dialogue I have an animated gif that lets the user know a page is loading. The GIF does not animate in IE7. After some troubleshooting I know the problem can be caused by Preload event loading images in body tag (not the case). An IE Setting in Tools > Internet Options > Advan... | TITLE:
jQuery - IE7 does not animate gif in modal dialogue
QUESTION:
I have an animated gif that lets the user know a page is loading. The GIF does not animate in IE7. After some troubleshooting I know the problem can be caused by Preload event loading images in body tag (not the case). An IE Setting in Tools > Intern... | [
"jquery",
"asp.net"
] | 0 | 1 | 2,612 | 2 | 0 | 2011-06-01T17:36:15.987000 | 2011-06-01T18:29:09.197000 |
6,205,367 | 6,205,801 | Deleting files on SDCard; The device thinks the files don't exist even though they do | I'm facing a problem in the following code. What I'm trying to do is delete a folder and all of it's contents. Sometimes it works and sometimes it doesn't. boolean success = false;
String directory = Environment.getExternalStorageDirectory().toString();
directory += "/.SID/Downloads/DC0601";
File path = new File(dir... | I see you're grabbing the external storage directory, but I don't see you checking it's state. What does Environment.getExternalStorageState() return? | Deleting files on SDCard; The device thinks the files don't exist even though they do I'm facing a problem in the following code. What I'm trying to do is delete a folder and all of it's contents. Sometimes it works and sometimes it doesn't. boolean success = false;
String directory = Environment.getExternalStorageDir... | TITLE:
Deleting files on SDCard; The device thinks the files don't exist even though they do
QUESTION:
I'm facing a problem in the following code. What I'm trying to do is delete a folder and all of it's contents. Sometimes it works and sometimes it doesn't. boolean success = false;
String directory = Environment.get... | [
"android",
"sd-card",
"delete-file"
] | 0 | 1 | 491 | 2 | 0 | 2011-06-01T17:36:21.010000 | 2011-06-01T18:14:36.780000 |
6,205,371 | 6,206,759 | jQuery namespace variable undeclared | I have the following JavaScript code: function LoadWord(currentLanguage, currentId, isBadWord) { var filePath, badFilePath; switch(currentLanguage) { case 'spanish': filePath = 'data/spanish.xml'; badFilePath = 'data/badSpanish.xml'; break; case 'catalan': filePath = 'data/catalan.xml'; badFilePath = 'data/badCatalan.x... | The correct answer is that I can't use an Array it is not initialized. I can do this inside success function: $.myNameSpace.badWords = new Array(3); And it will be available to any other function. | jQuery namespace variable undeclared I have the following JavaScript code: function LoadWord(currentLanguage, currentId, isBadWord) { var filePath, badFilePath; switch(currentLanguage) { case 'spanish': filePath = 'data/spanish.xml'; badFilePath = 'data/badSpanish.xml'; break; case 'catalan': filePath = 'data/catalan.x... | TITLE:
jQuery namespace variable undeclared
QUESTION:
I have the following JavaScript code: function LoadWord(currentLanguage, currentId, isBadWord) { var filePath, badFilePath; switch(currentLanguage) { case 'spanish': filePath = 'data/spanish.xml'; badFilePath = 'data/badSpanish.xml'; break; case 'catalan': filePath... | [
"jquery",
"undeclared-identifier"
] | 1 | 0 | 671 | 2 | 0 | 2011-06-01T17:36:28.467000 | 2011-06-01T19:44:57.893000 |
6,205,376 | 6,205,973 | Include Python scripts with Plone Add-on | I have a Plone Add-on (created through Zope) that includes Javascript and page template files. Some of the Javascript functions need to call Python scripts (through AJAX calls) - how to I include these Python scripts in my add-on without going through the ZMI? I have a "browser" folder which contains a "configure.zcml"... | You register your python as Views on the content object: Where INTERFACE is an interface of the object you want to have the view of, name is the view name (ie, http://path-to-object/@@name ), class is the Python class where your script is defined, and attribute is an optional method of the class (it defaults to __ call... | Include Python scripts with Plone Add-on I have a Plone Add-on (created through Zope) that includes Javascript and page template files. Some of the Javascript functions need to call Python scripts (through AJAX calls) - how to I include these Python scripts in my add-on without going through the ZMI? I have a "browser"... | TITLE:
Include Python scripts with Plone Add-on
QUESTION:
I have a Plone Add-on (created through Zope) that includes Javascript and page template files. Some of the Javascript functions need to call Python scripts (through AJAX calls) - how to I include these Python scripts in my add-on without going through the ZMI? ... | [
"python",
"scripting",
"plone",
"add-on"
] | 3 | 7 | 583 | 1 | 0 | 2011-06-01T17:36:33.023000 | 2011-06-01T18:30:26.720000 |
6,205,377 | 6,205,430 | Confused with rake error in Rails 3 | Noob trying to decipher what to do with the following error: rake aborted! You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec. Any help is greatly appreciated. | Try running bundle exec rake instead of just rake. This error will occur when you have a newer version of rake installed on your computer than the one specified in your Gemfile (or Gemfile.lock) | Confused with rake error in Rails 3 Noob trying to decipher what to do with the following error: rake aborted! You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec. Any help is greatly appreciated. | TITLE:
Confused with rake error in Rails 3
QUESTION:
Noob trying to decipher what to do with the following error: rake aborted! You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec. Any help is greatly appreciated.
ANSWER:
Try running bundle exec rake instead of just... | [
"ruby-on-rails-3",
"rake"
] | 10 | 13 | 3,957 | 5 | 0 | 2011-06-01T17:36:44.787000 | 2011-06-01T17:41:32.163000 |
6,205,380 | 6,205,436 | VB6 ADO Recordset Limit | Please don't laugh because I'm asking a VB6 question? I have to do some maintenance work. Does anyone know what the maximum number of rows can be returned to a VB6 ADO Recordset? If there is a limit, is there a preferred method for getting around it? | There is no limit (see link for documentation), but you can provide one if you want. There should be a MaxRecords property that you can set. You have to set it before you open the recordset. | VB6 ADO Recordset Limit Please don't laugh because I'm asking a VB6 question? I have to do some maintenance work. Does anyone know what the maximum number of rows can be returned to a VB6 ADO Recordset? If there is a limit, is there a preferred method for getting around it? | TITLE:
VB6 ADO Recordset Limit
QUESTION:
Please don't laugh because I'm asking a VB6 question? I have to do some maintenance work. Does anyone know what the maximum number of rows can be returned to a VB6 ADO Recordset? If there is a limit, is there a preferred method for getting around it?
ANSWER:
There is no limit ... | [
"vb6",
"ado",
"recordset"
] | 6 | 5 | 12,067 | 2 | 0 | 2011-06-01T17:36:58.720000 | 2011-06-01T17:42:31.290000 |
6,205,393 | 6,217,072 | New SQLite mixed assemblies | Previously.NET SQLite libraries were available from http://sqlite.phxsoftware.com, but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page. The new packages don't seem to contain mixed assemblies anymore (single assembly containing sqlite3.dll and the.NET wrapper).... | I found the solution. The problem was due to a known issue with SQLite.Interop.dll. This is the workaround from that worked for me. Using Dependency Walker from http://dependencywalker.com/ to look at SQLite.Interop.dll (x86 and x64) shows that it depends on MSVCR100.dll. The old 1.0.66.0 version of System.Data.SQLite.... | New SQLite mixed assemblies Previously.NET SQLite libraries were available from http://sqlite.phxsoftware.com, but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page. The new packages don't seem to contain mixed assemblies anymore (single assembly containing sqlit... | TITLE:
New SQLite mixed assemblies
QUESTION:
Previously.NET SQLite libraries were available from http://sqlite.phxsoftware.com, but they have recently been taken over by the main SQLite team and have moved System.Data.SQLite Download Page. The new packages don't seem to contain mixed assemblies anymore (single assembl... | [
".net",
"sqlite",
"iis",
"mixed-mode"
] | 26 | 18 | 14,683 | 4 | 0 | 2011-06-01T17:37:48.460000 | 2011-06-02T16:04:19.100000 |
6,205,396 | 6,205,438 | Android Layout Wrap Around Image? | I currently have 2 textviews one is a number and the next is some text. The number appears in the top lefthand corner of the screen and the text is meant to appear next to it. But what I really want is the text to wrap around the number next to and under it. Is there a way of doing this? Like you can wrap text around a... | I don't think this can be accomplished without writing your own class extending ViewGroup. It's either that, or embedding a WebView for displaying this part of the screen. | Android Layout Wrap Around Image? I currently have 2 textviews one is a number and the next is some text. The number appears in the top lefthand corner of the screen and the text is meant to appear next to it. But what I really want is the text to wrap around the number next to and under it. Is there a way of doing thi... | TITLE:
Android Layout Wrap Around Image?
QUESTION:
I currently have 2 textviews one is a number and the next is some text. The number appears in the top lefthand corner of the screen and the text is meant to appear next to it. But what I really want is the text to wrap around the number next to and under it. Is there ... | [
"android",
"xml",
"layout"
] | 0 | 1 | 1,173 | 1 | 0 | 2011-06-01T17:37:54.753000 | 2011-06-01T17:43:20.433000 |
6,205,429 | 6,210,629 | Specifying directory for checkout | I'm not sure if the following is possible or not: I have uploaded my Maven project test-app to my repository. I would now like to go onto a different machine and checkout this project from the repository so I can later build it. I enter the following onto the command line: C:\projects\workspace\testproject>mvn scm:chec... | You could try -Dbasedir=. If that does not help, scm:checkout goal seems to have checkoutDirectory parameter, which you can try using. Also, you may want to look at scm:bootstrap to build the project from a fresh copy of the source in the scm repository | Specifying directory for checkout I'm not sure if the following is possible or not: I have uploaded my Maven project test-app to my repository. I would now like to go onto a different machine and checkout this project from the repository so I can later build it. I enter the following onto the command line: C:\projects\... | TITLE:
Specifying directory for checkout
QUESTION:
I'm not sure if the following is possible or not: I have uploaded my Maven project test-app to my repository. I would now like to go onto a different machine and checkout this project from the repository so I can later build it. I enter the following onto the command ... | [
"maven"
] | 0 | 1 | 192 | 1 | 0 | 2011-06-01T17:41:28.737000 | 2011-06-02T05:04:53.693000 |
6,205,432 | 6,207,674 | Core Data: setPrimitiveValue and saving changes | In Core Data, is there some trick to saving changes to managed objects' attributes when the changes were made with setPrimitiveValue versus the object's regular accessor methods? I've switched to using setPrimitiveValue and setPrimitiveAttributeName in a few scenarios in order to avoid triggering my FRC's notification ... | If you don't want the code in the notification handlers to execute (BTW, why would you want that?), it might be easier to disable that, instead of completely avoiding the notifications. Also, remember that Core Data uses those notifications to update your relationships and maintain coherence in your model when you make... | Core Data: setPrimitiveValue and saving changes In Core Data, is there some trick to saving changes to managed objects' attributes when the changes were made with setPrimitiveValue versus the object's regular accessor methods? I've switched to using setPrimitiveValue and setPrimitiveAttributeName in a few scenarios in ... | TITLE:
Core Data: setPrimitiveValue and saving changes
QUESTION:
In Core Data, is there some trick to saving changes to managed objects' attributes when the changes were made with setPrimitiveValue versus the object's regular accessor methods? I've switched to using setPrimitiveValue and setPrimitiveAttributeName in a... | [
"iphone",
"ios",
"core-data",
"save",
"primitive"
] | 0 | 2 | 1,772 | 1 | 0 | 2011-06-01T17:42:01.963000 | 2011-06-01T21:05:13.510000 |
6,205,433 | 6,217,029 | JComboBox focus and mouse click events not working | Edit Downvoter, how is this a bad question? I have provided runnable example code of the issue. If it works for you please let me know or point out what is unclear. Hello, in the code below which has a single JComboBox in a JFrame, I am not notified when the mouse enters the JComboBox or is clicked or focus gained. How... | Possibly the downvoter took offense at your use of Netbeans GUI editor. I don't like it myself, but you're welcome to use it if you find that you can actually maintain a complex gui with it. I personally hate it due to various extremely annoying bugs that only show themselves when you're trying to edit the form and it ... | JComboBox focus and mouse click events not working Edit Downvoter, how is this a bad question? I have provided runnable example code of the issue. If it works for you please let me know or point out what is unclear. Hello, in the code below which has a single JComboBox in a JFrame, I am not notified when the mouse ente... | TITLE:
JComboBox focus and mouse click events not working
QUESTION:
Edit Downvoter, how is this a bad question? I have provided runnable example code of the issue. If it works for you please let me know or point out what is unclear. Hello, in the code below which has a single JComboBox in a JFrame, I am not notified w... | [
"events",
"swing",
"jcombobox"
] | 8 | 12 | 13,713 | 3 | 0 | 2011-06-01T17:42:17.953000 | 2011-06-02T16:00:32.633000 |
6,205,440 | 6,205,507 | php documentation tags in git | is there a way to automatically get git/github to update the doc tags in a PHP document to reflect the current version/tag? Something like /** * @version {tag} - {date} * @package My Product * @copyright (C) 2011 Me Inc. * @license see mylicense.txt */ If I go in and manually do a find/replace for these tags then it me... | You would have to tag after you change the code comment. Git bases the ids of commits based upon the contents of them. It's better for build artifacts to contain version references. You can also take a look at smudge/clean scripts. Hope this helps. | php documentation tags in git is there a way to automatically get git/github to update the doc tags in a PHP document to reflect the current version/tag? Something like /** * @version {tag} - {date} * @package My Product * @copyright (C) 2011 Me Inc. * @license see mylicense.txt */ If I go in and manually do a find/rep... | TITLE:
php documentation tags in git
QUESTION:
is there a way to automatically get git/github to update the doc tags in a PHP document to reflect the current version/tag? Something like /** * @version {tag} - {date} * @package My Product * @copyright (C) 2011 Me Inc. * @license see mylicense.txt */ If I go in and manu... | [
"php",
"git",
"documentation",
"github"
] | 1 | 1 | 394 | 1 | 0 | 2011-06-01T17:43:32.070000 | 2011-06-01T17:49:03.240000 |
6,205,441 | 6,216,128 | Multirow multicolumn table | I need to create the following table in LaTeX and I just cannot seem to get it right. The text inside the cells is not centered correctly and the same goes for the "Eye movements" cell. Could any of you see what I doing wrong? \begin{tabular}{ccc|c} & & \multicolumn{2}{c}{\textbf{Response}} \\ & & unnatural & natural \... | Thanks for the pointer. I finally made it work with the following code: \begin{table}[h]\centering \def \BoxWidth {3.5cm} \def \BoxHeight {2cm} \def \SWidth {0.2cm} \newcolumntype{M}{>{\centering\arraybackslash}m{\BoxWidth}} \newcolumntype{S}{>{\centering\arraybackslash}m{\SWidth}} \newcolumntype{R}{>{\raggedright\arra... | Multirow multicolumn table I need to create the following table in LaTeX and I just cannot seem to get it right. The text inside the cells is not centered correctly and the same goes for the "Eye movements" cell. Could any of you see what I doing wrong? \begin{tabular}{ccc|c} & & \multicolumn{2}{c}{\textbf{Response}} \... | TITLE:
Multirow multicolumn table
QUESTION:
I need to create the following table in LaTeX and I just cannot seem to get it right. The text inside the cells is not centered correctly and the same goes for the "Eye movements" cell. Could any of you see what I doing wrong? \begin{tabular}{ccc|c} & & \multicolumn{2}{c}{\t... | [
"latex"
] | 2 | 2 | 5,610 | 2 | 0 | 2011-06-01T17:43:32.747000 | 2011-06-02T14:46:53.303000 |
6,205,442 | 6,205,529 | How to find datetime 10 mins after current time? | I want to find out the datetime 10 mins after current time. Let's say we have from datetime import datetime now = datetime.now() new_now = datetime.strptime(now, '%a, %d %b %Y %H:%M:%S %Z') I want to find this now and new_now 10 minutes later. How can I do that? | This is a duplicate of this question. You basically just need to add a timedelta of 10 minutes to get the time you want. from datetime import datetime, timedelta now = datetime.now() now_plus_10 = now + timedelta(minutes = 10) | How to find datetime 10 mins after current time? I want to find out the datetime 10 mins after current time. Let's say we have from datetime import datetime now = datetime.now() new_now = datetime.strptime(now, '%a, %d %b %Y %H:%M:%S %Z') I want to find this now and new_now 10 minutes later. How can I do that? | TITLE:
How to find datetime 10 mins after current time?
QUESTION:
I want to find out the datetime 10 mins after current time. Let's say we have from datetime import datetime now = datetime.now() new_now = datetime.strptime(now, '%a, %d %b %Y %H:%M:%S %Z') I want to find this now and new_now 10 minutes later. How can I... | [
"python",
"datetime"
] | 95 | 187 | 134,759 | 3 | 0 | 2011-06-01T17:43:37.050000 | 2011-06-01T17:51:16.077000 |
6,205,445 | 6,205,487 | Checking that float modulo int is finite ordinal | In a for-loop, I'm integrating with respect to time with constant, fractional time step, dt. I only want to save the simulation results for integral (finite ordinal) time points. My solution is as follows, dt = 0.1 steps = 100
for step in range(steps): if (step*dt) % 1 == 0.0: print step I've never really trusted modu... | This is dangerous, in any programming language. In your example, 0.1 cannot be represented exactly by in floating-point, so that test will never pass (well I suppose it may do after 2^24 iterations or so). In many cases, the step size may not have an exact representation in floating-point, so that the accumulated round... | Checking that float modulo int is finite ordinal In a for-loop, I'm integrating with respect to time with constant, fractional time step, dt. I only want to save the simulation results for integral (finite ordinal) time points. My solution is as follows, dt = 0.1 steps = 100
for step in range(steps): if (step*dt) % 1 ... | TITLE:
Checking that float modulo int is finite ordinal
QUESTION:
In a for-loop, I'm integrating with respect to time with constant, fractional time step, dt. I only want to save the simulation results for integral (finite ordinal) time points. My solution is as follows, dt = 0.1 steps = 100
for step in range(steps):... | [
"python",
"floating-point",
"modulo"
] | 2 | 2 | 433 | 2 | 0 | 2011-06-01T17:43:56.673000 | 2011-06-01T17:47:33.073000 |
6,205,450 | 6,205,509 | Emacs Configuration | I am trying to get started with Emacs/Clojure. What is the proper way to install emacs extensions. I am trying to install the the following plugin: https://bitbucket.org/kotarak/vimclojure I have placed it in ~/.emacs/plugins but it does not work. | In general there is quite some amical animosity between the Vi users and the Emacs users. I am quite certain that trying to make a Vim plugin work in Emacs is quite impossible. For emacs use I suggest you checkout clojurebox if you 're on windows as it contains a preconfigured emacs environment. On Unix like environmen... | Emacs Configuration I am trying to get started with Emacs/Clojure. What is the proper way to install emacs extensions. I am trying to install the the following plugin: https://bitbucket.org/kotarak/vimclojure I have placed it in ~/.emacs/plugins but it does not work. | TITLE:
Emacs Configuration
QUESTION:
I am trying to get started with Emacs/Clojure. What is the proper way to install emacs extensions. I am trying to install the the following plugin: https://bitbucket.org/kotarak/vimclojure I have placed it in ~/.emacs/plugins but it does not work.
ANSWER:
In general there is quite... | [
"emacs",
"clojure"
] | 3 | 6 | 670 | 4 | 0 | 2011-06-01T17:44:12.980000 | 2011-06-01T17:49:20.803000 |
6,205,453 | 6,205,499 | How to detect if javascript is executing on page | Is there a way to detect if javascript is executing a script using either JQuery, javascript, WebDriver, or C# (like a browser API or something)? For example, say I'm on a webpage and I just selected a U.S. State (let's say California) from a picklist, and some javascript is now loading a second picklist with all the c... | Your question could be taken several ways. Are you trying to see if javascript is enabled on the browser from your server-side code? I have done this by sending a small page with a form field and some javascript to populate that field and post-back. if the post-back doesn't happen, the page says something about 'javasc... | How to detect if javascript is executing on page Is there a way to detect if javascript is executing a script using either JQuery, javascript, WebDriver, or C# (like a browser API or something)? For example, say I'm on a webpage and I just selected a U.S. State (let's say California) from a picklist, and some javascrip... | TITLE:
How to detect if javascript is executing on page
QUESTION:
Is there a way to detect if javascript is executing a script using either JQuery, javascript, WebDriver, or C# (like a browser API or something)? For example, say I'm on a webpage and I just selected a U.S. State (let's say California) from a picklist, ... | [
"c#",
"javascript",
"jquery",
"webdriver"
] | 1 | 1 | 3,396 | 5 | 0 | 2011-06-01T17:44:22.337000 | 2011-06-01T17:48:29.323000 |
6,205,457 | 6,221,876 | WCF Data Services and Entity Framework Code First? | Does WCF Data Services support working with Entity Framework Code First (4.1)? It seems like it's having a hard time understanding what to do with DbSet or DbContext. I suppose this shouldn't be too surprising since EFCF was released after Data Services. internal class Context:DbContext { public Context(String nameOrCo... | You need to install Microsoft WCF Data Services 2011 CTP2. Here is a good step by step article from the ADO.NET Team Blog: Using WCF Data Services with Entity Framework 4.1 and Code First You will need to change the reference for “System.Data.Services” and “System.Data.Services.Client” to “Microsoft.Data.Services” and ... | WCF Data Services and Entity Framework Code First? Does WCF Data Services support working with Entity Framework Code First (4.1)? It seems like it's having a hard time understanding what to do with DbSet or DbContext. I suppose this shouldn't be too surprising since EFCF was released after Data Services. internal class... | TITLE:
WCF Data Services and Entity Framework Code First?
QUESTION:
Does WCF Data Services support working with Entity Framework Code First (4.1)? It seems like it's having a hard time understanding what to do with DbSet or DbContext. I suppose this shouldn't be too surprising since EFCF was released after Data Servic... | [
"entity-framework-4.1",
"wcf-data-services"
] | 2 | 2 | 3,291 | 2 | 0 | 2011-06-01T17:44:53.163000 | 2011-06-03T00:34:41.543000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.