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,290,757 | 6,290,880 | Imposing Restrictions on the installation of apk | I want to make certain restrictions on distribution of the Android mobile application(apk). I am currently not uploading the apk to Android market. I want to provide the apk to the user with the following restrictions. i> After the Android mobile application(apk) is installed, the application should work for only 5 day... | Anything that you store on the device itself will be removed once the app is uninstalled, so you cannot check for a previous installation. You could hide something away on the SD card, you then cannot legislate for the user wiping their SD card, or swapping SD cards. I would suggest registering a unique ID for the app ... | Imposing Restrictions on the installation of apk I want to make certain restrictions on distribution of the Android mobile application(apk). I am currently not uploading the apk to Android market. I want to provide the apk to the user with the following restrictions. i> After the Android mobile application(apk) is inst... | TITLE:
Imposing Restrictions on the installation of apk
QUESTION:
I want to make certain restrictions on distribution of the Android mobile application(apk). I am currently not uploading the apk to Android market. I want to provide the apk to the user with the following restrictions. i> After the Android mobile applic... | [
"android"
] | 0 | 2 | 805 | 2 | 0 | 2011-06-09T09:32:21.030000 | 2011-06-09T09:42:26.813000 |
6,290,769 | 6,290,864 | Magento - Restrict some catogories for some customer groups | How can I hide/show some categories for some customers groups in Magento? Thanks a lot. | Here is what you need: https://github.com/Vinai/groupscatalog2 Why roll your own!?! | Magento - Restrict some catogories for some customer groups How can I hide/show some categories for some customers groups in Magento? Thanks a lot. | TITLE:
Magento - Restrict some catogories for some customer groups
QUESTION:
How can I hide/show some categories for some customers groups in Magento? Thanks a lot.
ANSWER:
Here is what you need: https://github.com/Vinai/groupscatalog2 Why roll your own!?! | [
"magento"
] | 6 | 7 | 14,416 | 3 | 0 | 2011-06-09T09:33:14.807000 | 2011-06-09T09:41:10.843000 |
6,290,772 | 6,290,838 | Flash Can you iteratively create unique variables? | Can you use a for(x:int=0; x<100; x++) { var varname+x:Type = (x, something, something); } To create one hundred unique variables? Basically I need to make 100 variables and am wondering how you create 100 vats with out resorting to Declaring them all by hand. the problem is var whatever+x just creates a variable with ... | Yes, try this: var holder:Object = {};
var i:uint = 0; for(i; i<100; i++) { holder["varname"+i] = i*2; }
trace(holder.varname34); //output: 68 If you make a class dynamic then you can assign new properties to it the same way, ie: package { public dynamic class UniqueVarHolder extends Object { public function UniqueVa... | Flash Can you iteratively create unique variables? Can you use a for(x:int=0; x<100; x++) { var varname+x:Type = (x, something, something); } To create one hundred unique variables? Basically I need to make 100 variables and am wondering how you create 100 vats with out resorting to Declaring them all by hand. the prob... | TITLE:
Flash Can you iteratively create unique variables?
QUESTION:
Can you use a for(x:int=0; x<100; x++) { var varname+x:Type = (x, something, something); } To create one hundred unique variables? Basically I need to make 100 variables and am wondering how you create 100 vats with out resorting to Declaring them all... | [
"flash",
"variables",
"iteration",
"names"
] | 0 | 1 | 60 | 1 | 0 | 2011-06-09T09:33:35.423000 | 2011-06-09T09:39:14.507000 |
6,290,778 | 6,290,882 | Is this type inference in java? | I have a generic method public K get() {... } When I call this method, I use a syntax like: Integer i = instance. get(); However, this is also legal: Integer i = instance.get(); My question is, is the second method call a form of type inference in Java? | Yes, this is type inference based on the assignment type. It's specified in section 15.12.2.8 of the JLS: If any of the method's type arguments were not inferred from the types of the actual arguments, they are now inferred as follows. If the method result occurs in a context where it will be subject to assignment conv... | Is this type inference in java? I have a generic method public K get() {... } When I call this method, I use a syntax like: Integer i = instance. get(); However, this is also legal: Integer i = instance.get(); My question is, is the second method call a form of type inference in Java? | TITLE:
Is this type inference in java?
QUESTION:
I have a generic method public K get() {... } When I call this method, I use a syntax like: Integer i = instance. get(); However, this is also legal: Integer i = instance.get(); My question is, is the second method call a form of type inference in Java?
ANSWER:
Yes, th... | [
"java",
"type-inference"
] | 3 | 5 | 230 | 1 | 0 | 2011-06-09T09:33:55.750000 | 2011-06-09T09:42:28.810000 |
6,290,782 | 6,290,812 | Question about UIWebview and Universal Application | I have an Universal Application and my question is, if it is possible to load two different html files in my UIWebview depending on the iDevice. Thanks for any answers. | you can use this... if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)//if device is ipad {
} else //if device is iPhone {
} | Question about UIWebview and Universal Application I have an Universal Application and my question is, if it is possible to load two different html files in my UIWebview depending on the iDevice. Thanks for any answers. | TITLE:
Question about UIWebview and Universal Application
QUESTION:
I have an Universal Application and my question is, if it is possible to load two different html files in my UIWebview depending on the iDevice. Thanks for any answers.
ANSWER:
you can use this... if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom... | [
"iphone",
"html",
"uiwebview",
"universal"
] | 2 | 7 | 609 | 2 | 0 | 2011-06-09T09:34:08.067000 | 2011-06-09T09:37:37.640000 |
6,290,787 | 6,291,214 | Maximize/Minimize external application | I have got Skype configured to launch minimized on windows starts. Now I need to bring Skype to front from a button from my full screen application button. I have got this code: For Each p As Process In Process.GetProcessesByName("skype") ShowWindow(p.MainWindowHandle, SHOW_WINDOW.SW_NORMAL) Next p It works but, when I... | Hope this helps? http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9bde4870-1599-4958-9ab4-902fa98ba53a/ | Maximize/Minimize external application I have got Skype configured to launch minimized on windows starts. Now I need to bring Skype to front from a button from my full screen application button. I have got this code: For Each p As Process In Process.GetProcessesByName("skype") ShowWindow(p.MainWindowHandle, SHOW_WINDOW... | TITLE:
Maximize/Minimize external application
QUESTION:
I have got Skype configured to launch minimized on windows starts. Now I need to bring Skype to front from a button from my full screen application button. I have got this code: For Each p As Process In Process.GetProcessesByName("skype") ShowWindow(p.MainWindowH... | [
"c#",
".net",
"vb.net"
] | 2 | 0 | 10,612 | 1 | 0 | 2011-06-09T09:34:42.947000 | 2011-06-09T10:13:29.983000 |
6,290,789 | 6,290,830 | Fibonacci Problem #2 from Project Euler with PHP | The question goes like this: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By >starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,... By considering the terms in the Fibonacci sequence whose values do not exceed four million, >find the sum of th... | Try changing $sum=array_sum($array[]); to $sum=array_sum($array); and see what it happens... Also, when you have a problem, it's good to let the others know what kind of problem it is. Like the error message or something like that... If by any chance there are no errors reported, try to turn them on. EDIT: I remember t... | Fibonacci Problem #2 from Project Euler with PHP The question goes like this: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By >starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,... By considering the terms in the Fibonacci sequence whose value... | TITLE:
Fibonacci Problem #2 from Project Euler with PHP
QUESTION:
The question goes like this: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By >starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89,... By considering the terms in the Fibonacci se... | [
"php",
"fibonacci"
] | 0 | 2 | 558 | 2 | 0 | 2011-06-09T09:34:52.567000 | 2011-06-09T09:38:54.960000 |
6,290,791 | 6,291,157 | wxPython: Problems with thread | My program keeps expanding. In my MainProgram method in the MainPanel class I'm using some functions from an other program. While using this the GUI hangs until that is finished and I want to solve this by using a new thread for this method. While doing this I get an error when executing OnRun. It says: Unhandled excep... | All interaction with wx object should be in the main thread. An easy fix would be to use something like wx.CallAfter(self.textOutput.SetValue, "output") instead of self.textOutput.SetValue("output"). wx.CallAfter sends to the main even loop what to execute as soon as it gets around to it and since the main loop is in t... | wxPython: Problems with thread My program keeps expanding. In my MainProgram method in the MainPanel class I'm using some functions from an other program. While using this the GUI hangs until that is finished and I want to solve this by using a new thread for this method. While doing this I get an error when executing ... | TITLE:
wxPython: Problems with thread
QUESTION:
My program keeps expanding. In my MainProgram method in the MainPanel class I'm using some functions from an other program. While using this the GUI hangs until that is finished and I want to solve this by using a new thread for this method. While doing this I get an err... | [
"multithreading",
"wxpython"
] | 1 | 2 | 1,498 | 3 | 0 | 2011-06-09T09:34:57.893000 | 2011-06-09T10:08:28.460000 |
6,290,802 | 6,290,874 | How do i get unique value from an array? | $a=array("a"=>"Cat","b"=>"Dog","c"=>"Cat"); From the above array i need the value Dog alone. how can i get the unique value from an array?. is there any functions in php?... Thanks Ravi | $a = array("a"=>"Cat","b"=>"Dog","c"=>"Cat"); $counted = array_count_values($a); $result = array(); foreach($counted as $key => $value) { if($value === 1) { $result[] = $key; } } //$result is now an array of only the unique values of $a print_r($result); | How do i get unique value from an array? $a=array("a"=>"Cat","b"=>"Dog","c"=>"Cat"); From the above array i need the value Dog alone. how can i get the unique value from an array?. is there any functions in php?... Thanks Ravi | TITLE:
How do i get unique value from an array?
QUESTION:
$a=array("a"=>"Cat","b"=>"Dog","c"=>"Cat"); From the above array i need the value Dog alone. how can i get the unique value from an array?. is there any functions in php?... Thanks Ravi
ANSWER:
$a = array("a"=>"Cat","b"=>"Dog","c"=>"Cat"); $counted = array_cou... | [
"php",
"arrays"
] | 1 | 2 | 3,547 | 6 | 0 | 2011-06-09T09:36:34.347000 | 2011-06-09T09:42:07.280000 |
6,290,805 | 6,290,827 | Can I count number of rows in joined table? | Like this: SELECT s.*, count( logs.* ) as ssh_count FROM servers s LEFT JOIN logs ON s.ip_address = logs.server_ip But I get an error with that query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* ) as ssh_count FROM servers s LE... | You can adress a table column, but you can't address table.*, you can do this for example: SELECT s.*, count( logs.server_ip ) as ssh_count FROM servers s LEFT JOIN logs ON s.ip_address = logs.server_ip | Can I count number of rows in joined table? Like this: SELECT s.*, count( logs.* ) as ssh_count FROM servers s LEFT JOIN logs ON s.ip_address = logs.server_ip But I get an error with that query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to ... | TITLE:
Can I count number of rows in joined table?
QUESTION:
Like this: SELECT s.*, count( logs.* ) as ssh_count FROM servers s LEFT JOIN logs ON s.ip_address = logs.server_ip But I get an error with that query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for th... | [
"mysql"
] | 0 | 3 | 3,901 | 1 | 0 | 2011-06-09T09:36:50.017000 | 2011-06-09T09:38:37.767000 |
6,290,811 | 6,290,896 | How to invalidate view I know has changed? | I'm developing a messaging system for a website. When user clicks on a message in Inbox, she goes to an individual message view that allows to reply to it. Now, imagine she clicks 'Back' right after seeing individual message. She'll see the inbox, but the message will still be highlighted as unread because the page has... | The standard way is to tell the webbrowser to reload the page from the server using meta tags. A combination of something like Usually works if you can insert in the header in your view. You can also configure these attributes via Response.Cache in your controller so that they are passed in the HTTP header. A more MVC-... | How to invalidate view I know has changed? I'm developing a messaging system for a website. When user clicks on a message in Inbox, she goes to an individual message view that allows to reply to it. Now, imagine she clicks 'Back' right after seeing individual message. She'll see the inbox, but the message will still be... | TITLE:
How to invalidate view I know has changed?
QUESTION:
I'm developing a messaging system for a website. When user clicks on a message in Inbox, she goes to an individual message view that allows to reply to it. Now, imagine she clicks 'Back' right after seeing individual message. She'll see the inbox, but the mes... | [
"html",
"asp.net-mvc",
"asp.net-mvc-3",
"caching",
"user-experience"
] | 0 | 2 | 540 | 1 | 0 | 2011-06-09T09:37:33.617000 | 2011-06-09T09:43:48.523000 |
6,290,813 | 6,290,938 | Locally deleting folder while ignoring its presence in the repo | To keep it simple I will use a simplistic example. I have a versioned folder A and there are two more folders X and Y and a file f. X and Y may contain any number and depth of files and folders. So the tree looks like this: A |-X | |-[...] | |-Y | |-[...] | |-f Now I have A with all contents fully recursively checked o... | I don't think there's a way to ignore a whole part of a directory tree like that in TortoiseSVN. I think the simplest solution would just be to only check out the parts of the repository that you need, i.e. instead of checking out from the root (A), check out X instead into its own folder. | Locally deleting folder while ignoring its presence in the repo To keep it simple I will use a simplistic example. I have a versioned folder A and there are two more folders X and Y and a file f. X and Y may contain any number and depth of files and folders. So the tree looks like this: A |-X | |-[...] | |-Y | |-[...] ... | TITLE:
Locally deleting folder while ignoring its presence in the repo
QUESTION:
To keep it simple I will use a simplistic example. I have a versioned folder A and there are two more folders X and Y and a file f. X and Y may contain any number and depth of files and folders. So the tree looks like this: A |-X | |-[...... | [
"tortoisesvn"
] | 0 | 1 | 42 | 1 | 0 | 2011-06-09T09:37:47.403000 | 2011-06-09T09:47:11.817000 |
6,290,814 | 6,291,255 | Do I need the Distribution Certificate in my Keystore when building with a Distribution Provisioning Profile | We're one step away from our first AppStore deployment. Unfortunately we have to deploy under our customer's account (to show the correct company name) At the moment we do not have access to the account's provisioning portal. My question is: I could ask my customer to generate a distribution provisioning profile and se... | Yes you will need the certificate, private key as well as the mobileprovision file for deployment. | Do I need the Distribution Certificate in my Keystore when building with a Distribution Provisioning Profile We're one step away from our first AppStore deployment. Unfortunately we have to deploy under our customer's account (to show the correct company name) At the moment we do not have access to the account's provis... | TITLE:
Do I need the Distribution Certificate in my Keystore when building with a Distribution Provisioning Profile
QUESTION:
We're one step away from our first AppStore deployment. Unfortunately we have to deploy under our customer's account (to show the correct company name) At the moment we do not have access to th... | [
"iphone",
"app-store"
] | 0 | 1 | 173 | 2 | 0 | 2011-06-09T09:37:54.983000 | 2011-06-09T10:16:29.677000 |
6,290,819 | 6,290,997 | Viewstate null on postback | So I have a listbox on my page and some textfields. Through the textfields I can add an item to my listbox (click the button, it adds it to a private List which is then set as a ViewState and the list is databound again). My listbox is also in an updatepanel which gets triggered on the button's Click event. Problem: My... | You're using vewstate during PreInit? Try to check that a bit later during PreLoad. | Viewstate null on postback So I have a listbox on my page and some textfields. Through the textfields I can add an item to my listbox (click the button, it adds it to a private List which is then set as a ViewState and the list is databound again). My listbox is also in an updatepanel which gets triggered on the button... | TITLE:
Viewstate null on postback
QUESTION:
So I have a listbox on my page and some textfields. Through the textfields I can add an item to my listbox (click the button, it adds it to a private List which is then set as a ViewState and the list is databound again). My listbox is also in an updatepanel which gets trigg... | [
"asp.net",
"listbox",
"postback",
"viewstate"
] | 1 | 10 | 14,500 | 2 | 0 | 2011-06-09T09:38:14.557000 | 2011-06-09T09:53:00.770000 |
6,290,824 | 6,291,101 | NSKeyedUnArchiver back to your original custom NSObject | I have an object i have made that is storing all information from twitter however i need to give it a load state so it needs to be saved to memory. This is the code i have done so far below NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
rssParser = [[RssParser alloc] loadXMLbyURL:@"http://twitter.com/s... | Does RssParser implement NSCoding? If so, you just have to do NSData *olddata = [prefs dataForKey:@"Tweets"]; RssParser *oldRssParser = (RssParser *)[NSKeyedUnarchiver unarchiveObjectWithData:olddata]; Otherwise you should read http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Archiving/Archiving.h... | NSKeyedUnArchiver back to your original custom NSObject I have an object i have made that is storing all information from twitter however i need to give it a load state so it needs to be saved to memory. This is the code i have done so far below NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
rssParser ... | TITLE:
NSKeyedUnArchiver back to your original custom NSObject
QUESTION:
I have an object i have made that is storing all information from twitter however i need to give it a load state so it needs to be saved to memory. This is the code i have done so far below NSUserDefaults *prefs = [NSUserDefaults standardUserDefa... | [
"iphone",
"objective-c",
"cocoa-touch",
"ios4"
] | 0 | 0 | 199 | 1 | 0 | 2011-06-09T09:38:28.260000 | 2011-06-09T10:03:08.863000 |
6,290,828 | 6,290,889 | JQUERY: getting the different values from divs with the same class | I have cobbled together some code to build an animated percentage bar. Everything works sweet when only one bar is present on a page. I have the following code 60 % $(function() { var overall_progress = $(".client_overall_progress", this).text();
// Hide the label at start $('#progress_bar.ui-progress.ui-label').hide(... | You are addressing your progress bars with an id of #progress_bar. Because elements IDs are suppose to be unique in the DOM, this will cause unexpected behaviors when trying to reach an element by it's ID, like you do on your jQuery selectors. What you can do, is change #progress_bar into.progress_bar, and instead of d... | JQUERY: getting the different values from divs with the same class I have cobbled together some code to build an animated percentage bar. Everything works sweet when only one bar is present on a page. I have the following code 60 % $(function() { var overall_progress = $(".client_overall_progress", this).text();
// Hi... | TITLE:
JQUERY: getting the different values from divs with the same class
QUESTION:
I have cobbled together some code to build an animated percentage bar. Everything works sweet when only one bar is present on a page. I have the following code 60 % $(function() { var overall_progress = $(".client_overall_progress", th... | [
"jquery"
] | 1 | 1 | 370 | 1 | 0 | 2011-06-09T09:38:42.997000 | 2011-06-09T09:43:15.817000 |
6,290,835 | 6,291,535 | set MTU for device with multiple interfaces | I am using ioctl(s, SIOCSIFMTU, (caddr_t)𝔦) to change the MTU for an interface. code is similar to this struct ifreq ifr; ifr.ifr_addr.sa_family = AF_INET; //iap->ifa_name is bond1:xx strncpy(ifr.ifr_name, iap->ifa_name, sizeof(ifr.ifr_name)); ifr.ifr_mtu = 1492; ioctl(s, SIOCSIFMTU, (caddr_t)𝔦) My problem is that th... | If you want to update MTU for the specific interface you shallset ifr_name field of the struct ifreq to the name of the interface EDIT: You problem is in the name of the interface. The number after the column in the interface name is just an alias. Actually, you don't have several different interfaces it's the same int... | set MTU for device with multiple interfaces I am using ioctl(s, SIOCSIFMTU, (caddr_t)𝔦) to change the MTU for an interface. code is similar to this struct ifreq ifr; ifr.ifr_addr.sa_family = AF_INET; //iap->ifa_name is bond1:xx strncpy(ifr.ifr_name, iap->ifa_name, sizeof(ifr.ifr_name)); ifr.ifr_mtu = 1492; ioctl(s, SI... | TITLE:
set MTU for device with multiple interfaces
QUESTION:
I am using ioctl(s, SIOCSIFMTU, (caddr_t)𝔦) to change the MTU for an interface. code is similar to this struct ifreq ifr; ifr.ifr_addr.sa_family = AF_INET; //iap->ifa_name is bond1:xx strncpy(ifr.ifr_name, iap->ifa_name, sizeof(ifr.ifr_name)); ifr.ifr_mtu =... | [
"c",
"linux",
"network-programming",
"ioctl",
"mtu"
] | 0 | 2 | 4,760 | 2 | 0 | 2011-06-09T09:39:08.593000 | 2011-06-09T10:42:02.553000 |
6,290,847 | 6,290,940 | PHP file modified time use GMT offset setting to report correct time | I'm currently reporting file modified time like so: $this->newScanData[$key]["modified"] = filemtime($path."/".$file); $modifiedtime = date($date_format." ".$time_format, $this->newScanData[$key]["modified"]); To me I thought there was nothing wrong with that but a user of my code is reporting the time being 4 hours ou... | What you need is the strtotime() function. Changed date to gmdate, converting your servers time to GMT For example if you need the time format like 10:00:00 gmdate("H:i:s", strtotime($gmt_offset. " hours")); More info here: http://php.net/manual/en/function.strtotime.php http://php.net/manual/en/function.gmdate.php | PHP file modified time use GMT offset setting to report correct time I'm currently reporting file modified time like so: $this->newScanData[$key]["modified"] = filemtime($path."/".$file); $modifiedtime = date($date_format." ".$time_format, $this->newScanData[$key]["modified"]); To me I thought there was nothing wrong w... | TITLE:
PHP file modified time use GMT offset setting to report correct time
QUESTION:
I'm currently reporting file modified time like so: $this->newScanData[$key]["modified"] = filemtime($path."/".$file); $modifiedtime = date($date_format." ".$time_format, $this->newScanData[$key]["modified"]); To me I thought there w... | [
"php",
"datetime",
"timezone",
"gmt",
"filetime"
] | 3 | 1 | 4,090 | 3 | 0 | 2011-06-09T09:39:45.697000 | 2011-06-09T09:47:16.443000 |
6,290,865 | 6,290,955 | Iterating Through Table in High-Performance Code | Supposing I have two temporary tables CREATE TABLE TableA ( SomeValue NVARCHAR(64) )
CREATE TABLE TableB ( SomeValue NVARHCAR(64) ) and a final table CREATE TABLE TableC ( SomeValue1 NVARCHAR(64), SomeValue2 NVARHCAR(64) ), what is the best way to insert into TableC every possible combination of values from TableA and... | A simple Cartesian product which is a CROSS JOIN ( Wikipedia, MSDN ) INSERT TABLEC (SomeValue1, SomeValue2) SELECT TABLEA.SomeValue, TABLEB.SomeValue FROM TABLEA CROSS JOIN TABLEB | Iterating Through Table in High-Performance Code Supposing I have two temporary tables CREATE TABLE TableA ( SomeValue NVARCHAR(64) )
CREATE TABLE TableB ( SomeValue NVARHCAR(64) ) and a final table CREATE TABLE TableC ( SomeValue1 NVARCHAR(64), SomeValue2 NVARHCAR(64) ), what is the best way to insert into TableC eve... | TITLE:
Iterating Through Table in High-Performance Code
QUESTION:
Supposing I have two temporary tables CREATE TABLE TableA ( SomeValue NVARCHAR(64) )
CREATE TABLE TableB ( SomeValue NVARHCAR(64) ) and a final table CREATE TABLE TableC ( SomeValue1 NVARCHAR(64), SomeValue2 NVARHCAR(64) ), what is the best way to inse... | [
"sql-server-2005"
] | 0 | 3 | 49 | 1 | 0 | 2011-06-09T09:41:11.473000 | 2011-06-09T09:48:36.333000 |
6,290,876 | 6,290,907 | Problem in reading binary file using C | I have problem with reading a binary file in C, the problem is: when i read the file it will not read the complete file but left some of the data from last... the code used to read the file is as below: FILE *file; unsigned long fileLen;
//Open file file = fopen("ASELogo.png", "rb"); if (!file) { fprintf(stderr, "Unab... | You're printing out bytes as characters. That's fine if they happen to be ASCII range, but you're going to end up printing control characters and so on. Try formatting the characters as bytes (e.g. 0xFF and 0x12) and see if that helps. | Problem in reading binary file using C I have problem with reading a binary file in C, the problem is: when i read the file it will not read the complete file but left some of the data from last... the code used to read the file is as below: FILE *file; unsigned long fileLen;
//Open file file = fopen("ASELogo.png", "r... | TITLE:
Problem in reading binary file using C
QUESTION:
I have problem with reading a binary file in C, the problem is: when i read the file it will not read the complete file but left some of the data from last... the code used to read the file is as below: FILE *file; unsigned long fileLen;
//Open file file = fopen... | [
"c"
] | 2 | 3 | 1,087 | 2 | 0 | 2011-06-09T09:42:09.453000 | 2011-06-09T09:45:10 |
6,290,878 | 6,291,224 | Can I share a web application's consumer key and secret using SA_OAuthTwitterEngine? | I'd like to enable users of my app to associate their twitter accounts so that some application interaction is automatically tweeted. Users can already associate their twitter accounts via the web interface, and I'd like them to be able to do the same from the mobile (iOS) app. The problem is, when the application is r... | For a mobile client, best to use xAuth. Using the pin method is suboptimal for mobile. After all your application isn't a web app. The new MGTwitterEngine has xAuth support, so switching should be painless:) | Can I share a web application's consumer key and secret using SA_OAuthTwitterEngine? I'd like to enable users of my app to associate their twitter accounts so that some application interaction is automatically tweeted. Users can already associate their twitter accounts via the web interface, and I'd like them to be abl... | TITLE:
Can I share a web application's consumer key and secret using SA_OAuthTwitterEngine?
QUESTION:
I'd like to enable users of my app to associate their twitter accounts so that some application interaction is automatically tweeted. Users can already associate their twitter accounts via the web interface, and I'd l... | [
"iphone",
"twitter",
"oauth",
"mgtwitterengine"
] | 0 | 1 | 258 | 1 | 0 | 2011-06-09T09:42:15.410000 | 2011-06-09T10:14:07.593000 |
6,290,879 | 6,290,944 | How to get xml attribute with plsql? | create table xtest01(col1 xmltype); insert into xtest01 values (' Audi TT '); insert into xtest01 values (' '); -- I know how to get Audi TT: select x.col1.extract('//car/model/text()').getStringVal() from xtest01 x; -- But how to get BMW X5? | select x.col1.extract('//car/@model').getStringVal() from xtest01 x; | How to get xml attribute with plsql? create table xtest01(col1 xmltype); insert into xtest01 values (' Audi TT '); insert into xtest01 values (' '); -- I know how to get Audi TT: select x.col1.extract('//car/model/text()').getStringVal() from xtest01 x; -- But how to get BMW X5? | TITLE:
How to get xml attribute with plsql?
QUESTION:
create table xtest01(col1 xmltype); insert into xtest01 values (' Audi TT '); insert into xtest01 values (' '); -- I know how to get Audi TT: select x.col1.extract('//car/model/text()').getStringVal() from xtest01 x; -- But how to get BMW X5?
ANSWER:
select x.col1... | [
"xml",
"plsql"
] | 6 | 9 | 16,378 | 1 | 0 | 2011-06-09T09:42:23.877000 | 2011-06-09T09:47:53.493000 |
6,290,884 | 6,290,913 | Accessing a random index of an incomplete array? | I have an array which can have a max length of several hundred thousand rows. It looks like this: arr[12] = false arr[334] = true arr[753] = true arr[1001] = false arr[1222] = true and so on... I want to find the fastest way to randomly select the index of a row that is true... My initial attempt was to do this: for(k ... | If the fraction of missing elements is sufficiently small it will be fast enough to just generate random indexes until you get a hit. Give it a try. var chose_true = function(array) { while (true) { var index = Math.floor(Math.random() * array.length) if (array[index]) { return array[index]; } } } | Accessing a random index of an incomplete array? I have an array which can have a max length of several hundred thousand rows. It looks like this: arr[12] = false arr[334] = true arr[753] = true arr[1001] = false arr[1222] = true and so on... I want to find the fastest way to randomly select the index of a row that is ... | TITLE:
Accessing a random index of an incomplete array?
QUESTION:
I have an array which can have a max length of several hundred thousand rows. It looks like this: arr[12] = false arr[334] = true arr[753] = true arr[1001] = false arr[1222] = true and so on... I want to find the fastest way to randomly select the index... | [
"javascript",
"arrays"
] | 2 | 1 | 543 | 5 | 0 | 2011-06-09T09:42:33.463000 | 2011-06-09T09:45:52.730000 |
6,290,900 | 6,290,991 | How to strip out <br> tags and wrap lines with <p> and </p> tags? | This is what the HTML code looks like. I need to strip out the br tags and wrap the lines in paragraph tags (ie the lines with dates). Each date should be wrapped in its own paragraph tags. Other Events Venue name Wednesday, May 11, 2011 Wednesday, June 08, 2011 Wednesday, July 13, 2011 Wednesday, August 10, 2011 Wedne... | Edit: By using tags in that manner your runining it's whole purpose instead you should try removing the tags and placing the text inside elements, which will have the same effect but will be semantically correct. Edit2: I think you wanted it in the above way, just triple read your question and I think I gotcha! var $p ... | How to strip out <br> tags and wrap lines with <p> and </p> tags? This is what the HTML code looks like. I need to strip out the br tags and wrap the lines in paragraph tags (ie the lines with dates). Each date should be wrapped in its own paragraph tags. Other Events Venue name Wednesday, May 11, 2011 Wednesday, June ... | TITLE:
How to strip out <br> tags and wrap lines with <p> and </p> tags?
QUESTION:
This is what the HTML code looks like. I need to strip out the br tags and wrap the lines in paragraph tags (ie the lines with dates). Each date should be wrapped in its own paragraph tags. Other Events Venue name Wednesday, May 11, 201... | [
"javascript",
"jquery",
"html"
] | 1 | 4 | 3,010 | 1 | 0 | 2011-06-09T09:44:12.667000 | 2011-06-09T09:52:28.620000 |
6,290,904 | 6,290,979 | const in C: Cannot allocate an array of constant size 0 | A small piece of code: void func() { const int BUF_SIZE = 5; char scale[BUF_SIZE]; } This code is built fine under C++, but under C I have an errors: error C2057: expected constant expression error C2466: cannot allocate an array of constant size 0 Why? Compiler: Microsoft Visual C++ 2008 Thanks in advance! | In C (all variants, I believe), a const is, ironically, not a constant expression in C. In pre-C99, array lengths must be a constant expression. However, C99 has the concept of "variable length arrays", so if you're compiling with a C99-compliant compiler, your code should be valid even though BUF_SIZE is not a constan... | const in C: Cannot allocate an array of constant size 0 A small piece of code: void func() { const int BUF_SIZE = 5; char scale[BUF_SIZE]; } This code is built fine under C++, but under C I have an errors: error C2057: expected constant expression error C2466: cannot allocate an array of constant size 0 Why? Compiler: ... | TITLE:
const in C: Cannot allocate an array of constant size 0
QUESTION:
A small piece of code: void func() { const int BUF_SIZE = 5; char scale[BUF_SIZE]; } This code is built fine under C++, but under C I have an errors: error C2057: expected constant expression error C2466: cannot allocate an array of constant size... | [
"c"
] | 5 | 5 | 4,860 | 3 | 0 | 2011-06-09T09:44:51.927000 | 2011-06-09T09:51:14.673000 |
6,290,908 | 6,290,994 | Parsing XML with PHP | I don't usually have to do any backend stuff, but for this one project I have to parse XML using PHP so it's all kind of new and very complicated to me. I need to display the fourth tag on a page and I figured I would use getElementsByTagName but the trouble is the three previous tags are the same, so it looks somethin... | My notes about XML: Links: http://php.net/simplexml.examples-basic And example: $xml=' ';
$xml = simplexml_load_string($xml);
foreach ($xml->providerref[0]->attributes() as $name -> $value) { ${$name}=$value; }
foreach ($xml->useractioninfo[0]->attributes() as $name -> $value) { ${$name}=$value; } Hope it will be us... | Parsing XML with PHP I don't usually have to do any backend stuff, but for this one project I have to parse XML using PHP so it's all kind of new and very complicated to me. I need to display the fourth tag on a page and I figured I would use getElementsByTagName but the trouble is the three previous tags are the same,... | TITLE:
Parsing XML with PHP
QUESTION:
I don't usually have to do any backend stuff, but for this one project I have to parse XML using PHP so it's all kind of new and very complicated to me. I need to display the fourth tag on a page and I figured I would use getElementsByTagName but the trouble is the three previous ... | [
"php",
"xml",
"parsing",
"dom"
] | 1 | 2 | 168 | 2 | 0 | 2011-06-09T09:45:11.717000 | 2011-06-09T09:52:48.650000 |
6,290,912 | 6,290,957 | how i can remove jQuery UI dialog mockup from the page? | when dialog close the page have dialog mockup as hidden in page. so how i can remove them then they are removed with the mockup. means how i can remove dialog with the mockup so later their is no mockup same can found in DOM. | I think you you must use.dialog("destroy") withe the same selector you used to create it or if you assind the dialog to a javascript variable you call the method on the variable. $('#myid').dialog("destroy")//You created it with $('#myid').dialog() mydialog.dialog("destroy")//You created it with var mydialog = $('#myid... | how i can remove jQuery UI dialog mockup from the page? when dialog close the page have dialog mockup as hidden in page. so how i can remove them then they are removed with the mockup. means how i can remove dialog with the mockup so later their is no mockup same can found in DOM. | TITLE:
how i can remove jQuery UI dialog mockup from the page?
QUESTION:
when dialog close the page have dialog mockup as hidden in page. so how i can remove them then they are removed with the mockup. means how i can remove dialog with the mockup so later their is no mockup same can found in DOM.
ANSWER:
I think you... | [
"jquery",
"jquery-ui"
] | 0 | 1 | 206 | 2 | 0 | 2011-06-09T09:45:44.207000 | 2011-06-09T09:48:41.560000 |
6,290,926 | 6,291,363 | How to read xml string values using this path as shown in code(getFilesDir().getAbsolutePath()+ File.separator + "test.xml") | Hi Everybody, I am new to Android. I am using DOM parsing for reading xml string value. For that, I used following code, that code will work up to getting root element value after that it is giving exception please solve this problem, Advance Thanks, Xml Code: 23545565635354 addsffggfdsfdsfdfs java code: File file = ne... | Document doc = db.parse(in); Element docElem = doc.getDocumentElement(); NodeList nl = docElem.getElementsByTagName("Oldpassword"); try that... update maybe it would be helpful if you take a look here: http://www.w3schools.com/xml/default.asp the following code is working, is just tested. import java.io.File; import ja... | How to read xml string values using this path as shown in code(getFilesDir().getAbsolutePath()+ File.separator + "test.xml") Hi Everybody, I am new to Android. I am using DOM parsing for reading xml string value. For that, I used following code, that code will work up to getting root element value after that it is givi... | TITLE:
How to read xml string values using this path as shown in code(getFilesDir().getAbsolutePath()+ File.separator + "test.xml")
QUESTION:
Hi Everybody, I am new to Android. I am using DOM parsing for reading xml string value. For that, I used following code, that code will work up to getting root element value aft... | [
"java",
"android",
"xml"
] | 0 | 0 | 3,797 | 3 | 0 | 2011-06-09T09:46:23.597000 | 2011-06-09T10:27:44.613000 |
6,290,936 | 6,290,965 | Place to upload tar file for users of my app to download | Intention of the app: One time download data(tar file, 10Mb) from the server which my app uses. Problem: I don't own a domain or a server space or have any idea where to upload the data securely which my app can download. Requirement is to download data securely and have analytics for it. Do I have to own a server spac... | Get a web host. They're not that expensive and you get good control over what's going on. You don't need to script anything if you don't want to since most hosts have statistics you can watch, but if you want to have your own stats a simple PHP script should suffice. | Place to upload tar file for users of my app to download Intention of the app: One time download data(tar file, 10Mb) from the server which my app uses. Problem: I don't own a domain or a server space or have any idea where to upload the data securely which my app can download. Requirement is to download data securely ... | TITLE:
Place to upload tar file for users of my app to download
QUESTION:
Intention of the app: One time download data(tar file, 10Mb) from the server which my app uses. Problem: I don't own a domain or a server space or have any idea where to upload the data securely which my app can download. Requirement is to downl... | [
"android",
"file-upload"
] | 0 | 1 | 179 | 2 | 0 | 2011-06-09T09:47:04.133000 | 2011-06-09T09:49:56.153000 |
6,290,945 | 6,291,037 | How to secure a WCF restful service? | I used to deal with web services and we secured it using the credential header with soap. The calling application would need to pass a username and password in the credential header. We are now looking at using a WCF restful based webservice and want to secure it. Wondering what the best way to secure it is? I was thin... | This link describes how to use WCF with WS-Security. This link describes what WS-Security is. This link describes the architecture of the WCF security component. Not sure if you can combine those with REST but know that HTTP has an authentication mechanisms of it's own (See Basic authentication and Digset authenticatio... | How to secure a WCF restful service? I used to deal with web services and we secured it using the credential header with soap. The calling application would need to pass a username and password in the credential header. We are now looking at using a WCF restful based webservice and want to secure it. Wondering what the... | TITLE:
How to secure a WCF restful service?
QUESTION:
I used to deal with web services and we secured it using the credential header with soap. The calling application would need to pass a username and password in the credential header. We are now looking at using a WCF restful based webservice and want to secure it. ... | [
"c#",
"asp.net",
"web-services",
"wcf-security"
] | 5 | 6 | 2,289 | 1 | 0 | 2011-06-09T09:47:53.640000 | 2011-06-09T09:56:15.543000 |
6,290,950 | 6,291,151 | Disabling hashchange listener when updating hash programatically (jQuery BBQ) | To prevent a feedback loop when setting the URL hash (#) programmatically (in contrast to manually changing the URL) I want to disable the hashChange listener temporarily. How should I change this code to actually disable the hashchange event when updating the hash using $.bbq.pushState(hash)? (code below doesn't work)... | The hashchange event fires asyncrounously, hashChangeEnabled is already reset to true, when the code in the event handler executes. You should reset your hashChangeEnabled in the hashchange event: if(that.hashChangeEnabled == true){ stateObj = event.getState() that.stateChangedHandler(stateObj); } else { that.hashChang... | Disabling hashchange listener when updating hash programatically (jQuery BBQ) To prevent a feedback loop when setting the URL hash (#) programmatically (in contrast to manually changing the URL) I want to disable the hashChange listener temporarily. How should I change this code to actually disable the hashchange event... | TITLE:
Disabling hashchange listener when updating hash programatically (jQuery BBQ)
QUESTION:
To prevent a feedback loop when setting the URL hash (#) programmatically (in contrast to manually changing the URL) I want to disable the hashChange listener temporarily. How should I change this code to actually disable th... | [
"javascript",
"jquery",
"fragment-identifier",
"hashchange",
"jquery-bbq"
] | 5 | 1 | 4,475 | 1 | 0 | 2011-06-09T09:48:21.403000 | 2011-06-09T10:07:45.567000 |
6,290,962 | 6,291,290 | Building an Android button with pictures and text | I am looking to build a button in my Android app which must contain: A background picture A picture Some text I am coming from iPhone dev and I am a little bit confused by Android development. While I could addSubView: UIImageView or UILabel to my UIButton, I can't use addView() with a android.widget.Button:( Does anyo... | android:background for background... remeber that you can build your own 9 patch android:drawableLeft, android:drawableRight, android:drawableTop, android:drawableBottom to add some picture to the left, right,... of text EDIT: i didn't mention... but i was talking about android.widget.Button 2nd EDIT: after you provide... | Building an Android button with pictures and text I am looking to build a button in my Android app which must contain: A background picture A picture Some text I am coming from iPhone dev and I am a little bit confused by Android development. While I could addSubView: UIImageView or UILabel to my UIButton, I can't use ... | TITLE:
Building an Android button with pictures and text
QUESTION:
I am looking to build a button in my Android app which must contain: A background picture A picture Some text I am coming from iPhone dev and I am a little bit confused by Android development. While I could addSubView: UIImageView or UILabel to my UIBu... | [
"android",
"android-widget"
] | 0 | 1 | 685 | 2 | 0 | 2011-06-09T09:49:46.513000 | 2011-06-09T10:19:12.977000 |
6,290,963 | 6,291,012 | How can i insert data into temporary table by using a dynamic query in MySql | I want to Insert a dynamic query's result into a temporary table. How can i possible this. Plz help me... Here is the method i tried. CREATE TEMPORARY TABLE temp_Table ( Id INT );
SET @str = 'SELECT id FROM animals';
PREPARE statement1 FROM @str;
INSERT INTO temp_Table EXECUTE statement1; This is not the actual Quer... | You can do it in one statement: CREATE TEMPORARY TABLE temp_Table SELECT id FROM animals; See here: http://dev.mysql.com/doc/refman/5.1/en/create-table.html | How can i insert data into temporary table by using a dynamic query in MySql I want to Insert a dynamic query's result into a temporary table. How can i possible this. Plz help me... Here is the method i tried. CREATE TEMPORARY TABLE temp_Table ( Id INT );
SET @str = 'SELECT id FROM animals';
PREPARE statement1 FROM ... | TITLE:
How can i insert data into temporary table by using a dynamic query in MySql
QUESTION:
I want to Insert a dynamic query's result into a temporary table. How can i possible this. Plz help me... Here is the method i tried. CREATE TEMPORARY TABLE temp_Table ( Id INT );
SET @str = 'SELECT id FROM animals';
PREPAR... | [
"c#",
"mysql",
"stored-procedures",
"temp-tables"
] | 0 | 2 | 2,005 | 1 | 0 | 2011-06-09T09:49:51.910000 | 2011-06-09T09:54:19.177000 |
6,290,964 | 6,290,995 | How to get the value of String Array? | I want to print the String Array. This is my Code: System.out.println(WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL)); I got this error: The method getGlobalLogValue(String) in the type WMSLoggerFactory is not applicable for the arguments (String[]) How can I print this? | Use for loop: for(String s: WMSLoggerIDs.FD_ALL) { System.out.println(WMSLoggerFactory.getGlobalLogValue(s)); } | How to get the value of String Array? I want to print the String Array. This is my Code: System.out.println(WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL)); I got this error: The method getGlobalLogValue(String) in the type WMSLoggerFactory is not applicable for the arguments (String[]) How can I print this? | TITLE:
How to get the value of String Array?
QUESTION:
I want to print the String Array. This is my Code: System.out.println(WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL)); I got this error: The method getGlobalLogValue(String) in the type WMSLoggerFactory is not applicable for the arguments (String[]) How c... | [
"java"
] | 0 | 3 | 2,580 | 2 | 0 | 2011-06-09T09:49:52.833000 | 2011-06-09T09:52:57.217000 |
6,290,967 | 6,291,022 | Stop the 'Ding' when pressing Enter | I have a very simple Windows Forms Application. And, in Windows (or, atleast Windows Forms Applications), when you press Enter while inside a Single-line TextBox Control, you hear a Ding. It's an unpleasent sound, that indicated you cannot enter a newline, because it is a single-line TextBox. This is all fine. However,... | Check out the Form.AcceptButton property. You can use it to specify a default button for a form, in this case for pressing enter. From the docs: This property enables you to designate a default action to occur when the user presses the ENTER key in your application. The button assigned to this property must be an IButt... | Stop the 'Ding' when pressing Enter I have a very simple Windows Forms Application. And, in Windows (or, atleast Windows Forms Applications), when you press Enter while inside a Single-line TextBox Control, you hear a Ding. It's an unpleasent sound, that indicated you cannot enter a newline, because it is a single-line... | TITLE:
Stop the 'Ding' when pressing Enter
QUESTION:
I have a very simple Windows Forms Application. And, in Windows (or, atleast Windows Forms Applications), when you press Enter while inside a Single-line TextBox Control, you hear a Ding. It's an unpleasent sound, that indicated you cannot enter a newline, because i... | [
"c#",
"winforms",
"audio",
"system-sounds"
] | 161 | 66 | 93,785 | 18 | 0 | 2011-06-09T09:50:01.287000 | 2011-06-09T09:55:03.790000 |
6,290,971 | 6,291,123 | Will a 64 bit application support MSXML 3.0? | We are planning to convert the 32bit application to support 64 bit OS. Currently the application uses MSXML 3.0 in Javascripts. I want to know whether it will work as it is in a 64 bit os or will there be any issues. | Based on a look at the COM registration on 64bit Win7 it appears that there is a 64bit MSXML3. However use of older versions of MSXML is deprecated, better to upgrade to the latest—V6—a significant application change is a good opportunity for this. | Will a 64 bit application support MSXML 3.0? We are planning to convert the 32bit application to support 64 bit OS. Currently the application uses MSXML 3.0 in Javascripts. I want to know whether it will work as it is in a 64 bit os or will there be any issues. | TITLE:
Will a 64 bit application support MSXML 3.0?
QUESTION:
We are planning to convert the 32bit application to support 64 bit OS. Currently the application uses MSXML 3.0 in Javascripts. I want to know whether it will work as it is in a 64 bit os or will there be any issues.
ANSWER:
Based on a look at the COM regi... | [
"xml",
"parsing",
"msxml3"
] | 1 | 3 | 693 | 1 | 0 | 2011-06-09T09:50:33.867000 | 2011-06-09T10:05:29.613000 |
6,290,973 | 6,296,211 | Rails MySQL auto generated column | I am working on RoR 3.x with MySQL as backend. Is there any way to modify the existing id (autogenerated with migration) in a way that can generate particular user defined pattern. For e.g: "Products Table" should have values in " id " field like "P01", "P02" and so on, where P can be specified by the user, and 01,02 a... | The 'regular' IDs (1, 2, 3,..., n) in this case aren't generated by rails but by MySQL (using AUTO_INCREMENT ). So, if you want to go with auto-generated, auto-incrementing IDs, I would suggest not messing with this. What you could do, and what I would suggest, is creating an additional column and then populating that ... | Rails MySQL auto generated column I am working on RoR 3.x with MySQL as backend. Is there any way to modify the existing id (autogenerated with migration) in a way that can generate particular user defined pattern. For e.g: "Products Table" should have values in " id " field like "P01", "P02" and so on, where P can be ... | TITLE:
Rails MySQL auto generated column
QUESTION:
I am working on RoR 3.x with MySQL as backend. Is there any way to modify the existing id (autogenerated with migration) in a way that can generate particular user defined pattern. For e.g: "Products Table" should have values in " id " field like "P01", "P02" and so o... | [
"mysql",
"ruby-on-rails-3",
"migration"
] | 1 | 4 | 834 | 1 | 0 | 2011-06-09T09:50:38.753000 | 2011-06-09T16:34:03.943000 |
6,290,981 | 6,291,049 | Rails 3. Date comparison with created_at | I am developing an app in Rails 3 and I would like to do a check that the current user is not new (that it has been more than 24 hours since he signed up). How can I do this? Thankful for all input. | Compare the created_at with 24 hours ago: current_user = User.first if current_user.created_at > 1.day.ago # user is new end | Rails 3. Date comparison with created_at I am developing an app in Rails 3 and I would like to do a check that the current user is not new (that it has been more than 24 hours since he signed up). How can I do this? Thankful for all input. | TITLE:
Rails 3. Date comparison with created_at
QUESTION:
I am developing an app in Rails 3 and I would like to do a check that the current user is not new (that it has been more than 24 hours since he signed up). How can I do this? Thankful for all input.
ANSWER:
Compare the created_at with 24 hours ago: current_use... | [
"ruby-on-rails"
] | 2 | 9 | 2,663 | 1 | 0 | 2011-06-09T09:51:23.493000 | 2011-06-09T09:57:43.657000 |
6,291,008 | 6,291,076 | Can you please help explain this code? | I have this function that I'm trying to convert but I just cant understand what is happening in some parts of the code. Could anyone please help me out and explain the code. I just want to know what they do with the pointers. There are some blank comments in the code where they do hell with the pointers, i just dont ge... | int count = *pPixels++; Dereferences the pPixels pointer to get the value and assigns it to count and increment the pointer - this will make the pointer to point to the next element in the array ( m_Pixels ) index += *pPixels++; Increment index with the value, pointed by pPixels and increment the pointer - this will ma... | Can you please help explain this code? I have this function that I'm trying to convert but I just cant understand what is happening in some parts of the code. Could anyone please help me out and explain the code. I just want to know what they do with the pointers. There are some blank comments in the code where they do... | TITLE:
Can you please help explain this code?
QUESTION:
I have this function that I'm trying to convert but I just cant understand what is happening in some parts of the code. Could anyone please help me out and explain the code. I just want to know what they do with the pointers. There are some blank comments in the ... | [
"c++",
"pointers",
"pointer-arithmetic"
] | 0 | 2 | 143 | 1 | 0 | 2011-06-09T09:54:00.130000 | 2011-06-09T10:00:15.240000 |
6,291,019 | 6,291,464 | An android mobile tablet browser emulator? | What is the best android/mobile/tablet browser emulator i can use to test some html5 stuff on? I dont want to have to download all the sdk stuff | Download the SDK stuff and use the appropriate API level and screen resolution, that is the best (and only as far as I know) way. | An android mobile tablet browser emulator? What is the best android/mobile/tablet browser emulator i can use to test some html5 stuff on? I dont want to have to download all the sdk stuff | TITLE:
An android mobile tablet browser emulator?
QUESTION:
What is the best android/mobile/tablet browser emulator i can use to test some html5 stuff on? I dont want to have to download all the sdk stuff
ANSWER:
Download the SDK stuff and use the appropriate API level and screen resolution, that is the best (and onl... | [
"android",
"browser",
"mobile",
"tablet"
] | 0 | 1 | 2,806 | 2 | 0 | 2011-06-09T09:54:58.350000 | 2011-06-09T10:35:27.750000 |
6,291,027 | 6,291,058 | PHP count object property occurrences | I have a PHP object like below and all I want to know whats the the easiest way to get a count of objects where the property 'typeId' = 3 Array ( [0] => ABC Object ( [id] => 13 [typeId] => 3 [sortOrder] => 0 ) [1] => ABC Object ( [id] => 12 [typeId] => 2 [sortOrder] => 0 ) [2] => ABC Object ( [id] => 14 [typeId] => 4 [... | A simple foreach counter should do: $count = 0; foreach ($array as $object) { if ($object->typeId == 3) $count++; } No need to over complicate things | PHP count object property occurrences I have a PHP object like below and all I want to know whats the the easiest way to get a count of objects where the property 'typeId' = 3 Array ( [0] => ABC Object ( [id] => 13 [typeId] => 3 [sortOrder] => 0 ) [1] => ABC Object ( [id] => 12 [typeId] => 2 [sortOrder] => 0 ) [2] => A... | TITLE:
PHP count object property occurrences
QUESTION:
I have a PHP object like below and all I want to know whats the the easiest way to get a count of objects where the property 'typeId' = 3 Array ( [0] => ABC Object ( [id] => 13 [typeId] => 3 [sortOrder] => 0 ) [1] => ABC Object ( [id] => 12 [typeId] => 2 [sortOrde... | [
"php",
"arrays",
"object",
"count"
] | 2 | 3 | 2,650 | 3 | 0 | 2011-06-09T09:55:33.820000 | 2011-06-09T09:58:34.437000 |
6,291,038 | 6,291,126 | Applying a Regex to a Substring Without using String Slice | I want to search for a regex match in a larger string from a certain position onwards, and without using string slices. My background is that I want to search through a string iteratively for matches of various regex's. A natural solution in Python would be keeping track of the current position within the string and us... | The variants with pos and endpos parameters only exist as members of regular expression objects. Try this: import re pattern = re.compile("match here") input = "don't match here, but do match here" start = input.find(",") print pattern.search(input, start).span()... outputs (25, 35) | Applying a Regex to a Substring Without using String Slice I want to search for a regex match in a larger string from a certain position onwards, and without using string slices. My background is that I want to search through a string iteratively for matches of various regex's. A natural solution in Python would be kee... | TITLE:
Applying a Regex to a Substring Without using String Slice
QUESTION:
I want to search for a regex match in a larger string from a certain position onwards, and without using string slices. My background is that I want to search through a string iteratively for matches of various regex's. A natural solution in P... | [
"python",
"regex"
] | 5 | 6 | 1,087 | 4 | 0 | 2011-06-09T09:56:23.623000 | 2011-06-09T10:05:34.917000 |
6,291,052 | 6,291,451 | Propagate a DateTime column of a DataSet to database | I have a DataSet that has a timestamp (i.e. Datetime.Now ) recording the date and time when a row is added to the DataSet in memory. I will later save (or propagate) all these rows to the SQLCE database where the DataSet's timestamp will be propagate to a DateTime column in the database table. It works fine and datetim... | String datetime = String.Format("{0:G}", ur_datetime_variable); will give you string in M/d/yyyy h:mm:ss tt format and then convert the datetime string to DateTime here's a link http://www.csharp-examples.net/string-format-datetime/ and there's everything bout datetime formating. | Propagate a DateTime column of a DataSet to database I have a DataSet that has a timestamp (i.e. Datetime.Now ) recording the date and time when a row is added to the DataSet in memory. I will later save (or propagate) all these rows to the SQLCE database where the DataSet's timestamp will be propagate to a DateTime co... | TITLE:
Propagate a DateTime column of a DataSet to database
QUESTION:
I have a DataSet that has a timestamp (i.e. Datetime.Now ) recording the date and time when a row is added to the DataSet in memory. I will later save (or propagate) all these rows to the SQLCE database where the DataSet's timestamp will be propagat... | [
"c#",
"wpf",
"timestamp",
"sql-server-ce"
] | 0 | 1 | 107 | 2 | 0 | 2011-06-09T09:57:57.367000 | 2011-06-09T10:34:30.760000 |
6,291,057 | 6,291,266 | Why variable value is getting changed unusually | I have a code like this,In this context HandleDisconnectEventCB will trigger when client has some modified whithout saved data and disconnected(remove network cable) from server,,then it will make 'clientWithLock= 0' and will remove from collection that is shown below code. But now the problem is other connected client... | Making clientwithlock static is going to cause you all kinds of headaches here if you have multiple disconnects in rapid succession. I'd recommend either making the whole operation stateless, so 'ClientWithLock' is passed as a parameter to the event, and you operate the static function based on all parameters passed. I... | Why variable value is getting changed unusually I have a code like this,In this context HandleDisconnectEventCB will trigger when client has some modified whithout saved data and disconnected(remove network cable) from server,,then it will make 'clientWithLock= 0' and will remove from collection that is shown below cod... | TITLE:
Why variable value is getting changed unusually
QUESTION:
I have a code like this,In this context HandleDisconnectEventCB will trigger when client has some modified whithout saved data and disconnected(remove network cable) from server,,then it will make 'clientWithLock= 0' and will remove from collection that ... | [
"c#",
".net",
"visual-studio-2005"
] | 1 | 2 | 100 | 1 | 0 | 2011-06-09T09:58:27.490000 | 2011-06-09T10:17:04.443000 |
6,291,060 | 6,291,108 | MySQL query order the results in GROUP BY 3 Tables Count | I'm coding a listing system and I'm trying to get the posts ORDER by number of comments and votes FROM 2 tables. Table1: Lists => id, title, detail
Table2: Votes => voteid, listid
Table3: Comments => commentid, listid WHERE MY Current query is $q = mysql_query("SELECT * FROM zoo_leads LEFT JOIN Votes ON Lists.id=Vote... | Try: SELECT * FROM zoo_leads LEFT JOIN votes ON lists.id = votes.listid LEFT JOIN comments ON lists.id = comments.listid GROUP BY lists.id ORDER BY COUNT(votes.id) DESC, COUNT(comments.id) DESC LIMIT 10 | MySQL query order the results in GROUP BY 3 Tables Count I'm coding a listing system and I'm trying to get the posts ORDER by number of comments and votes FROM 2 tables. Table1: Lists => id, title, detail
Table2: Votes => voteid, listid
Table3: Comments => commentid, listid WHERE MY Current query is $q = mysql_query(... | TITLE:
MySQL query order the results in GROUP BY 3 Tables Count
QUESTION:
I'm coding a listing system and I'm trying to get the posts ORDER by number of comments and votes FROM 2 tables. Table1: Lists => id, title, detail
Table2: Votes => voteid, listid
Table3: Comments => commentid, listid WHERE MY Current query is... | [
"php",
"mysql"
] | 0 | 1 | 222 | 2 | 0 | 2011-06-09T09:58:36.707000 | 2011-06-09T10:04:12.037000 |
6,291,087 | 6,291,443 | Android load library error -- failed to map segment | I am loading a native library using JNI. The library resides on the sdcard. I am loading the library with this code: try { File str; String storage; str = Environment.getExternalStorageDirectory(); storage = str.getAbsolutePath();
File f = new File(storage+"/Android/data/org.ilri.IMPACTLight/libIMPInterface.so"); if (... | You cannot load native libraries or execute binaries located on the SDCard. It is mounted noexec. You need to copy the library to the internal storage before you load it, that is, in a subdirectory of dataDir, eg: PackageManager pm = context.getPackageManager(); String dataDir = pm.getApplicationInfo(context.getPackage... | Android load library error -- failed to map segment I am loading a native library using JNI. The library resides on the sdcard. I am loading the library with this code: try { File str; String storage; str = Environment.getExternalStorageDirectory(); storage = str.getAbsolutePath();
File f = new File(storage+"/Android/... | TITLE:
Android load library error -- failed to map segment
QUESTION:
I am loading a native library using JNI. The library resides on the sdcard. I am loading the library with this code: try { File str; String storage; str = Environment.getExternalStorageDirectory(); storage = str.getAbsolutePath();
File f = new File(... | [
"android",
"java-native-interface",
"android-ndk"
] | 2 | 5 | 5,184 | 2 | 0 | 2011-06-09T10:01:01.060000 | 2011-06-09T10:33:28.617000 |
6,291,093 | 6,291,122 | C++ Compiler Implementing Namespace | From the C++ compiler's point of view, is namespace just a name decoration convention? I have inspected the generated assembly listing and found that everything just looks the same except the identifiers are decorated by the namespace's name. | As you point out, name mangling is part of the story (but the reasons for doing it have more to do with linkers rather than compilers). However, name mangling is far from the whole story as far as the handling of namespaces in the compiler is concerned. Among other things, the compiler has to be able to figure out unqu... | C++ Compiler Implementing Namespace From the C++ compiler's point of view, is namespace just a name decoration convention? I have inspected the generated assembly listing and found that everything just looks the same except the identifiers are decorated by the namespace's name. | TITLE:
C++ Compiler Implementing Namespace
QUESTION:
From the C++ compiler's point of view, is namespace just a name decoration convention? I have inspected the generated assembly listing and found that everything just looks the same except the identifiers are decorated by the namespace's name.
ANSWER:
As you point o... | [
"c++",
"compiler-construction",
"namespaces",
"implementation",
"name-decoration"
] | 2 | 2 | 1,712 | 4 | 0 | 2011-06-09T10:01:30.063000 | 2011-06-09T10:05:27.190000 |
6,291,094 | 6,291,371 | WCF error serializing cycle reference | I'm trying to return lists of objects that have references to another objects and viceversa. I only want the lazy load to get the "first level children", I mean, if I have a "Person" object with a "Place" property, I want the place data to be loaded but not every object in "Place" object needs to be loaded... because t... | I mean, if I have a "Person" object with a "Place" property, I want the place data to be loaded but not every object in "Place" object needs to be loaded... That is not possible when using lazy loading. Once the entity gets serialized the serializer will access every single property. Accessing every navigation property... | WCF error serializing cycle reference I'm trying to return lists of objects that have references to another objects and viceversa. I only want the lazy load to get the "first level children", I mean, if I have a "Person" object with a "Place" property, I want the place data to be loaded but not every object in "Place" ... | TITLE:
WCF error serializing cycle reference
QUESTION:
I'm trying to return lists of objects that have references to another objects and viceversa. I only want the lazy load to get the "first level children", I mean, if I have a "Person" object with a "Place" property, I want the place data to be loaded but not every ... | [
"c#",
"silverlight",
"wcf",
"entity-framework"
] | 3 | 4 | 1,919 | 3 | 0 | 2011-06-09T10:01:41.880000 | 2011-06-09T10:28:40.563000 |
6,291,102 | 6,291,171 | How to insert NULL in database using Django | I have a problem inserting NULL in Django. I mean i don't know how to do this. I have function, lets call it find_position, then i have field in model like position (IntegerField, null=True, blank=True). This function inspect some html code, and if it match with some regex, it returns integer, but if it doesn't find - ... | Make the function return None (or not returning anything, it's the same as returning None ), in database it will be saved Null: def find_position(self, to_find, something):... if re.search(to_find, something): return i + (page * 10) + 1 return None | How to insert NULL in database using Django I have a problem inserting NULL in Django. I mean i don't know how to do this. I have function, lets call it find_position, then i have field in model like position (IntegerField, null=True, blank=True). This function inspect some html code, and if it match with some regex, i... | TITLE:
How to insert NULL in database using Django
QUESTION:
I have a problem inserting NULL in Django. I mean i don't know how to do this. I have function, lets call it find_position, then i have field in model like position (IntegerField, null=True, blank=True). This function inspect some html code, and if it match ... | [
"database",
"django",
"django-models",
"integer",
"nullable"
] | 4 | 8 | 9,983 | 1 | 0 | 2011-06-09T10:03:11.623000 | 2011-06-09T10:09:42.370000 |
6,291,103 | 6,291,257 | Slow Performance on Duplicates Query? | I am running the following query to try and identify duplicates in my DB on a table SELECT * FROM db.tablename x JOIN db.tablename z ON x.columnA = z.columnA WHERE x.columnB > z.columnB However, it seems to be taking forever. i.e. just wondering whether this is a performance based issue or whether there is another way ... | If you just need to test, you can fetch only a couple of hundred records. For example SELECT top 100 * FROM db.tablename x JOIN db.tablename z ON x.columnA = z.columnA WHERE x.columnB > z.columnB | Slow Performance on Duplicates Query? I am running the following query to try and identify duplicates in my DB on a table SELECT * FROM db.tablename x JOIN db.tablename z ON x.columnA = z.columnA WHERE x.columnB > z.columnB However, it seems to be taking forever. i.e. just wondering whether this is a performance based ... | TITLE:
Slow Performance on Duplicates Query?
QUESTION:
I am running the following query to try and identify duplicates in my DB on a table SELECT * FROM db.tablename x JOIN db.tablename z ON x.columnA = z.columnA WHERE x.columnB > z.columnB However, it seems to be taking forever. i.e. just wondering whether this is a ... | [
"mysql"
] | 0 | 0 | 112 | 2 | 0 | 2011-06-09T10:03:16.210000 | 2011-06-09T10:16:38.903000 |
6,291,120 | 6,291,428 | Change the default domain of Client() in unittest of Django | I am writing a unit test for Django views. class TestLog(unittest.TestCase): """Test for Contact""" def setUp(self): self.c = Client() try: self.bob = User.objects.create_user("mojo","b@example.com", "bmojo") except: print ''
def test_get_emails(self): response = self.c.get('/text/') self.assertEqual(response.status_c... | Django's Client extends RequestFactory so you should be able to pass in extra params as keyword arguments. Try: response = self.c.get('/emails/html/upload', SERVER_NAME="mydomain.com") | Change the default domain of Client() in unittest of Django I am writing a unit test for Django views. class TestLog(unittest.TestCase): """Test for Contact""" def setUp(self): self.c = Client() try: self.bob = User.objects.create_user("mojo","b@example.com", "bmojo") except: print ''
def test_get_emails(self): respon... | TITLE:
Change the default domain of Client() in unittest of Django
QUESTION:
I am writing a unit test for Django views. class TestLog(unittest.TestCase): """Test for Contact""" def setUp(self): self.c = Client() try: self.bob = User.objects.create_user("mojo","b@example.com", "bmojo") except: print ''
def test_get_em... | [
"python",
"django",
"unit-testing",
"django-views",
"django-unittest"
] | 23 | 40 | 7,439 | 2 | 0 | 2011-06-09T10:05:22.090000 | 2011-06-09T10:32:14.637000 |
6,291,128 | 6,291,248 | Rounding color around borders of a button | I've got a little problem as seen below: The cell has a background color, and the button doesn't. Still, it doesn't give me rounded edges, but corners. How can I fix that? UIButton *meerKnop = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [[meerKnop layer] setCornerRadius:8.0f]; meerKnop.backgroundColor = [UIColor... | Try setting the corner radius of the layer of the button. [button.layer setCornerRadius:10]; Remember to import if you are using layer property Also, use: [[button layer] setMasksToBounds:YES]; With this code the layer gets a corner radius of 10.0 and the -setMasksToBounds: tells the button’s layer to mask any layer co... | Rounding color around borders of a button I've got a little problem as seen below: The cell has a background color, and the button doesn't. Still, it doesn't give me rounded edges, but corners. How can I fix that? UIButton *meerKnop = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [[meerKnop layer] setCornerRadius:... | TITLE:
Rounding color around borders of a button
QUESTION:
I've got a little problem as seen below: The cell has a background color, and the button doesn't. Still, it doesn't give me rounded edges, but corners. How can I fix that? UIButton *meerKnop = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [[meerKnop layer... | [
"iphone",
"objective-c",
"button",
"colors",
"tableview"
] | 1 | 3 | 596 | 3 | 0 | 2011-06-09T10:05:49.923000 | 2011-06-09T10:16:16.323000 |
6,291,131 | 6,291,701 | How to set the global text of title in Site.Master page using ASP.NET MVC 2 & 3? | I am using ASP.NET MVC 2 & 3 with aspx View not Razor View, my question is: How to set the title in Site.Master page? I wish every pages which use Site.Master page can add a Master title follow the page title show like: "Index -MasterTitle"; "About -MasterTitle". I've try in Site.Master page and it's doesn't work: -Mas... | I had similar issues and here is what I had to use: <%= "-MasterTitle" %> | How to set the global text of title in Site.Master page using ASP.NET MVC 2 & 3? I am using ASP.NET MVC 2 & 3 with aspx View not Razor View, my question is: How to set the title in Site.Master page? I wish every pages which use Site.Master page can add a Master title follow the page title show like: "Index -MasterTitle... | TITLE:
How to set the global text of title in Site.Master page using ASP.NET MVC 2 & 3?
QUESTION:
I am using ASP.NET MVC 2 & 3 with aspx View not Razor View, my question is: How to set the title in Site.Master page? I wish every pages which use Site.Master page can add a Master title follow the page title show like: "... | [
"asp.net-mvc",
"asp.net-mvc-3",
"master-pages",
"title"
] | 2 | 4 | 3,108 | 2 | 0 | 2011-06-09T10:05:58.813000 | 2011-06-09T10:58:03.040000 |
6,291,132 | 6,291,174 | How I can read an xml file with limited memory? | var q = from n in XElement.Load(Application.StartupPath + "..\\..\\..\\2.xml").Elements() select n; foreach (var q0 in q) { string str = q0.ToString(); } the problem is my xml file is so big so how I can manage this code to load it gradually not completely. now I traced by c# it loads all file completely in "q" and the... | Instead of reading the whole XML file in memory at once and then iterating over it, check out the XmlReader class and its derivatives. These allow you to traverse your XML node per node. XmlTextReader is a particular derivative for reading XML from text files. Check out http://support.microsoft.com/kb/307548. | How I can read an xml file with limited memory? var q = from n in XElement.Load(Application.StartupPath + "..\\..\\..\\2.xml").Elements() select n; foreach (var q0 in q) { string str = q0.ToString(); } the problem is my xml file is so big so how I can manage this code to load it gradually not completely. now I traced b... | TITLE:
How I can read an xml file with limited memory?
QUESTION:
var q = from n in XElement.Load(Application.StartupPath + "..\\..\\..\\2.xml").Elements() select n; foreach (var q0 in q) { string str = q0.ToString(); } the problem is my xml file is so big so how I can manage this code to load it gradually not complete... | [
"c#"
] | 0 | 3 | 102 | 2 | 0 | 2011-06-09T10:06:05.490000 | 2011-06-09T10:09:51.387000 |
6,291,133 | 6,291,162 | Mysql removing duplicates based on one column | I am using the query below $result2 = mysql_query("select * from HandsetStock WHERE SubCategory NOT LIKE '%clearance%'", $dbh2); I am getting a few duplicate results which I want to eliminate from the results however they are not completely duplicate rows. The column name is Make. I am guessing i need some kind of subq... | $result2 = mysql_query("select * from HandsetStock WHERE SubCategory NOT LIKE '%clearance%' group by Make", $dbh2) | Mysql removing duplicates based on one column I am using the query below $result2 = mysql_query("select * from HandsetStock WHERE SubCategory NOT LIKE '%clearance%'", $dbh2); I am getting a few duplicate results which I want to eliminate from the results however they are not completely duplicate rows. The column name i... | TITLE:
Mysql removing duplicates based on one column
QUESTION:
I am using the query below $result2 = mysql_query("select * from HandsetStock WHERE SubCategory NOT LIKE '%clearance%'", $dbh2); I am getting a few duplicate results which I want to eliminate from the results however they are not completely duplicate rows.... | [
"php",
"mysql"
] | 1 | 2 | 1,164 | 1 | 0 | 2011-06-09T10:06:09.583000 | 2011-06-09T10:08:58.530000 |
6,291,134 | 6,291,154 | C++ Crash Dumps on POSIX | I have a big C++ code (server for some application). This application is big, and catch a crash per 2 months in average. And i can't simulate this crash to catch her with gdb. Is exists some cool api to analyze memory on crash dump (stacktrace, local vars)? What is best way to catch stack corruption time? | Enable core dumping, wait for it to crash. Then load the core into gdb and debug as usual. ulimit -c unlimited | C++ Crash Dumps on POSIX I have a big C++ code (server for some application). This application is big, and catch a crash per 2 months in average. And i can't simulate this crash to catch her with gdb. Is exists some cool api to analyze memory on crash dump (stacktrace, local vars)? What is best way to catch stack corru... | TITLE:
C++ Crash Dumps on POSIX
QUESTION:
I have a big C++ code (server for some application). This application is big, and catch a crash per 2 months in average. And i can't simulate this crash to catch her with gdb. Is exists some cool api to analyze memory on crash dump (stacktrace, local vars)? What is best way to... | [
"c++",
"segmentation-fault",
"posix",
"stack-trace",
"crash-dumps"
] | 0 | 3 | 207 | 2 | 0 | 2011-06-09T10:06:10.113000 | 2011-06-09T10:08:08.370000 |
6,291,145 | 6,291,278 | Static class in C++ | In the header I declared #ifndef SOUND_CORE #define SOUND_CORE
static SoundEngine soundEngine;... but the constructor for SoundEngine gets called multiple times, how is it possible, when it's declared as global static I call it as #include "SoundCore.h" and use it directly soundEngine.foo() thank you | I would use extern instead of static. That's what extern is for. In the header: extern SoundEngine soundEngine; In an accompanying source file: SoundEngine soundEngine; This will create one translation unit with the instance, and including the header will allow you to use it everywhere in your code. // A.cpp #include /... | Static class in C++ In the header I declared #ifndef SOUND_CORE #define SOUND_CORE
static SoundEngine soundEngine;... but the constructor for SoundEngine gets called multiple times, how is it possible, when it's declared as global static I call it as #include "SoundCore.h" and use it directly soundEngine.foo() thank y... | TITLE:
Static class in C++
QUESTION:
In the header I declared #ifndef SOUND_CORE #define SOUND_CORE
static SoundEngine soundEngine;... but the constructor for SoundEngine gets called multiple times, how is it possible, when it's declared as global static I call it as #include "SoundCore.h" and use it directly soundEn... | [
"c++",
"class",
"static"
] | 4 | 7 | 229 | 5 | 0 | 2011-06-09T10:07:23.373000 | 2011-06-09T10:18:14.880000 |
6,291,161 | 6,291,296 | Is IIS a requirement in order to use AppFabric Server functionality for WCF Services? | I'm about to build a set of WCF Services. Previously I have written service-library DLL's and self hosted. However this new environment requires services to be deployed to AppFabric. It's my experience with AppFabric that it requires a.svc file, which must be hosted in IIS. If I want to use AppFabric for my WCF service... | As far i know, all App Fabric requires is service to be hosted on WAS. By not having IIS you wont be able to use the IIS UI but i guess there would be command line options for this. please have a look into: App Fabric FAQ | Is IIS a requirement in order to use AppFabric Server functionality for WCF Services? I'm about to build a set of WCF Services. Previously I have written service-library DLL's and self hosted. However this new environment requires services to be deployed to AppFabric. It's my experience with AppFabric that it requires ... | TITLE:
Is IIS a requirement in order to use AppFabric Server functionality for WCF Services?
QUESTION:
I'm about to build a set of WCF Services. Previously I have written service-library DLL's and self hosted. However this new environment requires services to be deployed to AppFabric. It's my experience with AppFabric... | [
"wcf",
"iis",
"appfabric"
] | 0 | 3 | 367 | 1 | 0 | 2011-06-09T10:08:50.590000 | 2011-06-09T10:19:32.807000 |
6,291,164 | 6,291,252 | Objective C: How to set key in NSUserDefault | I am trying to store information in NSUserdefault. My intention is to show a pop up message to the user if it is the first time he/she is launching the app. My code is as follows: //In my view did load method self.prefs = [NSUserDefaults standardUserDefaults]; self.firstTimeLaunchingApp = [prefs integerForKey:@"firstTi... | self.firstTimeLaunchingApp in initialized in viewDidLoad. After saving the key you have not refreshed it's value. So when the method is called again, its value is not 1. It is still containing the value which was read before. There is no problem in saving, as after re-launching you are not seeing the alert. Do this: [p... | Objective C: How to set key in NSUserDefault I am trying to store information in NSUserdefault. My intention is to show a pop up message to the user if it is the first time he/she is launching the app. My code is as follows: //In my view did load method self.prefs = [NSUserDefaults standardUserDefaults]; self.firstTime... | TITLE:
Objective C: How to set key in NSUserDefault
QUESTION:
I am trying to store information in NSUserdefault. My intention is to show a pop up message to the user if it is the first time he/she is launching the app. My code is as follows: //In my view did load method self.prefs = [NSUserDefaults standardUserDefault... | [
"objective-c",
"ios",
"nsuserdefaults"
] | 6 | 11 | 4,444 | 1 | 0 | 2011-06-09T10:09:09.123000 | 2011-06-09T10:16:18.607000 |
6,291,177 | 6,291,689 | windows service working on windows 7 but not on windows server 2003 | Solved the problem see the bottom of my post. So I have a simple windows service that watches a specific folder and upploads files that come into it to a server using a web service. It's working fine on my machine using windows 7 but when I try to start it on a windows server 2003, I receive an error: Error 1053: the s... | Have you installed the right version of.NET Framework on the Server 2003 PC? What comes as standard on Windows 7 will need to be installed manually on an older OS. You say "I have tried everything I can think of". Please edit the question to show what you have already tried so we don't suggest something you have alread... | windows service working on windows 7 but not on windows server 2003 Solved the problem see the bottom of my post. So I have a simple windows service that watches a specific folder and upploads files that come into it to a server using a web service. It's working fine on my machine using windows 7 but when I try to star... | TITLE:
windows service working on windows 7 but not on windows server 2003
QUESTION:
Solved the problem see the bottom of my post. So I have a simple windows service that watches a specific folder and upploads files that come into it to a server using a web service. It's working fine on my machine using windows 7 but ... | [
"c#",
".net",
"windows-services",
"timeout",
"windows-server-2003"
] | 0 | 1 | 3,023 | 4 | 0 | 2011-06-09T10:10:07.433000 | 2011-06-09T10:57:15.097000 |
6,291,178 | 6,291,192 | catch close browser with onunload function using master page in ASP.NET | I have a website with master page. I want to catch a user trying to close the browser/tab. When I try using onunload in the body tag, it fires not only when I try closing the browser, but also when I navigate to another page. Any idea how to only catch the event of closing the browser? | You can't distinguish closing the browser from navigating to another page. In both cases the current page is unloaded. update: maybe you can handle some cases with some jquery, i.e. whenever a link is clicked, set some flag to be able to distinguish it from closing the window or entering a new URL:... | catch close browser with onunload function using master page in ASP.NET I have a website with master page. I want to catch a user trying to close the browser/tab. When I try using onunload in the body tag, it fires not only when I try closing the browser, but also when I navigate to another page. Any idea how to only c... | TITLE:
catch close browser with onunload function using master page in ASP.NET
QUESTION:
I have a website with master page. I want to catch a user trying to close the browser/tab. When I try using onunload in the body tag, it fires not only when I try closing the browser, but also when I navigate to another page. Any ... | [
"asp.net",
"browser",
"master-pages",
"onunload"
] | 1 | 1 | 4,604 | 1 | 0 | 2011-06-09T10:10:19.950000 | 2011-06-09T10:11:43.843000 |
6,291,191 | 6,291,239 | How can I make a background transparent using css? | How can I add a background image to an element and make it transparent? | CSS doesn't provide a way to add translucency to just a background image. You can use the opacity property to make the entire element (content and children included) translucent. You can use rgba() colour values to make a plain background translucent. If you want a translucent background image, your best bet is to edit... | How can I make a background transparent using css? How can I add a background image to an element and make it transparent? | TITLE:
How can I make a background transparent using css?
QUESTION:
How can I add a background image to an element and make it transparent?
ANSWER:
CSS doesn't provide a way to add translucency to just a background image. You can use the opacity property to make the entire element (content and children included) tran... | [
"html",
"css"
] | 0 | 3 | 143 | 2 | 0 | 2011-06-09T10:11:41.527000 | 2011-06-09T10:16:00.690000 |
6,291,198 | 6,291,236 | Wrong text encoding in string sent to javascript | I have a javascript method which is receiving a UTF-8 encoded string (ViewBag.errorText), and uses this as a parameter to a new function. The problem is that the text displayed in show_error_dialog is displaying the html escaped characters ( æø etc') and not the intended ("æåø" etc.). I presume the problem is the enclo... | I think all Razor-inserted text is HTML-encoded by default. Use Html.Raw() to pass the string unencoded. | Wrong text encoding in string sent to javascript I have a javascript method which is receiving a UTF-8 encoded string (ViewBag.errorText), and uses this as a parameter to a new function. The problem is that the text displayed in show_error_dialog is displaying the html escaped characters ( æø etc') and not the intended... | TITLE:
Wrong text encoding in string sent to javascript
QUESTION:
I have a javascript method which is receiving a UTF-8 encoded string (ViewBag.errorText), and uses this as a parameter to a new function. The problem is that the text displayed in show_error_dialog is displaying the html escaped characters ( æø etc') an... | [
"javascript",
"asp.net-mvc-3"
] | 8 | 19 | 11,748 | 4 | 0 | 2011-06-09T10:12:25.903000 | 2011-06-09T10:15:21.207000 |
6,291,201 | 6,291,485 | DependencyProperty from string | How do I convert a property name (in string) to a DependencyProperty? I have a set of property names, its values in string and a DependencyObject. Now I want to set these property values to the DependencyObject. Any idea on how this can be achieved? Thanks. | You can get DependencyPropertyDescriptor using DependencyPropertyDescriptor.FromName method and then get dependency property identifier from this descriptor. var descriptor = DependencyPropertyDescriptor.FromName( propertyName, dependencyObject.GetType(), dependencyObject.GetType());
// now you can set property value ... | DependencyProperty from string How do I convert a property name (in string) to a DependencyProperty? I have a set of property names, its values in string and a DependencyObject. Now I want to set these property values to the DependencyObject. Any idea on how this can be achieved? Thanks. | TITLE:
DependencyProperty from string
QUESTION:
How do I convert a property name (in string) to a DependencyProperty? I have a set of property names, its values in string and a DependencyObject. Now I want to set these property values to the DependencyObject. Any idea on how this can be achieved? Thanks.
ANSWER:
You ... | [
"c#",
"wpf",
"xaml",
"dependency-properties",
"dependencyobject"
] | 14 | 33 | 9,165 | 1 | 0 | 2011-06-09T10:12:41.747000 | 2011-06-09T10:37:25.003000 |
6,291,208 | 6,291,232 | WCF - What is it exactly? | Possible Duplicate: What is WCF? I am a beginning programmer, and would like to know what WCF actually is. Maybe this is a stupid question but I can't get it figured out. I know it's a part of the.NET framework, but is it a way of working? Or is it a piece of code you can implement? or is it an interface? I understand ... | Read this: http://msdn.microsoft.com/en-us/library/ms731082.aspx | WCF - What is it exactly? Possible Duplicate: What is WCF? I am a beginning programmer, and would like to know what WCF actually is. Maybe this is a stupid question but I can't get it figured out. I know it's a part of the.NET framework, but is it a way of working? Or is it a piece of code you can implement? or is it a... | TITLE:
WCF - What is it exactly?
QUESTION:
Possible Duplicate: What is WCF? I am a beginning programmer, and would like to know what WCF actually is. Maybe this is a stupid question but I can't get it figured out. I know it's a part of the.NET framework, but is it a way of working? Or is it a piece of code you can imp... | [
".net",
"wcf"
] | 0 | 1 | 2,156 | 2 | 0 | 2011-06-09T10:13:02.753000 | 2011-06-09T10:15:06.657000 |
6,291,210 | 6,291,408 | offline map for a web based (ASP.Net) application | I'm developing a web based application where I need to overlay some color layers over each country or city. I know that I can use Google maps but the problem I have is that the server where we're deploying the app doesn't have access to the internet. so I need a map component like Google maps which I can use it offline... | You might check out openstreetmap. There you could download the planet.xml file for the whole world or specific files only for the regions you want to serve. Good material can be found also here: www.geofabrik.de Then you will have to set up your own tileserver, which will crunch png-tiles for the xml-files provided an... | offline map for a web based (ASP.Net) application I'm developing a web based application where I need to overlay some color layers over each country or city. I know that I can use Google maps but the problem I have is that the server where we're deploying the app doesn't have access to the internet. so I need a map com... | TITLE:
offline map for a web based (ASP.Net) application
QUESTION:
I'm developing a web based application where I need to overlay some color layers over each country or city. I know that I can use Google maps but the problem I have is that the server where we're deploying the app doesn't have access to the internet. s... | [
"asp.net",
"google-maps",
"maps",
"offline"
] | 1 | 4 | 3,507 | 2 | 0 | 2011-06-09T10:13:07.720000 | 2011-06-09T10:31:11.907000 |
6,291,219 | 6,291,974 | display content provider's save item in list view but throwing exception "null pointer" | hi dear i have one text box and and two button in my lay out which text i have enter save it in content provider by pressing save button and other button is for display content provider's save item in list view by pressing "mContactSendButton" button but it is throwing null pointer exception when i click save button wh... | I am not sure which command is line 45: is it String name = mContactNameEditText.getText().toString(); or madapter.insertRecord(name);? But I guess its the second one, because madapter is never initialized and should be null at the moment of calling madapter.insertRecord(name);. | display content provider's save item in list view but throwing exception "null pointer" hi dear i have one text box and and two button in my lay out which text i have enter save it in content provider by pressing save button and other button is for display content provider's save item in list view by pressing "mContact... | TITLE:
display content provider's save item in list view but throwing exception "null pointer"
QUESTION:
hi dear i have one text box and and two button in my lay out which text i have enter save it in content provider by pressing save button and other button is for display content provider's save item in list view by ... | [
"android"
] | 0 | 0 | 221 | 1 | 0 | 2011-06-09T10:13:46.317000 | 2011-06-09T11:20:54.170000 |
6,291,229 | 6,291,270 | Match string using preg_match | I have text in a $abc variable. Now I want to check that text can hold only characters (a-z, A-Z, 0-9). If they have any character except those, then "a output" should be returned. How can I do that? example: $abc = "this is @ text"; // no match | Something like: $abc = "this is @ text"; if (!preg_match('/^[a-z0-9]*\z/i', $abc)) { echo 'bad'; } With regards to Jame C's comment, here is the inverted case: $abc = "this is @ text"; if (preg_match('/[^a-z0-9]/i', $abc)) { echo 'bad'; } | Match string using preg_match I have text in a $abc variable. Now I want to check that text can hold only characters (a-z, A-Z, 0-9). If they have any character except those, then "a output" should be returned. How can I do that? example: $abc = "this is @ text"; // no match | TITLE:
Match string using preg_match
QUESTION:
I have text in a $abc variable. Now I want to check that text can hold only characters (a-z, A-Z, 0-9). If they have any character except those, then "a output" should be returned. How can I do that? example: $abc = "this is @ text"; // no match
ANSWER:
Something like: $... | [
"php",
"regex"
] | 1 | 6 | 563 | 3 | 0 | 2011-06-09T10:14:46.267000 | 2011-06-09T10:17:17.360000 |
6,291,231 | 6,291,449 | The best way of writing code to enable or disable some controls | Hi all i don't know whether it is correct or not to ask this type of questions but i would like to know the best and secure way of writing code. Actually i had some list of check boxes on which each selection particular DIV will get loaded. I would like to achieve this using 2 ways 1. Writing Java scripts to enable or ... | Both the approaches have their own advantages and disadvantages. Using JS you will definitely get better user experience & better performance. But it’s not reliable as someone might disable JS in the browser and you also need to think of browser compatibility. When you use server side code to do this in that case you n... | The best way of writing code to enable or disable some controls Hi all i don't know whether it is correct or not to ask this type of questions but i would like to know the best and secure way of writing code. Actually i had some list of check boxes on which each selection particular DIV will get loaded. I would like to... | TITLE:
The best way of writing code to enable or disable some controls
QUESTION:
Hi all i don't know whether it is correct or not to ask this type of questions but i would like to know the best and secure way of writing code. Actually i had some list of check boxes on which each selection particular DIV will get loade... | [
"javascript",
"asp.net"
] | 0 | 2 | 179 | 1 | 0 | 2011-06-09T10:15:00.370000 | 2011-06-09T10:34:15.727000 |
6,291,245 | 6,291,396 | Execute function if user doesn't press button with x seconds | I'm using a Jquery UI dialog like so: var $dialog; $(document).ready(function() { $dialog = $(' ').html('Are you awake? Yes ').dialog({ autoOpen: false, title: 'Inactivity Monitor' });
}); This dialog shows every 20 minutes and the user must click 'yes' to continue. I need to have something running behind this so if t... | You could use a setTimeout(); that will execute that function if reached, and you can set it to a variable so you could disable the timer if the button was clicked. I've set up a jsfiddle to show you how: http://jsfiddle.net/SrwTP/ JavaScript: var buttonTimer = setTimeout("alert('Oh noes! you didnt click the button:(')... | Execute function if user doesn't press button with x seconds I'm using a Jquery UI dialog like so: var $dialog; $(document).ready(function() { $dialog = $(' ').html('Are you awake? Yes ').dialog({ autoOpen: false, title: 'Inactivity Monitor' });
}); This dialog shows every 20 minutes and the user must click 'yes' to c... | TITLE:
Execute function if user doesn't press button with x seconds
QUESTION:
I'm using a Jquery UI dialog like so: var $dialog; $(document).ready(function() { $dialog = $(' ').html('Are you awake? Yes ').dialog({ autoOpen: false, title: 'Inactivity Monitor' });
}); This dialog shows every 20 minutes and the user mus... | [
"javascript",
"jquery",
"html",
"timer"
] | 0 | 2 | 1,187 | 2 | 0 | 2011-06-09T10:16:06.457000 | 2011-06-09T10:30:18.397000 |
6,291,247 | 6,291,966 | How to use multiple forms in one page with JSF 2.0? | I try to use multiple forms with JSF 2.0 in one page. I use PrimeFaces 3.0M1 and trying to build an application with tabs and one form per tab. I've got a page like the following: If I click on the submit button in tab 1, everything works like excpected. But, if I click on the button at the second tab, the command will... | The Primefaces wizard and tabview components must be enclosed by a single form. There is no reason that you cannot have multiple Submit buttons within a tabview or wizard like this. Your confusion on this is likely because you concerned about the other properties of your managed bean that do not appear in the currently... | How to use multiple forms in one page with JSF 2.0? I try to use multiple forms with JSF 2.0 in one page. I use PrimeFaces 3.0M1 and trying to build an application with tabs and one form per tab. I've got a page like the following: If I click on the submit button in tab 1, everything works like excpected. But, if I cli... | TITLE:
How to use multiple forms in one page with JSF 2.0?
QUESTION:
I try to use multiple forms with JSF 2.0 in one page. I use PrimeFaces 3.0M1 and trying to build an application with tabs and one form per tab. I've got a page like the following: If I click on the submit button in tab 1, everything works like excpec... | [
"java",
"jsf-2",
"primefaces"
] | 9 | 2 | 20,024 | 3 | 0 | 2011-06-09T10:16:08.217000 | 2011-06-09T11:19:58.010000 |
6,291,254 | 6,291,819 | Problem when setting a value to a dropdown in jQuery | I have this strange problem in JQuery. I try to set a value to a dropdown dinamically, so I have this code: $('#activity').val(idValue); //or this way: $('#activity').val("'"+idValue+"'"); but it does not work. However, if I'm setting the value "statically" then it works: $('#activity').val('23'); So, why does not acce... | What do you get if you alert idValue? Alternatively, I would also try attr(). $('#activity').attr('value',idValue); | Problem when setting a value to a dropdown in jQuery I have this strange problem in JQuery. I try to set a value to a dropdown dinamically, so I have this code: $('#activity').val(idValue); //or this way: $('#activity').val("'"+idValue+"'"); but it does not work. However, if I'm setting the value "statically" then it w... | TITLE:
Problem when setting a value to a dropdown in jQuery
QUESTION:
I have this strange problem in JQuery. I try to set a value to a dropdown dinamically, so I have this code: $('#activity').val(idValue); //or this way: $('#activity').val("'"+idValue+"'"); but it does not work. However, if I'm setting the value "sta... | [
"javascript",
"jquery"
] | 0 | 0 | 219 | 2 | 0 | 2011-06-09T10:16:26.157000 | 2011-06-09T11:08:21.203000 |
6,291,260 | 6,291,279 | Is possible with LINQ to extract from an array of objects the value of one property and create a new array? | I'm pretty new to LINQ and I wonder if it's possible to do the following thins: I have an array of objects with several properties. I want to create a new array with the values of one of those properties, so if I have this class: public class TestClass { public string A {get;set;} public string B {get;set;} public stri... | sure: string[] _cProperties = _array.Select(x => x.C).ToArray(); | Is possible with LINQ to extract from an array of objects the value of one property and create a new array? I'm pretty new to LINQ and I wonder if it's possible to do the following thins: I have an array of objects with several properties. I want to create a new array with the values of one of those properties, so if I... | TITLE:
Is possible with LINQ to extract from an array of objects the value of one property and create a new array?
QUESTION:
I'm pretty new to LINQ and I wonder if it's possible to do the following thins: I have an array of objects with several properties. I want to create a new array with the values of one of those p... | [
"c#",
".net",
"linq"
] | 3 | 15 | 3,795 | 2 | 0 | 2011-06-09T10:16:51.517000 | 2011-06-09T10:18:21.787000 |
6,291,280 | 6,291,369 | Coordinates of Document that is Currently Visible on Browser | How do I find out the coordinates of the web page / document that is currently visible on my browser? For example, $(window).height() returns 700 and $(document).height() returns 3,000 i.e. my document is longer than the browser's height. I'd like to find out, after interacting with the page (e.g. scrolling), which are... | If you use jQuery you could do: $(document).scrollTop(); http://api.jquery.com/scrollTop/ | Coordinates of Document that is Currently Visible on Browser How do I find out the coordinates of the web page / document that is currently visible on my browser? For example, $(window).height() returns 700 and $(document).height() returns 3,000 i.e. my document is longer than the browser's height. I'd like to find out... | TITLE:
Coordinates of Document that is Currently Visible on Browser
QUESTION:
How do I find out the coordinates of the web page / document that is currently visible on my browser? For example, $(window).height() returns 700 and $(document).height() returns 3,000 i.e. my document is longer than the browser's height. I'... | [
"javascript",
"jquery",
"html"
] | 1 | 1 | 575 | 2 | 0 | 2011-06-09T10:18:25.660000 | 2011-06-09T10:28:30.787000 |
6,291,282 | 6,291,340 | How to show the animation control by default | In this simple control object in mathematica like the following, Control[{x, 0, 1}] we have to bring the mouse pointer to the right upper corner of the object to get the hint called "Show Animation Controls" and then click it to see the animation controls like play, step forward etc. Is there a way by setting some opti... | For example, Manipulator[Dynamic[x], {0, 2}, Appearance \[Rule] "Open"]. Can you give more details on what you are trying to do? EDIT: Does this Manipulate[ Plot[Sin[a x + b], {x, 0, 6}], {a, 1, 4, Appearance \[Rule] "Open"}, {b, 0, 10, Appearance \[Rule] "Open"}] do what you want? | How to show the animation control by default In this simple control object in mathematica like the following, Control[{x, 0, 1}] we have to bring the mouse pointer to the right upper corner of the object to get the hint called "Show Animation Controls" and then click it to see the animation controls like play, step for... | TITLE:
How to show the animation control by default
QUESTION:
In this simple control object in mathematica like the following, Control[{x, 0, 1}] we have to bring the mouse pointer to the right upper corner of the object to get the hint called "Show Animation Controls" and then click it to see the animation controls l... | [
"animation",
"wolfram-mathematica"
] | 8 | 8 | 2,431 | 2 | 0 | 2011-06-09T10:18:36.390000 | 2011-06-09T10:25:14.037000 |
6,291,302 | 6,291,618 | jaas, authenticate application users on a database table | I want to know the simplest way to authenticate an application user on a database table using jaas. Since a database table with username/hashed password is probably the most common solution, is there a "provided" LoginModule for this kind of auth? | The JDBCRealm support in Tomcat 6, comes out-of-the-box. This is probably sufficient for most needs. Note, that Tomcat also provides the DataSourceRealm to allow for authentication via a JNDI based JDBC datasource; this is better suited for applications that need a dedicated connection pool to access the authentication... | jaas, authenticate application users on a database table I want to know the simplest way to authenticate an application user on a database table using jaas. Since a database table with username/hashed password is probably the most common solution, is there a "provided" LoginModule for this kind of auth? | TITLE:
jaas, authenticate application users on a database table
QUESTION:
I want to know the simplest way to authenticate an application user on a database table using jaas. Since a database table with username/hashed password is probably the most common solution, is there a "provided" LoginModule for this kind of aut... | [
"java",
"jaas"
] | 2 | 3 | 2,667 | 1 | 0 | 2011-06-09T10:20:01.140000 | 2011-06-09T10:49:10.743000 |
6,291,305 | 6,291,351 | c# - create a datatable from a class (not a list of instances) | This question concerns generics and types as well as datatables. The following snippet is around the net here and there, and creates a datatable based on a generic type: public static DataTable ListToDataTable (List list) { DataTable dt = new DataTable();
foreach (PropertyInfo info in typeof(T).GetProperties()) { dt.C... | It's actually pretty simple, when you realize that you don't need to (or even can) use generics in this case: public static DataTable CreateEmptyDataTable(Type myType) { DataTable dt = new DataTable();
foreach (PropertyInfo info in myType.GetProperties()) { dt.Columns.Add(new DataColumn(info.Name, info.PropertyType));... | c# - create a datatable from a class (not a list of instances) This question concerns generics and types as well as datatables. The following snippet is around the net here and there, and creates a datatable based on a generic type: public static DataTable ListToDataTable (List list) { DataTable dt = new DataTable();
... | TITLE:
c# - create a datatable from a class (not a list of instances)
QUESTION:
This question concerns generics and types as well as datatables. The following snippet is around the net here and there, and creates a datatable based on a generic type: public static DataTable ListToDataTable (List list) { DataTable dt = ... | [
"c#",
"generics",
"reflection",
"types",
"system.data.datatable"
] | 7 | 14 | 20,631 | 2 | 0 | 2011-06-09T10:20:42.863000 | 2011-06-09T10:26:32.220000 |
6,291,315 | 6,291,390 | Should we initialize a class object inside the config file? | Is it a good practice to initialize an object for an authentication class that does various stuff like register user, login user etc. inside a config file? The config file mostly does stuff like setting db username, password and site name etc. Please provide a reason if you don't find this a standard practice. Just to ... | In my opinion this is not a good idea. A config file is for configuration, not for execution. I would put this code into a bootstrap.php, so, when you have to edit your code in the future, you know exactly where you can find your configurations and instantiations. index.php: include('bootstrap.php'); bootstrap.php: inc... | Should we initialize a class object inside the config file? Is it a good practice to initialize an object for an authentication class that does various stuff like register user, login user etc. inside a config file? The config file mostly does stuff like setting db username, password and site name etc. Please provide a... | TITLE:
Should we initialize a class object inside the config file?
QUESTION:
Is it a good practice to initialize an object for an authentication class that does various stuff like register user, login user etc. inside a config file? The config file mostly does stuff like setting db username, password and site name etc... | [
"php",
"configuration-files"
] | 3 | 3 | 559 | 4 | 0 | 2011-06-09T10:21:59.263000 | 2011-06-09T10:29:36.600000 |
6,291,322 | 6,291,392 | How to encrypt username and password in Web.config in C# 2.0 | I have the entries below in my Web.config and I am using.NET 2.0 and C# for coding. Now I want this to be encrypted so that nobody can see it, and also these passwords may change frequently (every fifteen days). | You could put the username and password into a separate section and encrypt this section only. For example: and then use aspnet_regiis For Ex: aspnet_regiis -pef secureAppSettings. -prov DataProtectionConfigurationProvider | How to encrypt username and password in Web.config in C# 2.0 I have the entries below in my Web.config and I am using.NET 2.0 and C# for coding. Now I want this to be encrypted so that nobody can see it, and also these passwords may change frequently (every fifteen days). | TITLE:
How to encrypt username and password in Web.config in C# 2.0
QUESTION:
I have the entries below in my Web.config and I am using.NET 2.0 and C# for coding. Now I want this to be encrypted so that nobody can see it, and also these passwords may change frequently (every fifteen days).
ANSWER:
You could put the us... | [
"asp.net",
"web-config"
] | 15 | 13 | 42,060 | 4 | 0 | 2011-06-09T10:22:37.587000 | 2011-06-09T10:29:38.950000 |
6,291,325 | 6,291,795 | R: Replacing rownames of data frame by a substring[2] | I have a question about the use of gsub. The rownames of my data, have the same partial names. See below: > rownames(test) [1] "U2OS.EV.2.7.9" "U2OS.PIM.2.7.9" "U2OS.WDR.2.7.9" "U2OS.MYC.2.7.9" [5] "U2OS.OBX.2.7.9" "U2OS.EV.18.6.9" "U2O2.PIM.18.6.9" "U2OS.WDR.18.6.9" [9] "U2OS.MYC.18.6.9" "U2OS.OBX.18.6.9" "X1.U2OS...O... | If you don't want to use the "|" character, you can try something like: Rnames <- c( "U2OS.EV.2.7.9", "U2OS.PIM.2.7.9", "U2OS.WDR.2.7.9", "U2OS.MYC.2.7.9", "U2OS.OBX.2.7.9", "U2OS.EV.18.6.9","U2O2.PIM.18.6.9","U2OS.WDR.18.6.9" )
Rlevels <- c("MYC","EV","PIM","WDR","OBX") tmp <- sapply(Rlevels,grepl,Rnames) apply(tmp,1... | R: Replacing rownames of data frame by a substring[2] I have a question about the use of gsub. The rownames of my data, have the same partial names. See below: > rownames(test) [1] "U2OS.EV.2.7.9" "U2OS.PIM.2.7.9" "U2OS.WDR.2.7.9" "U2OS.MYC.2.7.9" [5] "U2OS.OBX.2.7.9" "U2OS.EV.18.6.9" "U2O2.PIM.18.6.9" "U2OS.WDR.18.6.9... | TITLE:
R: Replacing rownames of data frame by a substring[2]
QUESTION:
I have a question about the use of gsub. The rownames of my data, have the same partial names. See below: > rownames(test) [1] "U2OS.EV.2.7.9" "U2OS.PIM.2.7.9" "U2OS.WDR.2.7.9" "U2OS.MYC.2.7.9" [5] "U2OS.OBX.2.7.9" "U2OS.EV.18.6.9" "U2O2.PIM.18.6.9... | [
"r",
"dataframe",
"gsub",
"galaxy"
] | 2 | 2 | 1,774 | 2 | 0 | 2011-06-09T10:23:12.593000 | 2011-06-09T11:06:17.777000 |
6,291,326 | 6,291,389 | show off mobile sites in web portfolio? | Does anyone out there know if its possible to show a working version of a mobile site in a web portfolio? Wondered if there was an emulator that could be used for this purpose? Any ideas, please give me a shout. | If you're using device detection on the mobile site, the easiest way would be to have a flag in your URL that will make the site think it's serving a mobile client and not a web client. This depends on your implementation, but spoofing the device is the easiest way. Makes it easier to debug as well. | show off mobile sites in web portfolio? Does anyone out there know if its possible to show a working version of a mobile site in a web portfolio? Wondered if there was an emulator that could be used for this purpose? Any ideas, please give me a shout. | TITLE:
show off mobile sites in web portfolio?
QUESTION:
Does anyone out there know if its possible to show a working version of a mobile site in a web portfolio? Wondered if there was an emulator that could be used for this purpose? Any ideas, please give me a shout.
ANSWER:
If you're using device detection on the m... | [
"html",
"mobile"
] | 2 | 0 | 177 | 2 | 0 | 2011-06-09T10:23:13.827000 | 2011-06-09T10:29:36.397000 |
6,291,327 | 6,291,393 | In a migration: how to loop through Models and execute a private method in Model | I have a Post, to which a migration adds a new attribute and table column short_url. This attribute is either provided by the user, or, if left blank, automatically created: class Post < ActiveRecord::Base before_create:create_short_url
private def create_short_url if short_url.blank? || already_exists?(short_url) wri... | Just use the Object method send (it doesn't check protected/private). Post.all.each do |post| post.send:create_short_url post.save! end An alternative would be (but that could interfere with other migrations running in the same Ruby-process after that): Post.before_save:create_short_url Post.all.each(&:save!) Visibilit... | In a migration: how to loop through Models and execute a private method in Model I have a Post, to which a migration adds a new attribute and table column short_url. This attribute is either provided by the user, or, if left blank, automatically created: class Post < ActiveRecord::Base before_create:create_short_url
p... | TITLE:
In a migration: how to loop through Models and execute a private method in Model
QUESTION:
I have a Post, to which a migration adds a new attribute and table column short_url. This attribute is either provided by the user, or, if left blank, automatically created: class Post < ActiveRecord::Base before_create:c... | [
"ruby-on-rails-3",
"migration"
] | 2 | 1 | 1,209 | 1 | 0 | 2011-06-09T10:23:28.090000 | 2011-06-09T10:29:39.607000 |
6,291,334 | 6,291,505 | How to use REST while using Java? | I am using Spring MVC and want to develop a website that uses REST API provided by LinkedIn. I am very new to REST and have no Idea of how to use REST and retrieve data. I want a full tutorial so as to start up with my REST application. Please help me out through this. | For consuming RESTful services the core class provided by spring is RestTemplate The spring blog has a pretty good article on how to use the RestTemplate. A very simplified example is: class MyServiceClient {
RestTemplate rest = new RestTemplate();
public String get(String thingy){ return rest.get("http://www.example... | How to use REST while using Java? I am using Spring MVC and want to develop a website that uses REST API provided by LinkedIn. I am very new to REST and have no Idea of how to use REST and retrieve data. I want a full tutorial so as to start up with my REST application. Please help me out through this. | TITLE:
How to use REST while using Java?
QUESTION:
I am using Spring MVC and want to develop a website that uses REST API provided by LinkedIn. I am very new to REST and have no Idea of how to use REST and retrieve data. I want a full tutorial so as to start up with my REST application. Please help me out through this... | [
"rest"
] | 0 | 1 | 1,630 | 2 | 0 | 2011-06-09T10:24:20.747000 | 2011-06-09T10:39:18.560000 |
6,291,348 | 6,291,446 | prevent a form from being submitted while pressing enter key | how can we prevent a form from being submitted while pressing enter key. Actually I have a text box and on entering a value on that textbox and clicking enter the textbox2 will get focused. By default on clicking the enter button the form will get submitted. So I can not get the out put. I wrote return false on onclick... | Without looking up the actual code, here's the basic theory behind how I'd do it: Define an event handler on the document for a key being pressed to call a function. If the key that triggered the event is the enter/return key, return false, otherwise return true. EDIT: Looks like you already found the answer (as well a... | prevent a form from being submitted while pressing enter key how can we prevent a form from being submitted while pressing enter key. Actually I have a text box and on entering a value on that textbox and clicking enter the textbox2 will get focused. By default on clicking the enter button the form will get submitted. ... | TITLE:
prevent a form from being submitted while pressing enter key
QUESTION:
how can we prevent a form from being submitted while pressing enter key. Actually I have a text box and on entering a value on that textbox and clicking enter the textbox2 will get focused. By default on clicking the enter button the form wi... | [
"javascript",
"forms",
"form-submit"
] | 3 | 2 | 2,677 | 4 | 0 | 2011-06-09T10:26:12.930000 | 2011-06-09T10:33:47.317000 |
6,291,350 | 6,291,520 | Decorator design pattern, function bug | This is homework...I'm not asking for answers, I just have a bug I'm not sure what to do with. Thanks! The bug in question probably has nothing to do with the assignment itself, but here is the assignment description anyways: I'm working on an assignment (in C++) meant to teach use of the decorator design pattern throu... | Do you have currentPizza also declared as an field of the Pizza class and you are using that somewhere else? If so, the currentPizza you are updating in newPizza is specific to that method, and you need to do just currentPizza = new Plain(); instead of declaring a new currentPizza variable in the scope of the method. A... | Decorator design pattern, function bug This is homework...I'm not asking for answers, I just have a bug I'm not sure what to do with. Thanks! The bug in question probably has nothing to do with the assignment itself, but here is the assignment description anyways: I'm working on an assignment (in C++) meant to teach us... | TITLE:
Decorator design pattern, function bug
QUESTION:
This is homework...I'm not asking for answers, I just have a bug I'm not sure what to do with. Thanks! The bug in question probably has nothing to do with the assignment itself, but here is the assignment description anyways: I'm working on an assignment (in C++)... | [
"c++",
"class",
"initialization",
"decorator"
] | 9 | 6 | 510 | 3 | 0 | 2011-06-09T10:26:24.250000 | 2011-06-09T10:40:23.153000 |
6,291,362 | 6,291,433 | How GC deal with this problem on .net platform? | I have this code classObject var1 = new classObject(); classObject var2 = var1; Now, I wrote this: var1 = null; How the GC will handle this? Does GC will collect the instance of this classObject? And how GC will hangle this if i will wrote var2= null? ( and remove the var1=null from the code ) | Short answer: no, because var2 still refers to the instance. As long as you have at least one reference to an object, the object will not be collected. Longer answer: actually, probably it will in this example, because you don't go on to do anything with var2. The GC takes variable liveness into account. If you never u... | How GC deal with this problem on .net platform? I have this code classObject var1 = new classObject(); classObject var2 = var1; Now, I wrote this: var1 = null; How the GC will handle this? Does GC will collect the instance of this classObject? And how GC will hangle this if i will wrote var2= null? ( and remove the var... | TITLE:
How GC deal with this problem on .net platform?
QUESTION:
I have this code classObject var1 = new classObject(); classObject var2 = var1; Now, I wrote this: var1 = null; How the GC will handle this? Does GC will collect the instance of this classObject? And how GC will hangle this if i will wrote var2= null? ( ... | [
"c#",
".net",
"clr"
] | 0 | 8 | 84 | 5 | 0 | 2011-06-09T10:27:44.703000 | 2011-06-09T10:32:36.117000 |
6,291,370 | 6,291,431 | How to get value of checked checkbox in php? | Here's the code: get_databaseURL(); $dbUName = $conf->get_databaseUName(); $dbPword = $conf->get_databasePWord(); $dbName = $conf->get_databaseName(); $nameOfDbWithCustomers = $conf->get_tableName('customer');
if(isset($_REQUEST[session_name()])) { session_start(); } else { header("Location: authorize.php"); } if($_SE... | You should assign a value for checkbox in HTML code Active: and then if the checkbox is checked it contains assigned value in POST otherwise you have to set when checkbox is unchecked $active = isset($_POST['Active']) && $_POST['Active']? "1": "0"; | How to get value of checked checkbox in php? Here's the code: get_databaseURL(); $dbUName = $conf->get_databaseUName(); $dbPword = $conf->get_databasePWord(); $dbName = $conf->get_databaseName(); $nameOfDbWithCustomers = $conf->get_tableName('customer');
if(isset($_REQUEST[session_name()])) { session_start(); } else {... | TITLE:
How to get value of checked checkbox in php?
QUESTION:
Here's the code: get_databaseURL(); $dbUName = $conf->get_databaseUName(); $dbPword = $conf->get_databasePWord(); $dbName = $conf->get_databaseName(); $nameOfDbWithCustomers = $conf->get_tableName('customer');
if(isset($_REQUEST[session_name()])) { session... | [
"php",
"checkbox"
] | 6 | 27 | 81,388 | 3 | 0 | 2011-06-09T10:28:30.910000 | 2011-06-09T10:32:27.420000 |
6,291,375 | 6,291,606 | User Login Issue in iPhone App | I have an app which communicates to webserver. This webserver has SQLite database on it. User can log on to their account from the app. I want to ensure that if user is already logged in from one device, he should not be able to log in at the same time from other device. How can I achieve that? | Just a little bit of trick can do the task: For that you need to have some **Boolean variable** inside your **SQlite Table in server**. So, when you are successfully logged in make that boolean to true.And please check this variable value to be True or False when doing login. If you are already logged in another app th... | User Login Issue in iPhone App I have an app which communicates to webserver. This webserver has SQLite database on it. User can log on to their account from the app. I want to ensure that if user is already logged in from one device, he should not be able to log in at the same time from other device. How can I achieve... | TITLE:
User Login Issue in iPhone App
QUESTION:
I have an app which communicates to webserver. This webserver has SQLite database on it. User can log on to their account from the app. I want to ensure that if user is already logged in from one device, he should not be able to log in at the same time from other device.... | [
"iphone",
"objective-c",
"cocoa-touch",
"sqlite",
"ios4"
] | 0 | 1 | 131 | 1 | 0 | 2011-06-09T10:28:58.263000 | 2011-06-09T10:47:46.313000 |
6,291,381 | 6,291,473 | How to send HTTP data and get response with Synapse (Delphi) | I think the title was clear enough. I want to know how to send HTTP POST request with parameters/arguments and receive HTML response back - using Synapse library for Delphi. | Try to use HttpPostURL function. function HttpPostURL(const URL, URLData: string; const Data: TStream): Boolean; URL - target URL URLData - URL parameters; must be encoded e.g. using EncodeURLElement function Data - target stream, where the response will be stored The following example uses testing POST server where se... | How to send HTTP data and get response with Synapse (Delphi) I think the title was clear enough. I want to know how to send HTTP POST request with parameters/arguments and receive HTML response back - using Synapse library for Delphi. | TITLE:
How to send HTTP data and get response with Synapse (Delphi)
QUESTION:
I think the title was clear enough. I want to know how to send HTTP POST request with parameters/arguments and receive HTML response back - using Synapse library for Delphi.
ANSWER:
Try to use HttpPostURL function. function HttpPostURL(cons... | [
"http",
"delphi",
"request",
"http-post",
"ararat-synapse"
] | 5 | 8 | 15,453 | 1 | 0 | 2011-06-09T10:29:13.043000 | 2011-06-09T10:35:55.533000 |
6,291,383 | 6,291,864 | Login textbox style - iPhone | I have a login screen with a username and password textbox. However, I've come across a better way to present my username and password textboxes. The textboxes seems to be merged. Just like the login screen on Windows Live Messenger iPhone app. Does anyone know how to make this? Thanks. | Better You can also use Grouped UITableview, add two UITextfields into the tableview cells as subview. This should be look as same as windows live messenger. | Login textbox style - iPhone I have a login screen with a username and password textbox. However, I've come across a better way to present my username and password textboxes. The textboxes seems to be merged. Just like the login screen on Windows Live Messenger iPhone app. Does anyone know how to make this? Thanks. | TITLE:
Login textbox style - iPhone
QUESTION:
I have a login screen with a username and password textbox. However, I've come across a better way to present my username and password textboxes. The textboxes seems to be merged. Just like the login screen on Windows Live Messenger iPhone app. Does anyone know how to make... | [
"iphone",
"ios4",
"uiview",
"authentication"
] | 2 | 1 | 540 | 3 | 0 | 2011-06-09T10:29:21.940000 | 2011-06-09T11:11:59.837000 |
6,291,386 | 6,291,490 | Why extra spaces and linebreaks in queries are bad? | I see, from time to time, that people say that SQL query that is sent to a server from client application should not contain any extra linebreaks or spaces. One of the reason I've heard is "why waste network traffic?". Is there a real reason to make code harder to read and edit in favor of removing all spaces? With spa... | It is true, it will cost network traffic and server time; but it will be negligible on all except the most extreme cases. Now, if you are editing the code of FaceBook (or Google, or similar), and optimize in this way the 10 most common queries, then there is a point, since they will be run billions of times per day. Bu... | Why extra spaces and linebreaks in queries are bad? I see, from time to time, that people say that SQL query that is sent to a server from client application should not contain any extra linebreaks or spaces. One of the reason I've heard is "why waste network traffic?". Is there a real reason to make code harder to rea... | TITLE:
Why extra spaces and linebreaks in queries are bad?
QUESTION:
I see, from time to time, that people say that SQL query that is sent to a server from client application should not contain any extra linebreaks or spaces. One of the reason I've heard is "why waste network traffic?". Is there a real reason to make ... | [
"php",
"mysql",
"coding-style",
"formatting"
] | 5 | 12 | 186 | 5 | 0 | 2011-06-09T10:29:31.567000 | 2011-06-09T10:37:57.670000 |
6,291,388 | 6,291,479 | How to save state of application in android? | I want to know how can I save state of my application in android.What I want is when user is using my app and in between he goes out of my app without doing logout.So when he again open my app he should be redirected to the page and its section where he left instead of first page. Is it Possible to do? Please Help me.. | You can always play around with SharedPreferences and Editor you save a value that represents where your user got it and when you reopen the app you load the page accordingly like 1 => main page 2=>user info 3=>credits etc either check the android documentation or: http://saigeethamn.blogspot.com/2009/10/shared-prefere... | How to save state of application in android? I want to know how can I save state of my application in android.What I want is when user is using my app and in between he goes out of my app without doing logout.So when he again open my app he should be redirected to the page and its section where he left instead of first... | TITLE:
How to save state of application in android?
QUESTION:
I want to know how can I save state of my application in android.What I want is when user is using my app and in between he goes out of my app without doing logout.So when he again open my app he should be redirected to the page and its section where he lef... | [
"android",
"state"
] | 0 | 1 | 583 | 1 | 0 | 2011-06-09T10:29:36.190000 | 2011-06-09T10:36:31.950000 |
6,291,399 | 6,291,463 | Log4j - Force log message parameters | I am trying to force the detail within log4j messages as opposed to just a string. Ultimately I would like to have something like: logger.info("component", "error code", " error message"); I may even use an enum for the component. I would then expect the message to appear in the log as "time - component - code - messag... | A very trivial solution (for this special case): logger.info( String.format("%s - %s - %s", "component", "error code", "error message")); or in an improved version: logger.info(createMessage("component", "error code", "error message")); with public static String createMessage( String component, String errorCode, String... | Log4j - Force log message parameters I am trying to force the detail within log4j messages as opposed to just a string. Ultimately I would like to have something like: logger.info("component", "error code", " error message"); I may even use an enum for the component. I would then expect the message to appear in the log... | TITLE:
Log4j - Force log message parameters
QUESTION:
I am trying to force the detail within log4j messages as opposed to just a string. Ultimately I would like to have something like: logger.info("component", "error code", " error message"); I may even use an enum for the component. I would then expect the message to... | [
"java",
"log4j"
] | 1 | 6 | 5,439 | 1 | 0 | 2011-06-09T10:30:29.690000 | 2011-06-09T10:35:20.877000 |
6,291,405 | 6,291,568 | mysql - after insert ignore get primary key | i am running a query in mysql insert ignore into........ using Python after running the query I want to know the primary key of the row. I know there is the query SELECT LAST_INSERT_ID(); but i'm not sure if it will work with insert ignore what is the best way to do this? | The documentation for LAST_INSERT_ID() says: If you use INSERT IGNORE and the row is ignored, the AUTO_INCREMENT counter is not incremented and LAST_INSERT_ID() returns 0, which reflects that no row was inserted. Knowing this, you can make this a multi-step process: INSERT IGNORE if LAST_INSERT_ID(), then done (new row... | mysql - after insert ignore get primary key i am running a query in mysql insert ignore into........ using Python after running the query I want to know the primary key of the row. I know there is the query SELECT LAST_INSERT_ID(); but i'm not sure if it will work with insert ignore what is the best way to do this? | TITLE:
mysql - after insert ignore get primary key
QUESTION:
i am running a query in mysql insert ignore into........ using Python after running the query I want to know the primary key of the row. I know there is the query SELECT LAST_INSERT_ID(); but i'm not sure if it will work with insert ignore what is the best w... | [
"mysql"
] | 28 | 42 | 26,504 | 3 | 0 | 2011-06-09T10:31:04.077000 | 2011-06-09T10:44:32.887000 |
6,291,412 | 6,299,064 | NSMutableArray check if object already exists | I am not sure how to go about this. I have an NSMutableArray (addList) which holds all the items to be added to my datasource NSMutableArray. I now want to check if the object to be added from the addList array already exists in the datasource array. If it does not exist add the item, if exists ignore. Both the objects... | I found a solution, may not be the most efficient of all, but atleast works NSMutableArray *add=[[NSMutableArray alloc]init];
for (Item *item in addList){ if ([appDelegate.list containsObject:item]) {} else [add addObject:item]; } Then I iterate over the add array and insert items. | NSMutableArray check if object already exists I am not sure how to go about this. I have an NSMutableArray (addList) which holds all the items to be added to my datasource NSMutableArray. I now want to check if the object to be added from the addList array already exists in the datasource array. If it does not exist ad... | TITLE:
NSMutableArray check if object already exists
QUESTION:
I am not sure how to go about this. I have an NSMutableArray (addList) which holds all the items to be added to my datasource NSMutableArray. I now want to check if the object to be added from the addList array already exists in the datasource array. If it... | [
"iphone",
"objective-c",
"ios",
"nsmutablearray"
] | 45 | 40 | 79,839 | 9 | 0 | 2011-06-09T10:31:26.183000 | 2011-06-09T20:48:17.437000 |
6,291,442 | 6,291,484 | 1st Time to AJAX, Don't understand some line of codes | I am new to programming and its my first time to learn AJAX with PHP. I got a working sample code from internet and studying it but there are some codes that I don't understand and I am really frustrated. In the index.php, I am so confused about the code xmlhttp.open("GET","gethint.php?q="+str,true);. I dont know what ... | In your example, q is a parameter that is passed to gethint.php with the value contained in the variable str. The variable gets its value from the "First name" input element, whenever a key is pressed and released (the onkeyup event). The value of q is then accessed in the PHP file by the line $q=$_GET["q"];. You can n... | 1st Time to AJAX, Don't understand some line of codes I am new to programming and its my first time to learn AJAX with PHP. I got a working sample code from internet and studying it but there are some codes that I don't understand and I am really frustrated. In the index.php, I am so confused about the code xmlhttp.ope... | TITLE:
1st Time to AJAX, Don't understand some line of codes
QUESTION:
I am new to programming and its my first time to learn AJAX with PHP. I got a working sample code from internet and studying it but there are some codes that I don't understand and I am really frustrated. In the index.php, I am so confused about th... | [
"php",
"ajax"
] | 3 | 4 | 1,257 | 3 | 0 | 2011-06-09T10:33:25.807000 | 2011-06-09T10:37:23.623000 |
6,291,454 | 6,291,587 | ASP.NET MVC Inline Styling convert | Is there anyway I can get the all style of a page (even the style in some linked css files) as inline style? For example, I have my css file: body { background-color: red; color: black; } And this HTML: Hello World! So I'd like to get: Hello World! It would also work for me if I can get all the style in a style node. | from your comments, what you need is very different What you are looking for is a tool that grabs an HTML page with it's own CSS styling and convert them into inline styling. For that, plenty of tools are at your service: http://premailer.dialect.ca/ There are more in Google, this is commonly used in Mailing as Email C... | ASP.NET MVC Inline Styling convert Is there anyway I can get the all style of a page (even the style in some linked css files) as inline style? For example, I have my css file: body { background-color: red; color: black; } And this HTML: Hello World! So I'd like to get: Hello World! It would also work for me if I can g... | TITLE:
ASP.NET MVC Inline Styling convert
QUESTION:
Is there anyway I can get the all style of a page (even the style in some linked css files) as inline style? For example, I have my css file: body { background-color: red; color: black; } And this HTML: Hello World! So I'd like to get: Hello World! It would also work... | [
"css",
"asp.net-mvc-3",
"stylesheet",
"styles",
"inline-styles"
] | 2 | 3 | 2,063 | 3 | 0 | 2011-06-09T10:34:35.087000 | 2011-06-09T10:46:08.653000 |
6,291,456 | 6,291,498 | naming conventions of Field Name | What is your naming conventions of Field Name.. Which is popular way? Example: firstname First_Name first_name firstName FirstName
category_id categoryID CategoryID categoryId | I would recommend first_name and category_id due to readability and easily understandable. | naming conventions of Field Name What is your naming conventions of Field Name.. Which is popular way? Example: firstname First_Name first_name firstName FirstName
category_id categoryID CategoryID categoryId | TITLE:
naming conventions of Field Name
QUESTION:
What is your naming conventions of Field Name.. Which is popular way? Example: firstname First_Name first_name firstName FirstName
category_id categoryID CategoryID categoryId
ANSWER:
I would recommend first_name and category_id due to readability and easily understa... | [
"mysql",
"database",
"database-design"
] | 1 | 5 | 169 | 3 | 0 | 2011-06-09T10:34:39.470000 | 2011-06-09T10:38:48.330000 |
6,291,458 | 6,291,495 | How to convert a TCHAR array to std::string? | How do I convert a TCHAR array to std::string (not to std::basic_string )? | TCHAR is just a typedef that, depending on your compilation configuration, either defaults to char or wchar_t. Standard Template Library supports both ASCII (with std::string ) and wide character sets (with std::wstring ). All you need to do is to typedef String as either std::string or std::wstring depending on your c... | How to convert a TCHAR array to std::string? How do I convert a TCHAR array to std::string (not to std::basic_string )? | TITLE:
How to convert a TCHAR array to std::string?
QUESTION:
How do I convert a TCHAR array to std::string (not to std::basic_string )?
ANSWER:
TCHAR is just a typedef that, depending on your compilation configuration, either defaults to char or wchar_t. Standard Template Library supports both ASCII (with std::strin... | [
"c++",
"string",
"windows",
"unicode",
"tchar"
] | 35 | 39 | 82,771 | 6 | 0 | 2011-06-09T10:34:57.983000 | 2011-06-09T10:38:31.867000 |
6,291,460 | 6,291,482 | Do you need to "unwire" an anonymous function/lambda | My understanding is that any event handlers wired up in C# need to be unwired as such. Object myObject = new Object(); myObject.Event += EventHandler; //Wired myObject.Event -= EventHandler; //Unwired But do you need to unwire the following code? and if so, how? Object myObject = new Object(); myObject.Event += (object... | Yes, you need to (*) and you need to do it like this: Object myObject = new Object(); EventHandler handler = (object sender, EventArgs e) => { }; myObject.Event += handler; //Wired myObject.Event -= handler; //Unwired See here for an explanation. (*) You don't need to do it because of garbage collection. You need to do... | Do you need to "unwire" an anonymous function/lambda My understanding is that any event handlers wired up in C# need to be unwired as such. Object myObject = new Object(); myObject.Event += EventHandler; //Wired myObject.Event -= EventHandler; //Unwired But do you need to unwire the following code? and if so, how? Obje... | TITLE:
Do you need to "unwire" an anonymous function/lambda
QUESTION:
My understanding is that any event handlers wired up in C# need to be unwired as such. Object myObject = new Object(); myObject.Event += EventHandler; //Wired myObject.Event -= EventHandler; //Unwired But do you need to unwire the following code? an... | [
"c#",
"events",
"lambda",
"event-handling",
"anonymous-function"
] | 9 | 10 | 1,398 | 3 | 0 | 2011-06-09T10:35:06.147000 | 2011-06-09T10:37:08.160000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.