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,258,524 | 6,259,226 | WPF BitmapImage can`t be serialized/added into a Resource file | why can I not add a wpfImage of type BitmapImage/BitmapSource/ImageSource to a Resource file. Yes its not serializeable... So how can I workaround this? I need to put my bitmapImages in a Resource file with key/value access programatically. using (ResXResourceWriter writer = new ResXResourceWriter("TBM.Resource")) { wr... | Resx files were not designed to be used with WPF images. They work fine with GDI images though, so you can save the image to a System.Drawing.Bitmap, and add it to the resource file. var encoder = new PngBitmapEncoder(); using (var stream = new MemoryStream()) { // Write the WPF image to the stream encoder.Frames.Add(B... | WPF BitmapImage can`t be serialized/added into a Resource file why can I not add a wpfImage of type BitmapImage/BitmapSource/ImageSource to a Resource file. Yes its not serializeable... So how can I workaround this? I need to put my bitmapImages in a Resource file with key/value access programatically. using (ResXResou... | TITLE:
WPF BitmapImage can`t be serialized/added into a Resource file
QUESTION:
why can I not add a wpfImage of type BitmapImage/BitmapSource/ImageSource to a Resource file. Yes its not serializeable... So how can I workaround this? I need to put my bitmapImages in a Resource file with key/value access programatically... | [
"wpf",
"image",
"file",
"resources",
"addition"
] | 1 | 1 | 373 | 1 | 0 | 2011-06-06T22:00:48.577000 | 2011-06-06T23:37:46.860000 |
6,258,527 | 6,259,182 | MVC3 App Restarting Every Pageload | I'm making a MVC 3 app running on IIS 7.5 that uses EntityFramework to access a large database. The framework my company requires for accessing the database initializes connections and sets some thread context and security checks - a process that takes about 30 seconds. This should only run once when the app starts, bu... | You can get a reason for restart in Application_End with this code: HttpRuntime runtime = (HttpRuntime)typeof(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.GetField, null, null, null);
string shutDownMessage = "";
if (runtime!= null) { shutDownMessage ... | MVC3 App Restarting Every Pageload I'm making a MVC 3 app running on IIS 7.5 that uses EntityFramework to access a large database. The framework my company requires for accessing the database initializes connections and sets some thread context and security checks - a process that takes about 30 seconds. This should on... | TITLE:
MVC3 App Restarting Every Pageload
QUESTION:
I'm making a MVC 3 app running on IIS 7.5 that uses EntityFramework to access a large database. The framework my company requires for accessing the database initializes connections and sets some thread context and security checks - a process that takes about 30 secon... | [
"model-view-controller",
"iis",
"asp.net-mvc-3",
"iis-7"
] | 0 | 1 | 396 | 1 | 0 | 2011-06-06T22:00:58.007000 | 2011-06-06T23:31:00.130000 |
6,258,531 | 6,260,125 | Python parsing large text files and capturing multi-level data | First let me appologize if my description of this is completely retarded, still learning most of this on-the-fly. I have several large text-files (.txt) (~600,000 lines) of general hospital information, which I'm parsing with python. I have been using default dicts (python2.7) to get counts and sub-counts one level dee... | You can generalise the concept of hierarchic counts to get clearer code that is easier to modify. A basic example of an hierachic counter class is class HierarchicCounter(object): def __init__(self, key, hierarchy): self.key = key self.hierarchy = hierarchy self.counts = defaultdict(int) self.subcounters = defaultdict(... | Python parsing large text files and capturing multi-level data First let me appologize if my description of this is completely retarded, still learning most of this on-the-fly. I have several large text-files (.txt) (~600,000 lines) of general hospital information, which I'm parsing with python. I have been using defau... | TITLE:
Python parsing large text files and capturing multi-level data
QUESTION:
First let me appologize if my description of this is completely retarded, still learning most of this on-the-fly. I have several large text-files (.txt) (~600,000 lines) of general hospital information, which I'm parsing with python. I hav... | [
"python",
"parsing"
] | 2 | 5 | 1,341 | 3 | 0 | 2011-06-06T22:01:11.367000 | 2011-06-07T02:36:50.123000 |
6,258,544 | 6,258,740 | How to implement a CrossProcessCursor compatible generic custom CursorWrapper | I manage to create a working CursorWrapper, but get stuck when I want to use my ContentProvider across processes. These posts even show how to implement the CrossProcessCursor interface, notably the hard and undocumented fillWindow() method: What to do in custom ContentProvider's fillWindow() method? Passing binary blo... | I've implemented it as follows for now, but it does not feel like the right thing to do or robust: /** * Copy data from cursor to CursorWindow * @param position start position of data * @param window */ public void fillWindow(int position, CursorWindow window) { if (position < 0 || position > getCount()) { return; } wi... | How to implement a CrossProcessCursor compatible generic custom CursorWrapper I manage to create a working CursorWrapper, but get stuck when I want to use my ContentProvider across processes. These posts even show how to implement the CrossProcessCursor interface, notably the hard and undocumented fillWindow() method: ... | TITLE:
How to implement a CrossProcessCursor compatible generic custom CursorWrapper
QUESTION:
I manage to create a working CursorWrapper, but get stuck when I want to use my ContentProvider across processes. These posts even show how to implement the CrossProcessCursor interface, notably the hard and undocumented fil... | [
"android",
"cursor",
"wrapper",
"cross-process"
] | 1 | 0 | 1,041 | 1 | 0 | 2011-06-06T22:02:22.970000 | 2011-06-06T22:26:33.763000 |
6,258,550 | 6,260,075 | adding an item in a list widget to another list widget | I try to add an item in a list widget to another list widget when the button is clicked.I connected slot and signal.Then I wrote the code into called move function.My attempt is ui->topListWidget->addItem(ui->bottomListWidget->currentItem()); However it doesn't work. How can I do this or what's the problem of my code? | //move existing item topListWidget->addItem(bottomListWidget->takeItem(bottomListWidget->currentRow())); //add copied item topListWidget->addItem(bottomListWidget->currentItem()->text()); | adding an item in a list widget to another list widget I try to add an item in a list widget to another list widget when the button is clicked.I connected slot and signal.Then I wrote the code into called move function.My attempt is ui->topListWidget->addItem(ui->bottomListWidget->currentItem()); However it doesn't wor... | TITLE:
adding an item in a list widget to another list widget
QUESTION:
I try to add an item in a list widget to another list widget when the button is clicked.I connected slot and signal.Then I wrote the code into called move function.My attempt is ui->topListWidget->addItem(ui->bottomListWidget->currentItem()); Howe... | [
"qt",
"qt4"
] | 1 | 2 | 1,796 | 2 | 0 | 2011-06-06T22:03:01.563000 | 2011-06-07T02:27:12.797000 |
6,258,557 | 6,258,579 | How do I pass in event in javascript? | The javascript code is like below. var ADDRESS = { checkit: function(element){ if(event.target.className == "delete"){ doSomethingweird(); } else { doSomething(); } } and the calling function looks something like below. del Apparently, only input 'this' gets passed in, but I want to also pass in the event such that I c... | Your HTML should be del Now the event element is also being passed to your event handler. Warning This is old style event handling, most people nowadays use non-obtrusive event handling which decouples your JS and your HTML. | How do I pass in event in javascript? The javascript code is like below. var ADDRESS = { checkit: function(element){ if(event.target.className == "delete"){ doSomethingweird(); } else { doSomething(); } } and the calling function looks something like below. del Apparently, only input 'this' gets passed in, but I want t... | TITLE:
How do I pass in event in javascript?
QUESTION:
The javascript code is like below. var ADDRESS = { checkit: function(element){ if(event.target.className == "delete"){ doSomethingweird(); } else { doSomething(); } } and the calling function looks something like below. del Apparently, only input 'this' gets passe... | [
"javascript",
"jquery"
] | 0 | 4 | 169 | 3 | 0 | 2011-06-06T22:04:04.837000 | 2011-06-06T22:06:58.733000 |
6,258,562 | 6,259,615 | sqlalchemy bind values | I want to get the value of a parameter in a sqlalchemy query object dynamically: q = session.query(Model).filter(Model.foo = 6) I now want to be able to retrieve the value 6 from q assert(q.magic == 6) Attempts: print(q._criterion) # -> models.foo =:foo_1 But where is the value of foo_1? | SQLAlchemy generates a tree structure from your filter predicates, appending each leaf on as appropriate and putting the result in Query._criterion. You can explore this with the get_children() method of various ClauseElement and ColumnElement classes. For Model.foo == 6 you'll end up with something like this: Model.fo... | sqlalchemy bind values I want to get the value of a parameter in a sqlalchemy query object dynamically: q = session.query(Model).filter(Model.foo = 6) I now want to be able to retrieve the value 6 from q assert(q.magic == 6) Attempts: print(q._criterion) # -> models.foo =:foo_1 But where is the value of foo_1? | TITLE:
sqlalchemy bind values
QUESTION:
I want to get the value of a parameter in a sqlalchemy query object dynamically: q = session.query(Model).filter(Model.foo = 6) I now want to be able to retrieve the value 6 from q assert(q.magic == 6) Attempts: print(q._criterion) # -> models.foo =:foo_1 But where is the value ... | [
"python",
"sqlalchemy"
] | 2 | 14 | 1,592 | 1 | 0 | 2011-06-06T22:04:26.117000 | 2011-06-07T00:47:26.440000 |
6,258,572 | 6,258,599 | Checking if string is like another in Rails | In rails is there a way of doing something like the following... if @var == "string%" The % meaning that there can be anything at the end of the string but as long as it starts with "string" it will return true. Any help is much appreciated. | There is String#start_with? http://rubydoc.info/docs/ruby-core/1.9.2/String#start_with%3F-instance_method | Checking if string is like another in Rails In rails is there a way of doing something like the following... if @var == "string%" The % meaning that there can be anything at the end of the string but as long as it starts with "string" it will return true. Any help is much appreciated. | TITLE:
Checking if string is like another in Rails
QUESTION:
In rails is there a way of doing something like the following... if @var == "string%" The % meaning that there can be anything at the end of the string but as long as it starts with "string" it will return true. Any help is much appreciated.
ANSWER:
There i... | [
"ruby-on-rails",
"ruby",
"regex"
] | 1 | 7 | 13,513 | 8 | 0 | 2011-06-06T22:05:44.150000 | 2011-06-06T22:08:26.810000 |
6,258,574 | 6,258,583 | How can I pass "this" into setTimeout callback? | fiddle code: click this seems to refer to the window rather than the button. How can I pass the button object in so that I can re-enable it? I'm aware of workarounds... I could give the button an ID and then grab it again, but I'm interested to know if I can somehow pass this in. | this is a defined by how a function is called. foo.someFunc(); /* this is foo */ foo.bar.someFunc(); /* this is bar */ window.someFunc(); /* this is window */ someFunc(); /* this is window because window is the default */ setTimeout(foo.bar.someFunc, 500); /* this is window because you've passed a function and disassoc... | How can I pass "this" into setTimeout callback? fiddle code: click this seems to refer to the window rather than the button. How can I pass the button object in so that I can re-enable it? I'm aware of workarounds... I could give the button an ID and then grab it again, but I'm interested to know if I can somehow pass ... | TITLE:
How can I pass "this" into setTimeout callback?
QUESTION:
fiddle code: click this seems to refer to the window rather than the button. How can I pass the button object in so that I can re-enable it? I'm aware of workarounds... I could give the button an ID and then grab it again, but I'm interested to know if I... | [
"javascript"
] | 2 | 4 | 641 | 3 | 0 | 2011-06-06T22:06:06.563000 | 2011-06-06T22:07:20.487000 |
6,258,580 | 6,258,624 | How to decode JSON object and iterate over it? | In this post I learned how to encode an object on the server side, and now I would like to decode it on the client side. On the client side I do $.ajax({ type: "GET", url: "/cgi-bin/ajax_sort.pl", contentType: "application/json; charset=utf-8", dataType: "json",
data: { "column": this.id },
error: function(XMLHttpReq... | Because you specified the dataType: 'json', result should already contain the Javascript object unserialized from the HTTP response. $.parseJSON should be unnecessary. You can loop through it with $.each: success: function(result){ if (result.error) { showError(result.error); } else { $.each(result, function(key, value... | How to decode JSON object and iterate over it? In this post I learned how to encode an object on the server side, and now I would like to decode it on the client side. On the client side I do $.ajax({ type: "GET", url: "/cgi-bin/ajax_sort.pl", contentType: "application/json; charset=utf-8", dataType: "json",
data: { "... | TITLE:
How to decode JSON object and iterate over it?
QUESTION:
In this post I learned how to encode an object on the server side, and now I would like to decode it on the client side. On the client side I do $.ajax({ type: "GET", url: "/cgi-bin/ajax_sort.pl", contentType: "application/json; charset=utf-8", dataType: ... | [
"javascript",
"jquery",
"ajax",
"json"
] | 4 | 5 | 2,624 | 4 | 0 | 2011-06-06T22:06:58.840000 | 2011-06-06T22:11:19.823000 |
6,258,585 | 6,258,644 | SQL Server query select 1 from each sub-group | I have a set of data and need to pull out one record for each CON / OWNER / METHOD / MATRIX set. If there is a non-null RESULT, I want that one. Otherwise, I want the one with the highest COUNT. How do I query this? CON OWNER METHOD MATRIX RESULT COUNT *CON_1 OWNER_1 METHOD_A SOLID NULL 503 CON_1 OWNER_1 METHOD_A SOLID... | Try this, not 100% sure the syntax is right, but it is close. select * from (select CON, OWNER, METHOD, MATRIX, RESULT, COUNT, RANK() OVER(PARTITION BY CON, OWNER, METHOD,MATRIX ORDER BY RESULT,COUNT DESC) as rnk FROM #TempTable ) a WHERE rnk = 1 | SQL Server query select 1 from each sub-group I have a set of data and need to pull out one record for each CON / OWNER / METHOD / MATRIX set. If there is a non-null RESULT, I want that one. Otherwise, I want the one with the highest COUNT. How do I query this? CON OWNER METHOD MATRIX RESULT COUNT *CON_1 OWNER_1 METHOD... | TITLE:
SQL Server query select 1 from each sub-group
QUESTION:
I have a set of data and need to pull out one record for each CON / OWNER / METHOD / MATRIX set. If there is a non-null RESULT, I want that one. Otherwise, I want the one with the highest COUNT. How do I query this? CON OWNER METHOD MATRIX RESULT COUNT *CO... | [
"sql-server",
"t-sql",
"sql-server-2008"
] | 5 | 11 | 11,162 | 3 | 0 | 2011-06-06T22:07:29.540000 | 2011-06-06T22:14:14.470000 |
6,258,592 | 6,258,658 | .fadeIn() Black Outline IE6, 7, 8 | So i have a DIV with some text in and for some reason with a fadeIn call IE renders a black outline around the text Here is a screenshot and a link to a fiddle for an example; http://jsfiddle.net/JNaEV/! Black IE Border Image Example | IE disables font antialiasing while it does opacity animations... Font-family renders poorly in Explorer with jQuery animation I fixed mine by placing everything inside a container DIV and applying the jQuery fades & animations to the container instead of the text element itself. | .fadeIn() Black Outline IE6, 7, 8 So i have a DIV with some text in and for some reason with a fadeIn call IE renders a black outline around the text Here is a screenshot and a link to a fiddle for an example; http://jsfiddle.net/JNaEV/! Black IE Border Image Example | TITLE:
.fadeIn() Black Outline IE6, 7, 8
QUESTION:
So i have a DIV with some text in and for some reason with a fadeIn call IE renders a black outline around the text Here is a screenshot and a link to a fiddle for an example; http://jsfiddle.net/JNaEV/! Black IE Border Image Example
ANSWER:
IE disables font antialia... | [
"jquery",
"internet-explorer"
] | 0 | 0 | 484 | 1 | 0 | 2011-06-06T22:08:05.070000 | 2011-06-06T22:16:11.320000 |
6,258,609 | 6,258,646 | Haskell - What makes 'main' unique? | With this code: main:: FilePath -> FilePath -> IO () main wrPath rdPath = do x <- readFile rdPath writeFile wrPath x I got the following error: Couldn't match expected type 'IO t0' with actual type 'FilePath -> FilePath -> IO() But the file compiles correctly when I change the name of 'main' to something else. What's s... | Because the language spec says so. A Haskell program is a collection of modules, one of which, by convention, must be called Main and must export the value main. The value of the program is the value of the identifier main in module Main, which must be a computation of type IO t for some type t (see Chapter 7). When th... | Haskell - What makes 'main' unique? With this code: main:: FilePath -> FilePath -> IO () main wrPath rdPath = do x <- readFile rdPath writeFile wrPath x I got the following error: Couldn't match expected type 'IO t0' with actual type 'FilePath -> FilePath -> IO() But the file compiles correctly when I change the name o... | TITLE:
Haskell - What makes 'main' unique?
QUESTION:
With this code: main:: FilePath -> FilePath -> IO () main wrPath rdPath = do x <- readFile rdPath writeFile wrPath x I got the following error: Couldn't match expected type 'IO t0' with actual type 'FilePath -> FilePath -> IO() But the file compiles correctly when I... | [
"haskell",
"types",
"io",
"compiler-errors",
"program-entry-point"
] | 7 | 22 | 1,475 | 6 | 0 | 2011-06-06T22:09:18.093000 | 2011-06-06T22:14:24.053000 |
6,258,626 | 6,258,647 | Accessing information outside an HTML form | At the beginning of my PHP page I have a form with a save (submit) button. Below I draw a list of items which are from the db. I now want the user to be able to tick the items he wants to select. My problem: All the information is outside my form. How can I access the generated information? PHP function below: drawArti... | You MUST insert all form elements in tag if you want them to be automatically included in POST request. Otherwise, you'll need to manually code JavaScript onSubmit() handler to include values of those DOM nodes to the form request. You can surround whole page with elements, if that matters. | Accessing information outside an HTML form At the beginning of my PHP page I have a form with a save (submit) button. Below I draw a list of items which are from the db. I now want the user to be able to tick the items he wants to select. My problem: All the information is outside my form. How can I access the generate... | TITLE:
Accessing information outside an HTML form
QUESTION:
At the beginning of my PHP page I have a form with a save (submit) button. Below I draw a list of items which are from the db. I now want the user to be able to tick the items he wants to select. My problem: All the information is outside my form. How can I a... | [
"php",
"html",
"forms"
] | 0 | 2 | 155 | 4 | 0 | 2011-06-06T22:11:31.693000 | 2011-06-06T22:14:45.487000 |
6,258,632 | 6,258,824 | UnicodeWarning when comparing unicode strings to unicode results from os.walk command | Using python 2.7 I'm doing an os.walk with these files http://www.2shared.com/file/biSx7NI-/comer.html and then comparing the result against an array. In the actual program this array won't be predefined. The code that I am trying to use is as follows # -*- coding: utf-8 -*- import os.path group = ['comer.txt', 'coma.t... | Have you tried (note the 'u' before the string, which turns it to Unicode): for(path, dirs, files) in os.walk(u"C:/corpus/zz-auto generated/spanish/comer"): (note that having back-slashes in a string is not a good idea, Unicode or not). | UnicodeWarning when comparing unicode strings to unicode results from os.walk command Using python 2.7 I'm doing an os.walk with these files http://www.2shared.com/file/biSx7NI-/comer.html and then comparing the result against an array. In the actual program this array won't be predefined. The code that I am trying to ... | TITLE:
UnicodeWarning when comparing unicode strings to unicode results from os.walk command
QUESTION:
Using python 2.7 I'm doing an os.walk with these files http://www.2shared.com/file/biSx7NI-/comer.html and then comparing the result against an array. In the actual program this array won't be predefined. The code th... | [
"python",
"unicode",
"utf-8",
"python-2.7",
"os.walk"
] | 0 | 1 | 1,586 | 1 | 0 | 2011-06-06T22:12:11.040000 | 2011-06-06T22:39:52.933000 |
6,258,635 | 6,258,657 | CodeIgniter controller not interpreting hyphen correctly in function call | I'm having an odd problem. My controller is trying to call uri segments and is not interpreting the hyphen correctly. I don't get any error. Just the rest of the page beyond the call doesn't render. This is for a CMS and I have created an edit_market function in my markets controller. I want to be able to call the page... | There is absolutely nothing wrong with using the controller name: not sure where it came about that it is a bad practice. | CodeIgniter controller not interpreting hyphen correctly in function call I'm having an odd problem. My controller is trying to call uri segments and is not interpreting the hyphen correctly. I don't get any error. Just the rest of the page beyond the call doesn't render. This is for a CMS and I have created an edit_ma... | TITLE:
CodeIgniter controller not interpreting hyphen correctly in function call
QUESTION:
I'm having an odd problem. My controller is trying to call uri segments and is not interpreting the hyphen correctly. I don't get any error. Just the rest of the page beyond the call doesn't render. This is for a CMS and I have ... | [
"codeigniter",
"codeigniter-url",
"codeigniter-2"
] | 0 | 1 | 345 | 1 | 0 | 2011-06-06T22:12:25.550000 | 2011-06-06T22:16:10.683000 |
6,258,636 | 6,258,707 | 3D Box Circle intersection | I've got a circle defined by a center (x,y,z), a radius and an orientation vector that specifies which way the circle is facing. I need to test whether such a circle intersects with an axis-aligned bounding box. To clarify, by intersects, I mean if any points within the area described by the circle are within the bound... | Your circle center point and your vector define a plane; intersect your plane with your box (specifically 6 planes that make up your box); that will give you a set of line segments. Using the point-line nearest point algorithm, determine the nearest point on each line segments to your center point; if the square of the... | 3D Box Circle intersection I've got a circle defined by a center (x,y,z), a radius and an orientation vector that specifies which way the circle is facing. I need to test whether such a circle intersects with an axis-aligned bounding box. To clarify, by intersects, I mean if any points within the area described by the ... | TITLE:
3D Box Circle intersection
QUESTION:
I've got a circle defined by a center (x,y,z), a radius and an orientation vector that specifies which way the circle is facing. I need to test whether such a circle intersects with an axis-aligned bounding box. To clarify, by intersects, I mean if any points within the area... | [
"3d",
"intersection"
] | 4 | 1 | 935 | 1 | 0 | 2011-06-06T22:12:37.740000 | 2011-06-06T22:20:48.830000 |
6,258,643 | 6,258,709 | sed wildcard substitution | I want to do a substitution based on a wildcard. For example, change all "tenure" to "disposition" only if the word "tenure" comes after an '=' sign. Basically a regex that would match this =.*tenure The sed command that I have so for this is: sed 's/=.*tenure/=.*disposition/g' file.txt However, if I pass this to a fil... | You need to use a capturing group to capture the text that appears between your equals sign and "tenure". So sed 's/=\(.*\)tenure/=\1disposition/g' Note the use of \1 to reference and use the group you captured. So in echo 'blah blah blah = change "tenure" to "disposition"' | sed 's/=\(.*\)tenure/=\1disposition/g' we g... | sed wildcard substitution I want to do a substitution based on a wildcard. For example, change all "tenure" to "disposition" only if the word "tenure" comes after an '=' sign. Basically a regex that would match this =.*tenure The sed command that I have so for this is: sed 's/=.*tenure/=.*disposition/g' file.txt Howeve... | TITLE:
sed wildcard substitution
QUESTION:
I want to do a substitution based on a wildcard. For example, change all "tenure" to "disposition" only if the word "tenure" comes after an '=' sign. Basically a regex that would match this =.*tenure The sed command that I have so for this is: sed 's/=.*tenure/=.*disposition/... | [
"regex",
"sed",
"grep",
"wildcard",
"string-substitution"
] | 6 | 10 | 22,702 | 4 | 0 | 2011-06-06T22:14:12.883000 | 2011-06-06T22:21:22.600000 |
6,258,654 | 6,258,702 | Is a pointer to a null pointer defined in ANSI C? | Is this code (simplified from a real project) correct? Will the message always print? char *cp = NULL; char **cpp = &cp if(*cpp == NULL) { printf("I believe this will this always print. Does it?\n"); } Thanks! | Yes, it will always print. You can safely assume that your base stack pointer never points to 0x0, so &cp will always not equal NULL. In fact the compiler will eliminate the check at compile time, because it knows &cp!= NULL. See for yourself: Compiled with -O1: $ objdump -dC a.out a.out: file format elf64-x86-64... 00... | Is a pointer to a null pointer defined in ANSI C? Is this code (simplified from a real project) correct? Will the message always print? char *cp = NULL; char **cpp = &cp if(*cpp == NULL) { printf("I believe this will this always print. Does it?\n"); } Thanks! | TITLE:
Is a pointer to a null pointer defined in ANSI C?
QUESTION:
Is this code (simplified from a real project) correct? Will the message always print? char *cp = NULL; char **cpp = &cp if(*cpp == NULL) { printf("I believe this will this always print. Does it?\n"); } Thanks!
ANSWER:
Yes, it will always print. You ca... | [
"c",
"pointers",
"null"
] | 1 | 4 | 2,826 | 3 | 0 | 2011-06-06T22:15:56.867000 | 2011-06-06T22:19:59.410000 |
6,258,655 | 6,258,677 | Compare values from 2 arrays | I'm not sure which php function to use for this.. How can I check if one array has the values available in another array? Fro example, I have a text input where CSV are submitted --- $str = "green, yellow, blue" I use str_getcsv() to create an array of the string. Then I want to compare array 1 to array 2 seen below $a... | Look into PHP's array_diff( ) function here: http://php.net/manual/en/function.array-diff.php | Compare values from 2 arrays I'm not sure which php function to use for this.. How can I check if one array has the values available in another array? Fro example, I have a text input where CSV are submitted --- $str = "green, yellow, blue" I use str_getcsv() to create an array of the string. Then I want to compare arr... | TITLE:
Compare values from 2 arrays
QUESTION:
I'm not sure which php function to use for this.. How can I check if one array has the values available in another array? Fro example, I have a text input where CSV are submitted --- $str = "green, yellow, blue" I use str_getcsv() to create an array of the string. Then I w... | [
"php",
"arrays"
] | 1 | 4 | 197 | 2 | 0 | 2011-06-06T22:16:01.063000 | 2011-06-06T22:17:43.677000 |
6,258,666 | 6,258,835 | Alert/Warning E-mail Notifications should be sent from inside the application or through a log analyzer? | Which is "better": Build e-mail notifications for important events (critical problems and stuff) into my application (a socket server). Build/use a log analyzer to look into each line of the application log checking for some conditions and firing up a script to send emails. If the second is "better", which tools can I ... | I would just use log4net, which includes an SmtpAppender. It comes with many different appenders so you can very easily configure it to ie. dump all info messages to file, warnings and errors to database and send an email notification for errors only. You can change the configuration without any changes to the source c... | Alert/Warning E-mail Notifications should be sent from inside the application or through a log analyzer? Which is "better": Build e-mail notifications for important events (critical problems and stuff) into my application (a socket server). Build/use a log analyzer to look into each line of the application log checking... | TITLE:
Alert/Warning E-mail Notifications should be sent from inside the application or through a log analyzer?
QUESTION:
Which is "better": Build e-mail notifications for important events (critical problems and stuff) into my application (a socket server). Build/use a log analyzer to look into each line of the applic... | [
"email",
"logging",
"system",
"monitoring"
] | 2 | 1 | 561 | 2 | 0 | 2011-06-06T22:16:40.640000 | 2011-06-06T22:41:14.057000 |
6,258,668 | 6,258,756 | how can i easily format this .xml into every node being under one tag? | http://www.teamliquid.net/video/streams/Competo Competo 434 http://www.teamliquid.net/video/streams/Rmdx Rmdx 66 i wish to get all nodes under one tag.. not sure how i would go about it. | Well the easiest way is to edit the xml file. Add a at the beginning of the file and at the end. A more general method has been described by Marrow at http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/df9b1f1091aeabf0/e7f384763756affb?q=XML+staticinc+appending&pli=1 The idea here is that we ... | how can i easily format this .xml into every node being under one tag? http://www.teamliquid.net/video/streams/Competo Competo 434 http://www.teamliquid.net/video/streams/Rmdx Rmdx 66 i wish to get all nodes under one tag.. not sure how i would go about it. | TITLE:
how can i easily format this .xml into every node being under one tag?
QUESTION:
http://www.teamliquid.net/video/streams/Competo Competo 434 http://www.teamliquid.net/video/streams/Rmdx Rmdx 66 i wish to get all nodes under one tag.. not sure how i would go about it.
ANSWER:
Well the easiest way is to edit the... | [
"xml"
] | 0 | 0 | 68 | 1 | 0 | 2011-06-06T22:16:52.343000 | 2011-06-06T22:29:03.640000 |
6,258,682 | 6,258,772 | Is the M in MVC different than in MVVM? | First, I'd like to apologize for adding to the myriad of questions on this topic. I understand the basic difference between MVVM and MVC. What I don't understand is the exact definition for the M. In my understanding of MVC (which is consistent with what's out on wikipedia), the Model encapsulates the state (and possib... | They are the same; the M refers to the domain classes, and also the service layer (if you have one) encapsulating the business logic. The general principle is this: you want a fat model, a view that is as thin as possible, and a controller or viewmodel that is also thin, but fat enough to make the view as thin as possi... | Is the M in MVC different than in MVVM? First, I'd like to apologize for adding to the myriad of questions on this topic. I understand the basic difference between MVVM and MVC. What I don't understand is the exact definition for the M. In my understanding of MVC (which is consistent with what's out on wikipedia), the ... | TITLE:
Is the M in MVC different than in MVVM?
QUESTION:
First, I'd like to apologize for adding to the myriad of questions on this topic. I understand the basic difference between MVVM and MVC. What I don't understand is the exact definition for the M. In my understanding of MVC (which is consistent with what's out o... | [
"model-view-controller",
"mvvm"
] | 6 | 6 | 459 | 3 | 0 | 2011-06-06T22:17:56.610000 | 2011-06-06T22:31:44.477000 |
6,258,690 | 6,258,731 | Is there any way to change the color of text "halfway" through a character on a webpage? | One thing I've seen in some Desktop applications is the ability to change the color of text as the background changes -- to effectively have multiple colors on a single character. I've seen this most commonly with progress bars that display the percentage inside the bar. Generally a darker background color will be used... | I'll get you started: Create two equally sized "progress bars" ( div s). Set their size to the full width they would be if they were at 100%. Set one bar to black text with a white background and the other to yellow text with a blue background, as per your example above. Set the yellow/blue bar in a parent div and incr... | Is there any way to change the color of text "halfway" through a character on a webpage? One thing I've seen in some Desktop applications is the ability to change the color of text as the background changes -- to effectively have multiple colors on a single character. I've seen this most commonly with progress bars tha... | TITLE:
Is there any way to change the color of text "halfway" through a character on a webpage?
QUESTION:
One thing I've seen in some Desktop applications is the ability to change the color of text as the background changes -- to effectively have multiple colors on a single character. I've seen this most commonly with... | [
"html",
"css",
"colors",
"progress-bar"
] | 43 | 17 | 6,550 | 3 | 0 | 2011-06-06T22:18:50.160000 | 2011-06-06T22:24:50.693000 |
6,258,694 | 6,258,960 | Exception while using jsf + Tomahawk PWC 1231 why? | ApplicationDispatcher[/myapp] PWC1231: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: PWC6338: Cannot convert "yearMonthHeader" for the attribute monthYearRowClass of the bean javax.el.ValueExpression: PWC6348: Property editor not registered with the PropertyEditorManagerat org.apa... | Look like that EL environment is screwed up. Get rid of any servletcontainer specific (EL) libraries in webapp's /WEB-INF/lib and restart. | Exception while using jsf + Tomahawk PWC 1231 why? ApplicationDispatcher[/myapp] PWC1231: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: PWC6338: Cannot convert "yearMonthHeader" for the attribute monthYearRowClass of the bean javax.el.ValueExpression: PWC6348: Property editor not ... | TITLE:
Exception while using jsf + Tomahawk PWC 1231 why?
QUESTION:
ApplicationDispatcher[/myapp] PWC1231: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: PWC6338: Cannot convert "yearMonthHeader" for the attribute monthYearRowClass of the bean javax.el.ValueExpression: PWC6348: Pr... | [
"jsp",
"jsf",
"tomahawk"
] | 0 | 0 | 529 | 1 | 0 | 2011-06-06T22:18:59.423000 | 2011-06-06T23:00:16.990000 |
6,258,715 | 6,258,735 | MySQL conditional select statement? | Okay, so I have a client who wants to output all information for a bunch of students in a system. This output is to be imported into Excel to be manipulated. So, my problem is that I would like to output all students' information from 4 tables auditions scheduled auditions profiles audition times So, the auditions tabl... | You want to perform an outer join; an outer join returns results even when the joined records are null. Specifically, specifying a LEFT OUTER JOIN in your case on the auditions tables will force all the students' records to be returned, even the ones without auditions. | MySQL conditional select statement? Okay, so I have a client who wants to output all information for a bunch of students in a system. This output is to be imported into Excel to be manipulated. So, my problem is that I would like to output all students' information from 4 tables auditions scheduled auditions profiles a... | TITLE:
MySQL conditional select statement?
QUESTION:
Okay, so I have a client who wants to output all information for a bunch of students in a system. This output is to be imported into Excel to be manipulated. So, my problem is that I would like to output all students' information from 4 tables auditions scheduled au... | [
"mysql"
] | 1 | 2 | 782 | 4 | 0 | 2011-06-06T22:22:54.830000 | 2011-06-06T22:25:12.387000 |
6,258,717 | 6,258,795 | myslqimport --use-threads | I have a large database I'm copying to a slave server. Trying to import it (about 15GB) via a regular mysqldump took 2 days and failed. So I'm trying the mysqldump --tab trick. I also want to import using --use-threads - but it doesn't seem to be doing multiple tables at once. Is there any way to tell if it's even work... | Are you using MySQL 5.1.7 or later? If you want to test whether things are actually going through as expected, why not use a test schema and only a sample of data so that it runs faster? Update With regards to whether --use-threads is working, I'm not sure of a way to definitively check. However, I can't see any real d... | myslqimport --use-threads I have a large database I'm copying to a slave server. Trying to import it (about 15GB) via a regular mysqldump took 2 days and failed. So I'm trying the mysqldump --tab trick. I also want to import using --use-threads - but it doesn't seem to be doing multiple tables at once. Is there any way... | TITLE:
myslqimport --use-threads
QUESTION:
I have a large database I'm copying to a slave server. Trying to import it (about 15GB) via a regular mysqldump took 2 days and failed. So I'm trying the mysqldump --tab trick. I also want to import using --use-threads - but it doesn't seem to be doing multiple tables at once... | [
"mysql"
] | 7 | 3 | 16,498 | 5 | 0 | 2011-06-06T22:23:03.700000 | 2011-06-06T22:36:03.740000 |
6,258,720 | 6,258,797 | DataTable - Select only find row where value is less than 10? | I'm having a really hard time trying to figure out what's going on with the Select method of DataTable. Here's the data that I got back in a DataTable, called VotePeriods: PeriodID Description 11 Test 11 10 Test 10 9 Test 9...... 1 Test1 Here's the code to select the period based on PeriodID: if (VotePeriods.Rows.Count... | Hope below will work. Keep in mind to add single quotation for values always when using the select method with DataTable. if (VotePeriods.Rows.Count > 0) { DataRow[] vp = VotePeriods.Select("PeriodID = '" + voteperiod +"'");
if (vp.Length > 0) { return vp[0]; } } | DataTable - Select only find row where value is less than 10? I'm having a really hard time trying to figure out what's going on with the Select method of DataTable. Here's the data that I got back in a DataTable, called VotePeriods: PeriodID Description 11 Test 11 10 Test 10 9 Test 9...... 1 Test1 Here's the code to s... | TITLE:
DataTable - Select only find row where value is less than 10?
QUESTION:
I'm having a really hard time trying to figure out what's going on with the Select method of DataTable. Here's the data that I got back in a DataTable, called VotePeriods: PeriodID Description 11 Test 11 10 Test 10 9 Test 9...... 1 Test1 He... | [
"c#",
".net",
"select",
"datatable",
"row"
] | 0 | 2 | 6,227 | 3 | 0 | 2011-06-06T22:23:24.450000 | 2011-06-06T22:36:33.450000 |
6,258,727 | 6,260,358 | accessing User object in route | I have the following route: work: class: acWorkObjectRouteCollection options: prefix_path: /work module: work model: Work type: object column: workname model_methods: object: findBySlug As you can see, this route pulls a Work object from the db by the findBySlug method and the slug column is workname. It all works fine... | Although it's generally bad practice, I believe this is one of the rare cases when sfContext::getInstance() cannot be avoided. Use sfContext::getInstance()->getUser() in your findBySlug method. Before using it please read Why sfContext::getInstance() Is Bad so you're aware of it's problems. | accessing User object in route I have the following route: work: class: acWorkObjectRouteCollection options: prefix_path: /work module: work model: Work type: object column: workname model_methods: object: findBySlug As you can see, this route pulls a Work object from the db by the findBySlug method and the slug column... | TITLE:
accessing User object in route
QUESTION:
I have the following route: work: class: acWorkObjectRouteCollection options: prefix_path: /work module: work model: Work type: object column: workname model_methods: object: findBySlug As you can see, this route pulls a Work object from the db by the findBySlug method a... | [
"php",
"symfony1"
] | 0 | 0 | 75 | 2 | 0 | 2011-06-06T22:24:06.173000 | 2011-06-07T03:37:15.300000 |
6,258,739 | 6,258,752 | how can i extend $.browser | I want to write some jquery that will extend $.browser with some of my own properties. So it I can currently access $.browser.msie, how could I extend it to include $.browser.isPngSupported etc? | You can just set $.browser.isPngSupported to true or false. However, you should be extending $.support, not $.browser. | how can i extend $.browser I want to write some jquery that will extend $.browser with some of my own properties. So it I can currently access $.browser.msie, how could I extend it to include $.browser.isPngSupported etc? | TITLE:
how can i extend $.browser
QUESTION:
I want to write some jquery that will extend $.browser with some of my own properties. So it I can currently access $.browser.msie, how could I extend it to include $.browser.isPngSupported etc?
ANSWER:
You can just set $.browser.isPngSupported to true or false. However, yo... | [
"javascript",
"jquery",
"jquery-plugins"
] | 0 | 2 | 163 | 2 | 0 | 2011-06-06T22:26:02.713000 | 2011-06-06T22:28:02.440000 |
6,258,741 | 6,259,008 | ASP.net MVC Linq-to-SQL Insertion Problems | TLDR Summary I'm having a few issues with ASP.net MVC's InsertOnSubmit() function. How do you build and insert new objects into the database without running into key constraints? Steps to Reproduce I've gone ahead and created a simple demonstration of the 3-or-so major problems I've been having and maybe someone can he... | Can you confirm the set up of your experimentId column in SQL Server - I believe this should be set up as: [experimentId] [int] IDENTITY(1,1) NOT NULL I was able to reproduce your error when I removed the IDENTITY in LINQ to SQL, the properties for the column should have Int NOT NULL IDENTITY in the "Server Data Type" ... | ASP.net MVC Linq-to-SQL Insertion Problems TLDR Summary I'm having a few issues with ASP.net MVC's InsertOnSubmit() function. How do you build and insert new objects into the database without running into key constraints? Steps to Reproduce I've gone ahead and created a simple demonstration of the 3-or-so major problem... | TITLE:
ASP.net MVC Linq-to-SQL Insertion Problems
QUESTION:
TLDR Summary I'm having a few issues with ASP.net MVC's InsertOnSubmit() function. How do you build and insert new objects into the database without running into key constraints? Steps to Reproduce I've gone ahead and created a simple demonstration of the 3-o... | [
"c#",
"asp.net-mvc",
"linq-to-sql",
"insertonsubmit"
] | 1 | 2 | 1,872 | 3 | 0 | 2011-06-06T22:26:38.697000 | 2011-06-06T23:06:57.403000 |
6,258,750 | 6,258,779 | Combining multiple MySQL queries into one | I am trying to write a query where I can get a count on distinct user_id's in a transactions table of a database every 3 months. I can achieve the result manually if I do the following SELECT COUNT(DISTINCT(user_id)) FROM transactions WHERE DATE(created_at) BETWEEN "2011-01-01" AND "2011-03-31". But if I want to run th... | SELECT COUNT(DISTINCT user_id),YEAR(created_at), QUARTER(created_at) FROM transactions GROUP BY YEAR(created_at), QUARTER(created_at) | Combining multiple MySQL queries into one I am trying to write a query where I can get a count on distinct user_id's in a transactions table of a database every 3 months. I can achieve the result manually if I do the following SELECT COUNT(DISTINCT(user_id)) FROM transactions WHERE DATE(created_at) BETWEEN "2011-01-01"... | TITLE:
Combining multiple MySQL queries into one
QUESTION:
I am trying to write a query where I can get a count on distinct user_id's in a transactions table of a database every 3 months. I can achieve the result manually if I do the following SELECT COUNT(DISTINCT(user_id)) FROM transactions WHERE DATE(created_at) BE... | [
"mysql"
] | 1 | 5 | 131 | 3 | 0 | 2011-06-06T22:27:43.480000 | 2011-06-06T22:33:42.927000 |
6,258,757 | 6,258,844 | Flex 4 transparent background problem? | I have found several solutions for this,but non of those solutions work for me.Can someone help me with this please. here is my code: And I have setup in js to this params.wmode = "transparent"; and in object Does anybode have a solution that work? Tnx in advance. | 'Backgroundalpha' won't work. You'll need to create a custom transparent application skin class. Something like this: [HostComponent("spark.components.Application")] and assign it to your Application: I've tested this solution on all major browsers. (Yes, that includes Safari) Furthermore, will do you no good. It will ... | Flex 4 transparent background problem? I have found several solutions for this,but non of those solutions work for me.Can someone help me with this please. here is my code: And I have setup in js to this params.wmode = "transparent"; and in object Does anybode have a solution that work? Tnx in advance. | TITLE:
Flex 4 transparent background problem?
QUESTION:
I have found several solutions for this,but non of those solutions work for me.Can someone help me with this please. here is my code: And I have setup in js to this params.wmode = "transparent"; and in object Does anybode have a solution that work? Tnx in advance... | [
"actionscript-3",
"flex4",
"flexbuilder"
] | 2 | 5 | 3,648 | 1 | 0 | 2011-06-06T22:29:09.390000 | 2011-06-06T22:42:34.580000 |
6,258,758 | 6,258,799 | Help re.search python length | Is it possible to read the length of re.search's output? For example: import re
list=['lost','post','cross','help','cost']
for i in range(len(list)): output = re.search('os', list[i]) Can I read output length? | In this case, the output length will be the same as the input length, because you're searching for a specific substring. When you search in 'lost', the length of the match will be 2, because that's what the length of the search parameter is. Now if you want to differentiate between "found" and "not found", remember tha... | Help re.search python length Is it possible to read the length of re.search's output? For example: import re
list=['lost','post','cross','help','cost']
for i in range(len(list)): output = re.search('os', list[i]) Can I read output length? | TITLE:
Help re.search python length
QUESTION:
Is it possible to read the length of re.search's output? For example: import re
list=['lost','post','cross','help','cost']
for i in range(len(list)): output = re.search('os', list[i]) Can I read output length?
ANSWER:
In this case, the output length will be the same as ... | [
"python",
"regex"
] | 1 | 3 | 5,469 | 3 | 0 | 2011-06-06T22:29:17.160000 | 2011-06-06T22:36:56.863000 |
6,258,764 | 6,264,808 | Insert value into unbound column in bound datagridview | I've searched. I really have and I've given up. I have a DataGridView that is bound but it also has several unbound columns. I'm calculating the values in some of these unbound cells through values on the form including other cells that are bound. I can successfully set the value of a cell, however, under no circumstan... | I apparently am required to use the DataGridView's native events to perform such manipulation which I find to be extremely counter-intuitive. I plugged the code into the DataBindingComplete() event and boom, it worked. | Insert value into unbound column in bound datagridview I've searched. I really have and I've given up. I have a DataGridView that is bound but it also has several unbound columns. I'm calculating the values in some of these unbound cells through values on the form including other cells that are bound. I can successfull... | TITLE:
Insert value into unbound column in bound datagridview
QUESTION:
I've searched. I really have and I've given up. I have a DataGridView that is bound but it also has several unbound columns. I'm calculating the values in some of these unbound cells through values on the form including other cells that are bound.... | [
"winforms",
"datagridview",
"c#-3.0"
] | 1 | 2 | 2,324 | 1 | 0 | 2011-06-06T22:30:07.570000 | 2011-06-07T11:56:27.510000 |
6,258,771 | 6,259,440 | extract private key bytes in C# | I am currently able to extract a private key from a PFX file using OpenSSL using the following commands: openssl pkcs12 -in filename.pfx -nocerts -out privateKey.pem
openssl.exe rsa -in privateKey.pem -out private.pem The private.pem file begins with ---BEGIN RSA PRIVATE KEY--- and ends with ---END RSA PRIVATE KEY--- ... | This is what worked for me. Should also work for you: using System; using System.IO; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Text; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.OpenSsl; using Org.BouncyCastle.Security;
namespace SO6258771 { class Pr... | extract private key bytes in C# I am currently able to extract a private key from a PFX file using OpenSSL using the following commands: openssl pkcs12 -in filename.pfx -nocerts -out privateKey.pem
openssl.exe rsa -in privateKey.pem -out private.pem The private.pem file begins with ---BEGIN RSA PRIVATE KEY--- and ends... | TITLE:
extract private key bytes in C#
QUESTION:
I am currently able to extract a private key from a PFX file using OpenSSL using the following commands: openssl pkcs12 -in filename.pfx -nocerts -out privateKey.pem
openssl.exe rsa -in privateKey.pem -out private.pem The private.pem file begins with ---BEGIN RSA PRIVA... | [
".net",
"openssl"
] | 6 | 8 | 16,444 | 4 | 0 | 2011-06-06T22:31:11.817000 | 2011-06-07T00:11:41.920000 |
6,258,774 | 6,259,422 | I can't seem to get an implementation of Spring's Lifecycle working | I need something to happen immediately after Spring's application context is loaded. As I understand it, I need to create an implementation of Lifecycle and put a bean reference inside the context. So I have something like this in my context: The class looks something like this: public class MySpringLifecycle implement... | Two ways to do this: Implement SmartLifecycle instead of Lifecycle and make sure to return true from isAutoStartup(). Implement ApplicationListener. In this case there is only one method to implement instead of 6 for SmartLifecycle. | I can't seem to get an implementation of Spring's Lifecycle working I need something to happen immediately after Spring's application context is loaded. As I understand it, I need to create an implementation of Lifecycle and put a bean reference inside the context. So I have something like this in my context: The class... | TITLE:
I can't seem to get an implementation of Spring's Lifecycle working
QUESTION:
I need something to happen immediately after Spring's application context is loaded. As I understand it, I need to create an implementation of Lifecycle and put a bean reference inside the context. So I have something like this in my ... | [
"spring",
"spring-mvc"
] | 14 | 9 | 8,724 | 4 | 0 | 2011-06-06T22:32:12.273000 | 2011-06-07T00:08:24.513000 |
6,258,775 | 6,259,303 | Link error when using source files not on the root project directory (files included in the search paths) (Visual C++) | I've been programing a template structure and after make it work I decided to use it on some other project. The template consists in two files. ListOctree.cpp and ListOctree.h. While they compile and run just fine on their own (I can run the structure self-test). When using them on the other project, both ListOctree.cp... | The declaration and the definition of templates should be kept in the same file (usually the.h). See the FAQ for details (it's also technically possible to instantiate the template in a file that #includes the implementation ( see this also )). The keyword export that was supposed to be used in the case where the two a... | Link error when using source files not on the root project directory (files included in the search paths) (Visual C++) I've been programing a template structure and after make it work I decided to use it on some other project. The template consists in two files. ListOctree.cpp and ListOctree.h. While they compile and r... | TITLE:
Link error when using source files not on the root project directory (files included in the search paths) (Visual C++)
QUESTION:
I've been programing a template structure and after make it work I decided to use it on some other project. The template consists in two files. ListOctree.cpp and ListOctree.h. While ... | [
"c++",
"visual-studio",
"linker",
"extern"
] | 2 | 0 | 315 | 2 | 0 | 2011-06-06T22:32:13.497000 | 2011-06-06T23:49:59.200000 |
6,258,776 | 6,259,409 | Object pooling on Android platform | When I coding a Java Application, should I create my own object pooling to avoid object creation. From the Logcat, I see log message saying GC has kicked in a number of times. Thank you for any suggestion. | In my opinion, I really think it depends on the specifics of your application and the kind of objects you're using. In the section on Designing for Performance one of the 2 basic rules to follow is Don't allocate memory if you can avoid it But it again, I think it depends on what you're trying to do. If you look throug... | Object pooling on Android platform When I coding a Java Application, should I create my own object pooling to avoid object creation. From the Logcat, I see log message saying GC has kicked in a number of times. Thank you for any suggestion. | TITLE:
Object pooling on Android platform
QUESTION:
When I coding a Java Application, should I create my own object pooling to avoid object creation. From the Logcat, I see log message saying GC has kicked in a number of times. Thank you for any suggestion.
ANSWER:
In my opinion, I really think it depends on the spec... | [
"android"
] | 1 | 0 | 783 | 2 | 0 | 2011-06-06T22:32:27.490000 | 2011-06-07T00:05:24.977000 |
6,258,785 | 6,261,450 | Restricting the user to not get a new view on changing the URL id value | I am new to MVC and we are using MVC 3.0 for our project.. We do have a flow like serach_view => results_view => details_view.. we do have a jQgrid in the results view..if the user click on any one of the rows they will get redirected to a details view.. (this has to be done with jqgrid onselected row) now the URL will... | You can't control this. That's what pretty URLs such as controller/detials/1 are used for => so that the user can easily navigate the site by simply modifying the URL. This being said you have the possibility of serving the details view through a controller action decorated with the [HttpPost] attribute forcing POST ve... | Restricting the user to not get a new view on changing the URL id value I am new to MVC and we are using MVC 3.0 for our project.. We do have a flow like serach_view => results_view => details_view.. we do have a jQgrid in the results view..if the user click on any one of the rows they will get redirected to a details ... | TITLE:
Restricting the user to not get a new view on changing the URL id value
QUESTION:
I am new to MVC and we are using MVC 3.0 for our project.. We do have a flow like serach_view => results_view => details_view.. we do have a jQgrid in the results view..if the user click on any one of the rows they will get redire... | [
"model-view-controller",
"asp.net-mvc-3"
] | 0 | 0 | 496 | 2 | 0 | 2011-06-06T22:34:50.987000 | 2011-06-07T06:37:28.457000 |
6,258,786 | 6,258,872 | JSF2.0 - h:dataTable with column containing dropdown - issue with showing/hiding the dropdown per table row | I have a table where one of it's columns contains a dropdown list (HtmlSelectItems component). For any given row in this table, I want to be able to show or hide the dropdown at runtime, based on specific application conditions. My solution in this case was to use the component's pre-render event listener mechanism pro... | You need to let the rendered condition depend on the row itself, not on the parent bean. E.g.... instead of... Or if it needs to be determined by the #{bean} rather than #{item} due to some design restrictions, then there are several ways. If you're using DataModel as datatable's value, then you can get the current row... | JSF2.0 - h:dataTable with column containing dropdown - issue with showing/hiding the dropdown per table row I have a table where one of it's columns contains a dropdown list (HtmlSelectItems component). For any given row in this table, I want to be able to show or hide the dropdown at runtime, based on specific applica... | TITLE:
JSF2.0 - h:dataTable with column containing dropdown - issue with showing/hiding the dropdown per table row
QUESTION:
I have a table where one of it's columns contains a dropdown list (HtmlSelectItems component). For any given row in this table, I want to be able to show or hide the dropdown at runtime, based o... | [
"jsf-2"
] | 2 | 1 | 2,738 | 1 | 0 | 2011-06-06T22:35:00.633000 | 2011-06-06T22:46:00.473000 |
6,258,787 | 6,258,818 | splitting a single value | I have: and when I do: var Y = $('td').data('X'); Z=Y.split(); it works. But if I have: then it doesn't work. At least I think that's what's happening. I'm getting "Y.split is not a function", but only sometimes. | .data() is smart. It tries to use a more appropriate type than string for the value - in your case, it's number. From the docs: Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null) otherwise it is left as a string. To retrieve the value's attribu... | splitting a single value I have: and when I do: var Y = $('td').data('X'); Z=Y.split(); it works. But if I have: then it doesn't work. At least I think that's what's happening. I'm getting "Y.split is not a function", but only sometimes. | TITLE:
splitting a single value
QUESTION:
I have: and when I do: var Y = $('td').data('X'); Z=Y.split(); it works. But if I have: then it doesn't work. At least I think that's what's happening. I'm getting "Y.split is not a function", but only sometimes.
ANSWER:
.data() is smart. It tries to use a more appropriate ty... | [
"javascript"
] | 0 | 1 | 142 | 2 | 0 | 2011-06-06T22:35:01.750000 | 2011-06-06T22:39:27.333000 |
6,258,796 | 6,258,849 | Gson Java reserved keyword | I have some JSON that I am deserializing using Gson. { "resp": { "posts": [ {... "public": true,... }] } My problem is that public is a Java keyword, so how would I make a field in my class that correlates with the public field in the JSON? | You could use a different name for your field, using gson's Field Naming Support. public class Post { @SerializedName("public") private boolean isPublic;... } | Gson Java reserved keyword I have some JSON that I am deserializing using Gson. { "resp": { "posts": [ {... "public": true,... }] } My problem is that public is a Java keyword, so how would I make a field in my class that correlates with the public field in the JSON? | TITLE:
Gson Java reserved keyword
QUESTION:
I have some JSON that I am deserializing using Gson. { "resp": { "posts": [ {... "public": true,... }] } My problem is that public is a Java keyword, so how would I make a field in my class that correlates with the public field in the JSON?
ANSWER:
You could use a different... | [
"java",
"gson",
"keyword"
] | 25 | 50 | 3,792 | 2 | 0 | 2011-06-06T22:36:31.503000 | 2011-06-06T22:42:53.633000 |
6,258,812 | 6,258,888 | Why does this Stream of data end at byte 26? | I'm still working on that bitmap I/O problem from a week ago. I got stuck again, so I decided to start with a type of I/O I was familiar with, and make it more like what I needed steadily (which is checking each byte (pixel) at a time and outputting to a file based on that byte's value). I started out with a program th... | If you look up what ascii code 25 is you'll see it means end of medium so there's a good chance that if you're reading in ascii mode, any subsequent reads aren't going to work. Try specifying that you're using a binary file: sourcefile.open("Input.FILE", ios::binary); | Why does this Stream of data end at byte 26? I'm still working on that bitmap I/O problem from a week ago. I got stuck again, so I decided to start with a type of I/O I was familiar with, and make it more like what I needed steadily (which is checking each byte (pixel) at a time and outputting to a file based on that b... | TITLE:
Why does this Stream of data end at byte 26?
QUESTION:
I'm still working on that bitmap I/O problem from a week ago. I got stuck again, so I decided to start with a type of I/O I was familiar with, and make it more like what I needed steadily (which is checking each byte (pixel) at a time and outputting to a fi... | [
"c++",
"vector",
"fstream"
] | 2 | 6 | 1,070 | 4 | 0 | 2011-06-06T22:38:18.883000 | 2011-06-06T22:48:50.973000 |
6,258,813 | 6,266,037 | how to make python 3.x enter text into a web browser | Say I wanted to load google, then automatically enter text into the search bar and press enter all without user input, how would i do that? Edit: while i do need to point it to a specific URL, i want python to be able to enter text regardless of the URL. That's why i need it to be able to enter text into the search on ... | If I understand properly, you actually want to "control" a specific browser, i.e., open a browser window to a specific URL, rather than having a program parse a web page. In this case, you can take a look at the subprocess module, with wich you can actually run an external program (e.g., "firefox"), and then check the ... | how to make python 3.x enter text into a web browser Say I wanted to load google, then automatically enter text into the search bar and press enter all without user input, how would i do that? Edit: while i do need to point it to a specific URL, i want python to be able to enter text regardless of the URL. That's why i... | TITLE:
how to make python 3.x enter text into a web browser
QUESTION:
Say I wanted to load google, then automatically enter text into the search bar and press enter all without user input, how would i do that? Edit: while i do need to point it to a specific URL, i want python to be able to enter text regardless of the... | [
"python",
"python-3.x"
] | 4 | 3 | 7,737 | 2 | 0 | 2011-06-06T22:38:36.293000 | 2011-06-07T13:37:47.657000 |
6,258,820 | 6,258,919 | Serializing then Deserializing object yielding different results than original object | I'll try and provide what information I can, I'm not entirely sure what would be helpful in understanding this issue. I noticed I was having some odd behavior on code which I thought should be functionally the same. I am pulling data from Session as it is faster than hitting our database every time, but whenever I save... | The problem is that you are using UTF-8 encoding backwards. You are encoding when you think that you are decoding, and decoding when you think that you are encoding. The UTF-8 encoding is not intended to be used to represent any binary data as a string, it's intended to be used to represent a string as binary data. Whe... | Serializing then Deserializing object yielding different results than original object I'll try and provide what information I can, I'm not entirely sure what would be helpful in understanding this issue. I noticed I was having some odd behavior on code which I thought should be functionally the same. I am pulling data ... | TITLE:
Serializing then Deserializing object yielding different results than original object
QUESTION:
I'll try and provide what information I can, I'm not entirely sure what would be helpful in understanding this issue. I noticed I was having some odd behavior on code which I thought should be functionally the same. ... | [
"c#",
"serialization"
] | 2 | 3 | 1,202 | 1 | 0 | 2011-06-06T22:39:37.690000 | 2011-06-06T22:53:33.020000 |
6,258,827 | 6,258,883 | Large integer radix/base conversion from 10^x to 2^x | Preface I'm learning about computer math by writing and refining my own BigInt library. So far my first incarnation stores every digit of a base 10 number in successive elements of a vector. It can multiply and add with arbitrary precision. I want to speed it up by using all of the space available to me in a standard C... | Once you have multiply and add functions working for your bigint library, converting a string to bigint is simplicity itself. Start with a conversion result of zero. For each digit you process (left to right), multiply the previous result by 10 and add the value of the new digit (using your bigint multiply and add func... | Large integer radix/base conversion from 10^x to 2^x Preface I'm learning about computer math by writing and refining my own BigInt library. So far my first incarnation stores every digit of a base 10 number in successive elements of a vector. It can multiply and add with arbitrary precision. I want to speed it up by u... | TITLE:
Large integer radix/base conversion from 10^x to 2^x
QUESTION:
Preface I'm learning about computer math by writing and refining my own BigInt library. So far my first incarnation stores every digit of a base 10 number in successive elements of a vector. It can multiply and add with arbitrary precision. I want t... | [
"algorithm",
"math",
"gmp",
"bigint"
] | 6 | 6 | 3,693 | 3 | 0 | 2011-06-06T22:40:05.423000 | 2011-06-06T22:47:35.153000 |
6,258,834 | 6,258,871 | jQuery UI draggable event timing | I'm using the jQuery UI Draggable interaction on the handle of a 2d slider. I use the Draggable "drag" event to update the position of the slider as it's being dragged. The problem I'm having is that the drag event seems to fire before the element being dragged actually changes position. So, if you use the drag event t... | Look up the position of the handle like this: $('#handle').draggable({ drag: function(event,ui){... ui.position... }) | jQuery UI draggable event timing I'm using the jQuery UI Draggable interaction on the handle of a 2d slider. I use the Draggable "drag" event to update the position of the slider as it's being dragged. The problem I'm having is that the drag event seems to fire before the element being dragged actually changes position... | TITLE:
jQuery UI draggable event timing
QUESTION:
I'm using the jQuery UI Draggable interaction on the handle of a 2d slider. I use the Draggable "drag" event to update the position of the slider as it's being dragged. The problem I'm having is that the drag event seems to fire before the element being dragged actuall... | [
"jquery",
"jquery-ui",
"jquery-ui-draggable"
] | 0 | 1 | 573 | 1 | 0 | 2011-06-06T22:41:11.300000 | 2011-06-06T22:45:55.910000 |
6,258,837 | 6,259,848 | Is this acceptable practice initialize array on the heap? | Is this acceptable code?: unsigned char *buffer= malloc(16 * sizeof(*buffer)); if (buffer == NULL) { errorText.text= @"Insufficient memory."; NSLog(@"%@",@"Insufficient memory."); return; } unsigned char temp[16]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; memcpy(buffer,temp,16); NSData* seed= [NSData dataWithBytesNoCop... | [ edited to remove bogus advice about not using malloc with dataWithBytesNoCopy] Another option would be to just use -dataWithBytes: and let NSData take care of the copying for you: static unsigned char seedBytes[16]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; NSData* seed= [NSData dataWithBytes:seedBytes length:16]; | Is this acceptable practice initialize array on the heap? Is this acceptable code?: unsigned char *buffer= malloc(16 * sizeof(*buffer)); if (buffer == NULL) { errorText.text= @"Insufficient memory."; NSLog(@"%@",@"Insufficient memory."); return; } unsigned char temp[16]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; memcpy... | TITLE:
Is this acceptable practice initialize array on the heap?
QUESTION:
Is this acceptable code?: unsigned char *buffer= malloc(16 * sizeof(*buffer)); if (buffer == NULL) { errorText.text= @"Insufficient memory."; NSLog(@"%@",@"Insufficient memory."); return; } unsigned char temp[16]= {1,2,3,4,5,6,7,8,9,10,11,12,13... | [
"ios"
] | 0 | 0 | 349 | 1 | 0 | 2011-06-06T22:41:30.440000 | 2011-06-07T01:43:06.327000 |
6,258,838 | 6,258,852 | views or controller? symfony mvc | getId()?> getCompany()?> getIsPublic()?> getIsActivated()?> for example would like add class to TR in depending IsPublic(); "> getIsPublic() == 0) { echo "public"; } else {echo "unpublic";})?> gives: or and public or unpublic the instruction IF ELSE can be in VIEW? should be in the controller in correct MVC? | This should be in view, as view decides which markup needs to be returned. Controller is only to provide data necessary to make the decision (and the data that is going to be shown of course, but not name of CSS class in this one). | views or controller? symfony mvc getId()?> getCompany()?> getIsPublic()?> getIsActivated()?> for example would like add class to TR in depending IsPublic(); "> getIsPublic() == 0) { echo "public"; } else {echo "unpublic";})?> gives: or and public or unpublic the instruction IF ELSE can be in VIEW? should be in the cont... | TITLE:
views or controller? symfony mvc
QUESTION:
getId()?> getCompany()?> getIsPublic()?> getIsActivated()?> for example would like add class to TR in depending IsPublic(); "> getIsPublic() == 0) { echo "public"; } else {echo "unpublic";})?> gives: or and public or unpublic the instruction IF ELSE can be in VIEW? sho... | [
"php",
"model-view-controller",
"symfony1",
"symfony-1.4"
] | 0 | 1 | 197 | 1 | 0 | 2011-06-06T22:41:31.613000 | 2011-06-06T22:43:06.113000 |
6,258,850 | 6,261,328 | Turbomail Integration with Pyramid | I am in need of a method to send an email from a Pyramid application. I know of pyramid_mailer, but it seems to have a fairly limited message class. I don't understand if it's possible to write the messages from pyramid_mailer using templates to generate the body of the email. Further, I haven't seen anything regarding... | I can't answer your Turbomail questions other than to say that I've heard it works fine with Pyramid. Regarding pyramid_mailer, it's entirely possible to render your emails using the same subsystem that lets pyramid render all of your templates. from pyramid.renderers import render
opts = {} # a dictionary of globals ... | Turbomail Integration with Pyramid I am in need of a method to send an email from a Pyramid application. I know of pyramid_mailer, but it seems to have a fairly limited message class. I don't understand if it's possible to write the messages from pyramid_mailer using templates to generate the body of the email. Further... | TITLE:
Turbomail Integration with Pyramid
QUESTION:
I am in need of a method to send an email from a Pyramid application. I know of pyramid_mailer, but it seems to have a fairly limited message class. I don't understand if it's possible to write the messages from pyramid_mailer using templates to generate the body of ... | [
"python",
"pylons",
"turbogears",
"pyramid"
] | 5 | 4 | 1,002 | 2 | 0 | 2011-06-06T22:42:55.203000 | 2011-06-07T06:25:06.273000 |
6,258,851 | 6,261,622 | Specifying path in makefile (GNU make on Windows) | I'm using GNU make to build a project using Microsoft Visual C++, and I'd like to be able to run it from any CMD window rather than having to open the preconfigured one where the path (and various other environment variables) are preconfigured by a batch file. Ideally I'd like to define the relevant environment variabl... | This works: DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
export Path:=$(DevEnvDir);$(VCINSTALLDIR);$(Path) It was the need for "export" and for case-sensitivity that had defeated me before. | Specifying path in makefile (GNU make on Windows) I'm using GNU make to build a project using Microsoft Visual C++, and I'd like to be able to run it from any CMD window rather than having to open the preconfigured one where the path (and various other environment variables) are preconfigured by a batch file. Ideally I... | TITLE:
Specifying path in makefile (GNU make on Windows)
QUESTION:
I'm using GNU make to build a project using Microsoft Visual C++, and I'd like to be able to run it from any CMD window rather than having to open the preconfigured one where the path (and various other environment variables) are preconfigured by a bat... | [
"path",
"makefile"
] | 7 | 8 | 19,433 | 1 | 0 | 2011-06-06T22:43:00.937000 | 2011-06-07T06:57:22.157000 |
6,258,855 | 6,258,869 | How do I insert a list of strings (text format) into a container alphabetically? | Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Which container do I use? I need to be able to look up data on both the left hand and right hand side... | A std::vector with a one-off sort at the end may well be more efficient than something like a std::set (which will maintain ordering as you insert). My advice would be to pick the one that best matches the semantics of what you want to do, and then modify it later if you find that it is inefficient. | How do I insert a list of strings (text format) into a container alphabetically? Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Which container do I... | TITLE:
How do I insert a list of strings (text format) into a container alphabetically?
QUESTION:
Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Wh... | [
"c++",
"containers"
] | 0 | 2 | 112 | 1 | 0 | 2011-06-06T22:43:17.650000 | 2011-06-06T22:45:28.047000 |
6,258,859 | 6,259,462 | Call BeginInvoke on MulticastDelegate? | According to Jon Skeet, "You can only call BeginInvoke on a delegate which has a single target invocation." Why is that? What's the real reason? Note: For clarification (and because I made this mistake), I am talking about the BeginInvoke on delegates, not on controls. | I think Jon Skeet does a good job explaining in the post you linked: How do you want the threading to work? Do you have to run each invocation synchronously, but run the whole thing asynchronously with respect to the calling thread, or could you run each invocation asynchronously? If it's the former, just run a single ... | Call BeginInvoke on MulticastDelegate? According to Jon Skeet, "You can only call BeginInvoke on a delegate which has a single target invocation." Why is that? What's the real reason? Note: For clarification (and because I made this mistake), I am talking about the BeginInvoke on delegates, not on controls. | TITLE:
Call BeginInvoke on MulticastDelegate?
QUESTION:
According to Jon Skeet, "You can only call BeginInvoke on a delegate which has a single target invocation." Why is that? What's the real reason? Note: For clarification (and because I made this mistake), I am talking about the BeginInvoke on delegates, not on con... | [
"c#",
".net",
"begininvoke",
"multicastdelegate"
] | 10 | 8 | 1,925 | 3 | 0 | 2011-06-06T22:43:54.913000 | 2011-06-07T00:16:05.447000 |
6,258,862 | 6,259,612 | Change behavior of Wordpress Tags | I'm running a wordpress blog. When I click on a tag, it takes me to a new page with the headline of a relevant post. However, you have to click on the headline to see the actual post. I was hoping that if you click the tag in the tag cloud, it will show the headline and post/post pic immediately. Is there a way to chan... | That's Wordpress default behavior: you're going to the tag archive page to select the post, because WP assumes - and rightly so - that you will have more than one post with any one particular tag. You need the tag archive page to select the post. If you have only one tag per post, or one post with one tag, and will sta... | Change behavior of Wordpress Tags I'm running a wordpress blog. When I click on a tag, it takes me to a new page with the headline of a relevant post. However, you have to click on the headline to see the actual post. I was hoping that if you click the tag in the tag cloud, it will show the headline and post/post pic i... | TITLE:
Change behavior of Wordpress Tags
QUESTION:
I'm running a wordpress blog. When I click on a tag, it takes me to a new page with the headline of a relevant post. However, you have to click on the headline to see the actual post. I was hoping that if you click the tag in the tag cloud, it will show the headline a... | [
"php",
"wordpress"
] | 1 | 1 | 141 | 1 | 0 | 2011-06-06T22:44:08.843000 | 2011-06-07T00:46:10.850000 |
6,258,863 | 6,259,384 | Iframe DOM Problem: undefined values when accessing form field | I've been having trouble debugging some JavaScript which normally would seem easy to fix. I've tried several methods, some based on using a form to access fields, other ways by using getElementById. I've also messed around with leaving in/out the name attributes in several places. In the Iframe File, asdf_iframe.html: ... | To me, it seems you are calling asdf_iframe_doc.getElementById("field_1").value = 1234; Too early. You need to call that method after the iframe finished loading its url. Here's an attempt. window.onload = function() { var iframe = window.frames["asdf_iframe"]; iframe.onload = function() { iframe.document.getElementByI... | Iframe DOM Problem: undefined values when accessing form field I've been having trouble debugging some JavaScript which normally would seem easy to fix. I've tried several methods, some based on using a form to access fields, other ways by using getElementById. I've also messed around with leaving in/out the name attri... | TITLE:
Iframe DOM Problem: undefined values when accessing form field
QUESTION:
I've been having trouble debugging some JavaScript which normally would seem easy to fix. I've tried several methods, some based on using a form to access fields, other ways by using getElementById. I've also messed around with leaving in/... | [
"javascript",
"html",
"dom",
"iframe"
] | 0 | 3 | 1,984 | 2 | 0 | 2011-06-06T22:44:20.177000 | 2011-06-07T00:01:56.297000 |
6,258,870 | 6,258,947 | Am I supposed to dispose redirected StandardOutput/StandardError | If I redirect StandardOutput / StandardError when creating a Process object, should I dispose the StreamReaders when I no longer need the Process object? Using reflector I see that Process.Dispose() does not do this for me (unless I'm missing something). | Yes the process object disposes of its own readers and their underlying streams. Redirected output retrieves a reader instance but the underlying stream is still managed by the processinfo which gets disposed automatically so no, you don't need to dispose of the reader. | Am I supposed to dispose redirected StandardOutput/StandardError If I redirect StandardOutput / StandardError when creating a Process object, should I dispose the StreamReaders when I no longer need the Process object? Using reflector I see that Process.Dispose() does not do this for me (unless I'm missing something). | TITLE:
Am I supposed to dispose redirected StandardOutput/StandardError
QUESTION:
If I redirect StandardOutput / StandardError when creating a Process object, should I dispose the StreamReaders when I no longer need the Process object? Using reflector I see that Process.Dispose() does not do this for me (unless I'm mi... | [
".net",
"process"
] | 10 | 9 | 550 | 1 | 0 | 2011-06-06T22:45:43.627000 | 2011-06-06T22:57:13.627000 |
6,258,879 | 6,258,948 | SQLite rawquery selectionArgs not working | i got the following rawquery private static final String DB_QUERY_GETPOS = "select f._id, F.FName, F.FArt, P.VName, O.Gebaeude, O.Raum from Faecher as F " + "inner join profs as P on F.Prof_ID = P._id " + "inner join ort as o on F.ort_id = o._id " + "inner join position as PO on PO.pos=? and id is not null where f._id ... | When you work with cursors in Android, remember to use the moveToFirst function before reading the data. Otherwise it will result in ArrayOutOfBounds exceptions. | SQLite rawquery selectionArgs not working i got the following rawquery private static final String DB_QUERY_GETPOS = "select f._id, F.FName, F.FArt, P.VName, O.Gebaeude, O.Raum from Faecher as F " + "inner join profs as P on F.Prof_ID = P._id " + "inner join ort as o on F.ort_id = o._id " + "inner join position as PO o... | TITLE:
SQLite rawquery selectionArgs not working
QUESTION:
i got the following rawquery private static final String DB_QUERY_GETPOS = "select f._id, F.FName, F.FArt, P.VName, O.Gebaeude, O.Raum from Faecher as F " + "inner join profs as P on F.Prof_ID = P._id " + "inner join ort as o on F.ort_id = o._id " + "inner joi... | [
"android",
"sqlite"
] | 0 | 1 | 2,221 | 1 | 0 | 2011-06-06T22:46:55.687000 | 2011-06-06T22:57:14.173000 |
6,258,893 | 6,259,011 | how to not select uitextfield that is in uitableviewcell | I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens when the uitableviewcell is selected, but because I have a custom uitextfield on that uitableviewcell it selects that text field instead of selecting the uitableviewcell.. how do I stop this from happening? | I do not know what your goal is... But you can solve your problem by using CGRectMake(110, 10, 185, 30)] cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle= UITableViewCellSelectionStyleNone; UITextField *textField = [[UITextField ... | how to not select uitextfield that is in uitableviewcell I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens when the uitableviewcell is selected, but because I have a custom uitextfield on that uitableviewcell it selects that text field instead of selecting the uitableviewcell.... | TITLE:
how to not select uitextfield that is in uitableviewcell
QUESTION:
I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens when the uitableviewcell is selected, but because I have a custom uitextfield on that uitableviewcell it selects that text field instead of selecting th... | [
"iphone",
"uitableview",
"uitextfield"
] | 0 | 1 | 140 | 1 | 0 | 2011-06-06T22:49:31.427000 | 2011-06-06T23:07:35.513000 |
6,258,897 | 6,262,910 | How can I tell Chrome or Firefox to run Javascript or load a Bookmarklet from the commandline? | Is it possible to, from the command line, tell Chrome or Firefox to run javascript in the currently open browser window? Or alternatively, load a bookmarklet that contains javascript? I'd like to have a program that watches for changes to a css file, and when the css file updates, the browser window would automatically... | In Firefox this definitely won't be possible without an extension, don't know about Chrome. The command line can open a javascript: URL but this code will run in its own tab, without access to the page you are currently viewing. So an extension would need to implement nsICommandLineHandler interface (see https://develo... | How can I tell Chrome or Firefox to run Javascript or load a Bookmarklet from the commandline? Is it possible to, from the command line, tell Chrome or Firefox to run javascript in the currently open browser window? Or alternatively, load a bookmarklet that contains javascript? I'd like to have a program that watches f... | TITLE:
How can I tell Chrome or Firefox to run Javascript or load a Bookmarklet from the commandline?
QUESTION:
Is it possible to, from the command line, tell Chrome or Firefox to run javascript in the currently open browser window? Or alternatively, load a bookmarklet that contains javascript? I'd like to have a prog... | [
"css",
"firefox",
"google-chrome"
] | 3 | 2 | 1,231 | 2 | 0 | 2011-06-06T22:49:37.467000 | 2011-06-07T09:00:09.463000 |
6,258,898 | 6,259,246 | Fail to build mysql connector/c (libmysql) from source in cygwin | I am trying to build MySQL's "Connector/C" from source in cygwin and there are problems. -some context- We could talk a lot about why anyone would want use libmysql in cygwin. In this case, it is just simpler to do some unix development on a windows box with the cygwin tool set. From my research, it looks like I could ... | Why do you need Connector/C built with Cygwin? Would not normal win32 libmysql.dll suffice? Some ideas to get it compiling: a)you're trying to compile Connector/C with gcc as C++ compiler, better don't. Use g++. b)cmake. -DSKIP_SSL=1 (looking into CMakeLists.txt suggests it will remove yassl) And yes, MySQL has abandon... | Fail to build mysql connector/c (libmysql) from source in cygwin I am trying to build MySQL's "Connector/C" from source in cygwin and there are problems. -some context- We could talk a lot about why anyone would want use libmysql in cygwin. In this case, it is just simpler to do some unix development on a windows box w... | TITLE:
Fail to build mysql connector/c (libmysql) from source in cygwin
QUESTION:
I am trying to build MySQL's "Connector/C" from source in cygwin and there are problems. -some context- We could talk a lot about why anyone would want use libmysql in cygwin. In this case, it is just simpler to do some unix development ... | [
"mysql",
"build",
"cygwin",
"cmake",
"libmysql"
] | 2 | 2 | 2,088 | 1 | 0 | 2011-06-06T22:49:49.947000 | 2011-06-06T23:40:53.170000 |
6,258,905 | 6,259,014 | How to append (concatenate) a variable to a constant in javascript | I have created some arrays, example yy1, yy2, yy3, etc., and I am able to display the elements of an array using for (j=0; j < count; j++){ alert(yy1[j]); } and other arrays by changing number, that is yy2, yy3... How to display the array in a loop, like for (i=0; i< lengthL; i++){ for (j=0; j < count; j++){ alert(yyi[... | What you are looking for is eval (Warning, Eval is evil!). You can use it to do what you are trying to do but you should rather change the way the data is stored to avoid it. It is very easy in your case (look at other answer for guidance). var yy1 = [11, 12, 13]; var yy2 = [21, 22, 23, 24, 25]; var yy3 = [31, 32, 33, ... | How to append (concatenate) a variable to a constant in javascript I have created some arrays, example yy1, yy2, yy3, etc., and I am able to display the elements of an array using for (j=0; j < count; j++){ alert(yy1[j]); } and other arrays by changing number, that is yy2, yy3... How to display the array in a loop, lik... | TITLE:
How to append (concatenate) a variable to a constant in javascript
QUESTION:
I have created some arrays, example yy1, yy2, yy3, etc., and I am able to display the elements of an array using for (j=0; j < count; j++){ alert(yy1[j]); } and other arrays by changing number, that is yy2, yy3... How to display the ar... | [
"javascript",
"arrays"
] | 0 | 0 | 4,570 | 2 | 0 | 2011-06-06T22:51:31.693000 | 2011-06-06T23:08:06.900000 |
6,258,908 | 6,258,985 | move all files in a folder and all it's subfolders into one big folder - windows xp | I have a folder c:\downloads\ffme and inside it there are loads of subfolders with various amounts of files in each of them. I want to consolidate all those individual files into one big folder, removing them from their subfolders on the way. I want to end up with a folder with loads of files in it, but no subfolders. ... | The easiest way would be w/o a cmd... just open the folder in Windows Explorer and search for *.*, then select everything except the subfolders and drag/drop or cut/paste to the desired location. | move all files in a folder and all it's subfolders into one big folder - windows xp I have a folder c:\downloads\ffme and inside it there are loads of subfolders with various amounts of files in each of them. I want to consolidate all those individual files into one big folder, removing them from their subfolders on th... | TITLE:
move all files in a folder and all it's subfolders into one big folder - windows xp
QUESTION:
I have a folder c:\downloads\ffme and inside it there are loads of subfolders with various amounts of files in each of them. I want to consolidate all those individual files into one big folder, removing them from thei... | [
"windows",
"cmd",
"directory",
"file-copying"
] | 3 | 12 | 11,030 | 2 | 0 | 2011-06-06T22:52:20.513000 | 2011-06-06T23:03:34.973000 |
6,258,912 | 6,258,933 | How do I insert a list of pairs most efficiently? | Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Which container do I use? I need to be able to look up data on both the left hand and right hand side... | std::multimap comes to mind... Is basically a map, but allows duplicates in the map key (i.e. you can have multiple "A" keys, each mapping to a "B", "C" or "D" key, to continue your example). EDIT: In response to Chris' comment: you insert items into a multimap in the same manner as a map - you make a std::pair object ... | How do I insert a list of pairs most efficiently? Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Which container do I use? I need to be able to look... | TITLE:
How do I insert a list of pairs most efficiently?
QUESTION:
Supose i have (A,B) (A,C) (A,D) (B,C) (B,D) (C,D) (D,E) in a text file. I'll extract it using regular expressions. I would like to insert the data in to a container so that it looks like this. A->B,C,D B->C,D C->D D->E Which container do I use? I need ... | [
"c++",
"containers"
] | 3 | 6 | 998 | 2 | 0 | 2011-06-06T22:52:38.207000 | 2011-06-06T22:55:20.737000 |
6,258,918 | 6,259,118 | LINQ, joining results of two methods | I want to create a flat result set from the results of two methods in which the results of the first are the arguments for the second. For example, method 1 returns 1,2,3 and I want to feed each int into method 2, which just returns 4,5,6 every time. So I expect back a resultset like 1:4, 1:5, 1:6, 2:4, 2:5, 2:6, 3:4, ... | Using LINQ expressions void Main() { var method1 = new[] {1,2,3}; var method2 = new[] {4,5,6};
var res = from m in method1 from m2 in method2 select String.Format("{0}:{1}", m, m2);
foreach (var x in res) { Console.Out.WriteLine(x); }
} | LINQ, joining results of two methods I want to create a flat result set from the results of two methods in which the results of the first are the arguments for the second. For example, method 1 returns 1,2,3 and I want to feed each int into method 2, which just returns 4,5,6 every time. So I expect back a resultset lik... | TITLE:
LINQ, joining results of two methods
QUESTION:
I want to create a flat result set from the results of two methods in which the results of the first are the arguments for the second. For example, method 1 returns 1,2,3 and I want to feed each int into method 2, which just returns 4,5,6 every time. So I expect ba... | [
"linq"
] | 2 | 0 | 200 | 2 | 0 | 2011-06-06T22:53:28.933000 | 2011-06-06T23:21:01.680000 |
6,258,922 | 6,261,322 | Efficient substring matching in perl | I am looking for an efficient solution to do find the longest possible substring in a string tolerating n mismatches in the main string Eg: Main String AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACA AGATGCA*TACTCTAC* AGACGTAC TACTTTACA AGATGCA*TACTCTAC* Search String: TACTC... | use strict; use warnings; use feature qw( say );
sub match { my ($s, $t, $max_x) = @_;
my $m = my @s = unpack('(a)*', $s); my $n = my @t = unpack('(a)*', $t);
my @length_at_k = ( 0 ) x ($m+$n); my @mismatches_at_k = ( 0 ) x ($m+$n); my $offset = $m;
my $best_length = 0; my @solutions; for my $i (0..$m-1) { --$offse... | Efficient substring matching in perl I am looking for an efficient solution to do find the longest possible substring in a string tolerating n mismatches in the main string Eg: Main String AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACA AGATGCA*TACTCTAC* AGACGTAC TACTTTACA A... | TITLE:
Efficient substring matching in perl
QUESTION:
I am looking for an efficient solution to do find the longest possible substring in a string tolerating n mismatches in the main string Eg: Main String AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACT AGATGCA*TACTCTAC* AGACGTAC TACTCTACA AGATGCA*TACTCTAC* AG... | [
"perl",
"string",
"string-matching",
"substring",
"bioperl"
] | 8 | 3 | 1,787 | 2 | 0 | 2011-06-06T22:53:54.133000 | 2011-06-07T06:24:24.963000 |
6,258,923 | 6,258,940 | Mysql use row data in same query to select another row? | Ive never had to use a query like this before but there must be away to do it without using 2 queries? Table: forum_categories -------------------------------------- -- id ---- parent_id ---- name ------- -------------------------------------- 1 0 namehere1 2 1 namehere2 3 0 namehere3 4 1 namehere4 5 3 namehere5 I have... | You want something like select a.id as child_id, a.name as child_name, b.id as parent_id, a.name as parent_name from forum_categories a inner join forum_categories b on a.parent_id = b.id To restrict to your known id, add where a.id = knownid | Mysql use row data in same query to select another row? Ive never had to use a query like this before but there must be away to do it without using 2 queries? Table: forum_categories -------------------------------------- -- id ---- parent_id ---- name ------- -------------------------------------- 1 0 namehere1 2 1 na... | TITLE:
Mysql use row data in same query to select another row?
QUESTION:
Ive never had to use a query like this before but there must be away to do it without using 2 queries? Table: forum_categories -------------------------------------- -- id ---- parent_id ---- name ------- -------------------------------------- 1 ... | [
"mysql"
] | 0 | 0 | 427 | 1 | 0 | 2011-06-06T22:53:58.277000 | 2011-06-06T22:56:32.083000 |
6,258,925 | 6,259,091 | Why am I getting a "Call to a member function on a non-object" error? | I'm working with the Zend framework, backed by MySQL, and trying to set up an index view. However, with the code I have, I keep getting the "call to a member function on a non-object" error and I don't know how to solve it. Here's the Controller for my index page: public function indexAction() { $dImage = new Applicati... | You must add the Application_Model_DImage object to the view, or else the view does not know of an object with that name. Do this: public function indexAction() { $dImage = new Application_Model_DImage(); $this->view->dImage = $dImage; } Then you will have your $dImage available to your view scripts. Your view scripts ... | Why am I getting a "Call to a member function on a non-object" error? I'm working with the Zend framework, backed by MySQL, and trying to set up an index view. However, with the code I have, I keep getting the "call to a member function on a non-object" error and I don't know how to solve it. Here's the Controller for ... | TITLE:
Why am I getting a "Call to a member function on a non-object" error?
QUESTION:
I'm working with the Zend framework, backed by MySQL, and trying to set up an index view. However, with the code I have, I keep getting the "call to a member function on a non-object" error and I don't know how to solve it. Here's t... | [
"php",
"mysql",
"zend-framework"
] | 2 | 2 | 4,004 | 2 | 0 | 2011-06-06T22:54:06.940000 | 2011-06-06T23:17:19.777000 |
6,258,942 | 6,258,997 | How to go about setting a xml node as link | document.getElementById('num1').innerHTML = homestead[0].textContent; document.getElementById('num3').innerHTML = homestead[1].textContent;
} Untitled Document Stream Name: Viewers homestead is a node value from an xml sheet, and the script put it in the table.. i want to write a script to call the url (another node f... | I'm pretty confused as to what you're asking, but if you're just talking about adding a link to the table, you need to use an tag: document.getElementById('num1').innerHTML = ' Link '; | How to go about setting a xml node as link document.getElementById('num1').innerHTML = homestead[0].textContent; document.getElementById('num3').innerHTML = homestead[1].textContent;
} Untitled Document Stream Name: Viewers homestead is a node value from an xml sheet, and the script put it in the table.. i want to wri... | TITLE:
How to go about setting a xml node as link
QUESTION:
document.getElementById('num1').innerHTML = homestead[0].textContent; document.getElementById('num3').innerHTML = homestead[1].textContent;
} Untitled Document Stream Name: Viewers homestead is a node value from an xml sheet, and the script put it in the tab... | [
"javascript"
] | 0 | 0 | 44 | 1 | 0 | 2011-06-06T22:56:55.630000 | 2011-06-06T23:05:29.223000 |
6,258,950 | 6,259,062 | php oop classes call inside functions | so i have a class which contains basic stuff like Class Test{ public function wheels(){ echo 'wheels'; } } and another one Class Test2{ public function bikes(){ $test = new Test(); return 'i am a bike with '.$test; } } so my question is if i have different classes that i need inside a function is it good practise to ca... | For your webapp write an autoloader that is just loading all classes from files you want to use while you need it. You can then just write the code like you want to w/o the need to build complex inheritance between classes only because you want to make use of the functionality you've coded. This has multiple benefits: ... | php oop classes call inside functions so i have a class which contains basic stuff like Class Test{ public function wheels(){ echo 'wheels'; } } and another one Class Test2{ public function bikes(){ $test = new Test(); return 'i am a bike with '.$test; } } so my question is if i have different classes that i need insid... | TITLE:
php oop classes call inside functions
QUESTION:
so i have a class which contains basic stuff like Class Test{ public function wheels(){ echo 'wheels'; } } and another one Class Test2{ public function bikes(){ $test = new Test(); return 'i am a bike with '.$test; } } so my question is if i have different classes... | [
"php",
"oop",
"class"
] | 1 | 1 | 1,262 | 6 | 0 | 2011-06-06T22:57:41.770000 | 2011-06-06T23:14:25.823000 |
6,258,951 | 6,261,775 | EF, DAL facade and Unit Testing | I'm in the process of creating a Data Access Layer to one of my projects, it's merely a facade interface to the Entity Framework, so most of the underlying calls contain no logic besides calling the Entity Framework methods. Now, one of my colleagues says that I should Unit Test every single method even though they con... | Testing methods which wrap EF features is not unit testing but integration testing and it actually have a reason because it validates that your DAL is working with a real database. It is not about testing its parameters or what so ever but about testing that mapping works with the real database, that records are really... | EF, DAL facade and Unit Testing I'm in the process of creating a Data Access Layer to one of my projects, it's merely a facade interface to the Entity Framework, so most of the underlying calls contain no logic besides calling the Entity Framework methods. Now, one of my colleagues says that I should Unit Test every si... | TITLE:
EF, DAL facade and Unit Testing
QUESTION:
I'm in the process of creating a Data Access Layer to one of my projects, it's merely a facade interface to the Entity Framework, so most of the underlying calls contain no logic besides calling the Entity Framework methods. Now, one of my colleagues says that I should ... | [
"unit-testing",
"entity-framework",
"data-access-layer"
] | 4 | 2 | 686 | 1 | 0 | 2011-06-06T22:57:47.323000 | 2011-06-07T07:14:46.140000 |
6,258,953 | 6,259,272 | mysql select content around keyword | I'm trying to create the search form with keyword highlighting, but obviously I won't be able to highlight the keyword if it doesn't appear in the first few sentences of the result on the list - so I need to create a sql statement, which will populate number of characters of to the left of the found keyword and the sam... | Ok - I think I've figured it out - here is what I've come up with: SELECT IF ( LOCATE('keyword', `content`) < 20, SUBSTRING(`content`, 1, 200), SUBSTRING(`content`, LOCATE('keyword', `content`) - 20, 200) ) AS `content` FROM `table` WHERE `content` LIKE '%keyword%' First identifying the position of the keyword, then if... | mysql select content around keyword I'm trying to create the search form with keyword highlighting, but obviously I won't be able to highlight the keyword if it doesn't appear in the first few sentences of the result on the list - so I need to create a sql statement, which will populate number of characters of to the l... | TITLE:
mysql select content around keyword
QUESTION:
I'm trying to create the search form with keyword highlighting, but obviously I won't be able to highlight the keyword if it doesn't appear in the first few sentences of the result on the list - so I need to create a sql statement, which will populate number of char... | [
"mysql",
"sql",
"search"
] | 0 | 0 | 2,706 | 2 | 0 | 2011-06-06T22:58:15.513000 | 2011-06-06T23:44:56.210000 |
6,258,962 | 6,264,415 | Create a list with boolean values which represent results of a predicate when applied to a list | I am trying to figure out if there is a way to get a logical list through comparison in Python 3. Basically what I want to input is this x = [1, 2, 3, 4, 5, 6, 7, 8, 9] xlist = 4 <= x and what I am looking to output is a list that would look like this xlist = [False, False, False, True, True, True, True, True, True] Is... | The map approach is likely to be the faster but, please, profile them if you really want to know. Also consider the array module. In [2]: %timeit map(lambda i: 4<=i, xrange(1,100)) 100000 loops, best of 3: 15.9 us per loop
In [7]: %timeit list(4<=i for i in range(1,100)) 100000 loops, best of 3: 10.3 us per loop
In [... | Create a list with boolean values which represent results of a predicate when applied to a list I am trying to figure out if there is a way to get a logical list through comparison in Python 3. Basically what I want to input is this x = [1, 2, 3, 4, 5, 6, 7, 8, 9] xlist = 4 <= x and what I am looking to output is a lis... | TITLE:
Create a list with boolean values which represent results of a predicate when applied to a list
QUESTION:
I am trying to figure out if there is a way to get a logical list through comparison in Python 3. Basically what I want to input is this x = [1, 2, 3, 4, 5, 6, 7, 8, 9] xlist = 4 <= x and what I am looking ... | [
"python",
"python-3.x",
"list-comprehension"
] | 1 | 2 | 7,862 | 6 | 0 | 2011-06-06T23:00:24.263000 | 2011-06-07T11:19:25.283000 |
6,258,965 | 6,258,990 | Catching exception on filenotfound | So it is said to catch only exceptions which you cannot predict or are exceptional. So for example, IOExceptions instead of FileNotFoundException (As this single case can be handled with a simple file check ot avoid using exceptions as flow control). This is my understanding of the topic, correct me if I am wrong. Howe... | You should catch exceptions that you can handle. Your first sentence is a little off and might be what is causing your confusion. "So it is said to catch only exceptions which you cannot predict or are exceptional." This should read "So it is said to only throw exceptions in situations which you cannot predict or are e... | Catching exception on filenotfound So it is said to catch only exceptions which you cannot predict or are exceptional. So for example, IOExceptions instead of FileNotFoundException (As this single case can be handled with a simple file check ot avoid using exceptions as flow control). This is my understanding of the to... | TITLE:
Catching exception on filenotfound
QUESTION:
So it is said to catch only exceptions which you cannot predict or are exceptional. So for example, IOExceptions instead of FileNotFoundException (As this single case can be handled with a simple file check ot avoid using exceptions as flow control). This is my under... | [
"c#",
"exception"
] | 3 | 2 | 589 | 3 | 0 | 2011-06-06T23:00:30.913000 | 2011-06-06T23:04:36.307000 |
6,258,971 | 6,259,153 | How do I return a group of sequential numbers that might exist in an array? | If I have a sorted array, how do I find the sequential numbers? Btw, this is for determining if a poker hand is a straight or not. Duplicates in the array have been removed. I can do this, but it would be a multi-line method and I thought there might be a quick one liner using an Enumerable method. For example: FindSeq... | Assuming it is presorted, you can easily test for a straight like so: array.each_cons(2).all? { |x,y| y == x - 1 } To be safe you may want to add the sort: array.sort.each_cons(2).all? { |x,y| y == x + 1 } But if you really need to extract the largest sequence, it will take another solution. | How do I return a group of sequential numbers that might exist in an array? If I have a sorted array, how do I find the sequential numbers? Btw, this is for determining if a poker hand is a straight or not. Duplicates in the array have been removed. I can do this, but it would be a multi-line method and I thought there... | TITLE:
How do I return a group of sequential numbers that might exist in an array?
QUESTION:
If I have a sorted array, how do I find the sequential numbers? Btw, this is for determining if a poker hand is a straight or not. Duplicates in the array have been removed. I can do this, but it would be a multi-line method a... | [
"ruby-on-rails",
"ruby"
] | 3 | 3 | 1,474 | 3 | 0 | 2011-06-06T23:01:58.780000 | 2011-06-06T23:26:25.073000 |
6,258,972 | 6,259,148 | Gzip multiple files individually and keep the original files | I am looking to gzip multiple files (into multiple.gz files) in a directory while keeping the originals. I can do individual files using these commands: find. -type f -name "*cache.html" -exec gzip {} \; or gzip *cache.html but neither preserves the original. I tried find. -type f -name "*cache.html" -exec gzip -c {} >... | Your > in the last command gets parsed by the same shell which runs find. Use a nested shell: find. -type f -name "*cache.html" -exec sh -c "gzip < {} > {}.gz" \; | Gzip multiple files individually and keep the original files I am looking to gzip multiple files (into multiple.gz files) in a directory while keeping the originals. I can do individual files using these commands: find. -type f -name "*cache.html" -exec gzip {} \; or gzip *cache.html but neither preserves the original.... | TITLE:
Gzip multiple files individually and keep the original files
QUESTION:
I am looking to gzip multiple files (into multiple.gz files) in a directory while keeping the originals. I can do individual files using these commands: find. -type f -name "*cache.html" -exec gzip {} \; or gzip *cache.html but neither prese... | [
"linux",
"compression",
"gzip"
] | 12 | 9 | 10,554 | 4 | 0 | 2011-06-06T23:02:01.230000 | 2011-06-06T23:25:48.397000 |
6,258,977 | 6,259,276 | regex to match string content until comment | I'm trying to match to expresions contained within [%___%] in a string, before // (comments) excluding // that are in quotations (inside a string) so for example [%tag%] = "a" + "//" + [%tag2%]; //[%tag3%] should match [%tag%] and [%tag2%] The closest I can get is ^(?:(?:\[%([^%\]\[]*)%\])|[^"]|"[^"]*")*?(?://) So the ... | I think doing this in one shot is a little difficult because of double quotes matching being difficult to check. You can do it in two phases: ¤ Removing all matching double quotes ¤ Finding your pattern Regex re1 = new Regex(@"""[^""]*""", RegexOptions.Multiline); Regex re2 = new Regex(@"(? | regex to match string content until comment I'm trying to match to expresions contained within [%___%] in a string, before // (comments) excluding // that are in quotations (inside a string) so for example [%tag%] = "a" + "//" + [%tag2%]; //[%tag3%] should match [%tag%] and [%tag2%] The closest I can get is ^(?:(?:\[%(... | TITLE:
regex to match string content until comment
QUESTION:
I'm trying to match to expresions contained within [%___%] in a string, before // (comments) excluding // that are in quotations (inside a string) so for example [%tag%] = "a" + "//" + [%tag2%]; //[%tag3%] should match [%tag%] and [%tag2%] The closest I can ... | [
"c#",
".net",
"regex",
"regex-negation"
] | 1 | 1 | 610 | 2 | 0 | 2011-06-06T23:02:53.967000 | 2011-06-06T23:45:12.717000 |
6,258,982 | 6,259,092 | Suspended (exception ActivityNotFoundException) | I have an application that continually crashes with at Suspended (exception ActivityNotFoundException). The full response to the crash when I run the debugger is: Fan Laws [Android Application] DalvikVM[localhost:8683] Thread [<1> main] (Suspended (exception ActivityNotFoundException)) Instrumentation.checkStartActivit... | Have you added the activity to your AndroidManifest.xml file? | Suspended (exception ActivityNotFoundException) I have an application that continually crashes with at Suspended (exception ActivityNotFoundException). The full response to the crash when I run the debugger is: Fan Laws [Android Application] DalvikVM[localhost:8683] Thread [<1> main] (Suspended (exception ActivityNotFo... | TITLE:
Suspended (exception ActivityNotFoundException)
QUESTION:
I have an application that continually crashes with at Suspended (exception ActivityNotFoundException). The full response to the crash when I run the debugger is: Fan Laws [Android Application] DalvikVM[localhost:8683] Thread [<1> main] (Suspended (excep... | [
"android",
"android-manifest"
] | 0 | 2 | 877 | 1 | 0 | 2011-06-06T23:03:13.690000 | 2011-06-06T23:17:22.027000 |
6,258,993 | 6,259,060 | How does jQuery clean dynamically loaded JavaScript files before executing them using eval? | I am planning to load JS files using AJAX and then eval them to execute the code. But I am worried of using eval. Just to see how jQuery implements the getScript method I went through its source code and found this: rcleanScript = /^\s* globalEval is a method which evaluates the script in global (window) context and ta... | That regex matches one of two different things: <!-- </code></pre>
<p>These constructs are frequently used at the beginning of <code>script</code> elements to make sure the page validates and that it renders properly in browsers that don't support Javascript. The regex comments them out by putting them within Javascri... | How does jQuery clean dynamically loaded JavaScript files before executing them using eval? I am planning to load JS files using AJAX and then eval them to execute the code. But I am worried of using eval. Just to see how jQuery implements the getScript method I went through its source code and found this: rcleanScript... | TITLE:
How does jQuery clean dynamically loaded JavaScript files before executing them using eval?
QUESTION:
I am planning to load JS files using AJAX and then eval them to execute the code. But I am worried of using eval. Just to see how jQuery implements the getScript method I went through its source code and found ... | [
"jquery",
"security",
"eval"
] | 1 | 1 | 720 | 3 | 0 | 2011-06-06T23:05:00.730000 | 2011-06-06T23:14:10.097000 |
6,259,002 | 6,259,067 | Best way to perform version control on an embedded linux project? | I'm starting work on a new embedded Linux project. The project will consist of an embedded board running Linux, some drivers (possibly some custom drivers), and an application on top. I am working with another person and we need a way to put the project under version control. I have used git for many projects before an... | Regarding Git: putting everything under one giant repo is generally a bad idea (especially when you need to clone said "giant" repo around) you should put under version control what needs to have a source code history: if you don't intend to actually modify the Linux kernel source (but just reference the exact version ... | Best way to perform version control on an embedded linux project? I'm starting work on a new embedded Linux project. The project will consist of an embedded board running Linux, some drivers (possibly some custom drivers), and an application on top. I am working with another person and we need a way to put the project ... | TITLE:
Best way to perform version control on an embedded linux project?
QUESTION:
I'm starting work on a new embedded Linux project. The project will consist of an embedded board running Linux, some drivers (possibly some custom drivers), and an application on top. I am working with another person and we need a way t... | [
"version-control",
"embedded-linux"
] | 3 | 1 | 655 | 1 | 0 | 2011-06-06T23:06:12.297000 | 2011-06-06T23:14:50.107000 |
6,259,003 | 6,259,034 | Algorithm to count occurrences of a matrix inside a larger one | i'm facing a problem right now, i need to count the number of time a certain MxM matrix appears inside a NxN one (this one should be larger than the first one). Any hints on how to do this? I'm going to implement it in C and there is no option to change it. Revision 1 Hi everyone, i would really like to say thank to al... | Hm, sounds like a 2-dimensional version of string matching. I wonder if there's a 2D version of Boyer-Moore? A Boyer-Moore Approach for Two-Dimensional Matching Ah, apparently there is.:-) | Algorithm to count occurrences of a matrix inside a larger one i'm facing a problem right now, i need to count the number of time a certain MxM matrix appears inside a NxN one (this one should be larger than the first one). Any hints on how to do this? I'm going to implement it in C and there is no option to change it.... | TITLE:
Algorithm to count occurrences of a matrix inside a larger one
QUESTION:
i'm facing a problem right now, i need to count the number of time a certain MxM matrix appears inside a NxN one (this one should be larger than the first one). Any hints on how to do this? I'm going to implement it in C and there is no op... | [
"c",
"algorithm",
"matrix",
"count"
] | 11 | 13 | 1,474 | 3 | 0 | 2011-06-06T23:06:27.963000 | 2011-06-06T23:11:07.453000 |
6,259,005 | 6,259,013 | Can I debug an WP7 app that targets Mango in a real device? | Or is the debugging only available for emulator? | It's said that developer devices running Mango may be made available later but, for the time being, you can only debug Mango projects in the emulator. Edit - Mango Beta is now available to developers to install on their retail devices. You should get an email within the next couple weeks or so inviting you to this, if ... | Can I debug an WP7 app that targets Mango in a real device? Or is the debugging only available for emulator? | TITLE:
Can I debug an WP7 app that targets Mango in a real device?
QUESTION:
Or is the debugging only available for emulator?
ANSWER:
It's said that developer devices running Mango may be made available later but, for the time being, you can only debug Mango projects in the emulator. Edit - Mango Beta is now availabl... | [
"debugging",
"emulation",
"windows-phone-7"
] | 4 | 5 | 197 | 1 | 0 | 2011-06-06T23:06:38.510000 | 2011-06-06T23:08:03.967000 |
6,259,015 | 6,259,097 | Rails 3 - belongs_to user AND has_many users | I am trying to figure out how to do the following: a Concert belongs_to a user (the creator), has_many guests and has_many organisers. Is the following approach is good? Concert: class Concert < ActiveRecord::Base belongs_to:user has_many:guests,:class_name => 'User' has_many:organisers,:class_name => 'User' end User: ... | Ad two new models to hold the has_many relationships: class Concert < ActiveRecord::Base belongs_to:user has_many:concert_guests has_many:concert_organizers
has_many:guests,:through =>:concert_guests,:source =>:user has_many:organizers,:through =>:concert_organizers,:source =>:user end
class User < ActiveRecord::Base... | Rails 3 - belongs_to user AND has_many users I am trying to figure out how to do the following: a Concert belongs_to a user (the creator), has_many guests and has_many organisers. Is the following approach is good? Concert: class Concert < ActiveRecord::Base belongs_to:user has_many:guests,:class_name => 'User' has_man... | TITLE:
Rails 3 - belongs_to user AND has_many users
QUESTION:
I am trying to figure out how to do the following: a Concert belongs_to a user (the creator), has_many guests and has_many organisers. Is the following approach is good? Concert: class Concert < ActiveRecord::Base belongs_to:user has_many:guests,:class_name... | [
"ruby-on-rails",
"database",
"ruby-on-rails-3",
"activerecord"
] | 1 | 2 | 1,454 | 1 | 0 | 2011-06-06T23:08:12.837000 | 2011-06-06T23:17:51.050000 |
6,259,018 | 6,259,074 | create a jsp table using properties file | What is the best possible way to create a jsp table(key,value) from a properties file. Right now I am doing this using scriptlets..... ResourceBundle statusCodes = ResourceBundle.getBundle("statuscode"); Enumeration statusKeys = statusCodes.getKeys();
<% while (statusKeys.hasMoreElements()) { String key = (String) sta... | You should be using java.util.Properties instead of java.util.ResourceBundle. The ResourceBundle serves an entirely different purpose and it should not be abused to have "an easy way" to load properties since it by default lookups resources from the classpath. Let a servlet load and prepare it for JSP. Properties prope... | create a jsp table using properties file What is the best possible way to create a jsp table(key,value) from a properties file. Right now I am doing this using scriptlets..... ResourceBundle statusCodes = ResourceBundle.getBundle("statuscode"); Enumeration statusKeys = statusCodes.getKeys();
<% while (statusKeys.hasMo... | TITLE:
create a jsp table using properties file
QUESTION:
What is the best possible way to create a jsp table(key,value) from a properties file. Right now I am doing this using scriptlets..... ResourceBundle statusCodes = ResourceBundle.getBundle("statuscode"); Enumeration statusKeys = statusCodes.getKeys();
<% while... | [
"jsp",
"properties",
"jstl",
"el",
"resourcebundle"
] | 1 | 2 | 2,790 | 1 | 0 | 2011-06-06T23:08:43.320000 | 2011-06-06T23:15:09.603000 |
6,259,022 | 6,259,322 | How can I handle DLL_EXPORT when compiling dll to a static library? | I have a project in visual c++ 2010, which contains preprocessor directives in a key header file. Actually, it is the ZMQ source code. The project is normally configured to be a dll, so the header uses DLL_EXPORT's status (defined/not defined). If the project is used to compile a dll, the header can be used by both the... | I would just introduce a second (optional) macro, something like ZMQ_STATIC: #if defined(ZMQ_STATIC) # define ZMQ_EXPORT #elif defined(DLL_EXPORT) # define ZMQ_EXPORT __declspec(dllexport) #else # define ZMQ_EXPORT __declspec(dllimport) #endif Define said macro both when building your library as a static library or whe... | How can I handle DLL_EXPORT when compiling dll to a static library? I have a project in visual c++ 2010, which contains preprocessor directives in a key header file. Actually, it is the ZMQ source code. The project is normally configured to be a dll, so the header uses DLL_EXPORT's status (defined/not defined). If the ... | TITLE:
How can I handle DLL_EXPORT when compiling dll to a static library?
QUESTION:
I have a project in visual c++ 2010, which contains preprocessor directives in a key header file. Actually, it is the ZMQ source code. The project is normally configured to be a dll, so the header uses DLL_EXPORT's status (defined/not... | [
"c++",
"windows",
"static-libraries",
"dllexport"
] | 3 | 9 | 4,619 | 2 | 0 | 2011-06-06T23:09:52.023000 | 2011-06-06T23:52:31.667000 |
6,259,023 | 6,259,041 | Options for dynamically generating css styles from database in php | I am working on an app which allows users to choose style options inside the app. These options will then be used to generate a dynamic web page. I was wondering what my options are to achieve the styling of this page, and what the pros and cons are of these options? The way I see it, I have these 3 options: Apply the ... | Of course your second option is the best. With a style.php you are able to output whenever you want based on the user logged in. Consider I use style.php without even needing to customize it for the user. With it you can extend CSS functionalities like: // EXAMPLE
td { } /*etc*/ Also don't forget to: header('Content-T... | Options for dynamically generating css styles from database in php I am working on an app which allows users to choose style options inside the app. These options will then be used to generate a dynamic web page. I was wondering what my options are to achieve the styling of this page, and what the pros and cons are of ... | TITLE:
Options for dynamically generating css styles from database in php
QUESTION:
I am working on an app which allows users to choose style options inside the app. These options will then be used to generate a dynamic web page. I was wondering what my options are to achieve the styling of this page, and what the pro... | [
"php",
"css",
"stylesheet"
] | 4 | 5 | 1,943 | 3 | 0 | 2011-06-06T23:09:52.523000 | 2011-06-06T23:12:05.207000 |
6,259,027 | 6,259,113 | Python Minesweeper game with GUI using Tkinter How to display on buttons correctly? | I am creating a minesweeper game in python 2.7. I have run into several problems when attempting to create the GUI. I have used a library called easyGUI (found here: http://easygui.sourceforge.net/ ) for some of the basic setup windows, but that is not my problem. The issue is with the actual minesweeper window itself.... | You can change the text on a button with the configure method of the button (eg: b1.configure(text="whatever") ). You do not need to recreate the whole window with each update. Just create the buttons once and change the text or image as needed. For example, change your button definition to look like this: b = Tkinter.... | Python Minesweeper game with GUI using Tkinter How to display on buttons correctly? I am creating a minesweeper game in python 2.7. I have run into several problems when attempting to create the GUI. I have used a library called easyGUI (found here: http://easygui.sourceforge.net/ ) for some of the basic setup windows,... | TITLE:
Python Minesweeper game with GUI using Tkinter How to display on buttons correctly?
QUESTION:
I am creating a minesweeper game in python 2.7. I have run into several problems when attempting to create the GUI. I have used a library called easyGUI (found here: http://easygui.sourceforge.net/ ) for some of the ba... | [
"python",
"user-interface",
"button",
"tkinter",
"minesweeper"
] | 1 | 2 | 5,951 | 1 | 0 | 2011-06-06T23:10:16.907000 | 2011-06-06T23:20:29.403000 |
6,259,030 | 6,259,064 | How to pass string value from one form to another form's load event in C # | I need to pass a string value from Form1: public void button1_Click(object sender, EventArgs e) { string DepartmentName = "IT"; Form2 frm2 = new Form2();
Frm2.Show(); this.Hide(); } into the Form2 Load event. For example: private void Form2_Load(object sender, EventArgs e) { MessageBox.Show(DepartmentName); // or // s... | Just create a property on the Form2 class and set it before you show Form2. public class Form2 {... public string MyProperty { get; set; }
private void Form2_Load(object sender, EventArgs e) { MessageBox.Show(this.MyProperty); } } From Form1: public void button1_Click(object sender, EventArgs e) { string departmentNam... | How to pass string value from one form to another form's load event in C # I need to pass a string value from Form1: public void button1_Click(object sender, EventArgs e) { string DepartmentName = "IT"; Form2 frm2 = new Form2();
Frm2.Show(); this.Hide(); } into the Form2 Load event. For example: private void Form2_Loa... | TITLE:
How to pass string value from one form to another form's load event in C #
QUESTION:
I need to pass a string value from Form1: public void button1_Click(object sender, EventArgs e) { string DepartmentName = "IT"; Form2 frm2 = new Form2();
Frm2.Show(); this.Hide(); } into the Form2 Load event. For example: priv... | [
"c#",
"winforms"
] | 11 | 32 | 60,740 | 5 | 0 | 2011-06-06T23:10:35.420000 | 2011-06-06T23:14:38.087000 |
6,259,033 | 6,259,047 | How to to store multi-dimensional form data? | I have a form where fields get added via JavaScript. This is fairly easy to store without a bunch of extra JS code (for deleting and reordering) by using arrayed names for fields. The problem comes when I need a multi-dimensional arrayed list of form data. order request_date product[] quantity[] warehouse1 warehouse2 e... | Why not use JSON? On the PHP end you'll end up with an array of elements for the nested arrays. It sounds to me like you're either unaware of JSON (and with an SO rep of 3k, I can't believe that) or that you're unaware that you can pass JSON back to the server. But for what you're describing, that sounds like a natural... | How to to store multi-dimensional form data? I have a form where fields get added via JavaScript. This is fairly easy to store without a bunch of extra JS code (for deleting and reordering) by using arrayed names for fields. The problem comes when I need a multi-dimensional arrayed list of form data. order request_date... | TITLE:
How to to store multi-dimensional form data?
QUESTION:
I have a form where fields get added via JavaScript. This is fairly easy to store without a bunch of extra JS code (for deleting and reordering) by using arrayed names for fields. The problem comes when I need a multi-dimensional arrayed list of form data. ... | [
"php",
"javascript",
"html",
"forms"
] | 1 | 1 | 1,423 | 4 | 0 | 2011-06-06T23:10:39.557000 | 2011-06-06T23:12:40.017000 |
6,259,037 | 6,259,104 | How to simulate dropping stones into a bucket on the web? | I would like to simulate dropping stones into a bucket on the web. Drag and drop plus simple gravity simulation comes to mind. Is there an example, jQuery plugin, or something that makes this straight-forward and clean? Thanks! | As long as you don't need graphic extensive animations, everything can be done quite easily with HTML and Javascript; absolute positioned elements and jQuery's animate function. ** EDIT ** Take a look here. It seems to be exactly what you want. Also, take a look at this question. | How to simulate dropping stones into a bucket on the web? I would like to simulate dropping stones into a bucket on the web. Drag and drop plus simple gravity simulation comes to mind. Is there an example, jQuery plugin, or something that makes this straight-forward and clean? Thanks! | TITLE:
How to simulate dropping stones into a bucket on the web?
QUESTION:
I would like to simulate dropping stones into a bucket on the web. Drag and drop plus simple gravity simulation comes to mind. Is there an example, jQuery plugin, or something that makes this straight-forward and clean? Thanks!
ANSWER:
As long... | [
"jquery"
] | 1 | 1 | 728 | 2 | 0 | 2011-06-06T23:11:41.997000 | 2011-06-06T23:18:50.277000 |
6,259,048 | 6,259,205 | Where to package Class file so that both Client apps and EJBs on Server have access? | I am new to the Java EE platform and I am building a simple JMS app. I created a class that is being sent in an ObjectMessage. My problem arose when both the client app creating the message and the MDB on the server needed access to the same class file(the class composed in the ObjectMessage). I currently have the clas... | Typically most, if not all codesources (the locations from where classes are loaded) utilized by the application server's classloaders are located within the application server installation. In case of MDBs (or EJBs) for that matter, the codesources are contained within the EJB module (the EJB JAR file) or within the a... | Where to package Class file so that both Client apps and EJBs on Server have access? I am new to the Java EE platform and I am building a simple JMS app. I created a class that is being sent in an ObjectMessage. My problem arose when both the client app creating the message and the MDB on the server needed access to th... | TITLE:
Where to package Class file so that both Client apps and EJBs on Server have access?
QUESTION:
I am new to the Java EE platform and I am building a simple JMS app. I created a class that is being sent in an ObjectMessage. My problem arose when both the client app creating the message and the MDB on the server n... | [
"java",
"java-ee-6"
] | 0 | 0 | 87 | 1 | 0 | 2011-06-06T23:12:43.513000 | 2011-06-06T23:34:40.393000 |
6,259,053 | 6,259,183 | Getting the first or last result as part of a join | Currently I want to select the most recent value from a related table. So, I have a sale table which can have many transactions related to a single sale. I currently can use a subquery to fetch the most recent sale, as below, but it's very slow! UPDATE Sales s SET LastTrans = (SELECT Stamp FROM Transactions WHERE Sales... | You didn't say what column your inner query was sorted by so I assumed it was Stamp. UPDATE Sales s INNER JOIN ( SELECT SalesID, MAX(Stamp) AS MaxStamp FROM Transactions GROUP BY SalesID ) AS t ON s.ID = t.SalesID SET LastTrans = t.MaxStamp WHERE LastTrans IS NULL; | Getting the first or last result as part of a join Currently I want to select the most recent value from a related table. So, I have a sale table which can have many transactions related to a single sale. I currently can use a subquery to fetch the most recent sale, as below, but it's very slow! UPDATE Sales s SET Last... | TITLE:
Getting the first or last result as part of a join
QUESTION:
Currently I want to select the most recent value from a related table. So, I have a sale table which can have many transactions related to a single sale. I currently can use a subquery to fetch the most recent sale, as below, but it's very slow! UPDAT... | [
"mysql",
"sql"
] | 2 | 1 | 164 | 1 | 0 | 2011-06-06T23:12:59.260000 | 2011-06-06T23:31:03.937000 |
6,259,055 | 6,263,700 | CreateProcess such that child process is killed when parent is killed? | Is there a way to call CreateProcess such that killing the parent process automatically kills the child process? Perhaps using Create Process Flags? Edit The solution is to create a job object, place both parent and child in the job object. Whent he parent is killed the child is killed. I got the code from here: Kill c... | Using jobs as Neil says is IMHO the best way. You can make the child processes get killed when the job owning process dies by setting JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE on the job object using SetInformationJobObject(). The job object handle will be closed when your parent process exits/dies. For this to work it is ess... | CreateProcess such that child process is killed when parent is killed? Is there a way to call CreateProcess such that killing the parent process automatically kills the child process? Perhaps using Create Process Flags? Edit The solution is to create a job object, place both parent and child in the job object. Whent he... | TITLE:
CreateProcess such that child process is killed when parent is killed?
QUESTION:
Is there a way to call CreateProcess such that killing the parent process automatically kills the child process? Perhaps using Create Process Flags? Edit The solution is to create a job object, place both parent and child in the jo... | [
"c++",
"winapi",
"process",
"kernel32",
"win32-process"
] | 21 | 13 | 13,537 | 6 | 0 | 2011-06-06T23:13:21.773000 | 2011-06-07T10:09:05.547000 |
6,259,065 | 6,259,917 | Tracing my Data-Entity class and its MVC-ViewModel equivalent class match each other | I'm developing an MVC3 application with EntityFramework v4.1. According to most common MVC best practices, i should separate my data access layer objects from my view-model objects. I should not use entity objects as view-models for a good project design and for some possible XSS like security reasons. But since it is ... | I believe this is the problem you're running into. There's some explanation there on how to fix it. That said the Interface might be overkill. I prefer to map between database classes and view models by using AutoMapper. That will take everything between the two with the same name and handle it automatically, then you ... | Tracing my Data-Entity class and its MVC-ViewModel equivalent class match each other I'm developing an MVC3 application with EntityFramework v4.1. According to most common MVC best practices, i should separate my data access layer objects from my view-model objects. I should not use entity objects as view-models for a ... | TITLE:
Tracing my Data-Entity class and its MVC-ViewModel equivalent class match each other
QUESTION:
I'm developing an MVC3 application with EntityFramework v4.1. According to most common MVC best practices, i should separate my data access layer objects from my view-model objects. I should not use entity objects as ... | [
"model-view-controller",
"asp.net-mvc-3",
"interface",
"viewmodel",
"entity-framework-4.1"
] | 2 | 4 | 368 | 2 | 0 | 2011-06-06T23:14:43.820000 | 2011-06-07T01:57:55.950000 |
6,259,069 | 6,259,180 | How to change listview adapter in section setOnItemClickListener | I have listview with some listadapter after click on item from list I'd like to reload list with new data, change adapter's contests. I use this in setOnItemClickListener, but I get error: "Type The constructor ArrayAdapter(new AdapterView.OnItemClickListener(){}, int, ArrayList) is undefined" list.setAdapter(new Array... | Glendon's answer is probably the right one. Nevertheless, in case you really need to change the adapter for some reason, you need to pass the right Context instance to the first argument of the constructor. You can extend OnClickListener and add a field mContext to it, to which you will assign the current Activity. The... | How to change listview adapter in section setOnItemClickListener I have listview with some listadapter after click on item from list I'd like to reload list with new data, change adapter's contests. I use this in setOnItemClickListener, but I get error: "Type The constructor ArrayAdapter(new AdapterView.OnItemClickList... | TITLE:
How to change listview adapter in section setOnItemClickListener
QUESTION:
I have listview with some listadapter after click on item from list I'd like to reload list with new data, change adapter's contests. I use this in setOnItemClickListener, but I get error: "Type The constructor ArrayAdapter(new AdapterVi... | [
"android",
"listview"
] | 1 | 1 | 2,759 | 2 | 0 | 2011-06-06T23:14:56.710000 | 2011-06-06T23:30:21.180000 |
6,259,072 | 6,273,489 | IE9 rendering sprite hover image 1px off/blurred | I'm using a sprite to that has my button image and a hover image (slightly darker). Here's the CSS - my image is 31px tall: a { background-position: 0 0; }
a:hover { background-position: 0 -31px; } When I hover the background looks fine in all browsers but ie9 where it looks slightly blurred and appears to shift up on... | Instead of applying the background to an anchor, try making a div, applying the background to that, then wrapping it in anchor tags. In my experience, anchors are much harder to style. Also, is the image being scaled at all? Open your image in an image editor and make sure it's EXACTLY the width and height you want it,... | IE9 rendering sprite hover image 1px off/blurred I'm using a sprite to that has my button image and a hover image (slightly darker). Here's the CSS - my image is 31px tall: a { background-position: 0 0; }
a:hover { background-position: 0 -31px; } When I hover the background looks fine in all browsers but ie9 where it ... | TITLE:
IE9 rendering sprite hover image 1px off/blurred
QUESTION:
I'm using a sprite to that has my button image and a hover image (slightly darker). Here's the CSS - my image is 31px tall: a { background-position: 0 0; }
a:hover { background-position: 0 -31px; } When I hover the background looks fine in all browsers... | [
"css",
"internet-explorer-9",
"sprite",
"css-sprites"
] | 2 | 4 | 2,030 | 2 | 0 | 2011-06-06T23:15:07.367000 | 2011-06-08T02:08:23.497000 |
6,259,079 | 6,262,136 | Are elements searchable in a multimap? Is it needed? | If I have Key->Elements A->B,C,D,E Are B,C,D,E searchable, i.e. are they inserted into a red and black tree. I think the answer is no. I think I would need a multimap to make the value part searchable efficiently (i.e. part of a red and black tree) A->B,C,D B->C,D C->D D->E If I use a map of sets, this would best descr... | If you want the value part to be a sequence with efficient look-up time, you can use multimap if the elements of the value-sequence are unique, or multimap if not. This would give you logarithmic lookup time, and logarithmic insertion (this can be better or worse depending on the type of insertion, look at std::set and... | Are elements searchable in a multimap? Is it needed? If I have Key->Elements A->B,C,D,E Are B,C,D,E searchable, i.e. are they inserted into a red and black tree. I think the answer is no. I think I would need a multimap to make the value part searchable efficiently (i.e. part of a red and black tree) A->B,C,D B->C,D C-... | TITLE:
Are elements searchable in a multimap? Is it needed?
QUESTION:
If I have Key->Elements A->B,C,D,E Are B,C,D,E searchable, i.e. are they inserted into a red and black tree. I think the answer is no. I think I would need a multimap to make the value part searchable efficiently (i.e. part of a red and black tree) ... | [
"c++",
"containers"
] | 2 | 1 | 164 | 3 | 0 | 2011-06-06T23:15:56.117000 | 2011-06-07T07:50:42.393000 |
6,259,081 | 6,261,846 | Team Foundation Server Development Structure | I'm a part of a small development team who are in the process of moving from Visual Source Safe to TFS2010. I've been reading about TFS structure and came across a very good question. One thing mentioned in the above link which I'm not sure about is the Development structure: - Development/ - Trunk/ - Source/ - etc/ - ... | I agree, in the post you linked to it appears he has 2 "trunks", the Development\Trunk and Integration which is just another name for trunk in his context it appears. Depending on your branching strategy you usually only want to have one "trunk" (or integration branch). However, there are some scenarios where you might... | Team Foundation Server Development Structure I'm a part of a small development team who are in the process of moving from Visual Source Safe to TFS2010. I've been reading about TFS structure and came across a very good question. One thing mentioned in the above link which I'm not sure about is the Development structure... | TITLE:
Team Foundation Server Development Structure
QUESTION:
I'm a part of a small development team who are in the process of moving from Visual Source Safe to TFS2010. I've been reading about TFS structure and came across a very good question. One thing mentioned in the above link which I'm not sure about is the Dev... | [
"tfs",
"version-control",
"tfvc",
"team-project"
] | 1 | 0 | 842 | 2 | 0 | 2011-06-06T23:16:01.097000 | 2011-06-07T07:22:28.320000 |
6,259,086 | 6,259,119 | Where Do I Put the Scope for Related Models/Controllers | Transaction belongs_to Cart and Cart has_many Transactions. I have a Cart view that has the following in it: @cart.transactions.each do |t|. I want to limit the number of Transactions included in this loop to the first one. I also want to do this with a scope:first, limit(1).order('created_at ASC'). My question is: Whe... | If you want the first transaction, you can call it like so: @ftransaction = @cart.transactions.first Notice the plural transactions. The order for this by default is id ASC (unless you have a default scope defined), which should be for the sake of argument the same as created_at ASC. If you do decided you want or need ... | Where Do I Put the Scope for Related Models/Controllers Transaction belongs_to Cart and Cart has_many Transactions. I have a Cart view that has the following in it: @cart.transactions.each do |t|. I want to limit the number of Transactions included in this loop to the first one. I also want to do this with a scope:firs... | TITLE:
Where Do I Put the Scope for Related Models/Controllers
QUESTION:
Transaction belongs_to Cart and Cart has_many Transactions. I have a Cart view that has the following in it: @cart.transactions.each do |t|. I want to limit the number of Transactions included in this loop to the first one. I also want to do this... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 0 | 1 | 150 | 2 | 0 | 2011-06-06T23:16:51.050000 | 2011-06-06T23:21:07.657000 |
6,259,089 | 6,259,838 | Handling multiple windows in PyGTK/GtkBuilder | How can I store multiple different windows/dialogs in a single GtkBuilder file and then load these windows in different classes (each class corresponding to a different window)? For instance, currently I'm doing things like: def __init__(self): self.builder = gtk.Builder() self.builder.add_from_file('gtkbuilder.xml') s... | Using gtk.Builder.add_from_file adds the entire hierarchy from your file to the Builder object, which is why you're getting the signal connection warnings; the builder.connect_signals() call tries to connect up everything. Instead, use gtk.Builder.add_objects_from_file to choose the individual top-level window or widge... | Handling multiple windows in PyGTK/GtkBuilder How can I store multiple different windows/dialogs in a single GtkBuilder file and then load these windows in different classes (each class corresponding to a different window)? For instance, currently I'm doing things like: def __init__(self): self.builder = gtk.Builder() ... | TITLE:
Handling multiple windows in PyGTK/GtkBuilder
QUESTION:
How can I store multiple different windows/dialogs in a single GtkBuilder file and then load these windows in different classes (each class corresponding to a different window)? For instance, currently I'm doing things like: def __init__(self): self.builde... | [
"python",
"pygtk",
"glade",
"gtkbuilder"
] | 1 | 7 | 2,132 | 1 | 0 | 2011-06-06T23:17:07.850000 | 2011-06-07T01:41:03.660000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.