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,193,744 | 6,193,761 | What would be an alternate to [TearDown] and [SetUp] in MSTest? | When I use MSTest Framework, and copy the code that Selenium IDE generated for me, MSTest doesn't recognize [TearDown] and [SetUp]. What is the alternative to this? | You would use [TestCleanup] and [TestInitialize] respectively. | What would be an alternate to [TearDown] and [SetUp] in MSTest? When I use MSTest Framework, and copy the code that Selenium IDE generated for me, MSTest doesn't recognize [TearDown] and [SetUp]. What is the alternative to this? | TITLE:
What would be an alternate to [TearDown] and [SetUp] in MSTest?
QUESTION:
When I use MSTest Framework, and copy the code that Selenium IDE generated for me, MSTest doesn't recognize [TearDown] and [SetUp]. What is the alternative to this?
ANSWER:
You would use [TestCleanup] and [TestInitialize] respectively. | [
"c#",
"selenium",
"automated-tests",
"mstest"
] | 269 | 316 | 99,524 | 4 | 0 | 2011-05-31T21:24:34.647000 | 2011-05-31T21:26:32.190000 |
6,193,749 | 6,233,603 | getTabHost() is returning null | I am following the directions for a TabLayout. Everything is pretty much an exact copy from that page. public class DashboardActivity extends TabActivity { the problem is that in this line TabHost tabHost = getTabHost();, tabHost is always null, which causes a null pointer exception in the TabActivity base class. Is th... | Try putting all of the code for buildTabs() in your onCreate() method. | getTabHost() is returning null I am following the directions for a TabLayout. Everything is pretty much an exact copy from that page. public class DashboardActivity extends TabActivity { the problem is that in this line TabHost tabHost = getTabHost();, tabHost is always null, which causes a null pointer exception in th... | TITLE:
getTabHost() is returning null
QUESTION:
I am following the directions for a TabLayout. Everything is pretty much an exact copy from that page. public class DashboardActivity extends TabActivity { the problem is that in this line TabHost tabHost = getTabHost();, tabHost is always null, which causes a null point... | [
"java",
"android",
"nullpointerexception",
"tabactivity"
] | 1 | 2 | 1,486 | 2 | 0 | 2011-05-31T21:25:08.540000 | 2011-06-03T23:29:11.220000 |
6,193,756 | 6,193,950 | CSS3 transition with Javascript | i have this Webpage on which with mouse over, the element rotates and goes back to original position on mouseout. Note: This example does not work in Internet Explorer. Hover over the div element above, to see the transition effect. Now Is it possible to trigger this transition using JavaScript and not the defualt hove... | I believe all you need to do is fire a change the style of the element you want to modify when particular events happen. Also, I changed the DOCTYPE to use HTML5. Give this a try: Note: This example does not work in Internet Explorer. Hover over the div element above, to see the transition effect. Hover over the div el... | CSS3 transition with Javascript i have this Webpage on which with mouse over, the element rotates and goes back to original position on mouseout. Note: This example does not work in Internet Explorer. Hover over the div element above, to see the transition effect. Now Is it possible to trigger this transition using Jav... | TITLE:
CSS3 transition with Javascript
QUESTION:
i have this Webpage on which with mouse over, the element rotates and goes back to original position on mouseout. Note: This example does not work in Internet Explorer. Hover over the div element above, to see the transition effect. Now Is it possible to trigger this tr... | [
"javascript",
"html",
"css"
] | 2 | 3 | 21,140 | 5 | 0 | 2011-05-31T21:25:44.250000 | 2011-05-31T21:47:27.740000 |
6,193,762 | 6,193,797 | Webkit css box issue | I have a css3 boxflex layout in webkit, but for some reason, #main (the purple one) isn't filling 100% of the screen like the css is telling it to: http://jsfiddle.net/qxxZv/ How do I get it to fill the whole height available? This is just a basic layout with header, middle area with sidebar/content, and a footer. | Hey, you need your html and body tag to have a height of 100%: html,body {margin:0;padding:0; height: 100%;} jsFiddle example here: http://jsfiddle.net/jackrugile/63bg2/ | Webkit css box issue I have a css3 boxflex layout in webkit, but for some reason, #main (the purple one) isn't filling 100% of the screen like the css is telling it to: http://jsfiddle.net/qxxZv/ How do I get it to fill the whole height available? This is just a basic layout with header, middle area with sidebar/conten... | TITLE:
Webkit css box issue
QUESTION:
I have a css3 boxflex layout in webkit, but for some reason, #main (the purple one) isn't filling 100% of the screen like the css is telling it to: http://jsfiddle.net/qxxZv/ How do I get it to fill the whole height available? This is just a basic layout with header, middle area w... | [
"html",
"css",
"webkit"
] | 0 | 1 | 93 | 1 | 0 | 2011-05-31T21:26:35.163000 | 2011-05-31T21:30:17.593000 |
6,193,763 | 6,193,793 | ASIHTTPRequest-multiple request | I am developing an app that will request the profile picture URL of some users from Facebook servers, but I don't know how many users I will have (it might be 2 or it might be 20). Should I use ASIHTTPRequest with a loop and a synchronous request, or the API graph (with Facebook SDK for iOS) with a loop? | Trying using ASINetworkQueue. It will allow you to create a queue of ASIHTTPRequests that can still be started asynchronously. For example - (void)getImages { if(!self.queue) self.queue = [[[ASINetworkQueue alloc] init] autorelease];
NSArray* urlStringsToRequest = [NSArray arrayWithObjects:@"http://www.example.com/ima... | ASIHTTPRequest-multiple request I am developing an app that will request the profile picture URL of some users from Facebook servers, but I don't know how many users I will have (it might be 2 or it might be 20). Should I use ASIHTTPRequest with a loop and a synchronous request, or the API graph (with Facebook SDK for ... | TITLE:
ASIHTTPRequest-multiple request
QUESTION:
I am developing an app that will request the profile picture URL of some users from Facebook servers, but I don't know how many users I will have (it might be 2 or it might be 20). Should I use ASIHTTPRequest with a loop and a synchronous request, or the API graph (with... | [
"iphone",
"facebook",
"asihttprequest"
] | 3 | 7 | 4,318 | 1 | 0 | 2011-05-31T21:26:40.757000 | 2011-05-31T21:30:08.963000 |
6,193,776 | 6,193,848 | First time deploying rails app, cant get passenger to work? | Used railsready, then passenger w/ apache2, finally copied my app to /home/myapp. Inserted the passenger config lines into /etc/apache2/apache.conf at the bottom along with my virtual host settings: The servers name is rails. LoadModule passenger_module /home/myapp/.rvm/gems/ruby-1.9.2-p180/gems/passenger-3.0.7/ext/apa... | You declared a ServerName so you must use it to access this VirtualHost (and not the IP address as you mentioned). Connect to http://rails/ For this to work, the hostname rails must resolv to your server's IP. You can add it to you hosts file or use a real domain name configured to resolve to this IP. Or you can change... | First time deploying rails app, cant get passenger to work? Used railsready, then passenger w/ apache2, finally copied my app to /home/myapp. Inserted the passenger config lines into /etc/apache2/apache.conf at the bottom along with my virtual host settings: The servers name is rails. LoadModule passenger_module /home/... | TITLE:
First time deploying rails app, cant get passenger to work?
QUESTION:
Used railsready, then passenger w/ apache2, finally copied my app to /home/myapp. Inserted the passenger config lines into /etc/apache2/apache.conf at the bottom along with my virtual host settings: The servers name is rails. LoadModule passe... | [
"ruby-on-rails",
"ruby-on-rails-3",
"passenger"
] | 0 | 2 | 487 | 2 | 0 | 2011-05-31T21:27:40.200000 | 2011-05-31T21:35:32.347000 |
6,193,779 | 6,193,800 | Python readline from pipe on Linux | When creating a pipe with os.pipe() it returns 2 file numbers; a read end and a write end which can be written to and read form with os.write() / os.read(); there is no os.readline(). Is it possible to use readline? import os readEnd, writeEnd = os.pipe() # something somewhere writes to the pipe firstLine = readEnd.rea... | You can use os.fdopen() to get a file-like object from a file descriptor. import os readEnd, writeEnd = os.pipe() readFile = os.fdopen(readEnd) firstLine = readFile.readline() | Python readline from pipe on Linux When creating a pipe with os.pipe() it returns 2 file numbers; a read end and a write end which can be written to and read form with os.write() / os.read(); there is no os.readline(). Is it possible to use readline? import os readEnd, writeEnd = os.pipe() # something somewhere writes ... | TITLE:
Python readline from pipe on Linux
QUESTION:
When creating a pipe with os.pipe() it returns 2 file numbers; a read end and a write end which can be written to and read form with os.write() / os.read(); there is no os.readline(). Is it possible to use readline? import os readEnd, writeEnd = os.pipe() # something... | [
"python",
"pipe",
"readline"
] | 6 | 13 | 10,960 | 5 | 0 | 2011-05-31T21:28:02.350000 | 2011-05-31T21:30:27.333000 |
6,193,781 | 6,208,074 | AXIS1: How to personalize the "binding name" | We had the following generated webservices with axis1 tools: and the client want to us change the line: for: Q: How we can change that word? (WSExamplePortSoapBinding to WSExampleBinding). We had searched on the axis source code, but we can't find were is generated that name. Thanks for the help, | I solved this issue like this: In the server-config.wsdd file: I have to replace to: Then I have to modify the axis-1.4 source code like this: setBindingName(getServicePortName() + "SoapBinding"); I have to replace to: setBindingName(getServicePortName() + "Binding"); Then I have to make the JAR with ant and copy the n... | AXIS1: How to personalize the "binding name" We had the following generated webservices with axis1 tools: and the client want to us change the line: for: Q: How we can change that word? (WSExamplePortSoapBinding to WSExampleBinding). We had searched on the axis source code, but we can't find were is generated that name... | TITLE:
AXIS1: How to personalize the "binding name"
QUESTION:
We had the following generated webservices with axis1 tools: and the client want to us change the line: for: Q: How we can change that word? (WSExamplePortSoapBinding to WSExampleBinding). We had searched on the axis source code, but we can't find were is g... | [
"java",
"axis"
] | 1 | 1 | 595 | 1 | 0 | 2011-05-31T21:28:06.143000 | 2011-06-01T21:41:27.393000 |
6,193,794 | 6,194,436 | Prepared statement returning zero results | I am attempting to execute the following prepared statement: PREPARE stmt FROM 'SELECT * FROM Inventory I WHERE I.ParentId =?'; EXECUTE stmt USING @parentId; DEALLOCATE PREPARE stmt; When I execute this statement, it returns the column headers with no rows. It should return 6 rows. If I execute this same statement as a... | User variable @parentId and procedure argument parentID are independent. You need to set your user variable to procedure argument before executing statement. SET @parentID = parentId; | Prepared statement returning zero results I am attempting to execute the following prepared statement: PREPARE stmt FROM 'SELECT * FROM Inventory I WHERE I.ParentId =?'; EXECUTE stmt USING @parentId; DEALLOCATE PREPARE stmt; When I execute this statement, it returns the column headers with no rows. It should return 6 r... | TITLE:
Prepared statement returning zero results
QUESTION:
I am attempting to execute the following prepared statement: PREPARE stmt FROM 'SELECT * FROM Inventory I WHERE I.ParentId =?'; EXECUTE stmt USING @parentId; DEALLOCATE PREPARE stmt; When I execute this statement, it returns the column headers with no rows. It... | [
"mysql",
"sql"
] | 0 | 1 | 136 | 1 | 0 | 2011-05-31T21:30:09.683000 | 2011-05-31T22:50:37.847000 |
6,193,805 | 6,194,030 | Model specified for CakePHP Views | Hey all, have a slight problem here. In CakePHP I have a controller that uses several models. When creating a form in a view, the view will always name my UI elements based on what the first model is when I specify $uses = array('Model') so for instance if my User model is the first in my array then my UI elements will... | When creating a form use the full dot notation: echo $this->Form->create('ModelName'); echo $this->Form->text('ModelName.field_name'); echo $this->Form->input('ModelName.field_name'); | Model specified for CakePHP Views Hey all, have a slight problem here. In CakePHP I have a controller that uses several models. When creating a form in a view, the view will always name my UI elements based on what the first model is when I specify $uses = array('Model') so for instance if my User model is the first in... | TITLE:
Model specified for CakePHP Views
QUESTION:
Hey all, have a slight problem here. In CakePHP I have a controller that uses several models. When creating a form in a view, the view will always name my UI elements based on what the first model is when I specify $uses = array('Model') so for instance if my User mod... | [
"php",
"forms",
"cakephp",
"view",
"controller"
] | 0 | 2 | 63 | 1 | 0 | 2011-05-31T21:31:08.683000 | 2011-05-31T21:55:38.640000 |
6,193,812 | 6,195,571 | .NET or ActiveX component for playing common video formats | I'm looking for any reliable, commercial or freeware component to add video playback support in.NET application. Tried numerous options and packages and none of them seem to handle playback of common formats. The most common option - Windows Media Player ActiveX - is quite good, but requires WMPlayer to be installed on... | Have you tried VLC (VideoLan Client)? It is a self-contained, open source media player that you can use in.net applications as an ActiveX control. You will need to verify the license though, but I think it is safe to redistribute the official binaries. | .NET or ActiveX component for playing common video formats I'm looking for any reliable, commercial or freeware component to add video playback support in.NET application. Tried numerous options and packages and none of them seem to handle playback of common formats. The most common option - Windows Media Player Active... | TITLE:
.NET or ActiveX component for playing common video formats
QUESTION:
I'm looking for any reliable, commercial or freeware component to add video playback support in.NET application. Tried numerous options and packages and none of them seem to handle playback of common formats. The most common option - Windows M... | [
".net",
"video",
"directshow",
"playback",
"directshow.net"
] | 1 | 0 | 799 | 1 | 0 | 2011-05-31T21:31:48.323000 | 2011-06-01T02:20:32.960000 |
6,193,814 | 6,207,867 | Using NSPredicate to analyze strings | Howdy! This question is pretty long so be sure to have a seat first:) At one point in my code I get a string from the user, and I analyze that string. By analyzing I mean going through every character and mathcing it against a predicate the user has set in an NSPredicateEditor. The predicate is setup progamatically thi... | So the main question: Can you build an NSPredicateEditorRowTemplate that uses different constants than what's displayed in the user interface? Answer: yes. You used to be able to set this up in Interface Builder, but my attempts to do so in Xcode 4 have been unsuccessful. It's possible that the capability was removed i... | Using NSPredicate to analyze strings Howdy! This question is pretty long so be sure to have a seat first:) At one point in my code I get a string from the user, and I analyze that string. By analyzing I mean going through every character and mathcing it against a predicate the user has set in an NSPredicateEditor. The ... | TITLE:
Using NSPredicate to analyze strings
QUESTION:
Howdy! This question is pretty long so be sure to have a seat first:) At one point in my code I get a string from the user, and I analyze that string. By analyzing I mean going through every character and mathcing it against a predicate the user has set in an NSPre... | [
"objective-c",
"string",
"nspredicate",
"nspredicateeditor"
] | 3 | 3 | 1,317 | 2 | 0 | 2011-05-31T21:31:51.320000 | 2011-06-01T21:21:58.197000 |
6,193,822 | 6,194,152 | Using virtual com port on windows mobile | I have a windows mobile device which is running windows CE 5.0. I want to now connect a hardware to the USB port and communicate with the hardware by configuring it as a virutal com port and writing/reading bytes to/from it. Do i have to write a virual com driver for the windows mobile device? Please note that the hard... | Windows Mobile!= Windows CE 5.0, so first you need to verify what your hardware is actually running. Second, you have to verify what the "USB port" is. USB has two "modes" - Host and CLient - and they are different both physically and in software. If it's the port that you hoos the device to the PC through, then it's a... | Using virtual com port on windows mobile I have a windows mobile device which is running windows CE 5.0. I want to now connect a hardware to the USB port and communicate with the hardware by configuring it as a virutal com port and writing/reading bytes to/from it. Do i have to write a virual com driver for the windows... | TITLE:
Using virtual com port on windows mobile
QUESTION:
I have a windows mobile device which is running windows CE 5.0. I want to now connect a hardware to the USB port and communicate with the hardware by configuring it as a virutal com port and writing/reading bytes to/from it. Do i have to write a virual com driv... | [
"windows-mobile",
"serial-port",
"windows-ce",
"virtual"
] | 0 | 0 | 3,966 | 1 | 0 | 2011-05-31T21:32:33.447000 | 2011-05-31T22:08:47.590000 |
6,193,827 | 6,193,864 | Static variables and functions usage | I have the following class definition and the main(). Can someone please point me why I am getting the error? #include #include using namespace std;
class test { protected: static list a; public: test() { a.push_back(150); } static void send(int c) { if (c==1) cout< The error that I get is as follows: /tmp/ccre4um4.o:... | You've declared test::a, but you haven't defined it. Add the definition in namespace scope: list test::a; | Static variables and functions usage I have the following class definition and the main(). Can someone please point me why I am getting the error? #include #include using namespace std;
class test { protected: static list a; public: test() { a.push_back(150); } static void send(int c) { if (c==1) cout< The error that ... | TITLE:
Static variables and functions usage
QUESTION:
I have the following class definition and the main(). Can someone please point me why I am getting the error? #include #include using namespace std;
class test { protected: static list a; public: test() { a.push_back(150); } static void send(int c) { if (c==1) cou... | [
"c++",
"static-variables",
"static-functions"
] | 0 | 6 | 114 | 2 | 0 | 2011-05-31T21:33:22.350000 | 2011-05-31T21:38:06.480000 |
6,193,856 | 6,197,114 | Correct form of RTS/CTS Flow Control with FTDI's D2XX Interface | I was going through the example code on FTDI's website. After opening the device and setting the flow control to be RTS/CTS they send and receive data in the following manner: ' Set RTS FT_Status = FT_SetRts(FT_Handle) If FT_Status <> FT_OK Then Exit Sub End If ' Set DTR FT_Status = FT_SetDtr(FT_Handle) If FT_Status <>... | The correct way would be to always return the signals to their inactive state. If you do not have data to send immediately clear RTS. DTR is usually used to indicate the presence of terminal equipment on a link so it should always stay in the active state unless there is a failure on your side. I do not agree with the ... | Correct form of RTS/CTS Flow Control with FTDI's D2XX Interface I was going through the example code on FTDI's website. After opening the device and setting the flow control to be RTS/CTS they send and receive data in the following manner: ' Set RTS FT_Status = FT_SetRts(FT_Handle) If FT_Status <> FT_OK Then Exit Sub E... | TITLE:
Correct form of RTS/CTS Flow Control with FTDI's D2XX Interface
QUESTION:
I was going through the example code on FTDI's website. After opening the device and setting the flow control to be RTS/CTS they send and receive data in the following manner: ' Set RTS FT_Status = FT_SetRts(FT_Handle) If FT_Status <> FT_... | [
".net",
"vb.net",
"embedded",
"serial-port"
] | 1 | 2 | 4,108 | 2 | 0 | 2011-05-31T21:36:38.900000 | 2011-06-01T06:27:16.010000 |
6,193,865 | 6,193,880 | Is there a magic class function that can get a class constructor to take arguments like an associative array? | I have some code that looks something like this: $city, "streetname" => $streetname, "housenumber" => $housenumber);
$address = new address($addr);?> This just seems slightly redundant to me. Could I write the address to class to take this constructor? $city, "streetname" => $streetname, "housenumber" => $housenumber)... | That is reminiscent of an idea called named parameters (seen in Python, Objective-C and C#), which PHP unfortunately doesn't support, nor do its developers plan to add support for anytime. | Is there a magic class function that can get a class constructor to take arguments like an associative array? I have some code that looks something like this: $city, "streetname" => $streetname, "housenumber" => $housenumber);
$address = new address($addr);?> This just seems slightly redundant to me. Could I write the... | TITLE:
Is there a magic class function that can get a class constructor to take arguments like an associative array?
QUESTION:
I have some code that looks something like this: $city, "streetname" => $streetname, "housenumber" => $housenumber);
$address = new address($addr);?> This just seems slightly redundant to me.... | [
"php",
"class",
"function",
"magic-methods"
] | 0 | 1 | 76 | 1 | 0 | 2011-05-31T21:38:15.793000 | 2011-05-31T21:39:22.953000 |
6,193,866 | 6,194,456 | Accessing hash reference in perl | I am wondering if the following is possible to do in perl. It will save 40-50 lines of code. I have a hash data structure like following: hash_Ref->{a}->{b}->{c}->{d}->{e}->{'count'}=30 I am wondering is there a way I can do the following: my $hash_ref_1 = ash_Ref->{a}->{b}->{c}->{d}; and then use: $hash_ref_2->{e}. So... | # 'a' => { 'count' => 2, 'b' => { 'count' => 2, 'c' =>......} }
sub build_hash { $_[0] ||= {}; my $hash = shift; for (@_) { $hash = $hash->{$_} ||= {}; ++$hash->{count}; } }
build_hash($hash, @array1); build_hash($hash, @array2); If you wanted to use autovivification, you could write it as follows: sub build_hash { m... | Accessing hash reference in perl I am wondering if the following is possible to do in perl. It will save 40-50 lines of code. I have a hash data structure like following: hash_Ref->{a}->{b}->{c}->{d}->{e}->{'count'}=30 I am wondering is there a way I can do the following: my $hash_ref_1 = ash_Ref->{a}->{b}->{c}->{d}; a... | TITLE:
Accessing hash reference in perl
QUESTION:
I am wondering if the following is possible to do in perl. It will save 40-50 lines of code. I have a hash data structure like following: hash_Ref->{a}->{b}->{c}->{d}->{e}->{'count'}=30 I am wondering is there a way I can do the following: my $hash_ref_1 = ash_Ref->{a}... | [
"perl",
"perl-data-structures"
] | 0 | 2 | 720 | 2 | 0 | 2011-05-31T21:38:27.200000 | 2011-05-31T22:53:02.260000 |
6,193,873 | 6,194,091 | Functions not executing before Sys.sleep() | I am writing a function that needs to catch a rate-limiting error while pinging a web-based API. I am using tryCatch to catch the error, and inside this function I specify the following error function: error=function(e) { warning(paste(e,"\nWaiting an hour for rate limit to reset...")) Sys.sleep(3600) # Wait an hour fo... | For the hell of it, try: system(sprintf('sleep %d', seconds)) Assuming you've got the usual *NIX sleep command on path. | Functions not executing before Sys.sleep() I am writing a function that needs to catch a rate-limiting error while pinging a web-based API. I am using tryCatch to catch the error, and inside this function I specify the following error function: error=function(e) { warning(paste(e,"\nWaiting an hour for rate limit to re... | TITLE:
Functions not executing before Sys.sleep()
QUESTION:
I am writing a function that needs to catch a rate-limiting error while pinging a web-based API. I am using tryCatch to catch the error, and inside this function I specify the following error function: error=function(e) { warning(paste(e,"\nWaiting an hour fo... | [
"r",
"system"
] | 7 | 3 | 3,874 | 4 | 0 | 2011-05-31T21:39:01.160000 | 2011-05-31T22:02:35.487000 |
6,193,874 | 6,203,533 | Help with SAPI v5.1 SpeechRecognitionEngine always gives same wrong result with C# | I was playing around with this SAPI v5.1 library. So I was testing a sample WAV file I have. ( Download it from here ). Anyway, the sound in that file is clear and easy. It contains only one word which is number three. Now when I run the following code, I get number 8 or "eight". If I remove it, I get 7. If I try to ra... | How did you create your WAV file? It looks like it has a high bitrate. There are only certain formats supported by the recognizer. Try: 8 bits per sample single channel mono 22,050 samples per second PCM encoding You have about 3 seconds of audio and the file size is 520 KB. That seems too big for the supported formats... | Help with SAPI v5.1 SpeechRecognitionEngine always gives same wrong result with C# I was playing around with this SAPI v5.1 library. So I was testing a sample WAV file I have. ( Download it from here ). Anyway, the sound in that file is clear and easy. It contains only one word which is number three. Now when I run the... | TITLE:
Help with SAPI v5.1 SpeechRecognitionEngine always gives same wrong result with C#
QUESTION:
I was playing around with this SAPI v5.1 library. So I was testing a sample WAV file I have. ( Download it from here ). Anyway, the sound in that file is clear and easy. It contains only one word which is number three. ... | [
"c#",
"speech-recognition",
"sapi"
] | 3 | 5 | 2,984 | 1 | 0 | 2011-05-31T21:39:01.883000 | 2011-06-01T15:17:56.547000 |
6,193,882 | 6,193,988 | Flex how to compile images into swf | I have a flex project that uses bunch of images. When I build my project, it creates main.swf and images folder separately. I would like to compile one swf file which should contain all images. I dont know how to accomplish this. Here is my dir structure: Main -src (dir) --com.main (different packages) --images (contai... | You'll have to embed the images in the SWF. More info here. Conceptually something like this: [Embed(source="images/logo.gif")] [Bindable] public var imgCls:Class; In your MXML, do something like this to access it: However, your compile process should not--I believe--create an images folder. I suspect you are using Fla... | Flex how to compile images into swf I have a flex project that uses bunch of images. When I build my project, it creates main.swf and images folder separately. I would like to compile one swf file which should contain all images. I dont know how to accomplish this. Here is my dir structure: Main -src (dir) --com.main (... | TITLE:
Flex how to compile images into swf
QUESTION:
I have a flex project that uses bunch of images. When I build my project, it creates main.swf and images folder separately. I would like to compile one swf file which should contain all images. I dont know how to accomplish this. Here is my dir structure: Main -src ... | [
"apache-flex",
"flash",
"compilation"
] | 1 | 2 | 1,179 | 1 | 0 | 2011-05-31T21:39:41.690000 | 2011-05-31T21:51:00.550000 |
6,193,888 | 6,194,141 | How to update my custom UIView with drawRect? | I'm trying to build some iOS apps while learning and am having some trouble understanding the proper way to do this. What I have currently is a view that is a subclass of UIView. It is clear and I want to use it as a drawing surface. It will sit on top of something else, like tracing paper. The user should be able to c... | You are on the right track. Sounds like you need to keep track of the points. Here's some example code. LineDrawView.h #import @interface LineDrawView: UIView { NSMutableArray *lines; CGPoint pointA, pointB; BOOL activeLine; } @end LineDrawView.m #import "LineDrawView.h" @implementation LineDrawView - (id)initWithFrame... | How to update my custom UIView with drawRect? I'm trying to build some iOS apps while learning and am having some trouble understanding the proper way to do this. What I have currently is a view that is a subclass of UIView. It is clear and I want to use it as a drawing surface. It will sit on top of something else, li... | TITLE:
How to update my custom UIView with drawRect?
QUESTION:
I'm trying to build some iOS apps while learning and am having some trouble understanding the proper way to do this. What I have currently is a view that is a subclass of UIView. It is clear and I want to use it as a drawing surface. It will sit on top of ... | [
"objective-c",
"quartz-graphics",
"drawrect"
] | 2 | 4 | 10,839 | 1 | 0 | 2011-05-31T21:40:11.427000 | 2011-05-31T22:07:35.090000 |
6,193,889 | 6,193,933 | C++: Adding automatically allocated objects to a std::vector | I wrote the following code: #include #include using namespace std;
class AClass { public: int data;
AClass() { data = -333; cout << "+ Creating default " << data << endl; }
AClass(const AClass ©) { data = copy.data; cout << "+ Creating copy of " << data << endl; }
AClass(int d) { data = d; cout << "+ Creating " << ... | It appears that vector is making copies of existing objects when new ones are added When you add an element, e.g. with v.push_back(AClass(i));, what is done is a temporary AClass object is created and passed to push_back. push_back must then copy this object into the container. The other reason that you see copies made... | C++: Adding automatically allocated objects to a std::vector I wrote the following code: #include #include using namespace std;
class AClass { public: int data;
AClass() { data = -333; cout << "+ Creating default " << data << endl; }
AClass(const AClass ©) { data = copy.data; cout << "+ Creating copy of " << data <<... | TITLE:
C++: Adding automatically allocated objects to a std::vector
QUESTION:
I wrote the following code: #include #include using namespace std;
class AClass { public: int data;
AClass() { data = -333; cout << "+ Creating default " << data << endl; }
AClass(const AClass ©) { data = copy.data; cout << "+ Creating co... | [
"c++",
"object",
"stl",
"vector",
"allocation"
] | 4 | 5 | 2,537 | 4 | 0 | 2011-05-31T21:40:13.873000 | 2011-05-31T21:45:51.143000 |
6,193,892 | 6,193,944 | Regex replace specified text | I want to replace some words in text, but only on conditions as, for example, if each is surrounded by whitespace. To do this, I use: Regex rx = Regex(@"\s+" + word + @"\s+"); str = rx.Replace(str, word2); In the end, I get spaces replaced as well (and all the other specified surroundings). How can this be bypassed? | You can use the \b anchor to match the boundary between a \w (alphanumeric) and a \W (non-alphanumeric) character.: Debug.Assert(Regex.Match(word, "^\w+$").Success);
string result = Regex.Replace(input, @"\b" + word + @"\b", word2); | Regex replace specified text I want to replace some words in text, but only on conditions as, for example, if each is surrounded by whitespace. To do this, I use: Regex rx = Regex(@"\s+" + word + @"\s+"); str = rx.Replace(str, word2); In the end, I get spaces replaced as well (and all the other specified surroundings).... | TITLE:
Regex replace specified text
QUESTION:
I want to replace some words in text, but only on conditions as, for example, if each is surrounded by whitespace. To do this, I use: Regex rx = Regex(@"\s+" + word + @"\s+"); str = rx.Replace(str, word2); In the end, I get spaces replaced as well (and all the other specif... | [
"c#",
".net",
"regex",
"replace"
] | 4 | 5 | 218 | 3 | 0 | 2011-05-31T21:40:41.720000 | 2011-05-31T21:46:49.273000 |
6,193,897 | 6,194,104 | Need a WPF control suggestion | I have a tab control and I want to add a button in the top right corner. > [TabControl] > [TabItem1][TabItem2][TabItem3][TabItem4].....blank space...[ settings button] If I add the settings button to the TabControl, it will be directly adjacent to TabItem4. Any suggestions? | Create something like a template content for your TabControl you put inside. e.g. Alternatively you can edit TabControl template end customize HeaderPanel as you need. settings | Need a WPF control suggestion I have a tab control and I want to add a button in the top right corner. > [TabControl] > [TabItem1][TabItem2][TabItem3][TabItem4].....blank space...[ settings button] If I add the settings button to the TabControl, it will be directly adjacent to TabItem4. Any suggestions? | TITLE:
Need a WPF control suggestion
QUESTION:
I have a tab control and I want to add a button in the top right corner. > [TabControl] > [TabItem1][TabItem2][TabItem3][TabItem4].....blank space...[ settings button] If I add the settings button to the TabControl, it will be directly adjacent to TabItem4. Any suggestion... | [
"wpf"
] | 2 | 1 | 108 | 1 | 0 | 2011-05-31T21:41:25.640000 | 2011-05-31T22:04:02.920000 |
6,193,909 | 6,193,998 | 2 Database Design Questions. hierarchy tree | 1.) I have a DB where each entry represents a task. And out of several dozens or even a hundred of task, there will be a special task (which is a milestone) So, in this case, I have very few entries that requires an extra field to separate them from the majority. I don't want to create a second table, because this is t... | I am not sure if this is what you want: tblTask with columns taskID, isMilestone, and everything you need. tblAgent with columns agentID and everything you need (these will be the (sub-)performers). tblPerformance with columns fk_agentID, fk_task tblSubperformance with columns fk_agentID_performer, fk_agentID_subperfor... | 2 Database Design Questions. hierarchy tree 1.) I have a DB where each entry represents a task. And out of several dozens or even a hundred of task, there will be a special task (which is a milestone) So, in this case, I have very few entries that requires an extra field to separate them from the majority. I don't want... | TITLE:
2 Database Design Questions. hierarchy tree
QUESTION:
1.) I have a DB where each entry represents a task. And out of several dozens or even a hundred of task, there will be a special task (which is a milestone) So, in this case, I have very few entries that requires an extra field to separate them from the majo... | [
"php",
"mysql",
"database",
"database-design",
"hierarchy"
] | 0 | 1 | 335 | 3 | 0 | 2011-05-31T21:42:52.377000 | 2011-05-31T21:52:11.550000 |
6,193,911 | 6,193,982 | Can I automatically prompt a user to add a mobile web app to their homescreen? [iOS] | Can I automatically prompt a user to add a mobile web app to their homescreen? (iOS) Is there an equivalent on Android? Thanks very much! | On iOS, the best you can do is point an arrow at the bottom (middle) of the screen and tell them to add it to thier home screen. | Can I automatically prompt a user to add a mobile web app to their homescreen? [iOS] Can I automatically prompt a user to add a mobile web app to their homescreen? (iOS) Is there an equivalent on Android? Thanks very much! | TITLE:
Can I automatically prompt a user to add a mobile web app to their homescreen? [iOS]
QUESTION:
Can I automatically prompt a user to add a mobile web app to their homescreen? (iOS) Is there an equivalent on Android? Thanks very much!
ANSWER:
On iOS, the best you can do is point an arrow at the bottom (middle) o... | [
"javascript",
"jquery",
"iphone",
"html",
"css"
] | 0 | 4 | 643 | 1 | 0 | 2011-05-31T21:42:56.603000 | 2011-05-31T21:50:39.723000 |
6,193,912 | 6,193,961 | Strange problem with reading and writing a plist file | I have an application that read info from I plist file. To do it I use this code below: NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; localizedPath = [[NSBundle mainBundle] pathForResource:@"settings" ofType:@"plist"]; plistData = [NSData dataWithContentsOfFile:localizedPath];
plist = [NSP... | You can't write back to the application bundle. You will have to copy the original plist file to the documents directory or any other writable location before it can be written to. An example NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString libraryPath = [paths o... | Strange problem with reading and writing a plist file I have an application that read info from I plist file. To do it I use this code below: NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; localizedPath = [[NSBundle mainBundle] pathForResource:@"settings" ofType:@"plist"]; plistData = [NSDat... | TITLE:
Strange problem with reading and writing a plist file
QUESTION:
I have an application that read info from I plist file. To do it I use this code below: NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; localizedPath = [[NSBundle mainBundle] pathForResource:@"settings" ofType:@"plist"]; ... | [
"objective-c",
"iphone",
"plist"
] | 2 | 10 | 1,446 | 1 | 0 | 2011-05-31T21:42:56.603000 | 2011-05-31T21:48:40.787000 |
6,193,916 | 6,193,971 | Selectively Kick Out Logged-In Users After Banning Them | Hello StackOverflow Community: Here is a tricky situation. Suppose that 20 users are logged-in to my webapp and I, the admin, (from a different computer and browser) ban 3 of them, how then do I kick out those 3 logged-in users that I just banned? It seems to be a matter of deleting their sessions/cookies, but how do I... | You seem to be doing something wrong with your app. The idea of the SESSION/COOKIE system is that the SESSION id stored is matched at the beginning of each request made to the server with the COOKIE that the browser sends. If they don't match, the app simply exits and shows the logon page. Thus, if you are able to dele... | Selectively Kick Out Logged-In Users After Banning Them Hello StackOverflow Community: Here is a tricky situation. Suppose that 20 users are logged-in to my webapp and I, the admin, (from a different computer and browser) ban 3 of them, how then do I kick out those 3 logged-in users that I just banned? It seems to be a... | TITLE:
Selectively Kick Out Logged-In Users After Banning Them
QUESTION:
Hello StackOverflow Community: Here is a tricky situation. Suppose that 20 users are logged-in to my webapp and I, the admin, (from a different computer and browser) ban 3 of them, how then do I kick out those 3 logged-in users that I just banned... | [
"php",
"session",
"cakephp"
] | 4 | 1 | 1,804 | 1 | 0 | 2011-05-31T21:43:16.573000 | 2011-05-31T21:49:24.937000 |
6,193,918 | 6,194,335 | Relative File Paths in WF4 workflow/activity | This workflow is a xamlx file in an asp.net application. I have a CodeActivity with an InArgument that takes a relative file path to a text file that lives in the asp.net application. What is the right way to turn the relative path into an absolute path, so that I can read the file into memory. HttpContext.Current is n... | This is what I do: using System; using System.Diagnostics.Contracts; using System.IO; using System.Web.Hosting;
public static class PathExtensions { public static String ExpandPath(this String path) { if (String.IsNullOrWhiteSpace(path)) { return path; }
String resolvedPath = Environment.ExpandEnvironmentVariables(pa... | Relative File Paths in WF4 workflow/activity This workflow is a xamlx file in an asp.net application. I have a CodeActivity with an InArgument that takes a relative file path to a text file that lives in the asp.net application. What is the right way to turn the relative path into an absolute path, so that I can read t... | TITLE:
Relative File Paths in WF4 workflow/activity
QUESTION:
This workflow is a xamlx file in an asp.net application. I have a CodeActivity with an InArgument that takes a relative file path to a text file that lives in the asp.net application. What is the right way to turn the relative path into an absolute path, so... | [
".net",
"asp.net",
"wcf",
"workflow"
] | 0 | 0 | 386 | 2 | 0 | 2011-05-31T21:43:59.180000 | 2011-05-31T22:34:29.970000 |
6,193,924 | 6,193,955 | MYSQL query: USING LEFT JOIN | SELECT jos_mod_gdwcomm.*, COUNT(jos_mod_gdwcomm_spam.reportid) `num_spam` FROM `jos_mod_gdwcomm` WHERE `num_spam` > 0 LEFT JOIN `jos_mod_gdwcomm_spam` ON (jos_mod_gdwcomm.id = jos_mod_gdwcomm_spam.commid) GROUP BY jos_mod_gdwcomm.id ORDER BY `num_spam` DESC, jos_mod_gdwcomm_spam.datetime DESC How can i modify this quer... | You need a HAVING clause: SELECT jos_mod_gdwcomm.*, COUNT(jos_mod_gdwcomm_spam.reportid) `num_spam` FROM `jos_mod_gdwcomm` LEFT JOIN `jos_mod_gdwcomm_spam` ON (jos_mod_gdwcomm.id = jos_mod_gdwcomm_spam.commid) GROUP BY jos_mod_gdwcomm.id
HAVING num_spam > 0
ORDER BY `num_spam` DESC, jos_mod_gdwcomm_spam.datetime DESC | MYSQL query: USING LEFT JOIN SELECT jos_mod_gdwcomm.*, COUNT(jos_mod_gdwcomm_spam.reportid) `num_spam` FROM `jos_mod_gdwcomm` WHERE `num_spam` > 0 LEFT JOIN `jos_mod_gdwcomm_spam` ON (jos_mod_gdwcomm.id = jos_mod_gdwcomm_spam.commid) GROUP BY jos_mod_gdwcomm.id ORDER BY `num_spam` DESC, jos_mod_gdwcomm_spam.datetime DE... | TITLE:
MYSQL query: USING LEFT JOIN
QUESTION:
SELECT jos_mod_gdwcomm.*, COUNT(jos_mod_gdwcomm_spam.reportid) `num_spam` FROM `jos_mod_gdwcomm` WHERE `num_spam` > 0 LEFT JOIN `jos_mod_gdwcomm_spam` ON (jos_mod_gdwcomm.id = jos_mod_gdwcomm_spam.commid) GROUP BY jos_mod_gdwcomm.id ORDER BY `num_spam` DESC, jos_mod_gdwcom... | [
"mysql"
] | 1 | 2 | 68 | 3 | 0 | 2011-05-31T21:44:56.543000 | 2011-05-31T21:48:21.630000 |
6,193,935 | 6,194,014 | How to remove all but checked nodes and their parents in a treeview? | I have a TreeView that contains any number of nodes. Users can check any of the nodes in the TreeView and as soon as they click a button I want to prune everything but the checked nodes and their parents. I've got the button all setup and it calls a method that should prune the nodes, the issue I am having is the logic... | Sometimes looking at a problem from another point of view helps. Why dont you first change the logic of how the tree manages item checking if possible: If the user checks an item you will not delete either the item nor its parents. Therefore when the user checks an item check every item up the tree until you get to the... | How to remove all but checked nodes and their parents in a treeview? I have a TreeView that contains any number of nodes. Users can check any of the nodes in the TreeView and as soon as they click a button I want to prune everything but the checked nodes and their parents. I've got the button all setup and it calls a m... | TITLE:
How to remove all but checked nodes and their parents in a treeview?
QUESTION:
I have a TreeView that contains any number of nodes. Users can check any of the nodes in the TreeView and as soon as they click a button I want to prune everything but the checked nodes and their parents. I've got the button all setu... | [
"c#",
"asp.net",
"treeview",
"treenode"
] | 1 | 2 | 2,607 | 3 | 0 | 2011-05-31T21:46:14.580000 | 2011-05-31T21:53:54.593000 |
6,193,948 | 6,194,288 | Launching mono exe file within emacs/Fsharp mode | I'm using Fsharp mode in emacs. The key of ^C x is mapped to Run... command which is as follows. (defun fsharp-run-executable-file () (interactive) (let ((name (buffer-file-name))) (if (string-match "^\\(.*\\)\\.\\(fs\\|fsi\\)$" name) (shell-command (concat (match-string 1 name) ".exe"))))) The problem is that it tries... | You can redefine fsharp-run-executable-file and use this one instead: (defun fsharp-run-executable-file () (interactive) (let ((name (buffer-file-name))) (if (string-match "^\\(.*\\)\\.\\(fs\\|fsi\\)$" name) (compile (concat "mono " (match-string 1 name) ".exe"))))) There are two changes: 1) concat mono before the comm... | Launching mono exe file within emacs/Fsharp mode I'm using Fsharp mode in emacs. The key of ^C x is mapped to Run... command which is as follows. (defun fsharp-run-executable-file () (interactive) (let ((name (buffer-file-name))) (if (string-match "^\\(.*\\)\\.\\(fs\\|fsi\\)$" name) (shell-command (concat (match-string... | TITLE:
Launching mono exe file within emacs/Fsharp mode
QUESTION:
I'm using Fsharp mode in emacs. The key of ^C x is mapped to Run... command which is as follows. (defun fsharp-run-executable-file () (interactive) (let ((name (buffer-file-name))) (if (string-match "^\\(.*\\)\\.\\(fs\\|fsi\\)$" name) (shell-command (co... | [
"emacs",
"f#",
"elisp"
] | 4 | 3 | 513 | 2 | 0 | 2011-05-31T21:47:07.447000 | 2011-05-31T22:27:09.427000 |
6,193,957 | 6,194,497 | bouncing balls never stay calm on the ground | I try to create a very simple physics engine for my study (processing used for a interactive installation). The target is to have a ground covered with balls that you can throw around with gestures (based on Kinect information). Therefor I need to do some basic physic simulation like bouncing and thats what I started w... | It's not only air resistance that slows the ball down, but the fact that it's not perfectly elastic as this line suggests: mSpeedY = -mSpeedY; The ball absorbs energy when it squishes against the floor before it bounces back, so it doesn't bounce as high. Try a real super ball. I seem to remember it only bounces 80% as... | bouncing balls never stay calm on the ground I try to create a very simple physics engine for my study (processing used for a interactive installation). The target is to have a ground covered with balls that you can throw around with gestures (based on Kinect information). Therefor I need to do some basic physic simula... | TITLE:
bouncing balls never stay calm on the ground
QUESTION:
I try to create a very simple physics engine for my study (processing used for a interactive installation). The target is to have a ground covered with balls that you can throw around with gestures (based on Kinect information). Therefor I need to do some b... | [
"java",
"physics",
"processing"
] | 4 | 3 | 949 | 4 | 0 | 2011-05-31T21:48:28.947000 | 2011-05-31T22:57:05.147000 |
6,193,958 | 6,194,158 | DirectX9 Lighting C++ Lighting not working | This is a simple program that draws a 3d cube with a texture. The problem is I can not see the texture because the lights are not working.I have turned off the lights just to make sure the texture is there and it is.So if any one can help me figure out why the lights are not working I would greatly appreciate it. #incl... | You haven't enabled D3DRS_LIGHTING. m_pD3DDevice->setRenderState(D3DRS_LIGHTING, TRUE); | DirectX9 Lighting C++ Lighting not working This is a simple program that draws a 3d cube with a texture. The problem is I can not see the texture because the lights are not working.I have turned off the lights just to make sure the texture is there and it is.So if any one can help me figure out why the lights are not w... | TITLE:
DirectX9 Lighting C++ Lighting not working
QUESTION:
This is a simple program that draws a 3d cube with a texture. The problem is I can not see the texture because the lights are not working.I have turned off the lights just to make sure the texture is there and it is.So if any one can help me figure out why th... | [
"c++",
"visual-studio-2008",
"directx-9"
] | 0 | 1 | 1,384 | 1 | 0 | 2011-05-31T21:48:32.003000 | 2011-05-31T22:09:11.970000 |
6,193,960 | 6,194,291 | New line character in Scala | Is there a shorthand for a new line character in Scala? In Java (on Windows) I usually just use "\n", but that doesn't seem to work in Scala - specifically val s = """abcd efg""" val s2 = s.replace("\n", "") println(s2) outputs abcd efg in Eclipse, efgd (sic) from the command line, and abcdefg from the REPL (GREAT SUCC... | Your Eclipse making the newline marker the standard Windows \r\n, so you've got "abcd\r\nefg". The regex is turning it into "abcd\refg" and Eclipse console is treaing the \r slightly differently from how the windows shell does. The REPL is just using \n as the new line marker so it works as expected. Solution 1: change... | New line character in Scala Is there a shorthand for a new line character in Scala? In Java (on Windows) I usually just use "\n", but that doesn't seem to work in Scala - specifically val s = """abcd efg""" val s2 = s.replace("\n", "") println(s2) outputs abcd efg in Eclipse, efgd (sic) from the command line, and abcde... | TITLE:
New line character in Scala
QUESTION:
Is there a shorthand for a new line character in Scala? In Java (on Windows) I usually just use "\n", but that doesn't seem to work in Scala - specifically val s = """abcd efg""" val s2 = s.replace("\n", "") println(s2) outputs abcd efg in Eclipse, efgd (sic) from the comma... | [
"scala",
"newline"
] | 29 | 16 | 63,329 | 6 | 0 | 2011-05-31T21:48:37.010000 | 2011-05-31T22:28:13.033000 |
6,193,964 | 6,193,976 | Pointer confusion | I am fairly novice at C++, and I'm having an error that I just don't understand. class1* a = (class1*)p1; class2* b = (class2*)p2; a->foo(b); The error is: error: no matching function for call to 'a::foo(b*&)' note: candidates are: void a::foo(const b&) How do I get this right? | You probably have to do a->foo(*b); because foo takes a reference to b not a pointer to b. What are the differences between a pointer variable and a reference variable in C++? is a good place to learn the difference between a pointer and a reference in C++ | Pointer confusion I am fairly novice at C++, and I'm having an error that I just don't understand. class1* a = (class1*)p1; class2* b = (class2*)p2; a->foo(b); The error is: error: no matching function for call to 'a::foo(b*&)' note: candidates are: void a::foo(const b&) How do I get this right? | TITLE:
Pointer confusion
QUESTION:
I am fairly novice at C++, and I'm having an error that I just don't understand. class1* a = (class1*)p1; class2* b = (class2*)p2; a->foo(b); The error is: error: no matching function for call to 'a::foo(b*&)' note: candidates are: void a::foo(const b&) How do I get this right?
ANSW... | [
"c++",
"pointers"
] | 0 | 10 | 176 | 2 | 0 | 2011-05-31T21:48:49.413000 | 2011-05-31T21:50:09.783000 |
6,193,967 | 6,194,050 | How do I simulate a web session and store the received cookie using Ruby? | I am testing a messaging application that uses single sign-on(SSO). I need to simulate a user connecting to WAM using SSO, then I need to get the cookie from the server and store it for further communication events. Is anyone familiar with how this might be done using Ruby? | Mechanize does that automatically. There are also other HTTP client gems that may support cookies, e.g. this httparty example. | How do I simulate a web session and store the received cookie using Ruby? I am testing a messaging application that uses single sign-on(SSO). I need to simulate a user connecting to WAM using SSO, then I need to get the cookie from the server and store it for further communication events. Is anyone familiar with how th... | TITLE:
How do I simulate a web session and store the received cookie using Ruby?
QUESTION:
I am testing a messaging application that uses single sign-on(SSO). I need to simulate a user connecting to WAM using SSO, then I need to get the cookie from the server and store it for further communication events. Is anyone fa... | [
"ruby",
"testing",
"single-sign-on"
] | 1 | 5 | 1,079 | 2 | 0 | 2011-05-31T21:49:02.953000 | 2011-05-31T21:57:39.863000 |
6,193,970 | 6,194,375 | Prolog problem! 'singles' ! | I have a prolog homework, which should work like this: singles([1,2,3,2,2,4,1], [3,4]). true Now I've figured out I should test if one element is single in the list then put all the single element together..then I wrote down: singles(L,SL):-findall(X,isSingle(X,L),SL). isSingle(X,L):-member(X,L),append(Y,[X|Z],L),not(m... | Switch the order of not(member(X,L1)) and append(Y,Z,L1) and your code works. I'm no Prolog expert, so I'm not entirely sure about this, but, going through the trace, it seems to have to do with the subtleties of using not. You're forcing the evaluation of member on L1 before it has been unified in append(Y,Z,L1) bit. | Prolog problem! 'singles' ! I have a prolog homework, which should work like this: singles([1,2,3,2,2,4,1], [3,4]). true Now I've figured out I should test if one element is single in the list then put all the single element together..then I wrote down: singles(L,SL):-findall(X,isSingle(X,L),SL). isSingle(X,L):-member(... | TITLE:
Prolog problem! 'singles' !
QUESTION:
I have a prolog homework, which should work like this: singles([1,2,3,2,2,4,1], [3,4]). true Now I've figured out I should test if one element is single in the list then put all the single element together..then I wrote down: singles(L,SL):-findall(X,isSingle(X,L),SL). isSi... | [
"prolog"
] | 2 | 3 | 153 | 2 | 0 | 2011-05-31T21:49:24.467000 | 2011-05-31T22:41:00.753000 |
6,193,974 | 6,194,077 | Django: How do I update a model after a view has been rendered? | I have a view that displays a list of models. Some of the properties of some of the models need to be updated after the view has been rendered: that is, the user is expected to see the original, unchanged values on first visit and the updated values on successive visits (or upon page reload). I thought I could achieve ... | There's no need for anything clever here. Rendering a template doesn't need to be the end of the view - that only comes when you actually return that as a response. They don't have to be in the same step. So: def my_view(request, params): #...do something... response = render_to_response('my_template.html', {'foo': bar... | Django: How do I update a model after a view has been rendered? I have a view that displays a list of models. Some of the properties of some of the models need to be updated after the view has been rendered: that is, the user is expected to see the original, unchanged values on first visit and the updated values on suc... | TITLE:
Django: How do I update a model after a view has been rendered?
QUESTION:
I have a view that displays a list of models. Some of the properties of some of the models need to be updated after the view has been rendered: that is, the user is expected to see the original, unchanged values on first visit and the upd... | [
"python",
"django",
"django-views",
"django-generic-views"
] | 5 | 9 | 2,410 | 5 | 0 | 2011-05-31T21:49:40.350000 | 2011-05-31T22:01:33.157000 |
6,193,977 | 6,194,161 | Update rows then Insert new associated rows, or restructure data? | Let's set the stage, PHP & MYSQL: I have a table we'll call Directions to hold each step for a given task. Each task has variable steps. The only real essential fields for this question are (primary) step_id,**task_id**, step. When the author updates their directions, they can update each step, add new ones, remove old... | I believe task_id is quite essential field for this question too. If it is indexed you won't have any performance issues with selecting steps for a given task no matter how separated they are in your table. With steps serialized you would have more issues as you would have to deserialize them for every update/delete, s... | Update rows then Insert new associated rows, or restructure data? Let's set the stage, PHP & MYSQL: I have a table we'll call Directions to hold each step for a given task. Each task has variable steps. The only real essential fields for this question are (primary) step_id,**task_id**, step. When the author updates the... | TITLE:
Update rows then Insert new associated rows, or restructure data?
QUESTION:
Let's set the stage, PHP & MYSQL: I have a table we'll call Directions to hold each step for a given task. Each task has variable steps. The only real essential fields for this question are (primary) step_id,**task_id**, step. When the ... | [
"mysql",
"database-design",
"performance"
] | 0 | 0 | 48 | 1 | 0 | 2011-05-31T21:50:09.803000 | 2011-05-31T22:09:27.227000 |
6,193,983 | 6,207,845 | How does pushState protect against potential content forgeries? | As seen in GitHub's blog, they've implemented HTML5's JavaScript pushState feature for tree browsing (for modern browsers), bringing AJAX navigation without Hash Bangs. The code is simple: $('#slider a').click(function() { history.pushState({ path: this.path }, '', this.href) $.get(this.href, function(data) { $('#slide... | My understanding is that this is perfectly consistent with the Same Origin Policy that governs XMLHttpRequest, setting cookies, and various other browser functions. The assumption is that if it's on the same domain + protocol + port, it's a trusted resource. Usually, as a web developer, that's what you want (and need) ... | How does pushState protect against potential content forgeries? As seen in GitHub's blog, they've implemented HTML5's JavaScript pushState feature for tree browsing (for modern browsers), bringing AJAX navigation without Hash Bangs. The code is simple: $('#slider a').click(function() { history.pushState({ path: this.pa... | TITLE:
How does pushState protect against potential content forgeries?
QUESTION:
As seen in GitHub's blog, they've implemented HTML5's JavaScript pushState feature for tree browsing (for modern browsers), bringing AJAX navigation without Hash Bangs. The code is simple: $('#slider a').click(function() { history.pushSta... | [
"javascript",
"security",
"html",
"phishing",
"pushstate"
] | 12 | 9 | 8,396 | 2 | 0 | 2011-05-31T21:50:42.160000 | 2011-06-01T21:18:56.823000 |
6,193,984 | 6,206,055 | Show all processes in an AnyCPU application | I am writing an application for any CPU. When I am running the following on a 64bit-PC it will not work: System.Diagnostics.Process[] running = System.Diagnostics.Process.GetProcesses(); for (int i = 0; i < running.Length; i++){ try{ Console.WriteLine(running[i].MainModule.FileName); } catch (Exception ex){} } It only ... | I got the answer: running[i].MainModule.FileName is not supported by 64-bit processes. This was the reason my code always threw an exception. So the 64bit-processes were not listed. | Show all processes in an AnyCPU application I am writing an application for any CPU. When I am running the following on a 64bit-PC it will not work: System.Diagnostics.Process[] running = System.Diagnostics.Process.GetProcesses(); for (int i = 0; i < running.Length; i++){ try{ Console.WriteLine(running[i].MainModule.Fi... | TITLE:
Show all processes in an AnyCPU application
QUESTION:
I am writing an application for any CPU. When I am running the following on a 64bit-PC it will not work: System.Diagnostics.Process[] running = System.Diagnostics.Process.GetProcesses(); for (int i = 0; i < running.Length; i++){ try{ Console.WriteLine(runnin... | [
"c#",
"process",
"32bit-64bit"
] | 2 | 3 | 218 | 2 | 0 | 2011-05-31T21:50:43.420000 | 2011-06-01T18:38:38.463000 |
6,193,990 | 6,216,917 | Excluding items selectively from Sitecore's Lucene search index - works when rebuilding with IndexViewer, but not when using Sitecore's built-in tools | On a site powered by Sitecore 6.2, I need to give the user the ability to selectively exclude items from search results. To accomplish this, I have added a checkbox field entitled "Include in Search Results", and I created a custom database crawler to check that field's value: ~\App_Config\Include\Search Indexes\Websit... | I spoke with Alex Shyba yesterday, and we were able to figure out what was going on. There were a couple of problems with my configuration that was preventing everything from working correctly: As Seth noted, there are two distinct search APIs in Sitecore. My configuration file was using both of them. To use the newer ... | Excluding items selectively from Sitecore's Lucene search index - works when rebuilding with IndexViewer, but not when using Sitecore's built-in tools On a site powered by Sitecore 6.2, I need to give the user the ability to selectively exclude items from search results. To accomplish this, I have added a checkbox fiel... | TITLE:
Excluding items selectively from Sitecore's Lucene search index - works when rebuilding with IndexViewer, but not when using Sitecore's built-in tools
QUESTION:
On a site powered by Sitecore 6.2, I need to give the user the ability to selectively exclude items from search results. To accomplish this, I have add... | [
"c#",
"sitecore",
"config"
] | 7 | 4 | 4,833 | 3 | 0 | 2011-05-31T21:51:15.687000 | 2011-06-02T15:50:33.277000 |
6,193,991 | 6,194,524 | detect javascript button press in webview? | Does anyone know a way to detect if a button with this, code below, in the source of the webpage is pressed in my apps webview? html source of button: and then make a toast? P.s. I cant change html code it is not my site | that will be easy just define your Javascript Interface final class jocJavaScriptInterface { jocJavaScriptInterface() { } String myEvent; public void run(int id,String event) { //run method defined into your html. this.myEvent = event; mHandler.post(new Runnable() { public void run() { Toast.makeText(getApplicationCont... | detect javascript button press in webview? Does anyone know a way to detect if a button with this, code below, in the source of the webpage is pressed in my apps webview? html source of button: and then make a toast? P.s. I cant change html code it is not my site | TITLE:
detect javascript button press in webview?
QUESTION:
Does anyone know a way to detect if a button with this, code below, in the source of the webpage is pressed in my apps webview? html source of button: and then make a toast? P.s. I cant change html code it is not my site
ANSWER:
that will be easy just define... | [
"android",
"html",
"webview"
] | 0 | 0 | 1,858 | 1 | 0 | 2011-05-31T21:51:35.053000 | 2011-05-31T23:01:06.427000 |
6,193,992 | 6,194,710 | determine version of microsoft office with java | I wrote a program that creates a set of data that is outputted to an excel spreadsheet. I was originally using the jexcel library to write the data to the file, but I'd like to update the program so that it can check and see whether is should create a ".xls" or ".xlsx" file, then write to the appropriate document type.... | One way is to call the Windows ASSOC and FTYPE commands, capture the output and parse it to determine the Office version installed. C:\Users\me>assoc.xls.xls=Excel.Sheet.8
C:\Users\me>ftype Excel.sheet.8 Excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE" /e Here a quick example: import java.io.... | determine version of microsoft office with java I wrote a program that creates a set of data that is outputted to an excel spreadsheet. I was originally using the jexcel library to write the data to the file, but I'd like to update the program so that it can check and see whether is should create a ".xls" or ".xlsx" fi... | TITLE:
determine version of microsoft office with java
QUESTION:
I wrote a program that creates a set of data that is outputted to an excel spreadsheet. I was originally using the jexcel library to write the data to the file, but I'd like to update the program so that it can check and see whether is should create a ".... | [
"java",
"excel",
"ms-office",
"version",
"file-type"
] | 5 | 8 | 6,258 | 4 | 0 | 2011-05-31T21:51:42.833000 | 2011-05-31T23:29:55.207000 |
6,193,995 | 6,201,776 | Can UserControls have implicit styles in Silverlight? | Solution: UserControl is not the actual type, so I cannot use Implicit Styles on usercontrols. Thanks Tim. The following Implicit Style does not seem to do anything. I know styles are getting loaded into the Apps resource dictionary because if I explicitly set another style in the same.xaml file it will work just fine.... | You need to specify the actual type of your control instead of just using UserControl. Implicit styles will only work with the specific type. So instead of: you'd use: where my is declared as your namespace and MyUserControl is the actual class name for your UserControl-derived controls. | Can UserControls have implicit styles in Silverlight? Solution: UserControl is not the actual type, so I cannot use Implicit Styles on usercontrols. Thanks Tim. The following Implicit Style does not seem to do anything. I know styles are getting loaded into the Apps resource dictionary because if I explicitly set anoth... | TITLE:
Can UserControls have implicit styles in Silverlight?
QUESTION:
Solution: UserControl is not the actual type, so I cannot use Implicit Styles on usercontrols. Thanks Tim. The following Implicit Style does not seem to do anything. I know styles are getting loaded into the Apps resource dictionary because if I ex... | [
"c#",
"silverlight",
"xaml"
] | 1 | 2 | 355 | 1 | 0 | 2011-05-31T21:51:56.977000 | 2011-06-01T13:18:40.140000 |
6,193,999 | 6,195,072 | how to use distutils to create executable .zip file? | Python 2.6 and beyond has the ability to directly execute a.zip file if the zip file contains a __main__.py file at the top of the zip archive. I'm wanting to leverage this feature to provide preview releases of a tool I'm developing that won't require users to install anything beyond copying the.zip file to their disk... | Updated: Since the setup.cfg is global, it affects the 'install-lib' setting for all commands, which is not what is desired. Unfortunately there is no way (to my knowledge) to pass a options to a subcommand via the command line, e.g. if you specify bdist --install-lib=/ it will raise an error instead of passing that do... | how to use distutils to create executable .zip file? Python 2.6 and beyond has the ability to directly execute a.zip file if the zip file contains a __main__.py file at the top of the zip archive. I'm wanting to leverage this feature to provide preview releases of a tool I'm developing that won't require users to insta... | TITLE:
how to use distutils to create executable .zip file?
QUESTION:
Python 2.6 and beyond has the ability to directly execute a.zip file if the zip file contains a __main__.py file at the top of the zip archive. I'm wanting to leverage this feature to provide preview releases of a tool I'm developing that won't requ... | [
"python",
"distutils",
"python-2.6"
] | 7 | 5 | 5,852 | 2 | 0 | 2011-05-31T21:52:14.637000 | 2011-06-01T00:38:57.977000 |
6,194,009 | 6,194,126 | Is T4 template run every time it is requested? | I am trying to setup an environment which would let me use a template to send out email to thousands of people. In all of this, performance is a key and I am trying to find out, when myscript.tt is run, is it compiled and executed every time or is there a compiled object that can be reused for subsequent calls to execu... | Basically, you call this in a pre-compiled template: string result = new MyTemplate().TransformText(); The template and its code (logic, etc) is created once but you then call the TransformText to generate the dynamically desired output. In your case I think you feed your template with different e-mail addresses each t... | Is T4 template run every time it is requested? I am trying to setup an environment which would let me use a template to send out email to thousands of people. In all of this, performance is a key and I am trying to find out, when myscript.tt is run, is it compiled and executed every time or is there a compiled object t... | TITLE:
Is T4 template run every time it is requested?
QUESTION:
I am trying to setup an environment which would let me use a template to send out email to thousands of people. In all of this, performance is a key and I am trying to find out, when myscript.tt is run, is it compiled and executed every time or is there a... | [
"c#",
".net",
"templates",
"code-generation",
"t4"
] | 3 | 2 | 1,237 | 1 | 0 | 2011-05-31T21:53:21.567000 | 2011-05-31T22:06:15.073000 |
6,194,015 | 6,194,978 | Where can I find documentation/tutorial(s) for Mutagen? (Python) | After asking this question: How do I read album artwork using python? I got 'stuck' as it were. I have spent forever looking for documentation online but haven't come across any. I know that a lot of responses suggest reading the internal docstrings etc. but to be honest this is the first time I've come across a librar... | A couple of things you might try. Pydoc makes it easy to navigate the contents of docstrings for a given project. Assuming you have installed mutagen globally or in a virtualenv, this should start a webserver where you can browse locally: % pydoc -p 8080 # then navigate to http://localhost:8080/mutagen.html to see the ... | Where can I find documentation/tutorial(s) for Mutagen? (Python) After asking this question: How do I read album artwork using python? I got 'stuck' as it were. I have spent forever looking for documentation online but haven't come across any. I know that a lot of responses suggest reading the internal docstrings etc. ... | TITLE:
Where can I find documentation/tutorial(s) for Mutagen? (Python)
QUESTION:
After asking this question: How do I read album artwork using python? I got 'stuck' as it were. I have spent forever looking for documentation online but haven't come across any. I know that a lot of responses suggest reading the interna... | [
"python",
"mp3"
] | 2 | 2 | 1,188 | 1 | 0 | 2011-05-31T21:54:02.033000 | 2011-06-01T00:19:47.433000 |
6,194,025 | 6,194,080 | Simulate user input | Is it possible to simulate user input in android? For example to have some service or some thread that will work in background and initiate something that will simulate user input so if we are on the home screen and simulated input(let say click) happened than the application should start if the coordinates of the simu... | Is it possible to simulate user input in android? Only from a unit test suite. IOW, not in the way that you are thinking, as it would be a massive security hole. | Simulate user input Is it possible to simulate user input in android? For example to have some service or some thread that will work in background and initiate something that will simulate user input so if we are on the home screen and simulated input(let say click) happened than the application should start if the coo... | TITLE:
Simulate user input
QUESTION:
Is it possible to simulate user input in android? For example to have some service or some thread that will work in background and initiate something that will simulate user input so if we are on the home screen and simulated input(let say click) happened than the application shoul... | [
"android",
"click",
"simulation",
"keystroke"
] | 2 | 1 | 3,001 | 2 | 0 | 2011-05-31T21:55:02.313000 | 2011-05-31T22:01:49.037000 |
6,194,031 | 6,194,669 | Iterating Variadic Macro Arguments | I am programmatically generating bunch of functors, in order to keep the generated code more readable I am trying to come up with a macro that will expand line the following, SET_STATE(FunctorA,a,b);
ref a; ref b; FunctorA(ref a, ref b){ this->a = a; this->b = b; } Basically it will expand to the first arguments const... | Using the tricked found in this link http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/ to count the number of arguments and using some really ugly macro I can generate the output you wanted. I tested it using gcc (gcc -E test.cpp) and it works, It's not portable. Code: #define VA_NARGS_IMPL... | Iterating Variadic Macro Arguments I am programmatically generating bunch of functors, in order to keep the generated code more readable I am trying to come up with a macro that will expand line the following, SET_STATE(FunctorA,a,b);
ref a; ref b; FunctorA(ref a, ref b){ this->a = a; this->b = b; } Basically it will ... | TITLE:
Iterating Variadic Macro Arguments
QUESTION:
I am programmatically generating bunch of functors, in order to keep the generated code more readable I am trying to come up with a macro that will expand line the following, SET_STATE(FunctorA,a,b);
ref a; ref b; FunctorA(ref a, ref b){ this->a = a; this->b = b; } ... | [
"c++",
"c",
"c-preprocessor"
] | 15 | 6 | 9,334 | 2 | 0 | 2011-05-31T21:55:49.240000 | 2011-05-31T23:23:17.767000 |
6,194,037 | 6,194,708 | MySQL INSERT without having to specify every non-default field (#1067 - Invalid default value for 'table') | I have seen this several times. I have one server that allows me to insert some of the values, without specifying the others like so: INSERT INTO table SET value_a='a', value_b='b'; (value_c is a field that does not have a default value set, but it works fine here). When the script is moved to a new server some INSERT ... | One of your servers is running in strict mode by default and the other not. If a server runs in strict mode (or you set it in your connection) and you try to insert a NULL value into a column defined as NOT NULL you will get #1364 error. Without strict mode your NULL value will be replaced with empty string or 0. Examp... | MySQL INSERT without having to specify every non-default field (#1067 - Invalid default value for 'table') I have seen this several times. I have one server that allows me to insert some of the values, without specifying the others like so: INSERT INTO table SET value_a='a', value_b='b'; (value_c is a field that does n... | TITLE:
MySQL INSERT without having to specify every non-default field (#1067 - Invalid default value for 'table')
QUESTION:
I have seen this several times. I have one server that allows me to insert some of the values, without specifying the others like so: INSERT INTO table SET value_a='a', value_b='b'; (value_c is a... | [
"mysql",
"insert",
"mysql-error-1364"
] | 4 | 15 | 8,797 | 2 | 0 | 2011-05-31T21:56:09.553000 | 2011-05-31T23:29:11.367000 |
6,194,041 | 6,196,180 | Scrapy image download how to use custom filename | For my scrapy project I'm currently using the ImagesPipeline. The downloaded images are stored with a SHA1 hash of their URLs as the file names. How can I store the files using my own custom file names instead? What if my custom file name needs to contain another scraped field from the same item? e.g. use the item['des... | This was the way I solved the problem in Scrapy 0.10. Check the method persist_image of FSImagesStoreChangeableDirectory. The filename of the downloaded image is key class FSImagesStoreChangeableDirectory(FSImagesStore):
def persist_image(self, key, image, buf, info,append_path):
absolute_path = self._get_filesystem_... | Scrapy image download how to use custom filename For my scrapy project I'm currently using the ImagesPipeline. The downloaded images are stored with a SHA1 hash of their URLs as the file names. How can I store the files using my own custom file names instead? What if my custom file name needs to contain another scraped... | TITLE:
Scrapy image download how to use custom filename
QUESTION:
For my scrapy project I'm currently using the ImagesPipeline. The downloaded images are stored with a SHA1 hash of their URLs as the file names. How can I store the files using my own custom file names instead? What if my custom file name needs to conta... | [
"python",
"scrapy"
] | 14 | 8 | 14,776 | 6 | 0 | 2011-05-31T21:57:05.043000 | 2011-06-01T04:11:47.707000 |
6,194,046 | 6,194,768 | Java Web enterprise Application "Client" | At my current work, we are redesigning the entire core application which is basically springMVC, ejb3, SpringF, AJAX, etc. Our clients are like 60, that uses the same application depending on the acquired license. We are thinking to develop an application that can be simply installed locally on their places. Something ... | I can think of so many reasons to not to do this. But I am sure you have analyzed your requirements and have come up with such a need. have few questions: Have you done something like that? NO how is your app working? We did have something similar, but not on an per client machine basis because of system hardware requi... | Java Web enterprise Application "Client" At my current work, we are redesigning the entire core application which is basically springMVC, ejb3, SpringF, AJAX, etc. Our clients are like 60, that uses the same application depending on the acquired license. We are thinking to develop an application that can be simply inst... | TITLE:
Java Web enterprise Application "Client"
QUESTION:
At my current work, we are redesigning the entire core application which is basically springMVC, ejb3, SpringF, AJAX, etc. Our clients are like 60, that uses the same application depending on the acquired license. We are thinking to develop an application that ... | [
"java",
"jakarta-ee",
"client",
"application-server"
] | 0 | 1 | 227 | 1 | 0 | 2011-05-31T21:57:23.997000 | 2011-05-31T23:41:02.507000 |
6,194,062 | 6,194,102 | Arc4random float? | Doing this: float x = arc4random() % 100; returns a decent result of a number between 0 and 100. But doing this: float x = (arc4random() % 100)/100; Returns 0. How can I get it to return a float value? | Simply, you are doing integer division, instead of floating point division, so you are just getting a truncated result (.123 is truncated to 0, for example). Try float x = (arc4random() % 100)/100.0f; | Arc4random float? Doing this: float x = arc4random() % 100; returns a decent result of a number between 0 and 100. But doing this: float x = (arc4random() % 100)/100; Returns 0. How can I get it to return a float value? | TITLE:
Arc4random float?
QUESTION:
Doing this: float x = arc4random() % 100; returns a decent result of a number between 0 and 100. But doing this: float x = (arc4random() % 100)/100; Returns 0. How can I get it to return a float value?
ANSWER:
Simply, you are doing integer division, instead of floating point divisio... | [
"ios",
"objective-c",
"random"
] | 9 | 24 | 7,598 | 4 | 0 | 2011-05-31T21:59:39.097000 | 2011-05-31T22:03:57.887000 |
6,194,070 | 6,200,959 | How do use a custom datatype as a field in drupal 7? | I have several custom datatypes in drupal 7 restaurant menu recipe chef i want to create associations between this data chef -> restaurant -> menu -> recipe so that recipe can get the chefs name and the restaurants address and menu can get a list of recipes, etc In SQL land, i'd call this a foreign key, but i'm having ... | These are probably not datatypes but most likely content types. What you are looking for are A way to relate nodes (ie. content) of one content type to nodes of another (chef to restaurant, menu to restaurant, recipe to menu, etc.). A way to display information from related nodes (direct or indirect relations) when dis... | How do use a custom datatype as a field in drupal 7? I have several custom datatypes in drupal 7 restaurant menu recipe chef i want to create associations between this data chef -> restaurant -> menu -> recipe so that recipe can get the chefs name and the restaurants address and menu can get a list of recipes, etc In S... | TITLE:
How do use a custom datatype as a field in drupal 7?
QUESTION:
I have several custom datatypes in drupal 7 restaurant menu recipe chef i want to create associations between this data chef -> restaurant -> menu -> recipe so that recipe can get the chefs name and the restaurants address and menu can get a list of... | [
"drupal",
"drupal-7"
] | 5 | 5 | 1,218 | 2 | 0 | 2011-05-31T22:00:59.723000 | 2011-06-01T12:15:46.297000 |
6,194,074 | 6,194,210 | Lazy<T> breaks when exception is handled | Maybe I'm missing something but why does visual studio break execution to tell me an exception has occured even though its handled? Yes, unchecking user-unhandled exception fixes the problem, but why is a handled exception being called a unhandled exception? Lazy lazyCount = new Lazy (() => { throw new NotImplementedEx... | If you're annoyed by the dialog I would recommend disabling the Exception Assistant (I'm not sure what it is assisting). Tools -> Options -> Debugging Under this options menu you can disable the Exception Assistant, and control various other debugging features (Just My Code, etc). As @Michael Kennedy noted you can goto... | Lazy<T> breaks when exception is handled Maybe I'm missing something but why does visual studio break execution to tell me an exception has occured even though its handled? Yes, unchecking user-unhandled exception fixes the problem, but why is a handled exception being called a unhandled exception? Lazy lazyCount = new... | TITLE:
Lazy<T> breaks when exception is handled
QUESTION:
Maybe I'm missing something but why does visual studio break execution to tell me an exception has occured even though its handled? Yes, unchecking user-unhandled exception fixes the problem, but why is a handled exception being called a unhandled exception? La... | [
"c#"
] | 1 | 3 | 950 | 3 | 0 | 2011-05-31T22:01:15.993000 | 2011-05-31T22:15:25.873000 |
6,194,075 | 6,209,955 | How to close a file handle opened with SHCreateStreamOnFile | Since I need to format "pretty" XML using MSXML, I am using the trick referenced here to add indentation to my code. Since all I want is to save a file, I open an IStream using SHCreateStreamOnFile(). The file gets saved, I can open it in a text editor and the XML content is there. Then I call Release() on the IStream ... | ildjarn was right, I was passing it to an object that didn't get deleted, because I didn't knew that QueryInterface incremented the reference count ( I tought it was kind of a "COM" way of casting a pointer ). Releasing that object released the file at the same time. A beginner mistake from someone not used to COM prog... | How to close a file handle opened with SHCreateStreamOnFile Since I need to format "pretty" XML using MSXML, I am using the trick referenced here to add indentation to my code. Since all I want is to save a file, I open an IStream using SHCreateStreamOnFile(). The file gets saved, I can open it in a text editor and the... | TITLE:
How to close a file handle opened with SHCreateStreamOnFile
QUESTION:
Since I need to format "pretty" XML using MSXML, I am using the trick referenced here to add indentation to my code. Since all I want is to save a file, I open an IStream using SHCreateStreamOnFile(). The file gets saved, I can open it in a t... | [
"c++",
"windows",
"com"
] | 2 | 1 | 4,078 | 2 | 0 | 2011-05-31T22:01:19.803000 | 2011-06-02T03:04:40.573000 |
6,194,081 | 6,194,125 | How to join three degrees in mySQL | I have following tables: users(id, name) posts (id, text, userId) comments (id, text, userId, postId) I want to return a post, its owner name, its comments, and the owner of each comment. I can't get data for the owner of the comment. I wrote this: SELECT posts.id, posts.text, users.id, users.name, comments.text AS com... | Hmm, break the query down. OK, firstly a small correction SELECT posts.id, posts.text, users.id, users.name, comments.text AS commentText, commenters.id, commenters.name FROM posts JOIN users ON posts.userId = users.id LEFT JOIN comments ON posts.id = comments.postId LEFT JOIN users AS commenters ON comments.userId = c... | How to join three degrees in mySQL I have following tables: users(id, name) posts (id, text, userId) comments (id, text, userId, postId) I want to return a post, its owner name, its comments, and the owner of each comment. I can't get data for the owner of the comment. I wrote this: SELECT posts.id, posts.text, users.i... | TITLE:
How to join three degrees in mySQL
QUESTION:
I have following tables: users(id, name) posts (id, text, userId) comments (id, text, userId, postId) I want to return a post, its owner name, its comments, and the owner of each comment. I can't get data for the owner of the comment. I wrote this: SELECT posts.id, p... | [
"mysql",
"join"
] | 0 | 3 | 70 | 1 | 0 | 2011-05-31T22:01:49.593000 | 2011-05-31T22:06:12.360000 |
6,194,082 | 6,194,319 | Map Resources for Map Development | I am attempting a GPS application and i wanted to use Google maps API to create it. I was wondering if you guys had any resources such as the name of some books, websites, videos that i can purchase, and tutorials that i can look at to help me in creating the application. I am looking at using technologies such as java... | They have a bunch of examples,tutorials, demoes and documentations on google maps home page http://code.google.com/apis/maps/index.html You can also check examples in action and try your own modification in google code playground http://code.google.com/apis/ajax/playground/ There is another tutorial here: http://econym... | Map Resources for Map Development I am attempting a GPS application and i wanted to use Google maps API to create it. I was wondering if you guys had any resources such as the name of some books, websites, videos that i can purchase, and tutorials that i can look at to help me in creating the application. I am looking ... | TITLE:
Map Resources for Map Development
QUESTION:
I am attempting a GPS application and i wanted to use Google maps API to create it. I was wondering if you guys had any resources such as the name of some books, websites, videos that i can purchase, and tutorials that i can look at to help me in creating the applicat... | [
"google-maps",
"maps",
"bing-maps"
] | 0 | 1 | 64 | 1 | 0 | 2011-05-31T22:01:56.863000 | 2011-05-31T22:31:46.383000 |
6,194,089 | 6,195,165 | The page cannot be displayed error Facebook | This is the FB Url I am trying to access. https://graph.facebook.com/oauth/authorize?client_id=694aa71aed60fb9d79aae04b81ff27c8&redirect_uri=http://localhost/TestConnect/Facebook.aspx&scope=email,user_about_me,user_interests,user_likes,user_location,user_notes,user_education_hi It says The page cannot be displayed Ther... | Here is your URL: https://graph.facebook.com/oauth/authorize?client_id=694aa71aed60fb9d79aae04b81ff27c8 &redirect_uri=http://localhost/TestConnect/Facebook.aspx &scope=email,user_about_me,user_interests,user_likes,user_location,user_notes,user_education_hi When changing redirect_uri to http://localhost it works fine fo... | The page cannot be displayed error Facebook This is the FB Url I am trying to access. https://graph.facebook.com/oauth/authorize?client_id=694aa71aed60fb9d79aae04b81ff27c8&redirect_uri=http://localhost/TestConnect/Facebook.aspx&scope=email,user_about_me,user_interests,user_likes,user_location,user_notes,user_education_... | TITLE:
The page cannot be displayed error Facebook
QUESTION:
This is the FB Url I am trying to access. https://graph.facebook.com/oauth/authorize?client_id=694aa71aed60fb9d79aae04b81ff27c8&redirect_uri=http://localhost/TestConnect/Facebook.aspx&scope=email,user_about_me,user_interests,user_likes,user_location,user_not... | [
"facebook"
] | 0 | 0 | 1,902 | 1 | 0 | 2011-05-31T22:02:18.137000 | 2011-06-01T00:56:41.533000 |
6,194,100 | 6,194,361 | Complicated Pivot | I have reduced a complex schema to the following samples Students StudentID int, Name varchar(50) 1, Bill 2, Amy 3, Beth 4, Scott 5, Steve Classes ClassID int, Name varchar(50), Period varchar(50) 1, Algebra, Period1 2, Geography, Period3 3, Biology, Period5 4, Physics, Period4 5, Speech, Period2 6, History, Period6 an... | Assuming SQL Server 2005 (at least), using ROW_NUMBER() to order the choices: SELECT Name, Choice1, Choice2, Choice3, Choice4, Choice5, Choice6 FROM ( SELECT S.Name AS [NAME], 'Choice' + CAST(ROW_NUMBER() OVER(PARTITION BY S.Name ORDER BY S.Name, C.Period) AS VARCHAR) AS PIVOT_CODE, C.Name as [Class] FROM Classes C JOI... | Complicated Pivot I have reduced a complex schema to the following samples Students StudentID int, Name varchar(50) 1, Bill 2, Amy 3, Beth 4, Scott 5, Steve Classes ClassID int, Name varchar(50), Period varchar(50) 1, Algebra, Period1 2, Geography, Period3 3, Biology, Period5 4, Physics, Period4 5, Speech, Period2 6, H... | TITLE:
Complicated Pivot
QUESTION:
I have reduced a complex schema to the following samples Students StudentID int, Name varchar(50) 1, Bill 2, Amy 3, Beth 4, Scott 5, Steve Classes ClassID int, Name varchar(50), Period varchar(50) 1, Algebra, Period1 2, Geography, Period3 3, Biology, Period5 4, Physics, Period4 5, Sp... | [
"sql",
"pivot"
] | 5 | 5 | 683 | 1 | 0 | 2011-05-31T22:03:35.710000 | 2011-05-31T22:38:56.773000 |
6,194,106 | 6,194,135 | Unsure about website address structure | In my websites normally I use Ajax, so the address is always something like www.xxx.com for all pages. But now I read and search in google and I cant understand how is made this type of site: https://welshare.com/login
https://welshare.com/signup If I change the address bar to login.php or asp or html the page gives a... | If you are using apache as your server, you'll want to look into mod_rewrite. IIS also has an extension for this called URL rewrite. Edit To elaborate on how it works: Once you have your rules set up, it will look at the requested URL (say, mysite.com/test ) and then on the server side, actually send a request to mysit... | Unsure about website address structure In my websites normally I use Ajax, so the address is always something like www.xxx.com for all pages. But now I read and search in google and I cant understand how is made this type of site: https://welshare.com/login
https://welshare.com/signup If I change the address bar to lo... | TITLE:
Unsure about website address structure
QUESTION:
In my websites normally I use Ajax, so the address is always something like www.xxx.com for all pages. But now I read and search in google and I cant understand how is made this type of site: https://welshare.com/login
https://welshare.com/signup If I change the... | [
"html",
"web",
"ip-address"
] | 1 | 1 | 63 | 2 | 0 | 2011-05-31T22:04:06.940000 | 2011-05-31T22:07:19.630000 |
6,194,109 | 6,194,233 | Increment forever and you get -2147483648? | For a clever and complicated reason that I don't really want to explain (because it involves making a timer in an extremely ugly and hacky way), I wrote some C# code sort of like this: int i = 0; while (i >= 0) i++; //Should increment forever Console.Write(i); I expected the program to hang forever or crash or somethin... | In C#, the built-in integers are represented by a sequence of bit values of a predefined length. For the basic int datatype that length is 32 bits. Since 32 bits can only represent 4,294,967,296 different possible values (since that is 2^32), clearly your code will not loop forever with continually increasing values. S... | Increment forever and you get -2147483648? For a clever and complicated reason that I don't really want to explain (because it involves making a timer in an extremely ugly and hacky way), I wrote some C# code sort of like this: int i = 0; while (i >= 0) i++; //Should increment forever Console.Write(i); I expected the p... | TITLE:
Increment forever and you get -2147483648?
QUESTION:
For a clever and complicated reason that I don't really want to explain (because it involves making a timer in an extremely ugly and hacky way), I wrote some C# code sort of like this: int i = 0; while (i >= 0) i++; //Should increment forever Console.Write(i)... | [
"c#",
"loops",
"increment",
"infinite-loop",
"integer-overflow"
] | 5 | 12 | 6,966 | 9 | 0 | 2011-05-31T22:04:17.050000 | 2011-05-31T22:20:12.750000 |
6,194,110 | 6,253,153 | Take a lat/long pair from JavaScript for use in date_sunset in PHP | I have decided i'd like to do an ambitious mood change depending on the time of day. I need to get the time and compare it against the sunset and sunrise of any given day. So far I have found some javascript here that works well. Can anyone tell me how I might give the lat and long to the PHP function date_sunset? I ha... | This question had no answer as such, I ended up getting a PHP module and.dat file installed on my hosting for me. The AJAX did work, but only after a page from my site had been visited - which was no use sadly. Thanks for the help everyone.. | Take a lat/long pair from JavaScript for use in date_sunset in PHP I have decided i'd like to do an ambitious mood change depending on the time of day. I need to get the time and compare it against the sunset and sunrise of any given day. So far I have found some javascript here that works well. Can anyone tell me how ... | TITLE:
Take a lat/long pair from JavaScript for use in date_sunset in PHP
QUESTION:
I have decided i'd like to do an ambitious mood change depending on the time of day. I need to get the time and compare it against the sunset and sunrise of any given day. So far I have found some javascript here that works well. Can a... | [
"php",
"javascript",
"date"
] | 0 | 0 | 336 | 3 | 0 | 2011-05-31T22:04:22.687000 | 2011-06-06T13:59:27.453000 |
6,194,116 | 6,194,194 | Creating a custom layout for preferences | I'm trying to create a custom layout for managing preferences. I know there is the standard and recommended layout provided by PreferenceActivity, but if I want to add, say, a Button, how can I get that? I plan to design the application so that when the user touches a certain item on the main activity screen, it goes t... | You can always create a custom preference layout item and use it in the PreferenceActivity. For example, I did this: It has some waste, but basically creates 2 lines (heading, subtitle) with an image on the right. You could replace the ImageView with a Button and you'd be all set. You then set the layout for the indivi... | Creating a custom layout for preferences I'm trying to create a custom layout for managing preferences. I know there is the standard and recommended layout provided by PreferenceActivity, but if I want to add, say, a Button, how can I get that? I plan to design the application so that when the user touches a certain it... | TITLE:
Creating a custom layout for preferences
QUESTION:
I'm trying to create a custom layout for managing preferences. I know there is the standard and recommended layout provided by PreferenceActivity, but if I want to add, say, a Button, how can I get that? I plan to design the application so that when the user to... | [
"android"
] | 47 | 86 | 70,425 | 2 | 0 | 2011-05-31T22:05:08.780000 | 2011-05-31T22:13:24.720000 |
6,194,117 | 6,194,177 | Simple Django program causing me trouble | I've gone through quite a few django tutorials, and I'm finally getting ready to head out on my own. However, my first non-tutorial program is throwing an error, and I've been banging my head for a couple of days. I expect it to be a very noob problem, because, well, I am. When I use this view def todo(request): latest... | return render_to_response,('index.html', {"latest_list", latest_list}) Remove that comma affer render_to_response and you should be ok. Reason: the comma makes the return value a tuple object, but need to return an HttpResponse object from a view. | Simple Django program causing me trouble I've gone through quite a few django tutorials, and I'm finally getting ready to head out on my own. However, my first non-tutorial program is throwing an error, and I've been banging my head for a couple of days. I expect it to be a very noob problem, because, well, I am. When ... | TITLE:
Simple Django program causing me trouble
QUESTION:
I've gone through quite a few django tutorials, and I'm finally getting ready to head out on my own. However, my first non-tutorial program is throwing an error, and I've been banging my head for a couple of days. I expect it to be a very noob problem, because,... | [
"python",
"django"
] | 1 | 2 | 2,711 | 2 | 0 | 2011-05-31T22:05:31.730000 | 2011-05-31T22:11:30.693000 |
6,194,122 | 6,194,339 | Viewing flash images or files in rails 3.1 | its is not so easy to display flash files the way you display images and videos in rails. pls Does anyone have an idea how i can display flash images in rails. im using rails 3.0.8.rc4? | To display flash content in Rails you would just embed it in your view files. Erb is really just HTML with some nice ways to include typical Ruby code in them. Why don't you try embedding swf content as you would normally? If you have any other questions feel free to ask. | Viewing flash images or files in rails 3.1 its is not so easy to display flash files the way you display images and videos in rails. pls Does anyone have an idea how i can display flash images in rails. im using rails 3.0.8.rc4? | TITLE:
Viewing flash images or files in rails 3.1
QUESTION:
its is not so easy to display flash files the way you display images and videos in rails. pls Does anyone have an idea how i can display flash images in rails. im using rails 3.0.8.rc4?
ANSWER:
To display flash content in Rails you would just embed it in you... | [
"ruby-on-rails-3"
] | 0 | 1 | 230 | 1 | 0 | 2011-05-31T22:05:55.080000 | 2011-05-31T22:34:57.830000 |
6,194,134 | 6,194,340 | Using the ruby gem net-ssh-multi to execute a sudo command on multiple servers at once | In a previous question I figured out how to start a password-authenticated ssh sessions on multiple servers to run a single command. Now I need to be able to execute a "sudo" command. The problem is, that net-ssh-multi does not allocate a pseudo terminal (pty), which sudo needs to run, resulting in the following error:... | Can you try something like this: channel.request_pty do |c, success| if success command = "sudo YOUR_COMMAND" c.exec(command) do |c, success| # Some processing end end end In this case 'sudo' is inside. | Using the ruby gem net-ssh-multi to execute a sudo command on multiple servers at once In a previous question I figured out how to start a password-authenticated ssh sessions on multiple servers to run a single command. Now I need to be able to execute a "sudo" command. The problem is, that net-ssh-multi does not alloc... | TITLE:
Using the ruby gem net-ssh-multi to execute a sudo command on multiple servers at once
QUESTION:
In a previous question I figured out how to start a password-authenticated ssh sessions on multiple servers to run a single command. Now I need to be able to execute a "sudo" command. The problem is, that net-ssh-mu... | [
"ruby",
"sudo",
"net-ssh"
] | 5 | 8 | 5,290 | 3 | 0 | 2011-05-31T22:07:15.620000 | 2011-05-31T22:35:29.377000 |
6,194,144 | 6,194,166 | Regular Expression in JS | How do you trim all of the text after a comma using JS? I have: string = Doyletown, PA I want: s tring = Doyletown | How about a split: var string = 'Doyletown, PA'; var parts = string.split(','); if (parts.length > 0) { var result = parts[0]; alert(result); // alerts Doyletown } | Regular Expression in JS How do you trim all of the text after a comma using JS? I have: string = Doyletown, PA I want: s tring = Doyletown | TITLE:
Regular Expression in JS
QUESTION:
How do you trim all of the text after a comma using JS? I have: string = Doyletown, PA I want: s tring = Doyletown
ANSWER:
How about a split: var string = 'Doyletown, PA'; var parts = string.split(','); if (parts.length > 0) { var result = parts[0]; alert(result); // alerts D... | [
"javascript",
"jquery",
"regex",
"string"
] | 0 | 4 | 151 | 5 | 0 | 2011-05-31T22:08:03.340000 | 2011-05-31T22:09:50.503000 |
6,194,164 | 6,194,175 | JSPX EL 2.2 method calling using EL 2.1 | I have JSP that works fine in Tomcat 7 but does not work in Tomcat 6 which I assume is the fact that you cannot call methods (other than getters/setter) from EL 2.1. The method I need to call cannot be named as a getter. | I figured out a workaround and thought I would post the answer: If you have Spring installed you can use Spring EL so that you can call methods on objects For example: | JSPX EL 2.2 method calling using EL 2.1 I have JSP that works fine in Tomcat 7 but does not work in Tomcat 6 which I assume is the fact that you cannot call methods (other than getters/setter) from EL 2.1. The method I need to call cannot be named as a getter. | TITLE:
JSPX EL 2.2 method calling using EL 2.1
QUESTION:
I have JSP that works fine in Tomcat 7 but does not work in Tomcat 6 which I assume is the fact that you cannot call methods (other than getters/setter) from EL 2.1. The method I need to call cannot be named as a getter.
ANSWER:
I figured out a workaround and t... | [
"el",
"jspx"
] | 3 | 4 | 995 | 1 | 0 | 2011-05-31T22:09:49.723000 | 2011-05-31T22:11:03.093000 |
6,194,170 | 6,195,427 | Prevent an exception with jQuery UI Tabs | I am adding some custom tabs to a jquery ui tab control. $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0); $('a[href="#tabContent0"]').attr("href","javascript:window.location='http://www.google.co.uk';"); Yes this is a bit of a hack, but it is exactly what i need and provide a nice way to give links ba... | It works OK for me in Chrome and IE8. I also tried this code and it worked: $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0); $('a[href="#tabContent0"]').click(function() { document.location='http://www.google.co.uk/'; }); Instead of changing href attribute, I add a handler on the click event of the ne... | Prevent an exception with jQuery UI Tabs I am adding some custom tabs to a jquery ui tab control. $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0); $('a[href="#tabContent0"]').attr("href","javascript:window.location='http://www.google.co.uk';"); Yes this is a bit of a hack, but it is exactly what i nee... | TITLE:
Prevent an exception with jQuery UI Tabs
QUESTION:
I am adding some custom tabs to a jquery ui tab control. $("#tabs").tabs("add","#tabContent0","CLICK ME TO CHANGE PAGE",0); $('a[href="#tabContent0"]').attr("href","javascript:window.location='http://www.google.co.uk';"); Yes this is a bit of a hack, but it is ... | [
"javascript",
"jquery",
"jquery-ui"
] | 1 | 2 | 1,132 | 2 | 0 | 2011-05-31T22:10:30.053000 | 2011-06-01T01:47:00.747000 |
6,194,178 | 6,194,232 | SQL Design Decision: Should I merge these tables? | I'm attempting to design a small database for a customer. My customer has an organization that works with public and private schools; for every school that's involved, there's an implementation (a chapter) at each school. To design this, I've put together two tables; one for schools and one for chapters. I'm not sure, ... | I think they should be kept separate. But, you can make the chapter a subtype of a school (and the school the supertype) and use the same ID. Elsewhere in the database where you use SchoolID you mean the school and where you use ChapterID you mean the chapter. CREATE TABLE School ( SchoolID int unsigned NOT NULL AUTO_I... | SQL Design Decision: Should I merge these tables? I'm attempting to design a small database for a customer. My customer has an organization that works with public and private schools; for every school that's involved, there's an implementation (a chapter) at each school. To design this, I've put together two tables; on... | TITLE:
SQL Design Decision: Should I merge these tables?
QUESTION:
I'm attempting to design a small database for a customer. My customer has an organization that works with public and private schools; for every school that's involved, there's an implementation (a chapter) at each school. To design this, I've put toget... | [
"mysql",
"sql",
"database",
"database-design"
] | 2 | 3 | 219 | 4 | 0 | 2011-05-31T22:11:40.020000 | 2011-05-31T22:20:07.040000 |
6,194,179 | 6,195,221 | How to create a folder on WebMatrix | How do I create a sub folder within the Pictures folder? I need this because when you save a project, will create a folder where the folder name is the project code, and then I will save the images in this folder. | 1) Click the Files Workspace (in the Left Panel) 2) Select the parent folder (or root of the site) in the Tree 3) In the Ribbon, in the "New" Button, click only the Arrow (the bottom of the button) and you will see a "New Folder" option. Note that if you click the center of the button you will get the "new file dialog"... | How to create a folder on WebMatrix How do I create a sub folder within the Pictures folder? I need this because when you save a project, will create a folder where the folder name is the project code, and then I will save the images in this folder. | TITLE:
How to create a folder on WebMatrix
QUESTION:
How do I create a sub folder within the Pictures folder? I need this because when you save a project, will create a folder where the folder name is the project code, and then I will save the images in this folder.
ANSWER:
1) Click the Files Workspace (in the Left P... | [
"iis-7",
"directory",
"razor",
"virtual-directory",
"webmatrix"
] | 1 | 1 | 623 | 1 | 0 | 2011-05-31T22:11:40.220000 | 2011-06-01T01:06:40.923000 |
6,194,180 | 6,207,471 | JSON how find another value at the same index from a value in Javascript Object | A simple question I'm sure, but I can't figure it out. I have some JSON returned from the server while ($Row = mysql_fetch_array($params)) { $jsondata[]= array('adc'=>$Row["adc"], 'adSNU'=>$Row["adSNU"], 'adname'=>$Row["adname"], 'adcl'=>$Row["adcl"], 'adt'=>$Row["adt"]); };
echo json_encode(array("Ships" => $jsondata... | I could not find a way of finding the index as asked, but I created a variation on the answer by Devraj. In the solution I created a custom attribute called key into which I stored the index. newWShip.key = i; Later when I need the index back again I can use this.key inside the JQuery.click() method: var key = this.key... | JSON how find another value at the same index from a value in Javascript Object A simple question I'm sure, but I can't figure it out. I have some JSON returned from the server while ($Row = mysql_fetch_array($params)) { $jsondata[]= array('adc'=>$Row["adc"], 'adSNU'=>$Row["adSNU"], 'adname'=>$Row["adname"], 'adcl'=>$R... | TITLE:
JSON how find another value at the same index from a value in Javascript Object
QUESTION:
A simple question I'm sure, but I can't figure it out. I have some JSON returned from the server while ($Row = mysql_fetch_array($params)) { $jsondata[]= array('adc'=>$Row["adc"], 'adSNU'=>$Row["adSNU"], 'adname'=>$Row["ad... | [
"javascript",
"jquery",
"json",
"object"
] | 0 | 0 | 504 | 3 | 0 | 2011-05-31T22:11:47.290000 | 2011-06-01T20:48:31.350000 |
6,194,190 | 6,194,221 | Getting a syntax error when executing SQL statement | I have the following method that drops the database but I get a syntax error and I dont know what is going on. public void deleteDB(){ try{ Statement s = conn.createStatement(); System.out.println("Deleteting database..."); s.execute("DROP DATABASE Courses"); System.out.println("Database deleted."); } catch(SQLExceptio... | Do you have a database called courses? or a table named courses? according to this: http://db.apache.org/derby/docs/10.0/manuals/develop/develop13.html There is no drop database command. To drop a database, delete the database directory with operating system commands. | Getting a syntax error when executing SQL statement I have the following method that drops the database but I get a syntax error and I dont know what is going on. public void deleteDB(){ try{ Statement s = conn.createStatement(); System.out.println("Deleteting database..."); s.execute("DROP DATABASE Courses"); System.o... | TITLE:
Getting a syntax error when executing SQL statement
QUESTION:
I have the following method that drops the database but I get a syntax error and I dont know what is going on. public void deleteDB(){ try{ Statement s = conn.createStatement(); System.out.println("Deleteting database..."); s.execute("DROP DATABASE C... | [
"java",
"sql",
"embedded-database"
] | 2 | 10 | 2,002 | 1 | 0 | 2011-05-31T22:13:09.883000 | 2011-05-31T22:17:09.270000 |
6,194,193 | 6,194,219 | Dealing with the Tkinter Text Widgets Indexing System. | How do I split a floating point number. For example: 1.24345 would return 24345 1455.24 would return 24 1455.0 would return 0 Edit: My solution inspired by Nick ODell. This is oriented specifically toward the Tkinter Text widget. index = '140.2020'
split = index.split('.')
nindex = [int(i) for i in split]
print nind... | Assuming that 'index' is a string since you are dealing with a text widget index: int(index.split('.')[-1]) If you really do have a floating point number, you need to convert it to a string first: int(str(index).split('.')[-1]) | Dealing with the Tkinter Text Widgets Indexing System. How do I split a floating point number. For example: 1.24345 would return 24345 1455.24 would return 24 1455.0 would return 0 Edit: My solution inspired by Nick ODell. This is oriented specifically toward the Tkinter Text widget. index = '140.2020'
split = index.s... | TITLE:
Dealing with the Tkinter Text Widgets Indexing System.
QUESTION:
How do I split a floating point number. For example: 1.24345 would return 24345 1455.24 would return 24 1455.0 would return 0 Edit: My solution inspired by Nick ODell. This is oriented specifically toward the Tkinter Text widget. index = '140.2020... | [
"python",
"text",
"indexing",
"tkinter"
] | 1 | 5 | 1,480 | 4 | 0 | 2011-05-31T22:13:19.710000 | 2011-05-31T22:16:59.270000 |
6,194,200 | 6,194,295 | Sharing an Xcode project between different teams | I'm a novice iOS developer with a basic knowledge of Xcode. I have one app in the app store that I made myself with Titanium. For a next project I've enlisted the help of two more experienced programmers in another city. I have a question in two parts about the collaboration between us: I want to propose a work routine... | Use source control. Github is a great place to start. (private repositories will cost money though.) I used to use DropBox to share code between my two machines, but DropBox would routinely ruin work if I wasnt careful. DropBox is NOT version control. If you do insist in using Dropbox, don't open your code on more than... | Sharing an Xcode project between different teams I'm a novice iOS developer with a basic knowledge of Xcode. I have one app in the app store that I made myself with Titanium. For a next project I've enlisted the help of two more experienced programmers in another city. I have a question in two parts about the collabora... | TITLE:
Sharing an Xcode project between different teams
QUESTION:
I'm a novice iOS developer with a basic knowledge of Xcode. I have one app in the app store that I made myself with Titanium. For a next project I've enlisted the help of two more experienced programmers in another city. I have a question in two parts a... | [
"ios",
"xcode",
"dropbox",
"collaboration"
] | 0 | 2 | 1,889 | 2 | 0 | 2011-05-31T22:14:16.447000 | 2011-05-31T22:28:59.903000 |
6,194,204 | 6,194,228 | Android: Login screen with noHistory and SharePrefs but after exit app it goes back to Login screen | I was able to open the app and it starts by opening the login screen and after login it takes you to the MainActivity. From MainActivity there is no back to login and it would stay in session until logout. But when I exit the app it would go back to the login screen even tho I have a Sharedpref which saves the username... | In Login.onCreate(), check for the user ID in the SharedPref. If it exists, go directly to the MainActivity. | Android: Login screen with noHistory and SharePrefs but after exit app it goes back to Login screen I was able to open the app and it starts by opening the login screen and after login it takes you to the MainActivity. From MainActivity there is no back to login and it would stay in session until logout. But when I exi... | TITLE:
Android: Login screen with noHistory and SharePrefs but after exit app it goes back to Login screen
QUESTION:
I was able to open the app and it starts by opening the login screen and after login it takes you to the MainActivity. From MainActivity there is no back to login and it would stay in session until logo... | [
"android",
"authentication",
"history",
"logout",
"sharedpreferences"
] | 0 | 1 | 3,985 | 2 | 0 | 2011-05-31T22:14:39.770000 | 2011-05-31T22:19:06.257000 |
6,194,215 | 6,194,259 | the importance of facebook offline_access permission | What's the importance of the facebook offline_access permission? What it is useful for while the application can for example post to the user wall even if he is not logged in (of course after he once allowed access to the application without the offline_access permission). Thanks. | With the Facebook PHP SDK, you ask for the offline_access permission when generating the login link: $args['scope'] = 'offline_access'; $loginUrl = $facebook->getLoginUrl($args); echo ' Login with Facebook '; Then you can make API calls with that token: require "facebook.php"; $facebook = new Facebook(array( 'appId' =>... | the importance of facebook offline_access permission What's the importance of the facebook offline_access permission? What it is useful for while the application can for example post to the user wall even if he is not logged in (of course after he once allowed access to the application without the offline_access permis... | TITLE:
the importance of facebook offline_access permission
QUESTION:
What's the importance of the facebook offline_access permission? What it is useful for while the application can for example post to the user wall even if he is not logged in (of course after he once allowed access to the application without the off... | [
"facebook-php-sdk"
] | 1 | 1 | 2,182 | 2 | 0 | 2011-05-31T22:16:04.357000 | 2011-05-31T22:23:52.280000 |
6,194,217 | 6,231,061 | How to return a strongly-typed object from a SubSonic SPROC call with SPROC parameters? | I have a data caller method that returns a SubSonic collection of type ItemDatumCollection. The sproc is executed as follows: itemDatumCollection.LoadAndCloseReader(sp.GetReader()); However, I am unable to access the output parameters of the sproc in this fashion, as I am able to do when calling sp.GetDataSet() as foll... | I wanted to do something similar, and ended up changing most of the StoredProcedures.tt file, and I think some of the internals of SubSonic. Without getting too into detail, I changed by.tt file so that it would generate this for a given stored proc: public void COMPANIES_ACTIVATE_PACKAGE(long PI_COMPANY_ID, string PI_... | How to return a strongly-typed object from a SubSonic SPROC call with SPROC parameters? I have a data caller method that returns a SubSonic collection of type ItemDatumCollection. The sproc is executed as follows: itemDatumCollection.LoadAndCloseReader(sp.GetReader()); However, I am unable to access the output paramete... | TITLE:
How to return a strongly-typed object from a SubSonic SPROC call with SPROC parameters?
QUESTION:
I have a data caller method that returns a SubSonic collection of type ItemDatumCollection. The sproc is executed as follows: itemDatumCollection.LoadAndCloseReader(sp.GetReader()); However, I am unable to access t... | [
"c#",
"sql-server-2008",
"stored-procedures",
"subsonic",
"strongly-typed-dataset"
] | 0 | 0 | 432 | 1 | 0 | 2011-05-31T22:16:26.867000 | 2011-06-03T18:19:01.690000 |
6,194,222 | 6,194,640 | ActionScript play audio | I am just trying to make a simple.swf file that plays a piece of audio when it loads. This compiles but when I bring it up into the browser nothing happens. I could only find sprite based tutorials so I took a stab that you can extend Sound the same way as you would extend Sprite. The final version is going to be headl... | Rather than subclassing the Sound class, create a document class like this that contains a Sound class in it: package { import flash.display.Sprite; import flash.events.Event; import flash.events.IOErrorEvent; import flash.media.Sound; import flash.media.SoundChannel; import flash.net.URLRequest;
public class SoundPla... | ActionScript play audio I am just trying to make a simple.swf file that plays a piece of audio when it loads. This compiles but when I bring it up into the browser nothing happens. I could only find sprite based tutorials so I took a stab that you can extend Sound the same way as you would extend Sprite. The final vers... | TITLE:
ActionScript play audio
QUESTION:
I am just trying to make a simple.swf file that plays a piece of audio when it loads. This compiles but when I bring it up into the browser nothing happens. I could only find sprite based tutorials so I took a stab that you can extend Sound the same way as you would extend Spri... | [
"actionscript-3",
"audio",
"headless"
] | 0 | 2 | 665 | 1 | 0 | 2011-05-31T22:17:28.533000 | 2011-05-31T23:18:51.040000 |
6,194,225 | 6,194,239 | NSPredicate multiple field search | I'm trying to search multiple fields. Something like this: [NSPredicate predicateWithFormat:@"(name title contains[cd] %@) AND (title contains[cd] %@", self.searchBar.text]; A search is made on both the name field or the title field. Also, if anyone knows what a wildcard search would look like I'd appreciate that too. ... | First off, you must specify all the properties to examine, since there is no fixed or universal list of properties, and in Objective-C there is no real semantic distinction between a property and any other method. Second off, to examine multiple properties to see if they contain a search string, you should use OR, not ... | NSPredicate multiple field search I'm trying to search multiple fields. Something like this: [NSPredicate predicateWithFormat:@"(name title contains[cd] %@) AND (title contains[cd] %@", self.searchBar.text]; A search is made on both the name field or the title field. Also, if anyone knows what a wildcard search would l... | TITLE:
NSPredicate multiple field search
QUESTION:
I'm trying to search multiple fields. Something like this: [NSPredicate predicateWithFormat:@"(name title contains[cd] %@) AND (title contains[cd] %@", self.searchBar.text]; A search is made on both the name field or the title field. Also, if anyone knows what a wildc... | [
"iphone",
"ios",
"core-data",
"nspredicate"
] | 4 | 1 | 3,512 | 2 | 0 | 2011-05-31T22:18:02.680000 | 2011-05-31T22:21:03.043000 |
6,194,226 | 6,194,447 | Getting a crash relating to deallocated instance | I am getting a crash at line [selectedSession release]; in dealloc: Default [NSCheapMutableString release]: message sent to deallocated instance I don't understand why isn't this normal to put in dealloc? All current code below: LogViewController @implementation LogViewController
@synthesize fetchedResultsController =... | You posted a tableView:didSelectRowAtIndexPath:, but I don't think you told us which class that was in. In any case, that method seems to have a bug: selectedSession = (Session *)[__fetchedResultsController objectAtIndexPath:indexPath]; sessionViewController.selectedSession = self.selectedSession; I think on the first ... | Getting a crash relating to deallocated instance I am getting a crash at line [selectedSession release]; in dealloc: Default [NSCheapMutableString release]: message sent to deallocated instance I don't understand why isn't this normal to put in dealloc? All current code below: LogViewController @implementation LogViewC... | TITLE:
Getting a crash relating to deallocated instance
QUESTION:
I am getting a crash at line [selectedSession release]; in dealloc: Default [NSCheapMutableString release]: message sent to deallocated instance I don't understand why isn't this normal to put in dealloc? All current code below: LogViewController @imple... | [
"objective-c",
"memory-management",
"null"
] | 3 | 0 | 1,417 | 4 | 0 | 2011-05-31T22:18:40.470000 | 2011-05-31T22:52:21.330000 |
6,194,229 | 6,194,511 | Boldening text "Inside" a textarea | I have a textarea #myarea into which I'm typing text. I've typed this text. This is a sentence and only this word will end up being bolded Now I have a button on the side, like a bold button. I want to select the letters I want bolded, click the button, and see those letters turn bold inside the textarea. It's similar ... | If you don't mind using a div that has its ContentEditable property set to true then you can easily do this using: document.execCommand('bold',null,false); You can easily style this div to look and feel like a textarea. See jsFiddle here: http://jsfiddle.net/hqvDT/1/ | Boldening text "Inside" a textarea I have a textarea #myarea into which I'm typing text. I've typed this text. This is a sentence and only this word will end up being bolded Now I have a button on the side, like a bold button. I want to select the letters I want bolded, click the button, and see those letters turn bold... | TITLE:
Boldening text "Inside" a textarea
QUESTION:
I have a textarea #myarea into which I'm typing text. I've typed this text. This is a sentence and only this word will end up being bolded Now I have a button on the side, like a bold button. I want to select the letters I want bolded, click the button, and see those... | [
"javascript",
"jquery"
] | 4 | 8 | 4,318 | 1 | 0 | 2011-05-31T22:19:08.623000 | 2011-05-31T22:58:50.280000 |
6,194,240 | 6,194,304 | Using Python and Beautifulsoup how do I select the desired table in a div? | I would like to be able to select the table containing the "Accounts Payable" text but I'm not getting anywhere with what I'm trying and I'm pretty much guessing using findall. Can someone show me how I would do this? For example this is what I start with: Accounts Payable 222.82 92.54 100.34 99.95 Accrued Expenses 36.... | You can select the td elements with class lft lm and then examine the element.string to determine if you have the "Accounts Payable" td: import sys from BeautifulSoup import BeautifulSoup
# where so_soup.txt is your html f = open ("so_soup.txt", "r") data = f.readlines () f.close ()
soup = BeautifulSoup ("".join (dat... | Using Python and Beautifulsoup how do I select the desired table in a div? I would like to be able to select the table containing the "Accounts Payable" text but I'm not getting anywhere with what I'm trying and I'm pretty much guessing using findall. Can someone show me how I would do this? For example this is what I ... | TITLE:
Using Python and Beautifulsoup how do I select the desired table in a div?
QUESTION:
I would like to be able to select the table containing the "Accounts Payable" text but I'm not getting anywhere with what I'm trying and I'm pretty much guessing using findall. Can someone show me how I would do this? For examp... | [
"python",
"html-parsing",
"beautifulsoup"
] | 2 | 8 | 4,638 | 1 | 0 | 2011-05-31T22:21:02.950000 | 2011-05-31T22:30:03.287000 |
6,194,244 | 6,220,484 | downloading guice3.0 artifact from maven central repository | I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0. I'm trying to test it out using maven jetty. I've successfully upgraded my pom.xml to use the correct version and groupId for the 3.0 release, but if I call mvn jetty:run I see that it is trying to download guice-3.0-no_deps.jar which throws a build er... | I posted this question also to the guice user group. This is the answer I received. The guice-3.0-no_deps.jar is a build-time artifact that's used to compile the extensions, but is not required at runtime - it's not on maven central because the Guice team didn't want people depending on this "uber-jar" by mistake. The ... | downloading guice3.0 artifact from maven central repository I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0. I'm trying to test it out using maven jetty. I've successfully upgraded my pom.xml to use the correct version and groupId for the 3.0 release, but if I call mvn jetty:run I see that it is tryi... | TITLE:
downloading guice3.0 artifact from maven central repository
QUESTION:
I'm trying to upgrade my struts2 web app from guice2.0 to guice3.0. I'm trying to test it out using maven jetty. I've successfully upgraded my pom.xml to use the correct version and groupId for the 3.0 release, but if I call mvn jetty:run I s... | [
"maven",
"struts2",
"guice",
"maven-jetty-plugin",
"guice-3"
] | 0 | 1 | 471 | 1 | 0 | 2011-05-31T22:21:37.003000 | 2011-06-02T21:14:48.100000 |
6,194,247 | 6,194,321 | More LINQY-ness (sub-select) | I need to use LINQ to build a kind of weird query that uses a sub-query. I'm really looking for distinct records. Normally, the SQL would look like this: select distinct col1, col2 from foo where col3 = somevalue However, col2 just happens to be a BLOB, so I can't use distinct. So, I think that the next best SQL looks ... | Can you try this? var result = from f in foo where query.Contains(f.id) select new MyType() {col1 = f.col1, col2 = f.col2}; | More LINQY-ness (sub-select) I need to use LINQ to build a kind of weird query that uses a sub-query. I'm really looking for distinct records. Normally, the SQL would look like this: select distinct col1, col2 from foo where col3 = somevalue However, col2 just happens to be a BLOB, so I can't use distinct. So, I think ... | TITLE:
More LINQY-ness (sub-select)
QUESTION:
I need to use LINQ to build a kind of weird query that uses a sub-query. I'm really looking for distinct records. Normally, the SQL would look like this: select distinct col1, col2 from foo where col3 = somevalue However, col2 just happens to be a BLOB, so I can't use dist... | [
"c#",
"linq",
"entity-framework"
] | 1 | 1 | 96 | 1 | 0 | 2011-05-31T22:22:13.343000 | 2011-05-31T22:32:16.300000 |
6,194,249 | 6,194,457 | Terminate NSTask even if app crashes | If my app crashes I don't get a chance to terminate the NSTasks it spawned, so they stay around eating up resources. Is there any way to launch a task such that it terminates when your app terminates (even if it crashes)? | I suppose you need to handle application crashes manually and in a different way to terminate spawned processes. For example, you can check following article http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html and in exception/signal handler when the application crashes send terminate signal to your... | Terminate NSTask even if app crashes If my app crashes I don't get a chance to terminate the NSTasks it spawned, so they stay around eating up resources. Is there any way to launch a task such that it terminates when your app terminates (even if it crashes)? | TITLE:
Terminate NSTask even if app crashes
QUESTION:
If my app crashes I don't get a chance to terminate the NSTasks it spawned, so they stay around eating up resources. Is there any way to launch a task such that it terminates when your app terminates (even if it crashes)?
ANSWER:
I suppose you need to handle appli... | [
"objective-c",
"cocoa"
] | 6 | 3 | 2,270 | 4 | 0 | 2011-05-31T22:23:08.423000 | 2011-05-31T22:53:23.347000 |
6,194,257 | 6,194,293 | UIView animations in a loop | Is there a reason why animations do not work in a loop? I know you can do the command: [UIView setAnimationRepeatCount: someNumber]; which was working fine until I put actual different pdfs to be loaded. So before, with just one pdf that would always get loaded, when I did the animation say 5 times to go to the last do... | From my understanding of what you're doing, it sounds like you're actually running all 5 animations at once. When you perform an animation block in a for-loop, the runloop doesn't iterate between each loop and only the last animation gets run. What you'll need to use is use completion calls and "chain" them together. S... | UIView animations in a loop Is there a reason why animations do not work in a loop? I know you can do the command: [UIView setAnimationRepeatCount: someNumber]; which was working fine until I put actual different pdfs to be loaded. So before, with just one pdf that would always get loaded, when I did the animation say ... | TITLE:
UIView animations in a loop
QUESTION:
Is there a reason why animations do not work in a loop? I know you can do the command: [UIView setAnimationRepeatCount: someNumber]; which was working fine until I put actual different pdfs to be loaded. So before, with just one pdf that would always get loaded, when I did ... | [
"objective-c",
"iphone",
"core-animation"
] | 1 | 5 | 3,561 | 1 | 0 | 2011-05-31T22:23:49.800000 | 2011-05-31T22:28:35.083000 |
6,194,262 | 6,194,275 | High performance PHP simaliraty checking on large database | I have 30,000 rows in a database that need to be similarity checked (using similar_text or another such function). In order to do this it will require doing 30,000^2 checks for each columns. I estimate I will be checking on average 4 columns. This means I will have to do 3,600,000,000 checks. What is the best (fastest,... | I guess you just need FULL TEXT search. If that not fits you, you have only one chance to solve this: cache the results. So you will not have to parse 3bil of records for each requests Anyway here how you can do it: $result = array();
$sql = "SELECT * FROM TABLE"; while( $row =... ) { $result[] = $row; //> Append the ... | High performance PHP simaliraty checking on large database I have 30,000 rows in a database that need to be similarity checked (using similar_text or another such function). In order to do this it will require doing 30,000^2 checks for each columns. I estimate I will be checking on average 4 columns. This means I will ... | TITLE:
High performance PHP simaliraty checking on large database
QUESTION:
I have 30,000 rows in a database that need to be similarity checked (using similar_text or another such function). In order to do this it will require doing 30,000^2 checks for each columns. I estimate I will be checking on average 4 columns. ... | [
"php",
"mysql",
"performance"
] | 1 | 1 | 282 | 2 | 0 | 2011-05-31T22:24:12.193000 | 2011-05-31T22:25:26.677000 |
6,194,285 | 6,198,474 | Dealing with Messy Dates | I hope you didn't think I was asking for relationship advice. Infrequently, I have to offer survey respondents the ability to specify when an event occurred. What results is a horribly messy string that I honestly just don't know what to do with. Beyond recoding by hand. Here it is a short sample, of thousands: c("May2... | My sympathy that your date didn't turn out as pretty as expected.;-) I have constructed a (still partial) solution along the lines suggested by @Rguy. (Please note that this code still has a bug: It does't always return the correct time. For some reason, it doesn't always do a greedy match on the digits before the colo... | Dealing with Messy Dates I hope you didn't think I was asking for relationship advice. Infrequently, I have to offer survey respondents the ability to specify when an event occurred. What results is a horribly messy string that I honestly just don't know what to do with. Beyond recoding by hand. Here it is a short samp... | TITLE:
Dealing with Messy Dates
QUESTION:
I hope you didn't think I was asking for relationship advice. Infrequently, I have to offer survey respondents the ability to specify when an event occurred. What results is a horribly messy string that I honestly just don't know what to do with. Beyond recoding by hand. Here ... | [
"r"
] | 36 | 21 | 2,364 | 5 | 0 | 2011-05-31T22:26:54.077000 | 2011-06-01T08:44:44.320000 |
6,194,292 | 6,194,358 | Where's my ImageViews? | I've got a horizontal LinearLayout (inside of another LinearLayout ) containing a few ImageView s. For some reason I'm just just not seeing them when I run the app. Here's my layout: | I take it that you can see the TextView then? LinearLayout s are horizontal by default. This might be happening because Android is trying to draw the ImageView s to the right of the TextView when I'm guessing you want them below it. Try adding android:orientation="vertical" to the outer LinearLayout and removing androi... | Where's my ImageViews? I've got a horizontal LinearLayout (inside of another LinearLayout ) containing a few ImageView s. For some reason I'm just just not seeing them when I run the app. Here's my layout: | TITLE:
Where's my ImageViews?
QUESTION:
I've got a horizontal LinearLayout (inside of another LinearLayout ) containing a few ImageView s. For some reason I'm just just not seeing them when I run the app. Here's my layout:
ANSWER:
I take it that you can see the TextView then? LinearLayout s are horizontal by default.... | [
"android",
"android-layout"
] | 0 | 3 | 65 | 3 | 0 | 2011-05-31T22:28:15.930000 | 2011-05-31T22:38:15.743000 |
6,194,299 | 6,205,411 | Form dynamics broken in Firefox | I am currently in the process of creating a simple CMS designed specifically for the needs of my customer. The overall design uses a mysql database to store the page data in a table, and then those pages are accessed and displayed using AJAX. I have come to the part where I need to add the page editing features, And as... | Turns out it was a layering problem and I'm just a moron. In my CSS I made the container with the form in it have a z-index of -2. This caused another div to be on top of the form preventing the user from clicking on the form elements. Thank you to whoever looked at this question. | Form dynamics broken in Firefox I am currently in the process of creating a simple CMS designed specifically for the needs of my customer. The overall design uses a mysql database to store the page data in a table, and then those pages are accessed and displayed using AJAX. I have come to the part where I need to add t... | TITLE:
Form dynamics broken in Firefox
QUESTION:
I am currently in the process of creating a simple CMS designed specifically for the needs of my customer. The overall design uses a mysql database to store the page data in a table, and then those pages are accessed and displayed using AJAX. I have come to the part whe... | [
"php",
"javascript",
"mysql",
"forms",
"firefox"
] | 0 | 1 | 131 | 2 | 0 | 2011-05-31T22:29:26.660000 | 2011-06-01T17:39:38.340000 |
6,194,302 | 6,194,330 | How can I cleanly resize an iFrame with dragging functionality? | I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize. I'm using jQuery. Any help? | Iirc, the classical method is to put the IFrame inside of a div and make that div re-sizable; also make the iFrame's width and height at 100%. If you're using JQuery though, can you not use jQuery.load('uri') instead of an iFrame? I believe it's preferable in many situations. | How can I cleanly resize an iFrame with dragging functionality? I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize. I'm using jQuery. Any help? | TITLE:
How can I cleanly resize an iFrame with dragging functionality?
QUESTION:
I have an iFrame and I want the user to be able to grab one side of it and drag it to resize it. I don't want it to resize realtime, but rather use an indicator line and when the user releases, it'll resize. I'm using jQuery. Any help?
A... | [
"jquery",
"draggable"
] | 4 | 6 | 7,919 | 4 | 0 | 2011-05-31T22:29:53.433000 | 2011-05-31T22:33:24.253000 |
6,194,309 | 6,194,405 | A question about CABasicAnimation | - (IBAction) showCurrentTime: (id) sender
{ NSLog(@" --- showCurrentTime called --- ");
NSDate *now = [NSDate date];
static NSDateFormatter *formatter = nil;
if (!formatter) { formatter = [[NSDateFormatter alloc] init]; [formatter setTimeStyle: NSDateFormatterLongStyle]; }
[timeLabel setText: [formatter stringFrom... | try [CABasicAnimation animationWithKeyPath: @"transform.rotation"]; you forgot the "i" in rotation:) | A question about CABasicAnimation - (IBAction) showCurrentTime: (id) sender
{ NSLog(@" --- showCurrentTime called --- ");
NSDate *now = [NSDate date];
static NSDateFormatter *formatter = nil;
if (!formatter) { formatter = [[NSDateFormatter alloc] init]; [formatter setTimeStyle: NSDateFormatterLongStyle]; }
[timeLa... | TITLE:
A question about CABasicAnimation
QUESTION:
- (IBAction) showCurrentTime: (id) sender
{ NSLog(@" --- showCurrentTime called --- ");
NSDate *now = [NSDate date];
static NSDateFormatter *formatter = nil;
if (!formatter) { formatter = [[NSDateFormatter alloc] init]; [formatter setTimeStyle: NSDateFormatterLong... | [
"iphone",
"objective-c",
"cocoa-touch"
] | 0 | 5 | 549 | 1 | 0 | 2011-05-31T22:30:52.627000 | 2011-05-31T22:46:08.423000 |
6,194,311 | 6,194,595 | Integrating MsBuild with Git | Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources. MsBuild Comunity Tasks looks like doesn't have any support for Git. Any ideas how to connect these two is much appreciated. | Depending what you are doing and if you want to keep it simple, just use the Exec task to call the appropriate git command, like git tag You can otherwise look at extending MSBuild and write tasks that make use of these git commands or you can make use of GitSharp | Integrating MsBuild with Git Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources. MsBuild Comunity Tasks looks like doesn't have any support for Git. Any ideas how to connect these two is much appreciated. | TITLE:
Integrating MsBuild with Git
QUESTION:
Im looking for way to integrate MsBuild scripts with Git source control. The first thing I would like to make is to create Task that creates Git Tag at sources. MsBuild Comunity Tasks looks like doesn't have any support for Git. Any ideas how to connect these two is much a... | [
"git",
"msbuild"
] | 9 | 14 | 5,174 | 3 | 0 | 2011-05-31T22:30:58.113000 | 2011-05-31T23:11:32.993000 |
6,194,316 | 6,194,380 | How to check if a control is resigning first responder or become first responder? | I have a view that a content some NSTextfields and NSComboboxes. I want to do something when one of these controls resign first responder. I already try the delegate method - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor if ([control isKindOfClass: [NSTextField class]]){ //custom code re... | Try something resignFirstResponder instead of textShouldEndEditing | How to check if a control is resigning first responder or become first responder? I have a view that a content some NSTextfields and NSComboboxes. I want to do something when one of these controls resign first responder. I already try the delegate method - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText... | TITLE:
How to check if a control is resigning first responder or become first responder?
QUESTION:
I have a view that a content some NSTextfields and NSComboboxes. I want to do something when one of these controls resign first responder. I already try the delegate method - (BOOL)control:(NSControl *)control textShould... | [
"objective-c",
"cocoa",
"nstextfield",
"delegatecommand",
"resignfirstresponder"
] | 0 | 2 | 1,059 | 2 | 0 | 2011-05-31T22:31:25.737000 | 2011-05-31T22:41:39.710000 |
6,194,324 | 6,195,795 | How do I get the file path from my ActionMailer? | I'm developing a Rails 3 application, and I currently I would like to add an image as an attachment into an email. I'm doing the following right now: class CouponMailer < ActionMailer::Base default:from => "name@domain.com",:content_type => "multipart/mixed"
def send_coupon(recipient, coupon) @coupon = coupon @recipie... | It looks like RefineryCMS is using Dragonfly for file uploads. I believe you want to call.path on your picture to retrieve a file system path. Probably something like so: attachments.inline["#{coupon.picture.title}"] = File.read(coupon.picture.file) Have a look at the documentation for more info. You should find what y... | How do I get the file path from my ActionMailer? I'm developing a Rails 3 application, and I currently I would like to add an image as an attachment into an email. I'm doing the following right now: class CouponMailer < ActionMailer::Base default:from => "name@domain.com",:content_type => "multipart/mixed"
def send_co... | TITLE:
How do I get the file path from my ActionMailer?
QUESTION:
I'm developing a Rails 3 application, and I currently I would like to add an image as an attachment into an email. I'm doing the following right now: class CouponMailer < ActionMailer::Base default:from => "name@domain.com",:content_type => "multipart/m... | [
"ruby-on-rails-3"
] | 0 | 3 | 660 | 1 | 0 | 2011-05-31T22:32:38.413000 | 2011-06-01T02:59:13.923000 |
6,194,336 | 6,194,345 | jQuery HTML problem | I wrote this: Whatever. And it didn't work?. Thanks. | your element hasn't been rendered when your script runs... try this: | jQuery HTML problem I wrote this: Whatever. And it didn't work?. Thanks. | TITLE:
jQuery HTML problem
QUESTION:
I wrote this: Whatever. And it didn't work?. Thanks.
ANSWER:
your element hasn't been rendered when your script runs... try this: | [
"jquery"
] | 0 | 3 | 71 | 3 | 0 | 2011-05-31T22:34:31.077000 | 2011-05-31T22:36:26.833000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.