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,223,993 | 6,224,524 | why .live not working in IE9 | I finished coding my jQuery site but I have found that.live jQuery is not supported with IE9 or in fact any IE. Or at least that is my experience. I am wondering how to get IE to do the following $('ul#mainmenu a li').live('click', function(event){ //alert(this.id);
$("li#"+lastpageid).removeClass(); fetchpage(this.id... | Like others have pointed out make sure your HTML structure makes sense i.e. put the anchor INSIDE the li blah not blah is a structured list, doing the above has no structure meaning and isn't the right way to do things. If your aim is to have the anchor take up the full with of the list item, then make the anchor a blo... | why .live not working in IE9 I finished coding my jQuery site but I have found that.live jQuery is not supported with IE9 or in fact any IE. Or at least that is my experience. I am wondering how to get IE to do the following $('ul#mainmenu a li').live('click', function(event){ //alert(this.id);
$("li#"+lastpageid).rem... | TITLE:
why .live not working in IE9
QUESTION:
I finished coding my jQuery site but I have found that.live jQuery is not supported with IE9 or in fact any IE. Or at least that is my experience. I am wondering how to get IE to do the following $('ul#mainmenu a li').live('click', function(event){ //alert(this.id);
$("li... | [
"internet-explorer-9",
"jquery"
] | 2 | 0 | 1,248 | 1 | 0 | 2011-06-03T06:58:50.923000 | 2011-06-03T08:04:43.360000 |
6,223,999 | 6,224,150 | Read data in a HTML data | I have downloaded the HTML data from a website using webclient class. Now I want to read the data in between tags. I came to know about htmlagilitypack, but I don't want to use it. I am using the following code to get the HTML data. WebClient client = new WebClient(); string url = "XXXXXXXXXXXXX" Byte[] requestedHTML; ... | Try This: WebClient client = new WebClient(); string url = "Your URL"; Byte[] requestedHTML; requestedHTML = client.DownloadData(url); string htmlcode = client.DownloadString(url);
//client.DownloadFile(url, @"E:\test.html");
UTF8Encoding objUTF8 = new UTF8Encoding(); string html = objUTF8.GetString(requestedHTML);
... | Read data in a HTML data I have downloaded the HTML data from a website using webclient class. Now I want to read the data in between tags. I came to know about htmlagilitypack, but I don't want to use it. I am using the following code to get the HTML data. WebClient client = new WebClient(); string url = "XXXXXXXXXXXX... | TITLE:
Read data in a HTML data
QUESTION:
I have downloaded the HTML data from a website using webclient class. Now I want to read the data in between tags. I came to know about htmlagilitypack, but I don't want to use it. I am using the following code to get the HTML data. WebClient client = new WebClient(); string u... | [
"c#",
".net",
"asp.net"
] | 1 | 1 | 2,852 | 2 | 0 | 2011-06-03T06:59:55.057000 | 2011-06-03T07:20:51.947000 |
6,224,000 | 6,224,027 | I Have a problem with understanding some Java code | The Code: package com.keyoti.rapidSpell;
import java.util.Comparator;
// Referenced classes of package com.keyoti.rapidSpell: // RapidSpellChecker
class RapidSpellChecker$CompareL implements Comparator {
public int compare(Object a, Object b) { return (int)(100D * (suggestionScore2b(topWord, (String)b) - suggestion... | I suspect this is decompiled code. (See at the bottom for more information.) The $ shows that it's a nested class within RapidSpellChecker. So the code would originally have looked something like this: public class RapidSpellChecker { // Other code withing RapidSpellChecker
static class CompareL implements Comparator ... | I Have a problem with understanding some Java code The Code: package com.keyoti.rapidSpell;
import java.util.Comparator;
// Referenced classes of package com.keyoti.rapidSpell: // RapidSpellChecker
class RapidSpellChecker$CompareL implements Comparator {
public int compare(Object a, Object b) { return (int)(100D * ... | TITLE:
I Have a problem with understanding some Java code
QUESTION:
The Code: package com.keyoti.rapidSpell;
import java.util.Comparator;
// Referenced classes of package com.keyoti.rapidSpell: // RapidSpellChecker
class RapidSpellChecker$CompareL implements Comparator {
public int compare(Object a, Object b) { re... | [
"java"
] | 1 | 5 | 164 | 3 | 0 | 2011-06-03T07:00:06.777000 | 2011-06-03T07:03:23.020000 |
6,224,002 | 6,224,224 | Why NSAssert1, etc instead of NSAssert? | I thought NSAssert couldn't use printf specifiers, but this: NSAssert(0, @"%@%@", @"foo", @"bar"); works just as you'd expect: *** Assertion failure in -[MyClass myMethod], /MyClass.m:84 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'foobar' So what's the point of using NSAss... | Current versions of NSAssert() use preprocessor variadic macros, i.e., __VA_ARGS__. Since variadic macros are a C99 feature, my guess is that older versions of the SDK didn’t allow variable arguments in NSAssert(), hence the need for NSAssert1(), NSAssert2(), etc. If you try to compile NSAssert(0, @"%@%@", @"foo", @"ba... | Why NSAssert1, etc instead of NSAssert? I thought NSAssert couldn't use printf specifiers, but this: NSAssert(0, @"%@%@", @"foo", @"bar"); works just as you'd expect: *** Assertion failure in -[MyClass myMethod], /MyClass.m:84 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'fo... | TITLE:
Why NSAssert1, etc instead of NSAssert?
QUESTION:
I thought NSAssert couldn't use printf specifiers, but this: NSAssert(0, @"%@%@", @"foo", @"bar"); works just as you'd expect: *** Assertion failure in -[MyClass myMethod], /MyClass.m:84 *** Terminating app due to uncaught exception 'NSInternalInconsistencyExcep... | [
"cocoa-touch",
"cocoa",
"nsassert"
] | 7 | 18 | 2,460 | 2 | 0 | 2011-06-03T07:00:21.490000 | 2011-06-03T07:29:14.017000 |
6,224,004 | 6,236,714 | Lucene hot index backup using IndexReader instead of IndexWriter/SnapshotDeletionPolicy | Are the following lines of code acceptable to get a hot backup of a lucene index or IndexWriter/SnapshotDeletionPolicy as described in Lucene index backup should be followed? Directory dir =...; IndexReader reader = IndexReader.open(dir); IndexCommit commit = reader.getIndexCommit(); Collection fileNames = commit.getFi... | If you have no IndexWriter writing to the index, then the above code is fine. But an open IndexWriter against the index can easily delete the files referenced/still in use by this IndexReader (for example, when a merge completes) and then your backup will fail. | Lucene hot index backup using IndexReader instead of IndexWriter/SnapshotDeletionPolicy Are the following lines of code acceptable to get a hot backup of a lucene index or IndexWriter/SnapshotDeletionPolicy as described in Lucene index backup should be followed? Directory dir =...; IndexReader reader = IndexReader.open... | TITLE:
Lucene hot index backup using IndexReader instead of IndexWriter/SnapshotDeletionPolicy
QUESTION:
Are the following lines of code acceptable to get a hot backup of a lucene index or IndexWriter/SnapshotDeletionPolicy as described in Lucene index backup should be followed? Directory dir =...; IndexReader reader ... | [
"java",
"lucene"
] | 7 | 2 | 1,201 | 2 | 0 | 2011-06-03T07:00:28.633000 | 2011-06-04T12:21:26.010000 |
6,224,010 | 6,224,440 | Java lucene standard analyzer`s default delimiters? | i am looking for all the delimiters on which java lucene standard analyzer tokenizes the input string. need to know all delimiters that are by default used for tokenizing. | I know (from Lucene in Action) that all characters which are not a-zA-Z or variatons of a-zA-Z that have diacritics are used as delimiters, including numbers. So you might have Mc'Donald splitted in "Mc" "Donald", you might have "Web2.0" tokenized as "Web", and so on. The best is to do a test and enter all kinds of cha... | Java lucene standard analyzer`s default delimiters? i am looking for all the delimiters on which java lucene standard analyzer tokenizes the input string. need to know all delimiters that are by default used for tokenizing. | TITLE:
Java lucene standard analyzer`s default delimiters?
QUESTION:
i am looking for all the delimiters on which java lucene standard analyzer tokenizes the input string. need to know all delimiters that are by default used for tokenizing.
ANSWER:
I know (from Lucene in Action) that all characters which are not a-zA... | [
"java",
"lucene",
"delimiter"
] | 2 | 0 | 1,435 | 1 | 0 | 2011-06-03T07:01:23.920000 | 2011-06-03T07:55:36.397000 |
6,224,014 | 6,224,033 | creating an images gallery | I m trying to create an image gallery where the images are stored in resource bundle. I'm storing my images in NSMutable array what i want is an image gallery....but the output is pretty different from wat i expected.the below code works perfectly fine.to be more specific cud u guys help me out below is the code... _im... | Use the three20 library iPhone SDK: Creating a Photo Gallery With Three20 Edited: Your code are excellent except on wrong statement: coloumn==0; that's the reason your colomn always point to the 2nd coloumn. So change it to coloumn = 0; | creating an images gallery I m trying to create an image gallery where the images are stored in resource bundle. I'm storing my images in NSMutable array what i want is an image gallery....but the output is pretty different from wat i expected.the below code works perfectly fine.to be more specific cud u guys help me o... | TITLE:
creating an images gallery
QUESTION:
I m trying to create an image gallery where the images are stored in resource bundle. I'm storing my images in NSMutable array what i want is an image gallery....but the output is pretty different from wat i expected.the below code works perfectly fine.to be more specific cu... | [
"objective-c",
"xcode"
] | 0 | 0 | 961 | 3 | 0 | 2011-06-03T07:01:59.690000 | 2011-06-03T07:04:06.917000 |
6,224,016 | 6,224,053 | How to access value of list box? | I have update panel which gets updated on button click event. Out of the update panel,there is list box. When user clicks on the button which is placed inside update panel, at that time I want to retrieve selected items from the list box, but when I click the button, the selected index of list box is showing zero even ... | When you click the button, your page does a postback to the server on page_load and I think you are binding again. That's why the previous selection cleared. You should take care of the IsPostBack Condition while binding data to the listbox. | How to access value of list box? I have update panel which gets updated on button click event. Out of the update panel,there is list box. When user clicks on the button which is placed inside update panel, at that time I want to retrieve selected items from the list box, but when I click the button, the selected index ... | TITLE:
How to access value of list box?
QUESTION:
I have update panel which gets updated on button click event. Out of the update panel,there is list box. When user clicks on the button which is placed inside update panel, at that time I want to retrieve selected items from the list box, but when I click the button, t... | [
"c#",
"asp.net",
"ajax",
"listbox"
] | 1 | 2 | 208 | 1 | 0 | 2011-06-03T07:02:09.393000 | 2011-06-03T07:06:55.543000 |
6,224,017 | 6,224,269 | donot open ABPersonViewController | i am trying to open ABPersonViewController at table delegate method (DidSelectRowAtIndex). but when i tap on one of my contact person in table view it shows "obj msg send". help me here is my code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Fetch the address book i... | Use this line instead of that in your code, ABPersonViewController *personController = [[ABPersonViewController alloc] initWithNibName:@"ABPersonViewController" bundle:nil]; | donot open ABPersonViewController i am trying to open ABPersonViewController at table delegate method (DidSelectRowAtIndex). but when i tap on one of my contact person in table view it shows "obj msg send". help me here is my code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexP... | TITLE:
donot open ABPersonViewController
QUESTION:
i am trying to open ABPersonViewController at table delegate method (DidSelectRowAtIndex). but when i tap on one of my contact person in table view it shows "obj msg send". help me here is my code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NS... | [
"iphone"
] | 0 | 0 | 685 | 3 | 0 | 2011-06-03T07:02:20.957000 | 2011-06-03T07:34:25.767000 |
6,224,022 | 6,224,110 | How to make one item in a JList bold? | I'm making enhancements to a Swing app (never done Swing programming before), and need to be able to make a single text item in a JList bold. I've seen a few posts where they said to just put " " and " " around the string. Are you serious, that seems like such a hack. It's also possible in the future that we'll want to... | The ListCellRenderer component also gets the object to be displayed and thus you can format based on whatever logic you have to. You can find the introduction to custom rendering here and an example of a renderer here (it sets the background based on dnd location but the idea is the same for other logic as well). The f... | How to make one item in a JList bold? I'm making enhancements to a Swing app (never done Swing programming before), and need to be able to make a single text item in a JList bold. I've seen a few posts where they said to just put " " and " " around the string. Are you serious, that seems like such a hack. It's also pos... | TITLE:
How to make one item in a JList bold?
QUESTION:
I'm making enhancements to a Swing app (never done Swing programming before), and need to be able to make a single text item in a JList bold. I've seen a few posts where they said to just put " " and " " around the string. Are you serious, that seems like such a h... | [
"java",
"swing",
"jlist"
] | 5 | 7 | 5,396 | 1 | 0 | 2011-06-03T07:02:54.157000 | 2011-06-03T07:15:28.180000 |
6,224,031 | 6,224,059 | How get a breakpoint on variable write in Visual Studio? | How I can set breakpoint on variable change (I think this is write access) in Visual Studio? | This is referred to as a Data Breakpoint in Visual Studio. To create one you'll need the address of the variable in question (just add &variableName ) to the watch or immediate window. Then do the following Debug -> New Breakpoint -> New Data Breakpoint Enter the address in and size of the value in bytes Note: This is ... | How get a breakpoint on variable write in Visual Studio? How I can set breakpoint on variable change (I think this is write access) in Visual Studio? | TITLE:
How get a breakpoint on variable write in Visual Studio?
QUESTION:
How I can set breakpoint on variable change (I think this is write access) in Visual Studio?
ANSWER:
This is referred to as a Data Breakpoint in Visual Studio. To create one you'll need the address of the variable in question (just add &variabl... | [
"visual-studio",
"debugging",
"breakpoints"
] | 15 | 24 | 9,756 | 5 | 0 | 2011-06-03T07:03:48.723000 | 2011-06-03T07:07:49.540000 |
6,224,036 | 6,224,473 | DLL method call returns different results when called from a Windows Service | I have a program I'm converting to a Windows Service (in C#). This program interacts with an external DLL that has a method that returns an object. The object shows the state of another running program (whether it is running, and whether the program is logged in) With the previous implementation, everything worked fine... | I'm guessing the problem is that the service is running in a different session and thus a different desktop from the app whose status it is trying to report on. This DLL probably calls EnumWindow to find the app and this would fail to locate it when run from a different desktop. | DLL method call returns different results when called from a Windows Service I have a program I'm converting to a Windows Service (in C#). This program interacts with an external DLL that has a method that returns an object. The object shows the state of another running program (whether it is running, and whether the p... | TITLE:
DLL method call returns different results when called from a Windows Service
QUESTION:
I have a program I'm converting to a Windows Service (in C#). This program interacts with an external DLL that has a method that returns an object. The object shows the state of another running program (whether it is running,... | [
"c#",
"dll",
"service",
"windows-services"
] | 0 | 1 | 734 | 2 | 0 | 2011-06-03T07:04:36.810000 | 2011-06-03T07:59:23.590000 |
6,224,042 | 6,225,484 | Azure - 2x extra small or a single small instance | Starting out with Windows Azure, but how do I know which is better to handle web-traffic and a background processor. Would 2x extra small instances be better or a single small instance. If I were to use a small instance, I would make the background processor in the web-role, what are the cons of doing it this way? In f... | It is better to have 2 extra-small rather that 1 small instance as far service availability is concerned. That being said there are multiple gotchas: You need to put your 2 VMs into 2 distinct upgrade domains (done in role definition file ). Your app needs to support multi-VM, aka not rely on non-shared session state. ... | Azure - 2x extra small or a single small instance Starting out with Windows Azure, but how do I know which is better to handle web-traffic and a background processor. Would 2x extra small instances be better or a single small instance. If I were to use a small instance, I would make the background processor in the web-... | TITLE:
Azure - 2x extra small or a single small instance
QUESTION:
Starting out with Windows Azure, but how do I know which is better to handle web-traffic and a background processor. Would 2x extra small instances be better or a single small instance. If I were to use a small instance, I would make the background pro... | [
"azure",
"load-balancing",
"azure-compute-emulator"
] | 10 | 12 | 3,241 | 3 | 0 | 2011-06-03T07:05:21.753000 | 2011-06-03T09:47:50.770000 |
6,224,047 | 6,225,146 | Plone sessions lasting forver | After seeing the latest Twilight movies, I have an urge to make my Plone sessions immortal. How could I make Plone sessions which never expire and survive browser restarts? | This is documented in http://plone.org/documentation/kb/cookie-duration. Note that it is impossible to have an absolutely immortal cookie, you must set an expiration date on it or it will be removed when the browser is closed. | Plone sessions lasting forver After seeing the latest Twilight movies, I have an urge to make my Plone sessions immortal. How could I make Plone sessions which never expire and survive browser restarts? | TITLE:
Plone sessions lasting forver
QUESTION:
After seeing the latest Twilight movies, I have an urge to make my Plone sessions immortal. How could I make Plone sessions which never expire and survive browser restarts?
ANSWER:
This is documented in http://plone.org/documentation/kb/cookie-duration. Note that it is i... | [
"session",
"cookies",
"plone"
] | 2 | 3 | 168 | 1 | 0 | 2011-06-03T07:06:01.320000 | 2011-06-03T09:13:24.847000 |
6,224,048 | 6,224,655 | Help turning xpath result into formatted string | I am trying to parse an xml feed using xpath. The feed contains categories that look like this: Category 6 Category 12 Category 19 I currently using the path 'categories' to select all child nodes of which returns "Category 6Category 12Category 19" in string format. I would like the output to be like "Category 6, Categ... | Pure XPath is: concat(categories/category[id="6"],', ', categories/category[id="12"],', ', categories/category[id="19"]) But it's not going to be very useful if you need something dynamic, I mean if you don't know categories children a priori. For a dynamic selection use: string-join(categories/*,', ') or string-join(/... | Help turning xpath result into formatted string I am trying to parse an xml feed using xpath. The feed contains categories that look like this: Category 6 Category 12 Category 19 I currently using the path 'categories' to select all child nodes of which returns "Category 6Category 12Category 19" in string format. I wou... | TITLE:
Help turning xpath result into formatted string
QUESTION:
I am trying to parse an xml feed using xpath. The feed contains categories that look like this: Category 6 Category 12 Category 19 I currently using the path 'categories' to select all child nodes of which returns "Category 6Category 12Category 19" in st... | [
"xml",
"xpath",
"xpath-2.0"
] | 2 | 2 | 2,841 | 3 | 0 | 2011-06-03T07:06:02.143000 | 2011-06-03T08:19:17.033000 |
6,224,052 | 6,224,384 | What is the difference between a string and a byte string? | I am working with a library which returns a "byte string" ( bytes ) and I need to convert this to a string. Is there actually a difference between those two things? How are they related, and how can I do the conversion? | Assuming Python 3 (in Python 2, this difference is a little less well-defined) - a string is a sequence of characters, ie unicode codepoints; these are an abstract concept, and can't be directly stored on disk. A byte string is a sequence of, unsurprisingly, bytes - things that can be stored on disk. The mapping betwee... | What is the difference between a string and a byte string? I am working with a library which returns a "byte string" ( bytes ) and I need to convert this to a string. Is there actually a difference between those two things? How are they related, and how can I do the conversion? | TITLE:
What is the difference between a string and a byte string?
QUESTION:
I am working with a library which returns a "byte string" ( bytes ) and I need to convert this to a string. Is there actually a difference between those two things? How are they related, and how can I do the conversion?
ANSWER:
Assuming Pytho... | [
"python",
"string",
"character",
"byte"
] | 394 | 363 | 296,411 | 9 | 0 | 2011-06-03T07:06:53.563000 | 2011-06-03T07:49:39.767000 |
6,224,072 | 6,224,099 | how to search a control in an asp.net gridview and access it? | I have a gridview as: Resumes i have a list of resume names (string format) that i want to add as the text of the linkbutton "lbtnResumes" for all the resume names that i have in a string array. | make use of FindControl() mehod....to search control void gvAppRejProfiles_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton bl = (LinkButton)e.Row.FindControl("lbtnResumes");
} } | how to search a control in an asp.net gridview and access it? I have a gridview as: Resumes i have a list of resume names (string format) that i want to add as the text of the linkbutton "lbtnResumes" for all the resume names that i have in a string array. | TITLE:
how to search a control in an asp.net gridview and access it?
QUESTION:
I have a gridview as: Resumes i have a list of resume names (string format) that i want to add as the text of the linkbutton "lbtnResumes" for all the resume names that i have in a string array.
ANSWER:
make use of FindControl() mehod....t... | [
"c#",
"asp.net",
"gridview",
"findcontrol"
] | 0 | 0 | 1,239 | 2 | 0 | 2011-06-03T07:09:48.803000 | 2011-06-03T07:14:09.720000 |
6,224,076 | 6,233,956 | Authorization required error in Cruise control .net with Mercurial | we are using mercurial as source control in one of our projects. We are trying to setup continuous integration for this project using cruise control.net. while doing this we setup the source control as path of repository working directory path But when i try to build i got an error like this Error Message: ThoughtWorks... | One option is o put the username and password in the URL -- this isn't a Mercurial thing it's a part of HTTP URLs in general. Here's an example: http://username:password@hostname/path/to/repo Other options include using an [auth] section in the cruise control user's ~/.hgrc file, but putting it in the URL is probably e... | Authorization required error in Cruise control .net with Mercurial we are using mercurial as source control in one of our projects. We are trying to setup continuous integration for this project using cruise control.net. while doing this we setup the source control as path of repository working directory path But when ... | TITLE:
Authorization required error in Cruise control .net with Mercurial
QUESTION:
we are using mercurial as source control in one of our projects. We are trying to setup continuous integration for this project using cruise control.net. while doing this we setup the source control as path of repository working direct... | [
"mercurial",
"cruisecontrol.net"
] | 0 | 1 | 631 | 1 | 0 | 2011-06-03T07:10:21.670000 | 2011-06-04T00:52:56.173000 |
6,224,080 | 6,224,307 | without extends of class activity how to getget email id's from contacts and get phone no from contacts? | hi all how to implement coding for get email id's from contacts and get phone no from contacts show me the way to overcome from this problem note: class doesn't have extends Activity and oncreate() method also so kindly help me to go forward | Your class doesnot have extends Activity or onCreate() method. So pass the context parameter from the class which extends Activity to this class. sudo code Class A extends Activity{
new ClassB(this); } here Class B does not extends Activity. But write the following method to gwt contacts and email id in class B public... | without extends of class activity how to getget email id's from contacts and get phone no from contacts? hi all how to implement coding for get email id's from contacts and get phone no from contacts show me the way to overcome from this problem note: class doesn't have extends Activity and oncreate() method also so ki... | TITLE:
without extends of class activity how to getget email id's from contacts and get phone no from contacts?
QUESTION:
hi all how to implement coding for get email id's from contacts and get phone no from contacts show me the way to overcome from this problem note: class doesn't have extends Activity and oncreate()... | [
"android"
] | 1 | 2 | 224 | 2 | 0 | 2011-06-03T07:10:47.633000 | 2011-06-03T07:38:51.733000 |
6,224,086 | 6,224,249 | OutOfMemory when load image to bitmap from URL | I load image from url. it' ok, but when long time it error outofmemory: bitmap size exceeds vm budget. here my code BitmapFactory.Options bmOptions; bmOptions = new BitmapFactory.Options(); bmOptions.inJustDecodeBounds = true; //from web try { Bitmap bitmap=null; InputStream is=new URL(url).openStream(); BitmapFactory.... | Try using the sampleSize of BitmapFactory.Options, this will reduce the size in memory of your image (and the quality) But if your image is really too big, I think that's there no miracle solution, the image is simply too big... | OutOfMemory when load image to bitmap from URL I load image from url. it' ok, but when long time it error outofmemory: bitmap size exceeds vm budget. here my code BitmapFactory.Options bmOptions; bmOptions = new BitmapFactory.Options(); bmOptions.inJustDecodeBounds = true; //from web try { Bitmap bitmap=null; InputStre... | TITLE:
OutOfMemory when load image to bitmap from URL
QUESTION:
I load image from url. it' ok, but when long time it error outofmemory: bitmap size exceeds vm budget. here my code BitmapFactory.Options bmOptions; bmOptions = new BitmapFactory.Options(); bmOptions.inJustDecodeBounds = true; //from web try { Bitmap bitm... | [
"android"
] | 0 | 2 | 1,261 | 4 | 0 | 2011-06-03T07:11:44.763000 | 2011-06-03T07:32:06.353000 |
6,224,089 | 6,232,634 | Hadoop: Set slave as explicit reducer? | we use a hadoop multi-node setup on debian + ubuntu with the latest stable hadoop release. is it possible to set a specific slave to be the reducer? i just use one reducer task and i want to assign it to the most performant slave. atm we have 1 master, who just assignes the tasks to the slaves and 5 slaves, one is more... | Disable reducer slots on all other nodes by setting mapred.tasktracker.reduce.tasks.maximum to 0 in all conf/mapred-site.xml files (except the one node that you want to reduce). Or, you could write a custom LoadManager class for the Fair Scheduler (see this ), but it's a lot more work. | Hadoop: Set slave as explicit reducer? we use a hadoop multi-node setup on debian + ubuntu with the latest stable hadoop release. is it possible to set a specific slave to be the reducer? i just use one reducer task and i want to assign it to the most performant slave. atm we have 1 master, who just assignes the tasks ... | TITLE:
Hadoop: Set slave as explicit reducer?
QUESTION:
we use a hadoop multi-node setup on debian + ubuntu with the latest stable hadoop release. is it possible to set a specific slave to be the reducer? i just use one reducer task and i want to assign it to the most performant slave. atm we have 1 master, who just a... | [
"dictionary",
"hadoop",
"mapreduce",
"reduce",
"slave"
] | 0 | 1 | 174 | 1 | 0 | 2011-06-03T07:12:14.103000 | 2011-06-03T20:58:56.370000 |
6,224,096 | 6,224,913 | Speeding up Hibernate Object creation? | We use Hibernate as our ORM layer on top of a MySQL database. We have quite a few model objects, of which some are quite large (in terms of number of fields etc.). Some of our queries requires that a lot (if not all) of the model objects are retrieved from the database, to do various calculations on them. We have lazy ... | One approach is to not populate the entity but some kind of view object. Assuming a CustomerView has the appropriate constructor, you can do select new CustomerView(c.firstname, c.lastname, c.age) from Customer c Though I'm a bit surprised about Hibernate being slow to populate objects unless you happen to load associa... | Speeding up Hibernate Object creation? We use Hibernate as our ORM layer on top of a MySQL database. We have quite a few model objects, of which some are quite large (in terms of number of fields etc.). Some of our queries requires that a lot (if not all) of the model objects are retrieved from the database, to do vari... | TITLE:
Speeding up Hibernate Object creation?
QUESTION:
We use Hibernate as our ORM layer on top of a MySQL database. We have quite a few model objects, of which some are quite large (in terms of number of fields etc.). Some of our queries requires that a lot (if not all) of the model objects are retrieved from the da... | [
"mysql",
"hibernate",
"object-construction"
] | 4 | 2 | 1,616 | 3 | 0 | 2011-06-03T07:13:27.450000 | 2011-06-03T08:49:14.987000 |
6,224,097 | 6,240,513 | Android display OpenCore logs | I am trying to display opencore logs. I have already tried the ff. but still logs are not showing in the logcat. 1. created pvlogger.txt in sdcard and still no use. # echo 8 > /sdcard/pvlogger.txt 2. Edited the PV_LOG_INST_LEVEL from 0 to 5 in the pvlogger.h file but it causes the compilation to fail. "/android_log_app... | After trial and errors, I was finally able to show the OpenCore log messages! Here's what I did although I do not know yet if steps 4 and make options are needed. Added #define PV_LOG_INST_LEVEL 5 to \android\external\opencore\android\thread_init.cpp file. To solve the "/android_log_appender.h:75: error:" format not a ... | Android display OpenCore logs I am trying to display opencore logs. I have already tried the ff. but still logs are not showing in the logcat. 1. created pvlogger.txt in sdcard and still no use. # echo 8 > /sdcard/pvlogger.txt 2. Edited the PV_LOG_INST_LEVEL from 0 to 5 in the pvlogger.h file but it causes the compilat... | TITLE:
Android display OpenCore logs
QUESTION:
I am trying to display opencore logs. I have already tried the ff. but still logs are not showing in the logcat. 1. created pvlogger.txt in sdcard and still no use. # echo 8 > /sdcard/pvlogger.txt 2. Edited the PV_LOG_INST_LEVEL from 0 to 5 in the pvlogger.h file but it c... | [
"android",
"opencore"
] | 0 | 0 | 473 | 2 | 0 | 2011-06-03T07:13:28.523000 | 2011-06-05T01:44:02.947000 |
6,224,104 | 6,224,466 | does searchable plugin work only with hibernate? | I use grails-1.3.2 and hbase-0.2.4 plugin. I want to use searchable plugin, but when I install plugin with it appears hibernate plugin, which conflicts with hbase-0.2.4 plugin. When I am uninstalling hibernate plugin, I can not run my application and get this message: Error: The following plugins failed to load due to ... | The Searchable plugin works only with Hibernate. I have asked the same question on Grails user group when I was looking to put searchable and mongo DB to work. The searchable plugin depends on Hibernate os it can't work without it. HBase may sufficiently be scaled for complex searches. Please follow this link for more ... | does searchable plugin work only with hibernate? I use grails-1.3.2 and hbase-0.2.4 plugin. I want to use searchable plugin, but when I install plugin with it appears hibernate plugin, which conflicts with hbase-0.2.4 plugin. When I am uninstalling hibernate plugin, I can not run my application and get this message: Er... | TITLE:
does searchable plugin work only with hibernate?
QUESTION:
I use grails-1.3.2 and hbase-0.2.4 plugin. I want to use searchable plugin, but when I install plugin with it appears hibernate plugin, which conflicts with hbase-0.2.4 plugin. When I am uninstalling hibernate plugin, I can not run my application and ge... | [
"grails",
"groovy",
"grails-plugin",
"searchable",
"searchable-plugin"
] | 0 | 3 | 570 | 1 | 0 | 2011-06-03T07:14:48.583000 | 2011-06-03T07:58:13.863000 |
6,224,113 | 6,224,129 | adding files to svn:ignore from a script | I am trying to remove all the NetBeans related files ( nbactions.xml and nb-configuration.xml ) from a maven based tree of projects, and add them to svn:ignore in every directory that contains a pom.xml so they are not checked-in again. As it will be cumbersome to manually do that, I'm trying to write a script to do th... | The answer I've thought of is to hack the SVN_EDITOR system property to be my update script rather than an interactive editor. I haven't tried it yet, but it should be something like: update_svn_ignore.sh cat $1 ~/filestoignore.txt | sort | uniq > tmp.txt mv tmp.txt $1 and to do it in every directory with a pom.xml exp... | adding files to svn:ignore from a script I am trying to remove all the NetBeans related files ( nbactions.xml and nb-configuration.xml ) from a maven based tree of projects, and add them to svn:ignore in every directory that contains a pom.xml so they are not checked-in again. As it will be cumbersome to manually do th... | TITLE:
adding files to svn:ignore from a script
QUESTION:
I am trying to remove all the NetBeans related files ( nbactions.xml and nb-configuration.xml ) from a maven based tree of projects, and add them to svn:ignore in every directory that contains a pom.xml so they are not checked-in again. As it will be cumbersome... | [
"svn",
"properties",
"ignore"
] | 0 | 1 | 462 | 1 | 0 | 2011-06-03T07:15:43.427000 | 2011-06-03T07:17:42.503000 |
6,224,121 | 6,224,179 | Is `new (this) MyClass();` undefined behaviour after directly calling the destructor? | In this question of mine, @DeadMG says that reinitializing a class through the this pointer is undefined behaviour. Is there any mentioning thereof in the standard somewhere? Example: #include class X{ int _i; public: X(): _i(0) { std::cout << "X()\n"; } X(int i): _i(i) { std::cout << "X(int)\n"; }
~X(){ std::cout << ... | That would be okay if it didn't conflict with stack unwinding. You destroy the object, then reconstruct it via the pointer. That's what you would do if you needed to construct and destroy an array of objects that don't have a default constructor. The problem is this is exception unsafe. What if calling the constructor ... | Is `new (this) MyClass();` undefined behaviour after directly calling the destructor? In this question of mine, @DeadMG says that reinitializing a class through the this pointer is undefined behaviour. Is there any mentioning thereof in the standard somewhere? Example: #include class X{ int _i; public: X(): _i(0) { std... | TITLE:
Is `new (this) MyClass();` undefined behaviour after directly calling the destructor?
QUESTION:
In this question of mine, @DeadMG says that reinitializing a class through the this pointer is undefined behaviour. Is there any mentioning thereof in the standard somewhere? Example: #include class X{ int _i; public... | [
"c++",
"this",
"undefined-behavior",
"placement-new"
] | 9 | 8 | 642 | 2 | 0 | 2011-06-03T07:16:32.463000 | 2011-06-03T07:23:42.793000 |
6,224,125 | 6,224,308 | GROUP BY date with no leaks SQL on MySQL 5.1 | Possible Duplicate: What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)? Create Table: CREATE TABLE `trb3` ( `value` varchar(50) default NULL, `date` date default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT date, SUM(value) AS value FROM trb3 GROUP BY date ORDER ... | You'll need to get a list of the dates you want then outer join with it: create table my_dates (my_date date not NULL); then populate my_dates with the dates you want data for: insert into my_dates values ('2011-06-01'), ('2011-06-02'),...; then select my_dates.date, SUM(value) from my_dates left join trb3 on trb3.date... | GROUP BY date with no leaks SQL on MySQL 5.1 Possible Duplicate: What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)? Create Table: CREATE TABLE `trb3` ( `value` varchar(50) default NULL, `date` date default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT date, SUM(v... | TITLE:
GROUP BY date with no leaks SQL on MySQL 5.1
QUESTION:
Possible Duplicate: What is the most straightforward way to pad empty dates in sql results (on either mysql or perl end)? Create Table: CREATE TABLE `trb3` ( `value` varchar(50) default NULL, `date` date default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1
... | [
"mysql",
"sql",
"mysql5",
"mysql-5.1"
] | 0 | 2 | 142 | 1 | 0 | 2011-06-03T07:17:03.170000 | 2011-06-03T07:38:52.470000 |
6,224,126 | 6,225,482 | Customize form/input in validation in HTML 5 | Possible Duplicate: HTML5 form required attribute. Set custom validation message? in HTML 5 form validation this required filed will always shows the message "Please enter filed" Is there a way to customize this message? | Not all browsers will support this attribute, Firefox does support it, IE and chrome no. I dont know about the other browsers. using value="Your value" mentioned above won't work. i just tried it. i guess we have to wait till HTML5 becomes stable. to find out | Customize form/input in validation in HTML 5 Possible Duplicate: HTML5 form required attribute. Set custom validation message? in HTML 5 form validation this required filed will always shows the message "Please enter filed" Is there a way to customize this message? | TITLE:
Customize form/input in validation in HTML 5
QUESTION:
Possible Duplicate: HTML5 form required attribute. Set custom validation message? in HTML 5 form validation this required filed will always shows the message "Please enter filed" Is there a way to customize this message?
ANSWER:
Not all browsers will suppo... | [
"html"
] | 0 | 3 | 477 | 2 | 0 | 2011-06-03T07:17:07.880000 | 2011-06-03T09:47:39.613000 |
6,224,153 | 6,224,181 | How to write excluding sum query? | I have a values table: +------------+---------+ | name | value | +------------+---------+ | parameter1 | 53.8462 | | parameter2 | 7.6923 | | parameter3 | 23.0769 | | parameter4 | 15.3846 | +------------+---------+ What is the query for sum values of the three last parameters ( parameter 2, parameter 3, parameter 4 ) wi... | This may be a bit simplistic, but can't you do this: select sum(value) from table where name!= 'parameter2' If what you are really after is the sum past n-th value, you could do this (in SQL Server): WITH OrderedRows AS ( SELECT name, value, ROW_NUMBER() OVER (ORDER BY name) AS 'RowNumber' FROM table ) SELECT sum(value... | How to write excluding sum query? I have a values table: +------------+---------+ | name | value | +------------+---------+ | parameter1 | 53.8462 | | parameter2 | 7.6923 | | parameter3 | 23.0769 | | parameter4 | 15.3846 | +------------+---------+ What is the query for sum values of the three last parameters ( paramete... | TITLE:
How to write excluding sum query?
QUESTION:
I have a values table: +------------+---------+ | name | value | +------------+---------+ | parameter1 | 53.8462 | | parameter2 | 7.6923 | | parameter3 | 23.0769 | | parameter4 | 15.3846 | +------------+---------+ What is the query for sum values of the three last par... | [
"sql"
] | 0 | 1 | 3,893 | 6 | 0 | 2011-06-03T07:21:01.123000 | 2011-06-03T07:23:52.733000 |
6,224,154 | 6,224,379 | Trying to practice PHP and SQL- I am not sure if I get the logic right | I googled a short tutorial to connect a database and then I wanted to compare the username and password to then can gain access. It is kind of novice coding, but at least I can practice and hopefully pick up programming more. check.php index.php Partner Portal forgotten password EDIT The problem is that it won't show a... | Nice Josephine, that's a great start! Now I know you have heard of the saying, there are a million ways to skin a cat, and this is no exception. There are really a lot of ways to accomplish the above but as of late, this method of doing it have become a bit, how should I say it, un-secure. Database connection and user ... | Trying to practice PHP and SQL- I am not sure if I get the logic right I googled a short tutorial to connect a database and then I wanted to compare the username and password to then can gain access. It is kind of novice coding, but at least I can practice and hopefully pick up programming more. check.php index.php Par... | TITLE:
Trying to practice PHP and SQL- I am not sure if I get the logic right
QUESTION:
I googled a short tutorial to connect a database and then I wanted to compare the username and password to then can gain access. It is kind of novice coding, but at least I can practice and hopefully pick up programming more. check... | [
"php",
"sql"
] | 2 | 3 | 236 | 3 | 0 | 2011-06-03T07:21:06.330000 | 2011-06-03T07:48:47.847000 |
6,224,162 | 6,224,311 | How to read values from nested asp.net DataGrid using Javascript | I need to read the value from a nested data grid in aspx page using Javascript. Here is my code: | look at the id which is generated for the component on browsers view source page Probably it would be iterating by incremental numbers. I am not aware of Get the component in javsacript by using document.getElementById('innerData') and the values accordingly. if its a table then by document.getElementById('innerData').... | How to read values from nested asp.net DataGrid using Javascript I need to read the value from a nested data grid in aspx page using Javascript. Here is my code: | TITLE:
How to read values from nested asp.net DataGrid using Javascript
QUESTION:
I need to read the value from a nested data grid in aspx page using Javascript. Here is my code:
ANSWER:
look at the id which is generated for the component on browsers view source page Probably it would be iterating by incremental numb... | [
"javascript",
"asp.net",
"grid"
] | 0 | 0 | 1,169 | 1 | 0 | 2011-06-03T07:22:19.610000 | 2011-06-03T07:39:13.277000 |
6,224,177 | 6,224,270 | how to convert English numbers to Chinese in Java | I have to convert English number to Chinese numbers. But the Chinese number system is different than in English. Is there any way to convert english numbers at run time into chinese? | In that case, i suggest you build a hash table for it. It's not that difficult to start with. we know that chinese 'numerals' are pretty much defined by: See: http://en.wikipedia.org/wiki/Chinese_numerals With that, i think you are more than capable to build a table in your programming lang preference, java. | how to convert English numbers to Chinese in Java I have to convert English number to Chinese numbers. But the Chinese number system is different than in English. Is there any way to convert english numbers at run time into chinese? | TITLE:
how to convert English numbers to Chinese in Java
QUESTION:
I have to convert English number to Chinese numbers. But the Chinese number system is different than in English. Is there any way to convert english numbers at run time into chinese?
ANSWER:
In that case, i suggest you build a hash table for it. It's ... | [
"java",
"android"
] | 5 | 0 | 4,462 | 3 | 0 | 2011-06-03T07:23:38.413000 | 2011-06-03T07:34:26.887000 |
6,224,178 | 6,224,786 | How to create Multiple statusbar Notifications in android | I need to create multiple statusbar notifications. When i pull down the statusbar, multiple notification icons should be displayed as a list. Each notification icon should show separate data to display on next page.How could i do this? My code: public class SimpleNotification extends Activity {
private NotificationMan... | You need to pass a unique ID to each notification. Once you have clicked on the notification you use that ID to remove it. public class SimpleNotification extends Activity {
private NotificationManager mNotificationManager; private int SIMPLE_NOTFICATION_ID_A = 0; private int SIMPLE_NOTFICATION_ID_B = 1;
@Override pu... | How to create Multiple statusbar Notifications in android I need to create multiple statusbar notifications. When i pull down the statusbar, multiple notification icons should be displayed as a list. Each notification icon should show separate data to display on next page.How could i do this? My code: public class Simp... | TITLE:
How to create Multiple statusbar Notifications in android
QUESTION:
I need to create multiple statusbar notifications. When i pull down the statusbar, multiple notification icons should be displayed as a list. Each notification icon should show separate data to display on next page.How could i do this? My code:... | [
"android",
"android-notifications"
] | 19 | 30 | 27,401 | 5 | 0 | 2011-06-03T07:23:42.577000 | 2011-06-03T08:35:37.450000 |
6,224,183 | 6,224,313 | If one UL already is opened, hide the other one, how? | So, I'm creating a submenu by myself by following the jQuery codex only and I got stuck. Everything else is perfect, though. I have an HTML structure like the following: smth smth sub smth smth sub 2 And let's say that the first SMTH is opened. Now, when I click on the second SMTH it will just appear on top of the othe... | I'm not entirely sure I got the image right, because I don't know how you're styling your menu, so I'll assume it's a vertical list of SMTHs with sublists showing to the right. What you want to do is close all opened sublists (this will normally be only one sublist) when you click on the SMTH, before you add the "opene... | If one UL already is opened, hide the other one, how? So, I'm creating a submenu by myself by following the jQuery codex only and I got stuck. Everything else is perfect, though. I have an HTML structure like the following: smth smth sub smth smth sub 2 And let's say that the first SMTH is opened. Now, when I click on ... | TITLE:
If one UL already is opened, hide the other one, how?
QUESTION:
So, I'm creating a submenu by myself by following the jQuery codex only and I got stuck. Everything else is perfect, though. I have an HTML structure like the following: smth smth sub smth smth sub 2 And let's say that the first SMTH is opened. Now... | [
"jquery"
] | 0 | 1 | 1,166 | 2 | 0 | 2011-06-03T07:24:02.127000 | 2011-06-03T07:39:32.457000 |
6,224,184 | 6,242,346 | ListGrid Duplicates created after adding records onload then dragging the same again | I have a View where I have Drag and Drop working between 2 ListGrid-s, and after dragging a few records I then save them to a POJO type object upon clicking a button "Save". When I'm accessing again that view it calls a method loadGrid that pulls those values from the POJO and adds them back into the ListGrid that they... | Check if the ID field set as the primary key in the Datasource. [IdField].setPrimaryKey(true); | ListGrid Duplicates created after adding records onload then dragging the same again I have a View where I have Drag and Drop working between 2 ListGrid-s, and after dragging a few records I then save them to a POJO type object upon clicking a button "Save". When I'm accessing again that view it calls a method loadGrid... | TITLE:
ListGrid Duplicates created after adding records onload then dragging the same again
QUESTION:
I have a View where I have Drag and Drop working between 2 ListGrid-s, and after dragging a few records I then save them to a POJO type object upon clicking a button "Save". When I'm accessing again that view it calls... | [
"smartgwt"
] | 2 | 1 | 2,628 | 2 | 0 | 2011-06-03T07:24:07.893000 | 2011-06-05T10:32:27.257000 |
6,224,185 | 6,230,478 | Making customized InputForm and ShortInputForm | I often wish to see the internal representation of Mathematica 's graphical objects not in the FullForm but in much more readable InputForm having the ability to select parts of the code by double-clicking on it and easily copy this code to a new input Cell. But the default InputForm does not allow this since InputForm... | UPDATE The most recent version of the shortInputForm function can be found here. Original post Here is another, even better solution (compatible with Mathematica 5): myInputForm[expr_]:= Block[{oldContexts, output, interpretation, skeleton}, output = ToString[expr, InputForm]; oldContexts = {$Context, $ContextPath}; $C... | Making customized InputForm and ShortInputForm I often wish to see the internal representation of Mathematica 's graphical objects not in the FullForm but in much more readable InputForm having the ability to select parts of the code by double-clicking on it and easily copy this code to a new input Cell. But the defaul... | TITLE:
Making customized InputForm and ShortInputForm
QUESTION:
I often wish to see the internal representation of Mathematica 's graphical objects not in the FullForm but in much more readable InputForm having the ability to select parts of the code by double-clicking on it and easily copy this code to a new input Ce... | [
"wolfram-mathematica",
"mathematica-frontend"
] | 5 | 8 | 432 | 2 | 0 | 2011-06-03T07:24:23.967000 | 2011-06-03T17:22:41.837000 |
6,224,190 | 6,224,214 | How to debug Silverlight application with multiple browser tabs? | I have made a Silverlight application that can be started with deep links. My problem is that I need to debug when I try to open the application in another tab with a deep link. I use VS 2010. Thanks. | If the piece of code you trying to debug executes immediately upon opening the tab you could try to defer the execution by adding a delay that would allow you to use Visual Studio's Debug -> Attach to process functionality. | How to debug Silverlight application with multiple browser tabs? I have made a Silverlight application that can be started with deep links. My problem is that I need to debug when I try to open the application in another tab with a deep link. I use VS 2010. Thanks. | TITLE:
How to debug Silverlight application with multiple browser tabs?
QUESTION:
I have made a Silverlight application that can be started with deep links. My problem is that I need to debug when I try to open the application in another tab with a deep link. I use VS 2010. Thanks.
ANSWER:
If the piece of code you tr... | [
"visual-studio",
"silverlight",
"debugging"
] | 0 | 2 | 224 | 1 | 0 | 2011-06-03T07:25:02.200000 | 2011-06-03T07:27:32.967000 |
6,224,199 | 6,224,654 | Ext combobox select after store reload doesn't work properly | Here is my combobox configuration { xtype: 'combo', fieldLabel: 'Select Field', displayField: 'field_name', valueField: 'field_id', id: 'fields_combo_id', store: new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({url:eyefind.config.DATA_RETRIEVAL, method:'GET'}), baseParams: { subject: 'fields' }, root: 'data', id... | You set valuefield: 'field_id', but there is no field_id in store's fields, { xtype: 'combo', fieldLabel: 'Select Field', displayField: 'field_name', valueField: 'field_id', //This 'field_id' must be in store fields too. id: 'fields_combo_id', store: new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({url:eyefind.c... | Ext combobox select after store reload doesn't work properly Here is my combobox configuration { xtype: 'combo', fieldLabel: 'Select Field', displayField: 'field_name', valueField: 'field_id', id: 'fields_combo_id', store: new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({url:eyefind.config.DATA_RETRIEVAL, method... | TITLE:
Ext combobox select after store reload doesn't work properly
QUESTION:
Here is my combobox configuration { xtype: 'combo', fieldLabel: 'Select Field', displayField: 'field_name', valueField: 'field_id', id: 'fields_combo_id', store: new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({url:eyefind.config.DATA... | [
"javascript",
"extjs"
] | 4 | 3 | 2,525 | 2 | 0 | 2011-06-03T07:25:49.597000 | 2011-06-03T08:19:13.307000 |
6,224,212 | 6,224,223 | "No instance for" error | Following an example in http://en.wikibooks.org/wiki/Haskell/Beginning Prelude> let abs x = if x < 0 then -x else x Prelude> abs 5 5 Prelude> abs -3:1:6: No instance for (Num (a0 -> a0)) arising from the literal `3' Possible fix: add an instance declaration for (Num (a0 -> a0)) In the second argument of `(-)', namely `... | Haskell thinks you're trying to subtract 3 from abs, and is complaining that abs is not a number. You need to add parenthesis when using the unary negation operator: abs (-3) | "No instance for" error Following an example in http://en.wikibooks.org/wiki/Haskell/Beginning Prelude> let abs x = if x < 0 then -x else x Prelude> abs 5 5 Prelude> abs -3:1:6: No instance for (Num (a0 -> a0)) arising from the literal `3' Possible fix: add an instance declaration for (Num (a0 -> a0)) In the second arg... | TITLE:
"No instance for" error
QUESTION:
Following an example in http://en.wikibooks.org/wiki/Haskell/Beginning Prelude> let abs x = if x < 0 then -x else x Prelude> abs 5 5 Prelude> abs -3:1:6: No instance for (Num (a0 -> a0)) arising from the literal `3' Possible fix: add an instance declaration for (Num (a0 -> a0))... | [
"haskell",
"ghci"
] | 6 | 14 | 1,514 | 2 | 0 | 2011-06-03T07:27:25.893000 | 2011-06-03T07:28:58.840000 |
6,224,228 | 6,224,291 | How to install Python 2.7 devel if I have Python 2.7 in a different directory | I have python 2.7 installed in /opt/python2.7. Now i want to install the devel packages for it but could not find it. How can i install it os that goes in python2.7 not for default python2.4 | Installing Python from source installs the development files in the same prefix. | How to install Python 2.7 devel if I have Python 2.7 in a different directory I have python 2.7 installed in /opt/python2.7. Now i want to install the devel packages for it but could not find it. How can i install it os that goes in python2.7 not for default python2.4 | TITLE:
How to install Python 2.7 devel if I have Python 2.7 in a different directory
QUESTION:
I have python 2.7 installed in /opt/python2.7. Now i want to install the devel packages for it but could not find it. How can i install it os that goes in python2.7 not for default python2.4
ANSWER:
Installing Python from s... | [
"python",
"dependencies",
"development-environment"
] | 5 | 7 | 3,630 | 1 | 0 | 2011-06-03T07:29:59.963000 | 2011-06-03T07:37:28.073000 |
6,224,276 | 6,224,482 | Comparing 0x00000000 with 0xFFFFFFFF in MIPS | I'm trying to sort through a list of 32-bit numbers using MIPS assembler and xspim. I've been stepping trough my code to see what fails and noticed that when comparing 0x00000000 with 0xFFFFFFFF it doesn't compare these numbers as it should. At the point where the program fails I got 0x00000000 in $t3 and 0xFFFFFFFF in... | This is because 0xffffffff is interpreted as -1, i.e., in 2-complement. There are specific instructions to deal with numbers as if they were unsigned. Use these instructions. (Compare for instance bgt and bgtu where u stands for unsigned.) | Comparing 0x00000000 with 0xFFFFFFFF in MIPS I'm trying to sort through a list of 32-bit numbers using MIPS assembler and xspim. I've been stepping trough my code to see what fails and noticed that when comparing 0x00000000 with 0xFFFFFFFF it doesn't compare these numbers as it should. At the point where the program fa... | TITLE:
Comparing 0x00000000 with 0xFFFFFFFF in MIPS
QUESTION:
I'm trying to sort through a list of 32-bit numbers using MIPS assembler and xspim. I've been stepping trough my code to see what fails and noticed that when comparing 0x00000000 with 0xFFFFFFFF it doesn't compare these numbers as it should. At the point wh... | [
"assembly",
"mips"
] | 5 | 4 | 1,016 | 1 | 0 | 2011-06-03T07:35:30.513000 | 2011-06-03T08:00:41.637000 |
6,224,279 | 6,246,242 | How to print a variable to Linux console using Javascript and QWebview | Inside a function which IS getting called through Qt's QWebView: document.write ("11"); The above statement doesn't show anything on the console! I want it to get displayed on the "console". I am running the qt executable as "./showmap" and then a widget gets displayed on which the map is shown. On a button click, a fu... | That's what document.write does. It writes to the document. To write to the OS's standard output or standard error, subclass QWebPage and override javascriptConsoleMessage. Here is an example: http://wiki.forum.nokia.com/index.php/Redirecting_JavaScript_console_messages_in_a_Qt_hybrid_application Once you've overridden... | How to print a variable to Linux console using Javascript and QWebview Inside a function which IS getting called through Qt's QWebView: document.write ("11"); The above statement doesn't show anything on the console! I want it to get displayed on the "console". I am running the qt executable as "./showmap" and then a w... | TITLE:
How to print a variable to Linux console using Javascript and QWebview
QUESTION:
Inside a function which IS getting called through Qt's QWebView: document.write ("11"); The above statement doesn't show anything on the console! I want it to get displayed on the "console". I am running the qt executable as "./sho... | [
"javascript",
"linux",
"qwebview"
] | 0 | 2 | 1,192 | 1 | 0 | 2011-06-03T07:35:50.033000 | 2011-06-05T22:13:26.890000 |
6,224,283 | 6,224,346 | php system() shell_exec() hangs the browser | Possible Duplicate: Asynchronous shell exec in PHP i need to run a java program in the background. process.php contains shell_exec("php php_cli.php") php_cli.php contains shell_exec("java -jar BiForce.jar settings.ini > log.txt"); I am calling process.php asynchronously using ajax When i click the link in the webpage t... | You could call the command in the page displayed, but appending an & at the end: shell_exec("java -jar BiForce.jar settings.ini > log.txt &"); This way the process is launched on the background. Also, there is no need (unless defined by your application) to create a process.php wich itself calls php via a shell exec. Y... | php system() shell_exec() hangs the browser Possible Duplicate: Asynchronous shell exec in PHP i need to run a java program in the background. process.php contains shell_exec("php php_cli.php") php_cli.php contains shell_exec("java -jar BiForce.jar settings.ini > log.txt"); I am calling process.php asynchronously using... | TITLE:
php system() shell_exec() hangs the browser
QUESTION:
Possible Duplicate: Asynchronous shell exec in PHP i need to run a java program in the background. process.php contains shell_exec("php php_cli.php") php_cli.php contains shell_exec("java -jar BiForce.jar settings.ini > log.txt"); I am calling process.php as... | [
"php",
"shell-exec"
] | 5 | 2 | 8,893 | 4 | 0 | 2011-06-03T07:35:59.633000 | 2011-06-03T07:44:31.237000 |
6,224,299 | 6,224,334 | In a singleton class (in my case C++), if one method is called more than once, will the locals be on the stack? | i have singleton class, when calling one of the singleton methods more then once in the same time, and this method has local variables. does each method call of the singleton gets its own private stack, do i need to worry about sharing/mixing local variable data between calls? | Using local variables in a class method (not important whether it is a singleton) is no different from using local variables in a regular function. The local variables will not get mixed up. | In a singleton class (in my case C++), if one method is called more than once, will the locals be on the stack? i have singleton class, when calling one of the singleton methods more then once in the same time, and this method has local variables. does each method call of the singleton gets its own private stack, do i ... | TITLE:
In a singleton class (in my case C++), if one method is called more than once, will the locals be on the stack?
QUESTION:
i have singleton class, when calling one of the singleton methods more then once in the same time, and this method has local variables. does each method call of the singleton gets its own pr... | [
"singleton",
"local-variables"
] | 2 | 2 | 167 | 4 | 0 | 2011-06-03T07:38:04.637000 | 2011-06-03T07:43:32.843000 |
6,224,303 | 6,226,240 | How to use a C# class library from an IronPython app in Visual Studio? | I am a new user of Visual Studio, and I am trying to figure out how to load a C# class library built as part of a solution from an IronPython project in the same solution. Basically, I am trying to do the scenario in How to debug a class library in Visual Studio but using an IronPython script instead of the console app... | You could configure the SearchPath directory and then: clr.AddReference("NameOfAssembly") or you could also specify the full path: clr.AddReferenceToFileAndPath(@"c:\work\someproject\bin\debug\NameOfAssembly.dll") Here's a blog post describing the different functions for loading assemblies in IronPython. | How to use a C# class library from an IronPython app in Visual Studio? I am a new user of Visual Studio, and I am trying to figure out how to load a C# class library built as part of a solution from an IronPython project in the same solution. Basically, I am trying to do the scenario in How to debug a class library in ... | TITLE:
How to use a C# class library from an IronPython app in Visual Studio?
QUESTION:
I am a new user of Visual Studio, and I am trying to figure out how to load a C# class library built as part of a solution from an IronPython project in the same solution. Basically, I am trying to do the scenario in How to debug a... | [
".net",
"ironpython",
"class-library"
] | 1 | 2 | 595 | 1 | 0 | 2011-06-03T07:38:30.037000 | 2011-06-03T11:01:53.590000 |
6,224,305 | 6,224,322 | How to update an object property array value? | If I have an object defined as: var myObj={}; Then, I update this object with: myObj['fruit']=['apple', 'orange']; Later, I would like to append " [banana, melon] " to myObj['fruit'], that's update myObj to ['apple','orange','banana','melon'] what is the most elegant way to update 'fruit' attribute value of myObj in my... | JavaScript has a built in Array.push() myObj["fruit"].push( 'banana', 'melon' ); There are a few ways to approach appending an array. First up, use apply() to call push with the array as individual arguments: var toAppend = ['banana', 'melon']; // note [].push is just getting the "push" function from an empty array // ... | How to update an object property array value? If I have an object defined as: var myObj={}; Then, I update this object with: myObj['fruit']=['apple', 'orange']; Later, I would like to append " [banana, melon] " to myObj['fruit'], that's update myObj to ['apple','orange','banana','melon'] what is the most elegant way to... | TITLE:
How to update an object property array value?
QUESTION:
If I have an object defined as: var myObj={}; Then, I update this object with: myObj['fruit']=['apple', 'orange']; Later, I would like to append " [banana, melon] " to myObj['fruit'], that's update myObj to ['apple','orange','banana','melon'] what is the m... | [
"javascript"
] | 0 | 1 | 6,455 | 3 | 0 | 2011-06-03T07:38:32.300000 | 2011-06-03T07:41:50.847000 |
6,224,309 | 6,224,340 | Is there a possibility to set a notification to warn developers about any Db structure change done? | Is there any tool or a way to let all the developers to be notified if a Db guy or someone within the team makes a change in Db like adding a new column to a table or renaming etc.? Maybe a notification email to be sent on any modifications on table structures... Any advice? Thanks! | You can construct a simple schema version table, which is updated each time the database schema is changed by someone. The schema version (i.e the one which the developers are assuming) is held in a config file somewhere, and if a conflict arises, this should be made obvious. e.g. schema version table in the database h... | Is there a possibility to set a notification to warn developers about any Db structure change done? Is there any tool or a way to let all the developers to be notified if a Db guy or someone within the team makes a change in Db like adding a new column to a table or renaming etc.? Maybe a notification email to be sent ... | TITLE:
Is there a possibility to set a notification to warn developers about any Db structure change done?
QUESTION:
Is there any tool or a way to let all the developers to be notified if a Db guy or someone within the team makes a change in Db like adding a new column to a table or renaming etc.? Maybe a notification... | [
".net",
"sql",
"database",
"notifications"
] | 0 | 0 | 49 | 2 | 0 | 2011-06-03T07:38:55.693000 | 2011-06-03T07:44:01.643000 |
6,224,315 | 6,224,326 | How to verify if some items are in a list? | I'm trying to mess about trying the haskell equivalent of the ' Scala One Liners ' thing that has recently popped up on Reddit/Hacker News. Here's what I've got so far (people could probably do them a lot better than me but these are my beginner level attempts) https://gist.github.com/1005383 The one I'm stuck on is ve... | You can use the elem function from the Prelude which checks if an item is in a list. It is commonly used in infix form: Prelude> "foo" `elem` ["foo", "bar", "baz"] True You can then use it in an operator section just like you did with ==: Prelude> let wordList = ["scala", "akka", "play framework", "sbt", "types"] Prelu... | How to verify if some items are in a list? I'm trying to mess about trying the haskell equivalent of the ' Scala One Liners ' thing that has recently popped up on Reddit/Hacker News. Here's what I've got so far (people could probably do them a lot better than me but these are my beginner level attempts) https://gist.gi... | TITLE:
How to verify if some items are in a list?
QUESTION:
I'm trying to mess about trying the haskell equivalent of the ' Scala One Liners ' thing that has recently popped up on Reddit/Hacker News. Here's what I've got so far (people could probably do them a lot better than me but these are my beginner level attempt... | [
"haskell"
] | 6 | 11 | 298 | 3 | 0 | 2011-06-03T07:39:51.380000 | 2011-06-03T07:42:43.887000 |
6,224,316 | 6,224,624 | Facebook Canvas Application - send updates to members who installed the application | I want to be able to send updates (in news activity) to users who have installed the canvas application - without posting on their wall or sending them Facebook messages. One way of doing this could be through the application wall - where I post all my application updates. But these updates would only show up in the ne... | There is currently no way to programmatically like something. What you may be able to do is ask for their email and then email them when there is news for them. Alternatively, if you have the publish_stream permission you can send private wall messages to them. | Facebook Canvas Application - send updates to members who installed the application I want to be able to send updates (in news activity) to users who have installed the canvas application - without posting on their wall or sending them Facebook messages. One way of doing this could be through the application wall - whe... | TITLE:
Facebook Canvas Application - send updates to members who installed the application
QUESTION:
I want to be able to send updates (in news activity) to users who have installed the canvas application - without posting on their wall or sending them Facebook messages. One way of doing this could be through the appl... | [
"facebook",
"facebook-graph-api",
"facebook-c#-sdk",
"fbjs"
] | 0 | 1 | 486 | 1 | 0 | 2011-06-03T07:40:43.357000 | 2011-06-03T08:16:25.227000 |
6,224,321 | 6,224,457 | Hibernate - NonUniqueObjectException | I use JPA/Hibernate with Spring transaction management in my application. There is a InspectionEntity which has a one-to-many relation with InspectionDetailEntity. The PKs for both the entity's are created by an insert trigger in the database. The PK values when I try to save is the default 0 value. I add the Inspectio... | Don't set id to 0 before you save it. Leave it as null. If value is set Hibernate will assume that object is already in the database and attempt to update it. And you probably ending up with multiple objects with the same id (0). Update As I think about it, you are, probably, forced to set id to some value because you ... | Hibernate - NonUniqueObjectException I use JPA/Hibernate with Spring transaction management in my application. There is a InspectionEntity which has a one-to-many relation with InspectionDetailEntity. The PKs for both the entity's are created by an insert trigger in the database. The PK values when I try to save is the... | TITLE:
Hibernate - NonUniqueObjectException
QUESTION:
I use JPA/Hibernate with Spring transaction management in my application. There is a InspectionEntity which has a one-to-many relation with InspectionDetailEntity. The PKs for both the entity's are created by an insert trigger in the database. The PK values when I ... | [
"hibernate",
"jpa",
"jpa-2.0"
] | 0 | 2 | 1,544 | 2 | 0 | 2011-06-03T07:41:44.123000 | 2011-06-03T07:57:31.713000 |
6,224,325 | 6,224,367 | Check if more than one checkbox is selected in jQuery | I need to know if more than one checkbox is selected from my list. How to achive this using jQuery? I've tried something with:checked, but no success. Thanks all for help! | Assuming your container will have an id if ($("#containerID input:checkbox:checked").length > 1) { // your code goes here } See a working demo | Check if more than one checkbox is selected in jQuery I need to know if more than one checkbox is selected from my list. How to achive this using jQuery? I've tried something with:checked, but no success. Thanks all for help! | TITLE:
Check if more than one checkbox is selected in jQuery
QUESTION:
I need to know if more than one checkbox is selected from my list. How to achive this using jQuery? I've tried something with:checked, but no success. Thanks all for help!
ANSWER:
Assuming your container will have an id if ($("#containerID input:c... | [
"javascript",
"jquery",
"select",
"checkbox",
"checked"
] | 2 | 11 | 11,024 | 2 | 0 | 2011-06-03T07:42:39.970000 | 2011-06-03T07:47:12.937000 |
6,224,329 | 6,229,730 | How can I iterate through a CSS class' subclasses? | I have a CSS file which contains several hundred 16x16 icons. They are referenced using a CSS class/subclass arrangement, like so: So, if I need an "arrow up" icon, I simply code: And so on. Because there are so many icons in the library, I created a reference page (in Haml ), so I could quickly find which icon I need.... | Okay, so basically, the plan is to loop through all those classes and generate them in a Haml page, right? What I would do is open that CSS file (using Ruby of course) and then use a regular expression to parse and get all the subclasses. Since you would want to call that in a view, then I suggest using a helper: def l... | How can I iterate through a CSS class' subclasses? I have a CSS file which contains several hundred 16x16 icons. They are referenced using a CSS class/subclass arrangement, like so: So, if I need an "arrow up" icon, I simply code: And so on. Because there are so many icons in the library, I created a reference page (in... | TITLE:
How can I iterate through a CSS class' subclasses?
QUESTION:
I have a CSS file which contains several hundred 16x16 icons. They are referenced using a CSS class/subclass arrangement, like so: So, if I need an "arrow up" icon, I simply code: And so on. Because there are so many icons in the library, I created a ... | [
"ruby-on-rails",
"css",
"ruby"
] | 4 | 1 | 1,189 | 1 | 0 | 2011-06-03T07:42:53.780000 | 2011-06-03T16:08:56.063000 |
6,224,330 | 6,224,398 | Understanding nested PHP ternary operator | I dont understand how that output (" four ") comes? $a = 2;
echo $a == 1? 'one': $a == 2? 'two': $a == 3? 'three': $a == 5? 'four': 'other';
// prints 'four' I don't understand why " four " gets printed. | You need to bracket the ternary conditionals: returns: other one two three other four other as you'd expect. See the note at the bottom of "Ternary operators" at PHP Ternary operator help. The expressions are being evaluated left to right. So you are actually getting: echo ( ((($a == 1? 'one': $a == 2)? 'two': $a == 3)... | Understanding nested PHP ternary operator I dont understand how that output (" four ") comes? $a = 2;
echo $a == 1? 'one': $a == 2? 'two': $a == 3? 'three': $a == 5? 'four': 'other';
// prints 'four' I don't understand why " four " gets printed. | TITLE:
Understanding nested PHP ternary operator
QUESTION:
I dont understand how that output (" four ") comes? $a = 2;
echo $a == 1? 'one': $a == 2? 'two': $a == 3? 'three': $a == 5? 'four': 'other';
// prints 'four' I don't understand why " four " gets printed.
ANSWER:
You need to bracket the ternary conditionals:... | [
"php",
"ternary-operator",
"operator-precedence"
] | 20 | 32 | 8,433 | 4 | 0 | 2011-06-03T07:43:07.710000 | 2011-06-03T07:50:30.770000 |
6,224,338 | 6,224,462 | PHPUnit installation blues | I have installed PHPUnit by the PHPUnit Manual, Chapter 3. Installing PHPUnit, pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install phpunit/PHPUnit Now my PHPUnit folder looks like: > pwd /usr/share/php/PHPUnit > ll drwxr-xr-x 4 root ro... | The executable should be /usr/bin/phpunit. Or in pear config-show | grep execu for that matter. It case it's not try: pear install --force --alldeps phpunit/phpunit and check again. It should fix the broken installation. Also make sure you are using pear version 1.9.2. If it that might be the problem. Run pear install ... | PHPUnit installation blues I have installed PHPUnit by the PHPUnit Manual, Chapter 3. Installing PHPUnit, pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install phpunit/PHPUnit Now my PHPUnit folder looks like: > pwd /usr/share/php/PHPUni... | TITLE:
PHPUnit installation blues
QUESTION:
I have installed PHPUnit by the PHPUnit Manual, Chapter 3. Installing PHPUnit, pear channel-discover pear.phpunit.de pear channel-discover components.ez.no pear channel-discover pear.symfony-project.com pear install phpunit/PHPUnit Now my PHPUnit folder looks like: > pwd /us... | [
"php",
"installation",
"phpunit",
"pear"
] | 2 | 2 | 1,245 | 1 | 0 | 2011-06-03T07:43:52.310000 | 2011-06-03T07:57:56.197000 |
6,224,352 | 6,224,395 | How to redirect a site to a new site | I have a site which has pages like this: blabla.com/page/whatever blabla.com/category/whatever blabla.com/about... How can I redirect each of these to a new domain, like: blabla.net/page/whatever blabla.net/category/whatever blabla.net/about...? Using.htaccess | Use the Redirect directive: Redirect / http://blabla.net/ This directive automatically preserves anything specified after the /. | How to redirect a site to a new site I have a site which has pages like this: blabla.com/page/whatever blabla.com/category/whatever blabla.com/about... How can I redirect each of these to a new domain, like: blabla.net/page/whatever blabla.net/category/whatever blabla.net/about...? Using.htaccess | TITLE:
How to redirect a site to a new site
QUESTION:
I have a site which has pages like this: blabla.com/page/whatever blabla.com/category/whatever blabla.com/about... How can I redirect each of these to a new domain, like: blabla.net/page/whatever blabla.net/category/whatever blabla.net/about...? Using.htaccess
ANS... | [
".htaccess",
"redirect"
] | 2 | 3 | 88 | 3 | 0 | 2011-06-03T07:45:39.503000 | 2011-06-03T07:50:14.390000 |
6,224,359 | 6,226,731 | Qt: Can child objects be composed in their parent object? | In Qt, can I embed child widgets in their parent via composition, or do I have to create them with new? class MyWindow: public QMainWindow {... private: QPushButton myButton; }
MyWindow::MyWindow (): mybutton("Do Something", this) {... } The documentation says that any object derived from QObject will automatically de... | The non-static, non-heap member variables are deleted when that particular object's delete sequence starts. Only when all members are deleted, will it go to the destructor of the base class. Hence QPushButton myButton member will be deleted before ~QMainWindow() is called. And from QObject documentation: "If we delete ... | Qt: Can child objects be composed in their parent object? In Qt, can I embed child widgets in their parent via composition, or do I have to create them with new? class MyWindow: public QMainWindow {... private: QPushButton myButton; }
MyWindow::MyWindow (): mybutton("Do Something", this) {... } The documentation says ... | TITLE:
Qt: Can child objects be composed in their parent object?
QUESTION:
In Qt, can I embed child widgets in their parent via composition, or do I have to create them with new? class MyWindow: public QMainWindow {... private: QPushButton myButton; }
MyWindow::MyWindow (): mybutton("Do Something", this) {... } The d... | [
"c++",
"qt",
"qwidget",
"qobject"
] | 15 | 9 | 2,151 | 7 | 0 | 2011-06-03T07:46:35.760000 | 2011-06-03T11:49:31.820000 |
6,224,365 | 6,225,992 | Retrieving JSON data from an external file using jQuery Ajax not working in Chrome and Internet Explorer | I am trying to retrieve JSON data from an external text file using a GET request. The code is workinh in Firefox, but it's not working in Chrome and Internet Explorer. The JavaScript code is: $(document).ready(function() { $.ajax({ type: "GET", url: "ajax/test.txt", dataType: "json", cache: false, contentType: "applica... | JavaScript generally isn't allowed to load files from the file system. You'd have to host the project on a web server, then the URL would work, like http://localhost/ajax/test.txt if you host your project on http://localhost/. | Retrieving JSON data from an external file using jQuery Ajax not working in Chrome and Internet Explorer I am trying to retrieve JSON data from an external text file using a GET request. The code is workinh in Firefox, but it's not working in Chrome and Internet Explorer. The JavaScript code is: $(document).ready(funct... | TITLE:
Retrieving JSON data from an external file using jQuery Ajax not working in Chrome and Internet Explorer
QUESTION:
I am trying to retrieve JSON data from an external text file using a GET request. The code is workinh in Firefox, but it's not working in Chrome and Internet Explorer. The JavaScript code is: $(doc... | [
"json",
"jquery",
"cross-browser"
] | 0 | 0 | 4,707 | 2 | 0 | 2011-06-03T07:46:56.693000 | 2011-06-03T10:37:29.720000 |
6,224,368 | 6,224,412 | Does Using Generics in Java Affect Performance? | Generics have been in Java since version 5. What are the performance implications of using generics in a Java application and can you explain the reasons for their performance impact? | Generics is a compile time feature. It has next to no impact when running your application. Like most performance questions; it is far more important to write clear and simple code and this is often gives very good performance. Changing your design for performance reasons is a so often a mistake some people say you sho... | Does Using Generics in Java Affect Performance? Generics have been in Java since version 5. What are the performance implications of using generics in a Java application and can you explain the reasons for their performance impact? | TITLE:
Does Using Generics in Java Affect Performance?
QUESTION:
Generics have been in Java since version 5. What are the performance implications of using generics in a Java application and can you explain the reasons for their performance impact?
ANSWER:
Generics is a compile time feature. It has next to no impact ... | [
"java",
"generics"
] | 28 | 29 | 10,854 | 4 | 0 | 2011-06-03T07:47:32.890000 | 2011-06-03T07:52:19.937000 |
6,224,375 | 6,224,426 | using jquery load diffent css? | i have two buttons. now i want the vistor to click the button2, the site invoks the style2.css,when click button1. invoks the style.css. the default shows the style.css is there a ways to use jquery change the the link path of css. if click button2, change the line to < link rel="stylesheet" href="http://www.example.co... | In button2's onclick handler, do this: $('link').attr('href', 'http://www.example.com/themes/style2.css'); EDIT: Apparently I need to point out that this will affect all link tags if you have more than one, so use an id as your selector if you have more than one link, e.g.: $('#myLink).attr('href',...); | using jquery load diffent css? i have two buttons. now i want the vistor to click the button2, the site invoks the style2.css,when click button1. invoks the style.css. the default shows the style.css is there a ways to use jquery change the the link path of css. if click button2, change the line to < link rel="styleshe... | TITLE:
using jquery load diffent css?
QUESTION:
i have two buttons. now i want the vistor to click the button2, the site invoks the style2.css,when click button1. invoks the style.css. the default shows the style.css is there a ways to use jquery change the the link path of css. if click button2, change the line to < ... | [
"php",
"javascript",
"jquery"
] | 2 | 2 | 109 | 4 | 0 | 2011-06-03T07:48:14.963000 | 2011-06-03T07:54:24.013000 |
6,224,376 | 6,224,676 | JSF: Wait for party, then redirect | I'm using JSF 2.0 and Glassfish 3.1 and have the following problem: I've got an application in which two users must participate. The first user should set up the session and then get to a wait page. When the second user joins, the first one should be redirected to the application page. Is this possible in JSF, and if y... | Create an Ajax polling mechanism Invoke an action from Ajax, check if condition met If met using JavaScript code redirect the user (Or you can also make it redirect from action) | JSF: Wait for party, then redirect I'm using JSF 2.0 and Glassfish 3.1 and have the following problem: I've got an application in which two users must participate. The first user should set up the session and then get to a wait page. When the second user joins, the first one should be redirected to the application page... | TITLE:
JSF: Wait for party, then redirect
QUESTION:
I'm using JSF 2.0 and Glassfish 3.1 and have the following problem: I've got an application in which two users must participate. The first user should set up the session and then get to a wait page. When the second user joins, the first one should be redirected to th... | [
"java",
"javascript",
"jsf",
"redirect"
] | 1 | 3 | 621 | 1 | 0 | 2011-06-03T07:48:19.047000 | 2011-06-03T08:21:21.977000 |
6,224,389 | 6,224,568 | Finding a maximum weight clique in a weighted graph C# implementation | Is there a freely available implementation of finding a maximum weight clique in weighted graph in C#? | Find maximum clique is an NP-hard problem. You can find something useful in Clique problem (Wikipedia). | Finding a maximum weight clique in a weighted graph C# implementation Is there a freely available implementation of finding a maximum weight clique in weighted graph in C#? | TITLE:
Finding a maximum weight clique in a weighted graph C# implementation
QUESTION:
Is there a freely available implementation of finding a maximum weight clique in weighted graph in C#?
ANSWER:
Find maximum clique is an NP-hard problem. You can find something useful in Clique problem (Wikipedia). | [
"c#",
"algorithm",
"graph"
] | 1 | 1 | 1,852 | 2 | 0 | 2011-06-03T07:49:53.447000 | 2011-06-03T08:10:13.950000 |
6,224,404 | 6,225,499 | Is it possible to use wsgiservice with Python 2.5 (Google App Engine)? | I would like to use the WsgiService library to write a REST service on Google App Engine (GAE). The two features I like most are the way it automatically outputs a certain format (JSON, XML,...) depending on the file name ending in the request path. Also it is able to directly map parts of the path to variables using r... | The PKG-INFO file of WsgiService contains the following line Classifier: Programming Language:: Python:: 2.6 and therefore does not suit GAE (Python 2.5). The requested features can be achieved with different URL mappings, as described here: http://code.google.com/appengine/docs/python/tools/webapp/running.html#URL_Map... | Is it possible to use wsgiservice with Python 2.5 (Google App Engine)? I would like to use the WsgiService library to write a REST service on Google App Engine (GAE). The two features I like most are the way it automatically outputs a certain format (JSON, XML,...) depending on the file name ending in the request path.... | TITLE:
Is it possible to use wsgiservice with Python 2.5 (Google App Engine)?
QUESTION:
I would like to use the WsgiService library to write a REST service on Google App Engine (GAE). The two features I like most are the way it automatically outputs a certain format (JSON, XML,...) depending on the file name ending in... | [
"google-app-engine",
"syntax",
"wsgi",
"python-2.5"
] | 2 | 0 | 136 | 2 | 0 | 2011-06-03T07:51:36.057000 | 2011-06-03T09:49:15.110000 |
6,224,407 | 6,224,448 | UITableView "cellForRowAtIndexPath" method gets called twice on a swipe abruptly | I think many of us has faced this problem on UITableView delegate method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath which gets called twice. In my application I transforming the tableView. The code is: CGAffineTransform transform = CGAffineTransformMakeRotatio... | I think an immediate fix is just to set a flag which changes the first time it is hit, so then you ignore the second call. It's probably not the perfect solution, and I can't tell you why it gets hit twice - but this will work. (I have experienced exactly the same behavior when I implemented an Apple delegate from the ... | UITableView "cellForRowAtIndexPath" method gets called twice on a swipe abruptly I think many of us has faced this problem on UITableView delegate method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath which gets called twice. In my application I transforming the t... | TITLE:
UITableView "cellForRowAtIndexPath" method gets called twice on a swipe abruptly
QUESTION:
I think many of us has faced this problem on UITableView delegate method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath which gets called twice. In my application I ... | [
"objective-c",
"ios",
"ios-4.2"
] | 0 | 0 | 1,552 | 1 | 0 | 2011-06-03T07:51:44.897000 | 2011-06-03T07:56:38.063000 |
6,224,414 | 6,224,625 | We need advice for a server software implementation with Java NIO | I'm trying to calculate the load on a server I have to build. I need to create a server witch have one million users registered in an SQL database. During a week each user will approximately connect 3-4 times. Each time a user will up and download 1-30 MB data, and it will take maybe 1-2 minutes. When an upload is comp... | I am using Netty for a similar scenario. It is just working! Here is a starting point for using netty: public class TCPListener { private static ServerBootstrap bootstrap;
public static void run(){ bootstrap = new ServerBootstrap( new NioServerSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedT... | We need advice for a server software implementation with Java NIO I'm trying to calculate the load on a server I have to build. I need to create a server witch have one million users registered in an SQL database. During a week each user will approximately connect 3-4 times. Each time a user will up and download 1-30 M... | TITLE:
We need advice for a server software implementation with Java NIO
QUESTION:
I'm trying to calculate the load on a server I have to build. I need to create a server witch have one million users registered in an SQL database. During a week each user will approximately connect 3-4 times. Each time a user will up a... | [
"java",
"sql",
"multithreading",
"nio"
] | 6 | 4 | 669 | 4 | 0 | 2011-06-03T07:52:35.520000 | 2011-06-03T08:16:25.537000 |
6,224,422 | 6,224,496 | How to make Virtual static methods or a functional equivalent with reflection in java | I have a tree of projectile classes I am trying to use some reflection to not implement every combination possible by hand when most of it would be copy paste or at best a lot of one liner virtual methods to override attributes. Basically I have different weapon types that shoot in different patterns such as twin linke... | You should use instance methods to get the functionality that you want. Maybe you should consider using abstract factory pattern. You can have IProjectileFactory interface that is implemented by MissileFactory and BulletFactory. The factories are able to create new projectiles Missile and Bullet that implement the IPro... | How to make Virtual static methods or a functional equivalent with reflection in java I have a tree of projectile classes I am trying to use some reflection to not implement every combination possible by hand when most of it would be copy paste or at best a lot of one liner virtual methods to override attributes. Basic... | TITLE:
How to make Virtual static methods or a functional equivalent with reflection in java
QUESTION:
I have a tree of projectile classes I am trying to use some reflection to not implement every combination possible by hand when most of it would be copy paste or at best a lot of one liner virtual methods to override... | [
"java",
"reflection",
"abstract"
] | 1 | 2 | 141 | 2 | 0 | 2011-06-03T07:53:26.350000 | 2011-06-03T08:02:18.720000 |
6,224,433 | 6,224,585 | Opposite function of INITCAP() | Can we do the opposite of the INITCAP() function? It sets the first letter of each word to lowercase and rest of the letters to upper case. For example, SOMEFUNCTION(abc) returns aBC. | Below you can find a function for MySQL. delimiter // create function lower_first (input varchar(255)) returns varchar(255) deterministic begin declare len int; declare i int; set len = char_length(input); set input = upper(input); set i = 0; while (i < len) do if (mid(input,i,1) = ' ' or i = 0) then if (i < len) then ... | Opposite function of INITCAP() Can we do the opposite of the INITCAP() function? It sets the first letter of each word to lowercase and rest of the letters to upper case. For example, SOMEFUNCTION(abc) returns aBC. | TITLE:
Opposite function of INITCAP()
QUESTION:
Can we do the opposite of the INITCAP() function? It sets the first letter of each word to lowercase and rest of the letters to upper case. For example, SOMEFUNCTION(abc) returns aBC.
ANSWER:
Below you can find a function for MySQL. delimiter // create function lower_fi... | [
"mysql",
"sql",
"postgresql"
] | 3 | 2 | 1,498 | 1 | 0 | 2011-06-03T07:54:56.177000 | 2011-06-03T08:12:14.770000 |
6,224,438 | 6,226,203 | How to detect changes in the network? | I need to know how I can detect a switch in Wi-Fi networks, albeit automatically or manually, it doesn't matter. Is there some kind of intent being broadcasted throughout the system when a switch is detected? Or do I have to manually check if a new network is selected by calling a method on a ConnectivityManager? | At this point in time, I have fixed this like this (haven't fully tested it yet as I don't have a second network available at the moment): I extended the BroadcastReceiver class private class NetworkSwitcher extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = in... | How to detect changes in the network? I need to know how I can detect a switch in Wi-Fi networks, albeit automatically or manually, it doesn't matter. Is there some kind of intent being broadcasted throughout the system when a switch is detected? Or do I have to manually check if a new network is selected by calling a ... | TITLE:
How to detect changes in the network?
QUESTION:
I need to know how I can detect a switch in Wi-Fi networks, albeit automatically or manually, it doesn't matter. Is there some kind of intent being broadcasted throughout the system when a switch is detected? Or do I have to manually check if a new network is sele... | [
"android",
"networking"
] | 1 | 7 | 7,529 | 1 | 0 | 2011-06-03T07:55:29.703000 | 2011-06-03T10:58:00.527000 |
6,224,444 | 6,224,499 | Platform invocation services for .NET | Is there any better way to load and use functions from a DLL file in.NET (C#) than by using so-called P/Invoke? If the DLL file contains functions that were written using JNI is there still a way to use them in.NET? | For native DLLs your options are P/invoke or COM. The latter is easier once you have got over the not insignificant hurdle of making a COM server. | Platform invocation services for .NET Is there any better way to load and use functions from a DLL file in.NET (C#) than by using so-called P/Invoke? If the DLL file contains functions that were written using JNI is there still a way to use them in.NET? | TITLE:
Platform invocation services for .NET
QUESTION:
Is there any better way to load and use functions from a DLL file in.NET (C#) than by using so-called P/Invoke? If the DLL file contains functions that were written using JNI is there still a way to use them in.NET?
ANSWER:
For native DLLs your options are P/invo... | [
".net",
"dll",
"pinvoke"
] | 1 | 2 | 97 | 1 | 0 | 2011-06-03T07:56:17.650000 | 2011-06-03T08:02:37.787000 |
6,224,445 | 6,224,464 | MySQL select query | Possible Duplicate: MySQL wildcard in select … SELECT icon_* FROM images WHERE 1 I have three fields, icon_small, icon_big, and icon_large. How do I get all three without manually specifying them? | As far as I know, you can't. You will have to manually specify them. (See the duplicate) | MySQL select query Possible Duplicate: MySQL wildcard in select … SELECT icon_* FROM images WHERE 1 I have three fields, icon_small, icon_big, and icon_large. How do I get all three without manually specifying them? | TITLE:
MySQL select query
QUESTION:
Possible Duplicate: MySQL wildcard in select … SELECT icon_* FROM images WHERE 1 I have three fields, icon_small, icon_big, and icon_large. How do I get all three without manually specifying them?
ANSWER:
As far as I know, you can't. You will have to manually specify them. (See the... | [
"mysql",
"sql"
] | 0 | 3 | 103 | 3 | 0 | 2011-06-03T07:56:25.737000 | 2011-06-03T07:58:03.010000 |
6,224,452 | 6,224,551 | PHP 4 read and write XML | I have found several questions and answers pertaining to my question, but I'm getting a little confused. Perhaps clarification from someone would help. Sadly, I am working in PHP 4 - no chance of upgrading.:( (See comments below... I'm stuck working on a client server who doesn't want to upgrade from a folksy/non-PHP-u... | Why not simply define the textboxes as the following? Then in PHP you just access all values using foreach ($_POST['picture'] as $pictureUrl) { $buffer.= ' '.$pictureUrl.' '; } You definitely want to check whether the array is set or not, etc. | PHP 4 read and write XML I have found several questions and answers pertaining to my question, but I'm getting a little confused. Perhaps clarification from someone would help. Sadly, I am working in PHP 4 - no chance of upgrading.:( (See comments below... I'm stuck working on a client server who doesn't want to upgrad... | TITLE:
PHP 4 read and write XML
QUESTION:
I have found several questions and answers pertaining to my question, but I'm getting a little confused. Perhaps clarification from someone would help. Sadly, I am working in PHP 4 - no chance of upgrading.:( (See comments below... I'm stuck working on a client server who does... | [
"php",
"xml",
"php4"
] | 1 | 0 | 667 | 1 | 0 | 2011-06-03T07:57:07.947000 | 2011-06-03T08:08:28.037000 |
6,224,454 | 6,224,537 | How to set Accept and Accept-Language header fields? | I can set Request.Content-Type =..., Request.Content-Length =... How to set Accept and Accept-Language? I want to upload a file (RFC 1867) and need to create a request like this: POST /test-upload.php.xml HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 A... | Take a look at Accept property: HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create(myUri); myHttpWebRequest.Accept="image/*"; HttpWebResponse myHttpWebResponse= (HttpWebResponse)myHttpWebRequest.GetResponse(); This MSDN article shows how to add custom headers to your request: //Get the headers associated... | How to set Accept and Accept-Language header fields? I can set Request.Content-Type =..., Request.Content-Length =... How to set Accept and Accept-Language? I want to upload a file (RFC 1867) and need to create a request like this: POST /test-upload.php.xml HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT... | TITLE:
How to set Accept and Accept-Language header fields?
QUESTION:
I can set Request.Content-Type =..., Request.Content-Length =... How to set Accept and Accept-Language? I want to upload a file (RFC 1867) and need to create a request like this: POST /test-upload.php.xml HTTP/1.1 Host: example.com User-Agent: Mozil... | [
"c#",
"httpwebrequest"
] | 25 | 44 | 93,421 | 6 | 0 | 2011-06-03T07:57:19.327000 | 2011-06-03T08:06:31.210000 |
6,224,467 | 6,224,581 | Loading a Database Table to Memory to Use | In a search application, I need to keep track of the files and their locations. Currently am using a database table for this, but since I have to connect to the db every time I need to retrieve such data, this is obviously not efficient. Is there a method I can load the table to memory and use it? I won't need to modif... | If all you want to do is retrieve one table into memory you can do this with a single SELECT statement. You can build a collection like a Map from the ResultSet. After that get the information you want from the Map. | Loading a Database Table to Memory to Use In a search application, I need to keep track of the files and their locations. Currently am using a database table for this, but since I have to connect to the db every time I need to retrieve such data, this is obviously not efficient. Is there a method I can load the table t... | TITLE:
Loading a Database Table to Memory to Use
QUESTION:
In a search application, I need to keep track of the files and their locations. Currently am using a database table for this, but since I have to connect to the db every time I need to retrieve such data, this is obviously not efficient. Is there a method I ca... | [
"java",
"database",
"ram",
"main-memory-database"
] | 1 | 2 | 4,002 | 4 | 0 | 2011-06-03T07:58:15.507000 | 2011-06-03T08:11:52.063000 |
6,224,468 | 6,224,589 | Blinking effect on UILabel | I have a UILabel with background color as grey. I want a blinking effect on this label like it should become a little white & then become gray and it should keep happen till I turn it off programatically. Any clue how to achieve this? | Use NSTimer NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:(NSTimeInterval)(1.0) target:self selector:@selector(blink) userInfo:nil repeats:TRUE]; BOOL blinkStatus = NO; in your blink function -(void)blink{ if(blinkStatus == NO){ yourLabel.backgroundColor = [UIColor whiteColor]; blinkStatus = YES; }else { you... | Blinking effect on UILabel I have a UILabel with background color as grey. I want a blinking effect on this label like it should become a little white & then become gray and it should keep happen till I turn it off programatically. Any clue how to achieve this? | TITLE:
Blinking effect on UILabel
QUESTION:
I have a UILabel with background color as grey. I want a blinking effect on this label like it should become a little white & then become gray and it should keep happen till I turn it off programatically. Any clue how to achieve this?
ANSWER:
Use NSTimer NSTimer *timer = [N... | [
"ios",
"objective-c",
"cocoa-touch",
"uiview",
"uilabel"
] | 28 | 22 | 39,661 | 14 | 0 | 2011-06-03T07:58:17.333000 | 2011-06-03T08:12:28.147000 |
6,224,474 | 6,224,735 | Generating evalable python code: all combinations of functions in disjunctive normal form | (A,B,C) = (100, 200, 300)
def f1(p): return p+50 def f2(p): return p*1.5 def f3(p): return p*p
vars_ = (A,B,C) funcs_ = [f1, f2, f3] logic_ = ["and","or"] vol_lmt_ = [200, 300] op_ = [">","<","="] I want generate the assert code string for eval() to test the validity, take below one for example: "f1(A)>200 and f1(B)>... | Maybe this can summaries what you are trying to do (using python2 syntax): import itertools
arguments = ('A', 'B', 'C', 'D') funcs_ = [f1, f2, f3, f4] logic_ = ["and","or"] op_ = [">","<","="] vol_lmt_ = [200, 300]
num_func = len(funcs_)
assert num_func == len(arguments), ("The number of argument should be the same ... | Generating evalable python code: all combinations of functions in disjunctive normal form (A,B,C) = (100, 200, 300)
def f1(p): return p+50 def f2(p): return p*1.5 def f3(p): return p*p
vars_ = (A,B,C) funcs_ = [f1, f2, f3] logic_ = ["and","or"] vol_lmt_ = [200, 300] op_ = [">","<","="] I want generate the assert code... | TITLE:
Generating evalable python code: all combinations of functions in disjunctive normal form
QUESTION:
(A,B,C) = (100, 200, 300)
def f1(p): return p+50 def f2(p): return p*1.5 def f3(p): return p*p
vars_ = (A,B,C) funcs_ = [f1, f2, f3] logic_ = ["and","or"] vol_lmt_ = [200, 300] op_ = [">","<","="] I want genera... | [
"python",
"eval"
] | 3 | 0 | 294 | 3 | 0 | 2011-06-03T07:59:25.927000 | 2011-06-03T08:29:45.877000 |
6,224,476 | 6,224,530 | Find the text starting with another text | Is there any method in C can find a text within another text? For example, text = "abaHello", textneedtoSearch = "Hello";. If the text contains "Hello", return true, else return false. | Character and string searching functions `char *strstr( const char *s1, const char *s2)` returns a pointer to the first instance of string s2 in s1. Returns a NULL pointer if s2 is not encountered in s1. In additon, int strcmp(const char *s1, const char *s2); strcmp compares the string s1 to the string s2. The function... | Find the text starting with another text Is there any method in C can find a text within another text? For example, text = "abaHello", textneedtoSearch = "Hello";. If the text contains "Hello", return true, else return false. | TITLE:
Find the text starting with another text
QUESTION:
Is there any method in C can find a text within another text? For example, text = "abaHello", textneedtoSearch = "Hello";. If the text contains "Hello", return true, else return false.
ANSWER:
Character and string searching functions `char *strstr( const char ... | [
"c",
"string"
] | 9 | 6 | 262 | 5 | 0 | 2011-06-03T07:59:44.147000 | 2011-06-03T08:05:56.247000 |
6,224,478 | 6,224,501 | how to call jquery function without having to trigger selector event? | How do I call a jquery function by just loading the page? For example, on one page,I have a paragraph and this jquery code here: $(document).ready(function(){ $("button").click(function(){ $("p").hide(1000); }); }); How do I make the paragraph slowly fade away using jquery right after the page loads WITHOUT having any ... | Can't you just call hide like that: $(document).ready(function(){ $("p").hide(1000); }); | how to call jquery function without having to trigger selector event? How do I call a jquery function by just loading the page? For example, on one page,I have a paragraph and this jquery code here: $(document).ready(function(){ $("button").click(function(){ $("p").hide(1000); }); }); How do I make the paragraph slowly... | TITLE:
how to call jquery function without having to trigger selector event?
QUESTION:
How do I call a jquery function by just loading the page? For example, on one page,I have a paragraph and this jquery code here: $(document).ready(function(){ $("button").click(function(){ $("p").hide(1000); }); }); How do I make th... | [
"javascript",
"jquery",
"html",
"forms",
"function"
] | 2 | 2 | 7,491 | 4 | 0 | 2011-06-03T08:00:09.467000 | 2011-06-03T08:02:47.483000 |
6,224,484 | 6,224,565 | Is it Possible to Create New Classes on RunTime C# | Hi is it possible to Create New Classes in C#,classes which the Application Read's from XML and Declare they're Attributes also reading from XML. like: John Kennedy 24 bests. | Yes it is with System.Reflection.Emit namespace. But in.net 4.0 you can use dynamic keywoard for this. Like this http://blogs.msdn.com/b/mcsuksoldev/archive/2010/02/04/dynamic-xml-reader-with-c-and-net-4-0.aspx without dynamic, even if you create new class, you will need reflection to access their properties | Is it Possible to Create New Classes on RunTime C# Hi is it possible to Create New Classes in C#,classes which the Application Read's from XML and Declare they're Attributes also reading from XML. like: John Kennedy 24 bests. | TITLE:
Is it Possible to Create New Classes on RunTime C#
QUESTION:
Hi is it possible to Create New Classes in C#,classes which the Application Read's from XML and Declare they're Attributes also reading from XML. like: John Kennedy 24 bests.
ANSWER:
Yes it is with System.Reflection.Emit namespace. But in.net 4.0 you... | [
"c#",
"xml",
"class",
"reflection"
] | 6 | 10 | 9,276 | 6 | 0 | 2011-06-03T08:01:01.853000 | 2011-06-03T08:10:01.580000 |
6,224,486 | 6,224,641 | Problem with displaying content made with WYSIWYG in django admin | In one of my projects there was need to implement WYSIWYG-editor into django admin. I've installed http://code.google.com/p/django-tinymce/. Everything works well, but there is a problem with rendering the content made with WYSIWYG-editor. As a result, on html page returns special chars instead of normal html-tags and ... | try {{ content|safe }} Marks a string as not requiring further HTML escaping prior to output. via safe | Problem with displaying content made with WYSIWYG in django admin In one of my projects there was need to implement WYSIWYG-editor into django admin. I've installed http://code.google.com/p/django-tinymce/. Everything works well, but there is a problem with rendering the content made with WYSIWYG-editor. As a result, o... | TITLE:
Problem with displaying content made with WYSIWYG in django admin
QUESTION:
In one of my projects there was need to implement WYSIWYG-editor into django admin. I've installed http://code.google.com/p/django-tinymce/. Everything works well, but there is a problem with rendering the content made with WYSIWYG-edit... | [
"django",
"django-admin",
"django-templates",
"wysiwyg",
"django-wysiwyg"
] | 2 | 7 | 1,210 | 1 | 0 | 2011-06-03T08:01:05.780000 | 2011-06-03T08:18:13.837000 |
6,224,493 | 6,224,538 | APNS PHP push notification issue | I can run the APNS successfully on server. I get this message: Fri, 03 Jun 2011 10:01:41 +0200 ApnsPHP[29402]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Fri, 03 Jun 2011 10:01:42 +0200 ApnsPHP[29402]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195. Fri, 03 Jun 2011 10:01:42 +0200 ApnsPHP[2... | It sounds to me you are missing or you have an invalid app-token for your device. | APNS PHP push notification issue I can run the APNS successfully on server. I get this message: Fri, 03 Jun 2011 10:01:41 +0200 ApnsPHP[29402]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Fri, 03 Jun 2011 10:01:42 +0200 ApnsPHP[29402]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195. Fri, 03 ... | TITLE:
APNS PHP push notification issue
QUESTION:
I can run the APNS successfully on server. I get this message: Fri, 03 Jun 2011 10:01:41 +0200 ApnsPHP[29402]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Fri, 03 Jun 2011 10:01:42 +0200 ApnsPHP[29402]: INFO: Connected to ssl://gateway.sandbox.push.apple.... | [
"php",
"iphone",
"push-notification",
"apple-push-notifications"
] | 0 | 0 | 1,763 | 1 | 0 | 2011-06-03T08:02:00.247000 | 2011-06-03T08:06:36.160000 |
6,224,500 | 6,224,613 | Javascript multiply function failed when together | Javascript function does not work when function loadcontents(obj) { var params = $(obj).attr('href').split('?'); $.getJSON(IVIDPLAY_BASE_DIR+'content/load2.php?'+params[1], function(json) { if (json.returnval == 1) { $('#contents').fadeOut('fast', function() { $(this).html('json.contents').fadeIn('slow'); }); } } is tr... | Oh well, You need to use this: loadContent2(this, \"page\", \"2\"):) | Javascript multiply function failed when together Javascript function does not work when function loadcontents(obj) { var params = $(obj).attr('href').split('?'); $.getJSON(IVIDPLAY_BASE_DIR+'content/load2.php?'+params[1], function(json) { if (json.returnval == 1) { $('#contents').fadeOut('fast', function() { $(this).h... | TITLE:
Javascript multiply function failed when together
QUESTION:
Javascript function does not work when function loadcontents(obj) { var params = $(obj).attr('href').split('?'); $.getJSON(IVIDPLAY_BASE_DIR+'content/load2.php?'+params[1], function(json) { if (json.returnval == 1) { $('#contents').fadeOut('fast', func... | [
"php",
"javascript"
] | 0 | 1 | 163 | 1 | 0 | 2011-06-03T08:02:45.080000 | 2011-06-03T08:15:04.833000 |
6,224,505 | 6,224,559 | asp.net downloading file with french character | I need to download a file with french file name for example "mé.txt"..I have this code: FileStream fileStream = File.Open("filePath", FileMode.Open); byte[] bytContent = new byte[(int)fileStream.Length]; fileStream.Read(bytContent, 0, (int)fileStream.Length); fileStream.Close(); string fileName = "mé.txt"; Response.Add... | i think the problem has to be solved on the serverside using HttpUtility.UrlPathEncode | asp.net downloading file with french character I need to download a file with french file name for example "mé.txt"..I have this code: FileStream fileStream = File.Open("filePath", FileMode.Open); byte[] bytContent = new byte[(int)fileStream.Length]; fileStream.Read(bytContent, 0, (int)fileStream.Length); fileStream.Cl... | TITLE:
asp.net downloading file with french character
QUESTION:
I need to download a file with french file name for example "mé.txt"..I have this code: FileStream fileStream = File.Open("filePath", FileMode.Open); byte[] bytContent = new byte[(int)fileStream.Length]; fileStream.Read(bytContent, 0, (int)fileStream.Leng... | [
"asp.net",
"character-encoding",
"download"
] | 1 | 2 | 339 | 1 | 0 | 2011-06-03T08:03:05.730000 | 2011-06-03T08:09:37.330000 |
6,224,506 | 6,224,813 | How to solve DataSet Table with error mark in my each column? | I am debugging this error on my dataset table.I dunno what error is called.I am calling a stored procedure then this error is displayed. When I run in MS SQL, it is showing fine. But when I debug in C#, the 1st table is showing fine but 2nd table is showing error mark in all my data columns (except the FieldName and I ... | It seems that this is a problem with the debugger sometimes when displaying more than one table in a dataset. see here. The quickest solution it seems to be is instead of doing a quick watch over the whole dataset, do a quick watch on the table itself. Have a look at the workaround on this page for an alternative metho... | How to solve DataSet Table with error mark in my each column? I am debugging this error on my dataset table.I dunno what error is called.I am calling a stored procedure then this error is displayed. When I run in MS SQL, it is showing fine. But when I debug in C#, the 1st table is showing fine but 2nd table is showing ... | TITLE:
How to solve DataSet Table with error mark in my each column?
QUESTION:
I am debugging this error on my dataset table.I dunno what error is called.I am calling a stored procedure then this error is displayed. When I run in MS SQL, it is showing fine. But when I debug in C#, the 1st table is showing fine but 2nd... | [
"c#",
"dataset"
] | 0 | 0 | 272 | 1 | 0 | 2011-06-03T08:03:06.567000 | 2011-06-03T08:38:25.097000 |
6,224,513 | 6,224,617 | Which is a better option for random name of file on disk sha1 or uniqid? | To store uploaded files by users on remote server inside disk folder I change the name of file to $filename = '/tmp/foo.txt'; $newName = sha1_file($filename); // 40 characters //or I can do $newName = uniqid($filename) // 13 characters Which is a more robust method for new name that is not likely to fail?? Thanks. | A better solution is to use tmpfile() or tempnam(). Either one is guaranteed to create an unused file that won't collide and can't be "intercepted" by rogue processes changing permissions on you. tmpfile() automatically deletes the file when it's closed, whereas tempnam() keeps it around http://www.php.net/manual/en/fu... | Which is a better option for random name of file on disk sha1 or uniqid? To store uploaded files by users on remote server inside disk folder I change the name of file to $filename = '/tmp/foo.txt'; $newName = sha1_file($filename); // 40 characters //or I can do $newName = uniqid($filename) // 13 characters Which is a ... | TITLE:
Which is a better option for random name of file on disk sha1 or uniqid?
QUESTION:
To store uploaded files by users on remote server inside disk folder I change the name of file to $filename = '/tmp/foo.txt'; $newName = sha1_file($filename); // 40 characters //or I can do $newName = uniqid($filename) // 13 char... | [
"php",
"file",
"upload",
"unique",
"sha1"
] | 5 | 6 | 1,987 | 4 | 0 | 2011-06-03T08:03:38.950000 | 2011-06-03T08:15:43.790000 |
6,224,520 | 6,224,549 | The value from a prompt box when ESC is pressed | I have this simple function function Login() { var x=prompt("Please enter your name",""); var xmlhttp; if (window.XMLHttpRequest) {// Използваните браузъри xmlhttp=new XMLHttpRequest(); } else {// Кой ли ползва тези версии.. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","login.php?u="+x,true); xm... | It returns as if you had clicked cancel. It is null not as a string.. alert( prompt('') === null ); will alert true if you press Esc or cancel button | The value from a prompt box when ESC is pressed I have this simple function function Login() { var x=prompt("Please enter your name",""); var xmlhttp; if (window.XMLHttpRequest) {// Използваните браузъри xmlhttp=new XMLHttpRequest(); } else {// Кой ли ползва тези версии.. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");... | TITLE:
The value from a prompt box when ESC is pressed
QUESTION:
I have this simple function function Login() { var x=prompt("Please enter your name",""); var xmlhttp; if (window.XMLHttpRequest) {// Използваните браузъри xmlhttp=new XMLHttpRequest(); } else {// Кой ли ползва тези версии.. xmlhttp=new ActiveXObject("Mi... | [
"php",
"javascript",
"ajax"
] | 0 | 0 | 951 | 2 | 0 | 2011-06-03T08:04:03.323000 | 2011-06-03T08:07:59.600000 |
6,224,523 | 6,224,606 | Get enum definition from shared library | I am using ctypes to access a shared library written in C. The C source of the shared library contains an enum like enum { invalid = 0, type1 = 1, type2 = 2 } type_enum; On the Python side I was intending to just define integer constants for the various enum values, like: INVALID = 0 TYPE1 = 1 TYPE2 = 2 And then use th... | Enum definitions are not exported so your current solution is the only one available. In any case, C enum values are nothing much more than integer constants. There's no type safety on the C side, you can pass any integer values to an enum parameter. So it's not like the C compiler is doing much anyway. | Get enum definition from shared library I am using ctypes to access a shared library written in C. The C source of the shared library contains an enum like enum { invalid = 0, type1 = 1, type2 = 2 } type_enum; On the Python side I was intending to just define integer constants for the various enum values, like: INVALID... | TITLE:
Get enum definition from shared library
QUESTION:
I am using ctypes to access a shared library written in C. The C source of the shared library contains an enum like enum { invalid = 0, type1 = 1, type2 = 2 } type_enum; On the Python side I was intending to just define integer constants for the various enum val... | [
"python",
"c",
"ctypes"
] | 5 | 5 | 1,568 | 2 | 0 | 2011-06-03T08:04:40.043000 | 2011-06-03T08:14:31.123000 |
6,224,526 | 6,224,535 | How to convert a Javascript Array of Arrays into a JSON String | I have a complicated example of converting a Javascript Array to a JSON String. Let's say I have two type of objects. The first type is called a Property, it has the fields: id, uri, label and values[] where values is an array of the second type of object. The second type of object, called a Value has the fields: id, u... | In common you can use JSON.stringify(array), but not all browsers have this method implemented. However if you use some JS framework stringify is probably implemented there for old browsers. | How to convert a Javascript Array of Arrays into a JSON String I have a complicated example of converting a Javascript Array to a JSON String. Let's say I have two type of objects. The first type is called a Property, it has the fields: id, uri, label and values[] where values is an array of the second type of object. ... | TITLE:
How to convert a Javascript Array of Arrays into a JSON String
QUESTION:
I have a complicated example of converting a Javascript Array to a JSON String. Let's say I have two type of objects. The first type is called a Property, it has the fields: id, uri, label and values[] where values is an array of the secon... | [
"javascript",
"arrays",
"json"
] | 1 | 2 | 3,130 | 1 | 0 | 2011-06-03T08:05:03.880000 | 2011-06-03T08:06:27.693000 |
6,224,527 | 6,224,674 | File upload problem in iphone | I want to upload a plist file to my server from my iphone app. I have tried the following code (found googling), but my file is still not uploaded. Where is the problem? iphone app code (method which handles uploading): - (IBAction)sendHTTPPost:(id)sender {
NSString *path = [self pathOfFile]; NSString *fileName = @"Co... | It seems to me that you are posting the file in as userfile, and trying to read it server side as uploaded. Make this uniform and it should work. | File upload problem in iphone I want to upload a plist file to my server from my iphone app. I have tried the following code (found googling), but my file is still not uploaded. Where is the problem? iphone app code (method which handles uploading): - (IBAction)sendHTTPPost:(id)sender {
NSString *path = [self pathOfFi... | TITLE:
File upload problem in iphone
QUESTION:
I want to upload a plist file to my server from my iphone app. I have tried the following code (found googling), but my file is still not uploaded. Where is the problem? iphone app code (method which handles uploading): - (IBAction)sendHTTPPost:(id)sender {
NSString *pat... | [
"php",
"iphone",
"file-upload"
] | 1 | 2 | 942 | 2 | 0 | 2011-06-03T08:05:20.807000 | 2011-06-03T08:21:11.310000 |
6,224,540 | 6,224,612 | Error in dismissing a modal view controller | I have encountered application termination while dismissing a modal view controller. -[NSCFString window]: unrecognized selector sent to instance 0x6337dc0 2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString window]: unrecognized s... | From you log it seems that you are calling window on an NSCFString. NSCFString does not have a window selector, and the compiler would complain if you try and do so, so it is likely that you are sending that message to a deallocated object (imagine that a new object has been allocated where another one was previously),... | Error in dismissing a modal view controller I have encountered application termination while dismissing a modal view controller. -[NSCFString window]: unrecognized selector sent to instance 0x6337dc0 2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', r... | TITLE:
Error in dismissing a modal view controller
QUESTION:
I have encountered application termination while dismissing a modal view controller. -[NSCFString window]: unrecognized selector sent to instance 0x6337dc0 2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArg... | [
"iphone",
"ios4",
"iphone-sdk-3.0"
] | 0 | 0 | 275 | 1 | 0 | 2011-06-03T08:06:42.930000 | 2011-06-03T08:15:01.860000 |
6,224,553 | 6,224,579 | Help, Javascript regular expression | I'm always fighting with regular expression, some help would be appreciated. What is the best way to get all parameters (words starting with @) in strings like: statement: "SELECT @Measure on 0, TOPCOUNT(@Hierarchy.levels(1).member) where @Measure" This expression is not working correctly: var paramsNames = mdxStatemen... | Use this: "SELECT @Measure on 0, TOPCOUNT(@Hierarchy.levels(1).member) where @Measure".match(/(@\w+)/g); And remove the last item, if you do not need it.:) | Help, Javascript regular expression I'm always fighting with regular expression, some help would be appreciated. What is the best way to get all parameters (words starting with @) in strings like: statement: "SELECT @Measure on 0, TOPCOUNT(@Hierarchy.levels(1).member) where @Measure" This expression is not working corr... | TITLE:
Help, Javascript regular expression
QUESTION:
I'm always fighting with regular expression, some help would be appreciated. What is the best way to get all parameters (words starting with @) in strings like: statement: "SELECT @Measure on 0, TOPCOUNT(@Hierarchy.levels(1).member) where @Measure" This expression i... | [
"javascript",
"jquery",
"regex"
] | 0 | 3 | 90 | 4 | 0 | 2011-06-03T08:08:45.850000 | 2011-06-03T08:11:38.607000 |
6,224,555 | 6,224,679 | What gem combinations should I use for testing my rails project? | Hi I usually use cucumber + webrat + rspec/shoula + factory_girl for tests. What gems should be added or replaced to make testing easier/better? | I use only rspec and factory_girl for testing - and it is pretty easy. And it is enough for me. As for me using to much testing frameworks is not good - it is very complicated and could brign strange behaviour. | What gem combinations should I use for testing my rails project? Hi I usually use cucumber + webrat + rspec/shoula + factory_girl for tests. What gems should be added or replaced to make testing easier/better? | TITLE:
What gem combinations should I use for testing my rails project?
QUESTION:
Hi I usually use cucumber + webrat + rspec/shoula + factory_girl for tests. What gems should be added or replaced to make testing easier/better?
ANSWER:
I use only rspec and factory_girl for testing - and it is pretty easy. And it is en... | [
"ruby-on-rails",
"ruby-on-rails-3",
"testing"
] | 0 | 1 | 21 | 1 | 0 | 2011-06-03T08:09:08.897000 | 2011-06-03T08:21:34.460000 |
6,224,567 | 6,225,423 | How to disable the TO address on compose email UI using MonoTouch? | I need to disable the TO address on compose mail UI. Because i used static email address. Also i don't want CC/Bcc address. How to remove CC/Bcc address on compose mail UI? I'm using MFMailComposeViewController for sending email. I'm using MonoTouch. How to achieve this one? | You cannot do that, and there's a good reason. Apple's approach to UI design is to make sure user is always in control. If you present user with an email form, you should be prepared she might want to cancel and save it as a draft for later, add her other email address to CC, or even change To address if she really wan... | How to disable the TO address on compose email UI using MonoTouch? I need to disable the TO address on compose mail UI. Because i used static email address. Also i don't want CC/Bcc address. How to remove CC/Bcc address on compose mail UI? I'm using MFMailComposeViewController for sending email. I'm using MonoTouch. Ho... | TITLE:
How to disable the TO address on compose email UI using MonoTouch?
QUESTION:
I need to disable the TO address on compose mail UI. Because i used static email address. Also i don't want CC/Bcc address. How to remove CC/Bcc address on compose mail UI? I'm using MFMailComposeViewController for sending email. I'm u... | [
"iphone",
"email",
"xamarin.ios",
"mfmailcomposeviewcontroller"
] | 1 | 2 | 413 | 1 | 0 | 2011-06-03T08:10:13.390000 | 2011-06-03T09:43:05.237000 |
6,224,570 | 6,225,116 | how to use DES_DECRYPT() function to get data from mysql? | At last i try Encryption and Compression Functions in mysql for secure password and username. DES_ENCRYPT function is perfectly work for encrypt. I give the code which i use to encrypt and save in database. MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand();... | DES_DECRYPT is the way to decrypt DES_ENCRYPT ed data. Lets stick to the SQL part of it. Easy example: /* generating test table */ CREATE TABLE `test` ( `testField` varchar(512) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1
/* adding some test data to it */ INSERT INTO test () VALUES (DES_ENCRYPT("Hello")), (DES... | how to use DES_DECRYPT() function to get data from mysql? At last i try Encryption and Compression Functions in mysql for secure password and username. DES_ENCRYPT function is perfectly work for encrypt. I give the code which i use to encrypt and save in database. MySqlConnection connection = new MySqlConnection(MyConS... | TITLE:
how to use DES_DECRYPT() function to get data from mysql?
QUESTION:
At last i try Encryption and Compression Functions in mysql for secure password and username. DES_ENCRYPT function is perfectly work for encrypt. I give the code which i use to encrypt and save in database. MySqlConnection connection = new MySq... | [
"mysql",
"encryption"
] | 0 | 1 | 7,495 | 1 | 0 | 2011-06-03T08:10:49.047000 | 2011-06-03T09:09:28.947000 |
6,224,571 | 6,225,904 | Positioning multiple, random sized, absolutely positioned elements so they don't overlap | Ok I need to be able to position a bunch of random sized absolutely positioned words on a page but I don't want any of the elements to overlap. The end goal is to have a fluid word cloud that responds to user interaction (remember the Google Balls Doodle?). I would really like to build this from scratch to develop my u... | I'm not sure if you also want to position the words randomly inside a container, but i've written a fiddle that does just that. You can modify the code to position one word right after the other if you want to though. I think the key part is the method to check if there's a collision. see http://jsfiddle.net/fZtdt/13/ ... | Positioning multiple, random sized, absolutely positioned elements so they don't overlap Ok I need to be able to position a bunch of random sized absolutely positioned words on a page but I don't want any of the elements to overlap. The end goal is to have a fluid word cloud that responds to user interaction (remember ... | TITLE:
Positioning multiple, random sized, absolutely positioned elements so they don't overlap
QUESTION:
Ok I need to be able to position a bunch of random sized absolutely positioned words on a page but I don't want any of the elements to overlap. The end goal is to have a fluid word cloud that responds to user inte... | [
"javascript",
"css",
"animation",
"positioning",
"interactive"
] | 4 | 13 | 7,246 | 2 | 0 | 2011-06-03T08:10:49.753000 | 2011-06-03T10:29:37.490000 |
6,224,577 | 6,225,656 | Detect shaking of device in left or right direction in android? | I want to use SensorManager but for detecting Shaking of device in left or right direction, I don't know how to detect shaking of device is in right direction or in left direction. I have following question: How to implement shaking of device using SensorManager? How can I detect in which direction shaking of device is... | I have tried this one and found out one way of doing this. The method is, I am monitoring the value of X axis. If the threshold exceeds the limit and the X value exceeds the value we are giving, then we will get a Toast message that on which we shaken the phone either left or right. I have tried like this: public class... | Detect shaking of device in left or right direction in android? I want to use SensorManager but for detecting Shaking of device in left or right direction, I don't know how to detect shaking of device is in right direction or in left direction. I have following question: How to implement shaking of device using SensorM... | TITLE:
Detect shaking of device in left or right direction in android?
QUESTION:
I want to use SensorManager but for detecting Shaking of device in left or right direction, I don't know how to detect shaking of device is in right direction or in left direction. I have following question: How to implement shaking of de... | [
"android"
] | 14 | 21 | 14,890 | 2 | 0 | 2011-06-03T08:11:37.153000 | 2011-06-03T10:06:16.693000 |
6,224,582 | 6,224,737 | How can I tell OpenGL how often to draw stuff? | Okay, I'm going to sound like an idiot with this one. Here goes. I've been doing iOS development for about a year now, but only tonight have I started doing anything OpenGL related. I've followed Jeff LaMarche's wonderful guide and I'm drawing a neat looking triangle, and I got it to flip around and stuff. I'm one ente... | You should read up on the concept of game loops. http://entropyinteractive.com/2011/02/game-engine-design-the-game-loop/ is a good resource to get you started. | How can I tell OpenGL how often to draw stuff? Okay, I'm going to sound like an idiot with this one. Here goes. I've been doing iOS development for about a year now, but only tonight have I started doing anything OpenGL related. I've followed Jeff LaMarche's wonderful guide and I'm drawing a neat looking triangle, and ... | TITLE:
How can I tell OpenGL how often to draw stuff?
QUESTION:
Okay, I'm going to sound like an idiot with this one. Here goes. I've been doing iOS development for about a year now, but only tonight have I started doing anything OpenGL related. I've followed Jeff LaMarche's wonderful guide and I'm drawing a neat look... | [
"opengl-es",
"frame-rate"
] | 1 | 1 | 335 | 3 | 0 | 2011-06-03T08:12:04.333000 | 2011-06-03T08:29:59.700000 |
6,224,584 | 6,224,895 | Protocol Buffer for PHP | What are the avaliable libraries for using protobuf in PHP? | Protocol_Buffer_for_PHP Last updated in May 2009 Implementing the Google "Protocol Buffer" for PHP, include parsing... Issue list: http://code.google.com/p/pb4php/issues/list Protobuf-PHP Last updated in April 2011 Protobuf for PHP is an implementation of Google's Protocol Buffers for the PHP language, supporting its b... | Protocol Buffer for PHP What are the avaliable libraries for using protobuf in PHP? | TITLE:
Protocol Buffer for PHP
QUESTION:
What are the avaliable libraries for using protobuf in PHP?
ANSWER:
Protocol_Buffer_for_PHP Last updated in May 2009 Implementing the Google "Protocol Buffer" for PHP, include parsing... Issue list: http://code.google.com/p/pb4php/issues/list Protobuf-PHP Last updated in April... | [
"php",
"protocol-buffers"
] | 20 | 14 | 23,017 | 3 | 0 | 2011-06-03T08:12:10.420000 | 2011-06-03T08:47:38.643000 |
6,224,593 | 6,225,008 | Is there a way of checking file availability in a DOS script? | Background: I have a post-build process that copies a file to another location. It looks like this: copy $(TargetPath) "%programfiles%\mypath" This step can fail if the another process is using the file. The step is not critical, so if possible I would like to ignore the failure. To do this I need the script to check t... | Ok, so I needed to check the errorlevel after performing the copy, so that I could handle the exit properly. The solution is below: copy $(TargetPath) "%programfiles%\mypath" if errorlevel 1 goto BuildProcessFailed
goto BuildProcessOK:BuildProcessFailed echo BUILDPROCESS FAILED FOR PROJECT $(ProjectName) goto ExitBuil... | Is there a way of checking file availability in a DOS script? Background: I have a post-build process that copies a file to another location. It looks like this: copy $(TargetPath) "%programfiles%\mypath" This step can fail if the another process is using the file. The step is not critical, so if possible I would like ... | TITLE:
Is there a way of checking file availability in a DOS script?
QUESTION:
Background: I have a post-build process that copies a file to another location. It looks like this: copy $(TargetPath) "%programfiles%\mypath" This step can fail if the another process is using the file. The step is not critical, so if poss... | [
"windows",
"dos"
] | 1 | 0 | 305 | 2 | 0 | 2011-06-03T08:12:50 | 2011-06-03T09:00:56.233000 |
6,224,598 | 6,224,777 | Is there a cleaner way to register Qt custom events? | I need to create several custom event classes for a Qt application. Right now, it looks like I will need to implement the following event type registration code for each event class: class MyEvent: public QEvent { public: MyEvent(): QEvent(registeredType()) { }
static QEvent::Type eventType;
private: static QEvent::T... | That's what templates are for. They can be used with constant integral parameters, which need to be known at compile time too: enum EventNames { UpdateEvent,... }
template class MyEvent: public QEvent { public: MyEvent(): QEvent(registeredType()) { }
static QEvent::Type eventType;
private: static QEvent::Type regist... | Is there a cleaner way to register Qt custom events? I need to create several custom event classes for a Qt application. Right now, it looks like I will need to implement the following event type registration code for each event class: class MyEvent: public QEvent { public: MyEvent(): QEvent(registeredType()) { }
stat... | TITLE:
Is there a cleaner way to register Qt custom events?
QUESTION:
I need to create several custom event classes for a Qt application. Right now, it looks like I will need to implement the following event type registration code for each event class: class MyEvent: public QEvent { public: MyEvent(): QEvent(registere... | [
"c++",
"qt",
"macros",
"qevent"
] | 9 | 9 | 3,907 | 1 | 0 | 2011-06-03T08:13:14.797000 | 2011-06-03T08:34:51.510000 |
6,224,604 | 6,225,121 | python: how to make a product of iterables without repeating the items? | I need a function that functions in a similar manner as itertools.product, but without repeating items. For example: no_repeat_product((1,2,3), (5,6)) = ((1,5), (None,6), (2,5), (None,6),...(None,6)) no_repeat_product((1,2,3), (5,6), (7,8)) = ((1,5,7), (None,None,8), (None,6,7), (None,None,8),...(None,None,8)) Any idea... | Based on your comment stating "because (None,None,8) does not occur successively", I'm assuming you only want to None -ify elements that appear in the output immediately before. def no_repeat_product(*seq): previous = (None,)*len(seq) for vals in itertools.product(*seq): out = list(vals) for i,x in enumerate(out): if p... | python: how to make a product of iterables without repeating the items? I need a function that functions in a similar manner as itertools.product, but without repeating items. For example: no_repeat_product((1,2,3), (5,6)) = ((1,5), (None,6), (2,5), (None,6),...(None,6)) no_repeat_product((1,2,3), (5,6), (7,8)) = ((1,5... | TITLE:
python: how to make a product of iterables without repeating the items?
QUESTION:
I need a function that functions in a similar manner as itertools.product, but without repeating items. For example: no_repeat_product((1,2,3), (5,6)) = ((1,5), (None,6), (2,5), (None,6),...(None,6)) no_repeat_product((1,2,3), (5,... | [
"python",
"python-itertools"
] | 1 | 2 | 1,031 | 3 | 0 | 2011-06-03T08:14:24.677000 | 2011-06-03T09:10:24.037000 |
6,224,621 | 6,224,650 | Compiling vim with the breakindent patch, I now have characters that won't display correctly | After compiling vim (I really wanted the breakindent feature, which wasn't available in vanilla vim for some reason), it won't display certain characters, like curly quotes or bullet points. Furthermore, it gives me an error for a line that has been commented out in a syntax file: Not an editor command: " Vim Syntax Sc... | Your distro likely has other patches applied to vim to make it fit your environment. By compiling it yourself you are missing out on all the work they have done to make it fit your system. You should probably figure out how to compile using the distro compile system instead of from scratch. Once you can compile the ver... | Compiling vim with the breakindent patch, I now have characters that won't display correctly After compiling vim (I really wanted the breakindent feature, which wasn't available in vanilla vim for some reason), it won't display certain characters, like curly quotes or bullet points. Furthermore, it gives me an error fo... | TITLE:
Compiling vim with the breakindent patch, I now have characters that won't display correctly
QUESTION:
After compiling vim (I really wanted the breakindent feature, which wasn't available in vanilla vim for some reason), it won't display certain characters, like curly quotes or bullet points. Furthermore, it gi... | [
"vim",
"compilation"
] | 1 | 1 | 199 | 1 | 0 | 2011-06-03T08:15:49.473000 | 2011-06-03T08:19:01.670000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.