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,256,818 | 6,257,793 | Wxpython - how to generate a series of text prompts without closing the app? | I have a text box in wxpython (see below) that stores the name of the value as a variable. I am trying to do two things: After the answer is entered, I want to display another question, and assign the new answer to another variable, using the same or an idential TextEntryDialog window. Ideally, from a user standpoint, ... | I don't recommend creating and destroying 250 dialogs like the other fellow did. I would probably create a list or dict at the beginning of my program that would get appended to whenever the user enters an answer. Also in that event handler, I would reset the StaticText control with a new question. You might need to re... | Wxpython - how to generate a series of text prompts without closing the app? I have a text box in wxpython (see below) that stores the name of the value as a variable. I am trying to do two things: After the answer is entered, I want to display another question, and assign the new answer to another variable, using the ... | TITLE:
Wxpython - how to generate a series of text prompts without closing the app?
QUESTION:
I have a text box in wxpython (see below) that stores the name of the value as a variable. I am trying to do two things: After the answer is entered, I want to display another question, and assign the new answer to another va... | [
"python",
"wxpython"
] | 1 | 3 | 597 | 2 | 0 | 2011-06-06T19:09:18.293000 | 2011-06-06T20:41:48.320000 |
6,256,819 | 6,257,467 | Set ClientCredentials without using a Proxy? | Is it possible to set ClientCredentials without using a generated proxy? I have seen something about using a ChannelFactory, but is it possible to do it without this as well? | In order to call a WCF service from a client, you need a proxy (unless you want to hardcode the SOAP request yourself, which isn't something too easy to do, especially if you're dealing with security). The proxy can be created either using one of the tools to generate the proxy (Add Service Reference, svcutil, etc), or... | Set ClientCredentials without using a Proxy? Is it possible to set ClientCredentials without using a generated proxy? I have seen something about using a ChannelFactory, but is it possible to do it without this as well? | TITLE:
Set ClientCredentials without using a Proxy?
QUESTION:
Is it possible to set ClientCredentials without using a generated proxy? I have seen something about using a ChannelFactory, but is it possible to do it without this as well?
ANSWER:
In order to call a WCF service from a client, you need a proxy (unless yo... | [
"wcf"
] | 1 | 4 | 1,981 | 2 | 0 | 2011-06-06T19:09:20.493000 | 2011-06-06T20:10:48.960000 |
6,256,820 | 6,256,856 | OL missing numbers | This is going to seem like a stupid question and is basic html but I'm going to ask it anyway. I've seen a few posts that ask this similar question and its not helping fix my issue. I'm working off my local server for testing. I have this for my syntax. Kid Wonder Kid Wonder Kid Wonder Kid Wonder Kid Wonder However it ... | Try removing display: block; so that your css becomes like this instead: li.top5rankings { color: red; text-align: center; } | OL missing numbers This is going to seem like a stupid question and is basic html but I'm going to ask it anyway. I've seen a few posts that ask this similar question and its not helping fix my issue. I'm working off my local server for testing. I have this for my syntax. Kid Wonder Kid Wonder Kid Wonder Kid Wonder Kid... | TITLE:
OL missing numbers
QUESTION:
This is going to seem like a stupid question and is basic html but I'm going to ask it anyway. I've seen a few posts that ask this similar question and its not helping fix my issue. I'm working off my local server for testing. I have this for my syntax. Kid Wonder Kid Wonder Kid Won... | [
"html",
"xhtml"
] | 4 | 5 | 9,495 | 2 | 0 | 2011-06-06T19:09:27.180000 | 2011-06-06T19:13:39.630000 |
6,256,822 | 6,256,910 | Move list elements between two containers, combine with autocomplete | I would somehow assume that something like that has been asked but can't find anything. At the beginning, all students are in the left list. User can move students to the right list by clicking on the arrow User can move students back to the original list If group of students is too large, user can search with autocomp... | Something like this? $('#students li').live("click",function(){ $(this).appendTo("#selectedStudents") });
$('#selectedStudents li').live("click",function(){ $(this).appendTo("#students") });
$('#add').click(function(){ $('#students li').filter(function(){ if( $(this).text().toLowerCase() == $('#search').val().toLower... | Move list elements between two containers, combine with autocomplete I would somehow assume that something like that has been asked but can't find anything. At the beginning, all students are in the left list. User can move students to the right list by clicking on the arrow User can move students back to the original ... | TITLE:
Move list elements between two containers, combine with autocomplete
QUESTION:
I would somehow assume that something like that has been asked but can't find anything. At the beginning, all students are in the left list. User can move students to the right list by clicking on the arrow User can move students bac... | [
"javascript",
"jquery",
"ajax"
] | 2 | 2 | 1,290 | 2 | 0 | 2011-06-06T19:09:30.613000 | 2011-06-06T19:19:05.550000 |
6,256,825 | 6,256,899 | Cyrillic alphabet validation | I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value "Наталья" is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! - Duncan private boolean isAlphaNumeric(String str) ... | You have to use Unicode regex. for example \p{L}+ for any unicode letter. For more look in the java doc for java.util.Pattern there is section called unicode support. Also, there are details here: link | Cyrillic alphabet validation I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value "Наталья" is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! - Duncan private boolea... | TITLE:
Cyrillic alphabet validation
QUESTION:
I came across an interesting defect today the issue is I have a deployment of my web application in Russia and the name value "Наталья" is not returning true as alphaNumeric in the method below. Curious for some input on how people would approach a problem like this! - Dun... | [
"java",
"regex",
"validation",
"unicode",
"internationalization"
] | 13 | 18 | 16,566 | 2 | 0 | 2011-06-06T19:09:56.097000 | 2011-06-06T19:18:04.810000 |
6,256,836 | 6,257,699 | How to remove <a> tag only when xml node is empty | First of all, I apologize for my poor English. I'm using jquery plugin jParse which parse xml easily. here is the demo page( http://jparse.kylerush.net/demo ) I've tried a couple times but can't seem to figure out how to remove tag if the href is empty. Here is my code: elementTag: ['category', 'pubDate', 'title', 'lin... | Where are you calling $("a[href='']").remove() - it should be in your finish() function shown in the demo. If this is where you are using it it may be that the href is not entirely empty. Try: function finish() { jQuery('#jparse-meta').remove(); $('a').each(function() { var string = $(this).text().replace(/\s{2,}/g, ''... | How to remove <a> tag only when xml node is empty First of all, I apologize for my poor English. I'm using jquery plugin jParse which parse xml easily. here is the demo page( http://jparse.kylerush.net/demo ) I've tried a couple times but can't seem to figure out how to remove tag if the href is empty. Here is my code:... | TITLE:
How to remove <a> tag only when xml node is empty
QUESTION:
First of all, I apologize for my poor English. I'm using jquery plugin jParse which parse xml easily. here is the demo page( http://jparse.kylerush.net/demo ) I've tried a couple times but can't seem to figure out how to remove tag if the href is empty... | [
"jquery",
"xml"
] | 0 | 0 | 382 | 2 | 0 | 2011-06-06T19:10:58.983000 | 2011-06-06T20:31:55.957000 |
6,256,844 | 6,257,058 | sql server update from select | Following the answer from this post, I have something like this: update MyTable set column1 = otherTable.SomeColumn, column2 = otherTable.SomeOtherColumn from MyTable inner join (select *some complex query here*) as otherTable on MyTable.key_field = otherTable.key_field; However, I keep getting this error: The column p... | I submit to you this altered query: update x set x.pr_rpc_slr_amount_year_to_date = summary.sumSLR, x.pr_rpc_hours_year_to_date = summary.sumHours from pdx_projects x join ( select pr.pr_pk as pr_pk, sum(tc.stc_slr_amount) as SumSLR, sum(tc.stc_worked_hours) as SumHours from pdx_time_and_cost_from_rpc tc join pdx_rpc_p... | sql server update from select Following the answer from this post, I have something like this: update MyTable set column1 = otherTable.SomeColumn, column2 = otherTable.SomeOtherColumn from MyTable inner join (select *some complex query here*) as otherTable on MyTable.key_field = otherTable.key_field; However, I keep ge... | TITLE:
sql server update from select
QUESTION:
Following the answer from this post, I have something like this: update MyTable set column1 = otherTable.SomeColumn, column2 = otherTable.SomeOtherColumn from MyTable inner join (select *some complex query here*) as otherTable on MyTable.key_field = otherTable.key_field; ... | [
"sql",
"sql-server-2000"
] | 1 | 1 | 2,464 | 3 | 0 | 2011-06-06T19:11:26.563000 | 2011-06-06T19:36:35.283000 |
6,256,847 | 6,271,607 | Curious null-coalescing operator custom implicit conversion behaviour | Note: this appears to have been fixed in Roslyn This question arose when writing my answer to this one, which talks about the associativity of the null-coalescing operator. Just as a reminder, the idea of the null-coalescing operator is that an expression of the form x?? y first evaluates x, then: If the value of x is ... | Thanks to everyone who contributed to analyzing this issue. It is clearly a compiler bug. It appears to only happen when there is a lifted conversion involving two nullable types on the left-hand side of the coalescing operator. I have not yet identified where precisely things go wrong, but at some point during the "nu... | Curious null-coalescing operator custom implicit conversion behaviour Note: this appears to have been fixed in Roslyn This question arose when writing my answer to this one, which talks about the associativity of the null-coalescing operator. Just as a reminder, the idea of the null-coalescing operator is that an expre... | TITLE:
Curious null-coalescing operator custom implicit conversion behaviour
QUESTION:
Note: this appears to have been fixed in Roslyn This question arose when writing my answer to this one, which talks about the associativity of the null-coalescing operator. Just as a reminder, the idea of the null-coalescing operato... | [
"c#",
"null-coalescing-operator"
] | 573 | 435 | 27,277 | 5 | 0 | 2011-06-06T19:11:50.450000 | 2011-06-07T21:01:09.797000 |
6,256,850 | 6,261,006 | sending data back from datatables to codeigniter | I am having a datatable displayed using jquery datatable from a codeigniter controller. What i wanna know is how do i send values from within the datatable back to a controller and use those values to retrieve new records from DB and then load them on again into the page. My current code is $(function(){ $('#tableChart... | humm... assuming this select box has id as #min_max_value your javascript code will be something like in code down below. This code will re-invoke ajax and will redraw table. On the codeigniter controller u will be able to grab this min max value as $_POST['min_max_value'] i referred to this page on fnServerData sectio... | sending data back from datatables to codeigniter I am having a datatable displayed using jquery datatable from a codeigniter controller. What i wanna know is how do i send values from within the datatable back to a controller and use those values to retrieve new records from DB and then load them on again into the page... | TITLE:
sending data back from datatables to codeigniter
QUESTION:
I am having a datatable displayed using jquery datatable from a codeigniter controller. What i wanna know is how do i send values from within the datatable back to a controller and use those values to retrieve new records from DB and then load them on a... | [
"php",
"javascript",
"jquery",
"codeigniter",
"datatable"
] | 0 | 1 | 2,615 | 2 | 0 | 2011-06-06T19:12:05.130000 | 2011-06-07T05:38:57.333000 |
6,256,852 | 6,256,944 | How fast invalidate refreshers the canvas? | if i call invlidate() at the end of onDraw() function in a View, at what rate does the system refreshers?. In emulator it takes around 1 second to call the method. | What are you using the canvas for? If you're doing a game or something that needs to be refreshed constantly you should really use a SurfaceView. That will take care of calling the draw method at regular intervals without you having to call invalidate. That said the refresh rate of a SurfaceView really depends on what ... | How fast invalidate refreshers the canvas? if i call invlidate() at the end of onDraw() function in a View, at what rate does the system refreshers?. In emulator it takes around 1 second to call the method. | TITLE:
How fast invalidate refreshers the canvas?
QUESTION:
if i call invlidate() at the end of onDraw() function in a View, at what rate does the system refreshers?. In emulator it takes around 1 second to call the method.
ANSWER:
What are you using the canvas for? If you're doing a game or something that needs to b... | [
"android"
] | 2 | 2 | 852 | 1 | 0 | 2011-06-06T19:12:23.887000 | 2011-06-06T19:24:06.837000 |
6,256,853 | 6,259,098 | ASP.Net MVC Music Store Tutorial CSS Layout issue | I just completed an MVC tutorial, but some of my webpages don't look right. This is mine: But it's supposed to look like this: The code for this page is: @model MvcSuper.Models.MusicStore.Genre
@{ ViewBag.Title = "Browse Albums"; } @Model.Name Albums @foreach (var album in Model.Albums) { @album.Title } The left menu ... | To push that Album listing back up to its rightful place and put your mind at ease... add a width to your main css class: #main { overflow: hidden; padding: 0 0 15px 10px; float: left; width: 500px; } also add a * to first css class *{ margin: 0px; padding: 0px; border: none; } | ASP.Net MVC Music Store Tutorial CSS Layout issue I just completed an MVC tutorial, but some of my webpages don't look right. This is mine: But it's supposed to look like this: The code for this page is: @model MvcSuper.Models.MusicStore.Genre
@{ ViewBag.Title = "Browse Albums"; } @Model.Name Albums @foreach (var albu... | TITLE:
ASP.Net MVC Music Store Tutorial CSS Layout issue
QUESTION:
I just completed an MVC tutorial, but some of my webpages don't look right. This is mine: But it's supposed to look like this: The code for this page is: @model MvcSuper.Models.MusicStore.Genre
@{ ViewBag.Title = "Browse Albums"; } @Model.Name Albums ... | [
"css",
"asp.net-mvc"
] | 2 | 2 | 2,099 | 2 | 0 | 2011-06-06T19:12:47.937000 | 2011-06-06T23:17:59.100000 |
6,256,854 | 6,257,153 | Testing Browser Compatibility | If I'm using Windows 7 and IE9 to test browser compatibility for css/html/javascript is it "good enough" to use the developer tools and switch the browser mode between ie7, ie8 and ie9 or should i really be testing in each stand alone version? (using a virtual machine). Also, should i be testing these separately on XP,... | ...what's your baseline? IE7? One vm would do fine. I run Virtual Box for Win XP, but would suggest a stand alone machine for Win 7. I'd expect it to be a dog on a vm. But you might find it good enough. Funny thing is, FF on Linux and Win (4.0 for example) does produce different rendering results. | Testing Browser Compatibility If I'm using Windows 7 and IE9 to test browser compatibility for css/html/javascript is it "good enough" to use the developer tools and switch the browser mode between ie7, ie8 and ie9 or should i really be testing in each stand alone version? (using a virtual machine). Also, should i be t... | TITLE:
Testing Browser Compatibility
QUESTION:
If I'm using Windows 7 and IE9 to test browser compatibility for css/html/javascript is it "good enough" to use the developer tools and switch the browser mode between ie7, ie8 and ie9 or should i really be testing in each stand alone version? (using a virtual machine). A... | [
"html",
"css",
"testing",
"cross-browser"
] | 2 | 1 | 306 | 3 | 0 | 2011-06-06T19:12:51.690000 | 2011-06-06T19:43:37.457000 |
6,256,860 | 6,256,879 | Order results by category | I'm trying to order my blog posts by user defined category, i.e, the one they click on my blog page. Here's my code thus far, ########################################################## $cat = mysql_real_escape_string($_GET['category']); ##########################################################
$sql = "SELECT * FROM p... | $sql = "SELECT * FROM php_blog WHERE category = '". mysql_real_escape_string($cat). "' ORDER BY timestamp"; The string needed to be quoted (in your example it was Update, needs to be 'Update'), and also I ran it through mysql_real_escape_string() to protect you from SQL Injection. | Order results by category I'm trying to order my blog posts by user defined category, i.e, the one they click on my blog page. Here's my code thus far, ########################################################## $cat = mysql_real_escape_string($_GET['category']); #########################################################... | TITLE:
Order results by category
QUESTION:
I'm trying to order my blog posts by user defined category, i.e, the one they click on my blog page. Here's my code thus far, ########################################################## $cat = mysql_real_escape_string($_GET['category']); #######################################... | [
"php",
"mysql"
] | 1 | 4 | 144 | 2 | 0 | 2011-06-06T19:13:58.530000 | 2011-06-06T19:16:00.567000 |
6,256,866 | 6,283,138 | How to Test Functions w/ Complex Data Interactions | Currently, I am working on system that does quite a bit of reporting-style functions that consumes many different data points and transforms them into larger, sometimes flattened outputs. Most of my app is built upon a variation of the repository pattern. Due to this, I have a suite of mock-repositories that I use for ... | The first thing you want to do is make centralized object that knows how to retrieve the data for different repositories. Since this is reporting only, it's easier because you don't have to worry about change tracking. From a logistical standpoint, one thing I would consider is making a local database to hold the remot... | How to Test Functions w/ Complex Data Interactions Currently, I am working on system that does quite a bit of reporting-style functions that consumes many different data points and transforms them into larger, sometimes flattened outputs. Most of my app is built upon a variation of the repository pattern. Due to this, ... | TITLE:
How to Test Functions w/ Complex Data Interactions
QUESTION:
Currently, I am working on system that does quite a bit of reporting-style functions that consumes many different data points and transforms them into larger, sometimes flattened outputs. Most of my app is built upon a variation of the repository patt... | [
"c#",
"asp.net",
"testing"
] | 3 | 1 | 323 | 3 | 0 | 2011-06-06T19:14:29.107000 | 2011-06-08T17:58:55.723000 |
6,256,881 | 6,257,039 | jQuery injecting data in ajax global event | I'm trying to inject data in my ajax requests, but it fails and I don't know why. I tried to look at the jQuery source code, but still can't find why it doesn't work, Any help appreciated. Here is the code: $('#someElement').ajaxSend(function(e, req, options) { options.data += (options.data.length > 0? '&': '') + '__to... | I think the problem is that by the time jQuery decides to call the "ajaxSend" callback, the parameters have already been used to prepare the request. Thus, changing them in that handler has no effect. edit — given the answer from @mikermcneil I'm not sure this is right. The jQuery "ajax" method is, to say the least, co... | jQuery injecting data in ajax global event I'm trying to inject data in my ajax requests, but it fails and I don't know why. I tried to look at the jQuery source code, but still can't find why it doesn't work, Any help appreciated. Here is the code: $('#someElement').ajaxSend(function(e, req, options) { options.data +=... | TITLE:
jQuery injecting data in ajax global event
QUESTION:
I'm trying to inject data in my ajax requests, but it fails and I don't know why. I tried to look at the jQuery source code, but still can't find why it doesn't work, Any help appreciated. Here is the code: $('#someElement').ajaxSend(function(e, req, options)... | [
"javascript",
"jquery",
"ajax"
] | 3 | 2 | 429 | 4 | 0 | 2011-06-06T19:16:09.723000 | 2011-06-06T19:34:31.820000 |
6,256,883 | 6,257,003 | c# Web Service referencing c# project referencing DLL | Alright, so maybe this is inadvisable, but I'm writing a Web Service for an existing application. I'm trying to use the C# Library we wrote for the project, and that C# Library uses functions from a dll that is not acreated from a.NET project. I know the DLL isn't a problem, because the actual application (A windows fo... | I would run the winforms exe with depends.exe. You might be getting that error for a dell that the dll you are calling needs. | c# Web Service referencing c# project referencing DLL Alright, so maybe this is inadvisable, but I'm writing a Web Service for an existing application. I'm trying to use the C# Library we wrote for the project, and that C# Library uses functions from a dll that is not acreated from a.NET project. I know the DLL isn't a... | TITLE:
c# Web Service referencing c# project referencing DLL
QUESTION:
Alright, so maybe this is inadvisable, but I'm writing a Web Service for an existing application. I'm trying to use the C# Library we wrote for the project, and that C# Library uses functions from a dll that is not acreated from a.NET project. I kn... | [
"c#",
".net",
"asp.net",
"dllimport"
] | 3 | 2 | 764 | 1 | 0 | 2011-06-06T19:16:43.067000 | 2011-06-06T19:30:28.633000 |
6,256,884 | 6,259,884 | In .vimrc, how to test whether any filename arguments are given to Vim at invocation? | The answer to the question Using vim Sessions Only With GUI? suggests using au VimLeave * mksession! ~/.gvimsession au VimEnter * source ~/.gvimsession My problem is when I start Vim, say, by issuing $ gvim test.html, the test.html file is loaded into a buffer that is not shown. How can I test if arguments where passed... | One can test whether there are any command-line arguments (using the argc() function) and load the previously saved session only when there are not any::autocmd VimEnter * if argc() == 0 | source ~/.gvimsession | endif | In .vimrc, how to test whether any filename arguments are given to Vim at invocation? The answer to the question Using vim Sessions Only With GUI? suggests using au VimLeave * mksession! ~/.gvimsession au VimEnter * source ~/.gvimsession My problem is when I start Vim, say, by issuing $ gvim test.html, the test.html fi... | TITLE:
In .vimrc, how to test whether any filename arguments are given to Vim at invocation?
QUESTION:
The answer to the question Using vim Sessions Only With GUI? suggests using au VimLeave * mksession! ~/.gvimsession au VimEnter * source ~/.gvimsession My problem is when I start Vim, say, by issuing $ gvim test.html... | [
"vim"
] | 8 | 14 | 1,594 | 1 | 0 | 2011-06-06T19:16:50.190000 | 2011-06-07T01:49:36.657000 |
6,256,886 | 6,256,938 | Android startActivityForResult and child activity starts another activity | I have a scenario where I have my home screen (ActivityA) starting a login screen (ActivityB). This login screen will have a button to allow non-registered users to register an account, triggering (ActivityC). In my code, I am having ActivityA public class ActivityA extends Activity {... startActivityForResult(new Inte... | ActivtyA's onActivityResult method will be triggered by ActivityB when it finishes. It doesn't matter what ActivityB does during its lifecycle or how many new Activities it spawns, when finish() is called on ActivityB (hopefully after calling setResult() it will propagate back to ActivityA. The only gap in your communi... | Android startActivityForResult and child activity starts another activity I have a scenario where I have my home screen (ActivityA) starting a login screen (ActivityB). This login screen will have a button to allow non-registered users to register an account, triggering (ActivityC). In my code, I am having ActivityA pu... | TITLE:
Android startActivityForResult and child activity starts another activity
QUESTION:
I have a scenario where I have my home screen (ActivityA) starting a login screen (ActivityB). This login screen will have a button to allow non-registered users to register an account, triggering (ActivityC). In my code, I am h... | [
"android",
"android-activity"
] | 1 | 3 | 2,526 | 1 | 0 | 2011-06-06T19:16:51.610000 | 2011-06-06T19:22:30.547000 |
6,256,896 | 6,256,956 | Group results where specific ID in a while-loop | Table with data:
id score inputid 1 1 1 2 4 1 3 3 1 4 1 2 5 2 2 6 3 5 7 1 6 8 1 6
while ($stmt_score->fetch()) { if($bind_inputid == '1') $array['score'][0] += $bind_score; if($bind_inputid == '2') $array['score'][1] += $bind_score; if($bind_inputid == '5') $array['score'][2] += $bind_score; if($bind_inputid == '6') ... | Assume your result is sorted by inputid: $inputid_curr = -1; $score_array_index = -1; while ($stmt_score->fetch()) { if($inputid_curr!= $bind_inputid) { $score_array_index = $score_array_index + 1; $inputid_curr = $bind_inputid; }
$array['score'][$score_array_index] += $bind_score; } | Group results where specific ID in a while-loop Table with data:
id score inputid 1 1 1 2 4 1 3 3 1 4 1 2 5 2 2 6 3 5 7 1 6 8 1 6
while ($stmt_score->fetch()) { if($bind_inputid == '1') $array['score'][0] += $bind_score; if($bind_inputid == '2') $array['score'][1] += $bind_score; if($bind_inputid == '5') $array['scor... | TITLE:
Group results where specific ID in a while-loop
QUESTION:
Table with data:
id score inputid 1 1 1 2 4 1 3 3 1 4 1 2 5 2 2 6 3 5 7 1 6 8 1 6
while ($stmt_score->fetch()) { if($bind_inputid == '1') $array['score'][0] += $bind_score; if($bind_inputid == '2') $array['score'][1] += $bind_score; if($bind_inputid ==... | [
"php",
"while-loop",
"statements"
] | 0 | 1 | 103 | 1 | 0 | 2011-06-06T19:17:38.820000 | 2011-06-06T19:25:14.507000 |
6,256,902 | 6,257,661 | Message Sent To Deallocated Instance Error | I am getting a crash saying *** -[CFString release]: message sent to deallocated instance 0x7021e80 in my dealloc method for line [muscleURL release]; The init for muscleURL is @property (nonatomic, retain) NSString *muscleURL; This only happens when I click the done button in my NavBar. Here is the related code: - (vo... | NSString *muscleURL = [[self.muscleArray objectAtIndex:indexPath.row]objectForKey:@"musclePicture"]; This returns an auto released object so you do not need to release it in your dealloc method as the system has already deallocated the memory. It might be a good idea for you to read up on Objective-C memory management,... | Message Sent To Deallocated Instance Error I am getting a crash saying *** -[CFString release]: message sent to deallocated instance 0x7021e80 in my dealloc method for line [muscleURL release]; The init for muscleURL is @property (nonatomic, retain) NSString *muscleURL; This only happens when I click the done button in... | TITLE:
Message Sent To Deallocated Instance Error
QUESTION:
I am getting a crash saying *** -[CFString release]: message sent to deallocated instance 0x7021e80 in my dealloc method for line [muscleURL release]; The init for muscleURL is @property (nonatomic, retain) NSString *muscleURL; This only happens when I click ... | [
"iphone",
"objective-c",
"xcode",
"memory-management",
"dealloc"
] | 1 | 0 | 2,482 | 2 | 0 | 2011-06-06T19:18:15.230000 | 2011-06-06T20:29:39.453000 |
6,256,911 | 6,257,731 | unknown attribute error when submitting multiple records in double-nested form | I'm using nested_form for a situation where: Parent (climb) ==has_one==> Join Model (route_ascent) ==polymorphic has_many==> Children (route_step) So I have a climb object that looks like class Climb < ActiveRecord::Base has_one:route_ascent accepts_nested_attributes_for:route_ascent end Here's RouteAscent class RouteA... | From a quick glance it seems like the second ascent_steps_attributes has the same "identifier" "0" which would conflict with the first one. If you haven't already tested this data in irb that will be a good place to see if you can create your data objects with this input. | unknown attribute error when submitting multiple records in double-nested form I'm using nested_form for a situation where: Parent (climb) ==has_one==> Join Model (route_ascent) ==polymorphic has_many==> Children (route_step) So I have a climb object that looks like class Climb < ActiveRecord::Base has_one:route_ascent... | TITLE:
unknown attribute error when submitting multiple records in double-nested form
QUESTION:
I'm using nested_form for a situation where: Parent (climb) ==has_one==> Join Model (route_ascent) ==polymorphic has_many==> Children (route_step) So I have a climb object that looks like class Climb < ActiveRecord::Base ha... | [
"ruby-on-rails",
"nested-forms",
"nested-form-for"
] | 0 | 0 | 564 | 1 | 0 | 2011-06-06T19:19:07.517000 | 2011-06-06T20:34:10.327000 |
6,256,918 | 6,257,685 | Advanced data aggregation: counting average in MongoDB collections | I have a collection of documents like: { "browser": "firefox", "version": "4.0.1" }
{ "browser": "firefox", "version": "3.6.2" }
{ "browser": "ie", "version": "8.0" } How to count the average of all browsers so the results would be: global firefox: 66% global ie: 33%
precise firefox: 4.0.1: 50% 3.6.3: 50% The tricky... | Here is a solution that produces your statistics with pure numbers (e.g. 0.5 instead of 50%): var m = function() { emit('global', this.browser); emit('local', [this.browser, this.version]); };
var r = function(key, values) { var global={}, local={}, total=0, i, j, x; if (key == 'global') { values.forEach(function(v) {... | Advanced data aggregation: counting average in MongoDB collections I have a collection of documents like: { "browser": "firefox", "version": "4.0.1" }
{ "browser": "firefox", "version": "3.6.2" }
{ "browser": "ie", "version": "8.0" } How to count the average of all browsers so the results would be: global firefox: 66... | TITLE:
Advanced data aggregation: counting average in MongoDB collections
QUESTION:
I have a collection of documents like: { "browser": "firefox", "version": "4.0.1" }
{ "browser": "firefox", "version": "3.6.2" }
{ "browser": "ie", "version": "8.0" } How to count the average of all browsers so the results would be: ... | [
"mongodb",
"node.js"
] | 3 | 6 | 1,286 | 1 | 0 | 2011-06-06T19:19:39.223000 | 2011-06-06T20:30:41.840000 |
6,256,925 | 6,257,083 | Enforcing Input Method of Edit Text | I've tried searching around for an answer to this but I can't seem to find an answer. Is it possible for me to prevent a user from changing the input method of an edittext that I have created? Currently I have an edittext which I would like to only accept numbers from the user by displaying a soft keyboard similiar to ... | As far as I know, it's not possible to force a user to use a specific system keyboard inside your application (reference: android app specific soft keyboard ). That reference does show you how to create your own, though. It wouldn't be terribly difficult to create a View that pops up when the EditText is focused that p... | Enforcing Input Method of Edit Text I've tried searching around for an answer to this but I can't seem to find an answer. Is it possible for me to prevent a user from changing the input method of an edittext that I have created? Currently I have an edittext which I would like to only accept numbers from the user by dis... | TITLE:
Enforcing Input Method of Edit Text
QUESTION:
I've tried searching around for an answer to this but I can't seem to find an answer. Is it possible for me to prevent a user from changing the input method of an edittext that I have created? Currently I have an edittext which I would like to only accept numbers fr... | [
"android"
] | 0 | 2 | 4,406 | 1 | 0 | 2011-06-06T19:21:09.963000 | 2011-06-06T19:38:46.980000 |
6,256,931 | 6,257,015 | Selenium's waitForPageToLoad not reliable? | I am using Selenium to verify google.com First I type a Search query in the Search box, and click the Search button. The next page displays the Search results for the query. I used selenium.waitForPageToLoad("60000"); and then check that some elements on this page exist. But I get a "ERROR: Command timed out" for the w... | This is actually a mixed bag problem. You may want to give clickAndWait a try, but with the changes to asynchronous requests all over the web some of that has become unreliable. Some pages, even with the great google, don't return to a ready state and the script cannot tell the difference. You can, however, turn to wai... | Selenium's waitForPageToLoad not reliable? I am using Selenium to verify google.com First I type a Search query in the Search box, and click the Search button. The next page displays the Search results for the query. I used selenium.waitForPageToLoad("60000"); and then check that some elements on this page exist. But I... | TITLE:
Selenium's waitForPageToLoad not reliable?
QUESTION:
I am using Selenium to verify google.com First I type a Search query in the Search box, and click the Search button. The next page displays the Search results for the query. I used selenium.waitForPageToLoad("60000"); and then check that some elements on this... | [
"selenium"
] | 1 | 2 | 2,855 | 1 | 0 | 2011-06-06T19:21:37.093000 | 2011-06-06T19:31:47.740000 |
6,256,941 | 6,257,529 | Inheritance problem in javascript | I have the following class hierarchy: Storage Collection EixoCollection OfertaCollection And I have the following code: var ofertaCollection = new OfertaCollection(); var eixoCollection = new EixoCollection();
ofertaCollection.set('mykey', 'myvalue'); alert(eixoCollection.get('mykey')); // it returns 'myvalue', should... | Firstly, I suggest two changes in your code (that the examples will use): this.storage should be an object {}, since it looks like you never use it as an array. Also, get and set should be in the prototype, otherwise a new instance of those methods will be created for every instance object (unless a smart compiler opti... | Inheritance problem in javascript I have the following class hierarchy: Storage Collection EixoCollection OfertaCollection And I have the following code: var ofertaCollection = new OfertaCollection(); var eixoCollection = new EixoCollection();
ofertaCollection.set('mykey', 'myvalue'); alert(eixoCollection.get('mykey')... | TITLE:
Inheritance problem in javascript
QUESTION:
I have the following class hierarchy: Storage Collection EixoCollection OfertaCollection And I have the following code: var ofertaCollection = new OfertaCollection(); var eixoCollection = new EixoCollection();
ofertaCollection.set('mykey', 'myvalue'); alert(eixoColle... | [
"javascript",
"inheritance"
] | 4 | 2 | 137 | 3 | 0 | 2011-06-06T19:23:03.490000 | 2011-06-06T20:18:04.980000 |
6,256,945 | 6,261,652 | What can I use to track which button was pressed? | I have a button that I touch to enter a game mode. All buttons start the same activity, but the rules and physics are changed depending on what you touch. I want to track the button pressed so that I can know if people selected Classic mode or Training mode, and set the rules accordingly. How would I do this? Here is h... | I found a way to do what I wanted in a lot less steps public class Global{ public static int rules = 0; } And now I can just access those rules whenever and wherever I want by typing Global.rules | What can I use to track which button was pressed? I have a button that I touch to enter a game mode. All buttons start the same activity, but the rules and physics are changed depending on what you touch. I want to track the button pressed so that I can know if people selected Classic mode or Training mode, and set the... | TITLE:
What can I use to track which button was pressed?
QUESTION:
I have a button that I touch to enter a game mode. All buttons start the same activity, but the rules and physics are changed depending on what you touch. I want to track the button pressed so that I can know if people selected Classic mode or Training... | [
"java",
"android",
"variables"
] | 1 | 0 | 98 | 3 | 0 | 2011-06-06T19:24:10.503000 | 2011-06-07T07:00:40.977000 |
6,256,946 | 6,257,001 | Jquery/Javascript Retrieval of URL Not Working | Im trying to get this complete url: https://mail.google.com/mail/u/0/?ui=2#inbox/13047asdee8be4e1 Through the use of: var url = document.location.toString(); But it only returns up to https://mail.google.com/mail/u/0/?ui=2 I have also tried other ways like document.url, window.location and it still spits out same thing... | Try window.location.href. Read this: window.location - MDC Run this in console to be sure. function showLoc() { var x = window.location; var t = ['Property - Typeof - Value', 'window.location - ' + (typeof x) + ' - ' + x ]; for (var prop in x){ t.push(prop + ' - ' + (typeof x[prop]) + ' - ' + (x[prop] || 'n/a')); } ale... | Jquery/Javascript Retrieval of URL Not Working Im trying to get this complete url: https://mail.google.com/mail/u/0/?ui=2#inbox/13047asdee8be4e1 Through the use of: var url = document.location.toString(); But it only returns up to https://mail.google.com/mail/u/0/?ui=2 I have also tried other ways like document.url, wi... | TITLE:
Jquery/Javascript Retrieval of URL Not Working
QUESTION:
Im trying to get this complete url: https://mail.google.com/mail/u/0/?ui=2#inbox/13047asdee8be4e1 Through the use of: var url = document.location.toString(); But it only returns up to https://mail.google.com/mail/u/0/?ui=2 I have also tried other ways lik... | [
"php",
"javascript",
"jquery",
"url",
"gmail"
] | 3 | 3 | 186 | 5 | 0 | 2011-06-06T19:24:14.597000 | 2011-06-06T19:30:21.913000 |
6,256,951 | 6,257,054 | I get 'Variable x inaccessible here due to optimization' | I get 'Variable ForAllUsers inaccessible here due to optimization' even if the build configuration is set to 'Debug' and the Optimization is False. So, I cannot debug my program. Why do I get this? Which build is ran when I press the Run button? How can I see procedure Test(ForAllUsers: boolean); VAR FName, Path1, Path... | We all suffer from this from time to time. What I sometimes do is add some spurious code at the point at which I need to debug the variable that references the variable but does nothing. For example: if x>0 then x:= x*1; Or if it is a boolean then: if b then b:= not not b; Something along these lines is usually enough ... | I get 'Variable x inaccessible here due to optimization' I get 'Variable ForAllUsers inaccessible here due to optimization' even if the build configuration is set to 'Debug' and the Optimization is False. So, I cannot debug my program. Why do I get this? Which build is ran when I press the Run button? How can I see pro... | TITLE:
I get 'Variable x inaccessible here due to optimization'
QUESTION:
I get 'Variable ForAllUsers inaccessible here due to optimization' even if the build configuration is set to 'Debug' and the Optimization is False. So, I cannot debug my program. Why do I get this? Which build is ran when I press the Run button?... | [
"delphi",
"delphi-xe",
"delphi-ide"
] | 11 | 12 | 10,813 | 3 | 0 | 2011-06-06T19:24:44.573000 | 2011-06-06T19:36:17.990000 |
6,256,959 | 6,257,033 | c# regex - alternative text | I want to get the familyId and there is an alternative between compar/produ.aspx. I use the regex: \/selector/ (compar.+|produ.+).aspx\?famiid= (\d{2}) \&produ=\d{2} that matches: /selector/comparioPage.aspx?famiid=32&produ=40 and /selector/productCust.aspx?famiid=32&produ=40 and I get the familyId as the second match.... | You can specify a non-capturing group by using this syntax: (?:...) So your pattern becomes (?:compar.+|produ.+) It's not clear why you didn't use the full name of the pages, unless other pages exist with the same prefix. If so a better pattern might be: @"/selector/(?:compar|produ)[^.]+\.aspx\?famiid=(\d+)&produ=\d+";... | c# regex - alternative text I want to get the familyId and there is an alternative between compar/produ.aspx. I use the regex: \/selector/ (compar.+|produ.+).aspx\?famiid= (\d{2}) \&produ=\d{2} that matches: /selector/comparioPage.aspx?famiid=32&produ=40 and /selector/productCust.aspx?famiid=32&produ=40 and I get the f... | TITLE:
c# regex - alternative text
QUESTION:
I want to get the familyId and there is an alternative between compar/produ.aspx. I use the regex: \/selector/ (compar.+|produ.+).aspx\?famiid= (\d{2}) \&produ=\d{2} that matches: /selector/comparioPage.aspx?famiid=32&produ=40 and /selector/productCust.aspx?famiid=32&produ=... | [
"c#",
"regex"
] | 1 | 3 | 511 | 2 | 0 | 2011-06-06T19:25:42.247000 | 2011-06-06T19:33:50.760000 |
6,256,964 | 6,256,988 | Question mark icons showing up for quotation marks when there's a UTF-8 character encoding | For some reason, after I add: between my head tags, certain symbols (namely quotation marks) show up as diamond-shape icons with question marks in the middle, as if that symbol is not found. Anyone know what's up? | Your text editor is saving your file, including the quotation marks, in some encoding that isn't UTF-8 (most likely CP1252). Convert the file to actually be UTF-8 and try again. | Question mark icons showing up for quotation marks when there's a UTF-8 character encoding For some reason, after I add: between my head tags, certain symbols (namely quotation marks) show up as diamond-shape icons with question marks in the middle, as if that symbol is not found. Anyone know what's up? | TITLE:
Question mark icons showing up for quotation marks when there's a UTF-8 character encoding
QUESTION:
For some reason, after I add: between my head tags, certain symbols (namely quotation marks) show up as diamond-shape icons with question marks in the middle, as if that symbol is not found. Anyone know what's u... | [
"html",
"css",
"encoding",
"utf-8"
] | 2 | 3 | 8,823 | 2 | 0 | 2011-06-06T19:26:26.560000 | 2011-06-06T19:29:08.030000 |
6,256,965 | 6,257,499 | Android Programmatically Change Style | I have over 50 XML Layouts/pages and need a way to determine a "base" font size for each screen type (small/medium/large). Actually, I need to specify other things, such as sizes for linear layouts. In short, I want to differentiate sizes between small/medium/large devices. 1) Would I programmatically change the text s... | I'm assuming that you know that you should use scalable units as stated in Vinay's answer: http://developer.android.com/guide/practices/screens_support.html I strongly recommend not to deviate from the "best practices" unless you really know what you're doing. It can only bring you problems down the road. I'm not a pro... | Android Programmatically Change Style I have over 50 XML Layouts/pages and need a way to determine a "base" font size for each screen type (small/medium/large). Actually, I need to specify other things, such as sizes for linear layouts. In short, I want to differentiate sizes between small/medium/large devices. 1) Woul... | TITLE:
Android Programmatically Change Style
QUESTION:
I have over 50 XML Layouts/pages and need a way to determine a "base" font size for each screen type (small/medium/large). Actually, I need to specify other things, such as sizes for linear layouts. In short, I want to differentiate sizes between small/medium/larg... | [
"android",
"android-layout"
] | 3 | 3 | 2,780 | 2 | 0 | 2011-06-06T19:26:28.980000 | 2011-06-06T20:14:19.580000 |
6,256,976 | 6,310,112 | Discoloration in OpenGL | I'm using OpenGL to draw in 2D. I'm trying to overlay textures with alpha. I have done this: glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); And then I draw in reverse z-order. However, I'm getting strange discolorations. Here's an example of somet... | Is there any change if you use this as your blending function? glBlendFunc(GL_SRC_ONE,GL_ONE_MINUS_SRC_ALPHA); EDIT/SOLUTION: Pre-multiplied alpha in the PNG was the culprit. Alpha needed to be divided back out of RGB to correct the image and remove the gray artifact (see comment chain for details) | Discoloration in OpenGL I'm using OpenGL to draw in 2D. I'm trying to overlay textures with alpha. I have done this: glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); And then I draw in reverse z-order. However, I'm getting strange discolorations. He... | TITLE:
Discoloration in OpenGL
QUESTION:
I'm using OpenGL to draw in 2D. I'm trying to overlay textures with alpha. I have done this: glDisable(GL_DEPTH_TEST); glDepthMask(GL_FALSE);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); And then I draw in reverse z-order. However, I'm getting strange ... | [
"opengl",
"colors",
"2d",
"alpha",
"alphablending"
] | 7 | 2 | 863 | 3 | 0 | 2011-06-06T19:28:01.697000 | 2011-06-10T17:41:17.703000 |
6,256,979 | 6,257,214 | Android: adb pull error, myfile.txt does not exist | I'm developing an app that does some heavy html parsing. I want to make sure that the html and css have been properly formatted (I have strong reason to believe they are not). using logcat is not particularly helpuful since there is a great deal of text to sift through. So I thought why not write it to a file and then ... | The file will probably be located on /sdcard/myfile.txt since you are storing it on the root of the external storage (which is the sdcard I assume). Try pulling your file from there: adb pull /sdcard/myfile.txt. | Android: adb pull error, myfile.txt does not exist I'm developing an app that does some heavy html parsing. I want to make sure that the html and css have been properly formatted (I have strong reason to believe they are not). using logcat is not particularly helpuful since there is a great deal of text to sift through... | TITLE:
Android: adb pull error, myfile.txt does not exist
QUESTION:
I'm developing an app that does some heavy html parsing. I want to make sure that the html and css have been properly formatted (I have strong reason to believe they are not). using logcat is not particularly helpuful since there is a great deal of te... | [
"android",
"adb"
] | 1 | 0 | 7,053 | 5 | 0 | 2011-06-06T19:28:06.950000 | 2011-06-06T19:48:13.757000 |
6,256,982 | 6,257,393 | Parsing Links and Receiving Extra Blanks | I am parsing a webpage for http links by first parsing out all the anchored tags, then parsing out the href tags, then running a regex to remove all tags that aren't independent links (like href="/img/link.php"). The following code works correctly, but also appends lots of blank lines in between the parsed links. while... | The reason you are getting an empty string in value2 is that matchResults.Value == "" if the regular expression fails to match. Instead of checking if value2!= "", you could directly check matchResults.Success to see if the regular expression matched. You're basically doing that, anyway, since your particular regular e... | Parsing Links and Receiving Extra Blanks I am parsing a webpage for http links by first parsing out all the anchored tags, then parsing out the href tags, then running a regex to remove all tags that aren't independent links (like href="/img/link.php"). The following code works correctly, but also appends lots of blank... | TITLE:
Parsing Links and Receiving Extra Blanks
QUESTION:
I am parsing a webpage for http links by first parsing out all the anchored tags, then parsing out the href tags, then running a regex to remove all tags that aren't independent links (like href="/img/link.php"). The following code works correctly, but also app... | [
"c#",
"regex",
"parsing",
"html-parsing",
"append"
] | 1 | 2 | 131 | 3 | 0 | 2011-06-06T19:28:41.147000 | 2011-06-06T20:03:44.957000 |
6,256,983 | 6,257,048 | How are deques in Python implemented, and when are they worse than lists? | I've recently gotten into investigating how various data structures are implemented in Python in order to make my code more efficient. In investigating how lists and deques work, I found that I can get benefits when I want to shift and unshift reducing the time from O(n) in lists to O(1) in deques (lists being implemen... | https://github.com/python/cpython/blob/v3.8.1/Modules/_collectionsmodule.c A dequeobject is composed of a doubly-linked list of block nodes. So yes, a deque is a (doubly-)linked list as another answer suggests. Elaborating: What this means is that Python lists are much better for random-access and fixed-length operatio... | How are deques in Python implemented, and when are they worse than lists? I've recently gotten into investigating how various data structures are implemented in Python in order to make my code more efficient. In investigating how lists and deques work, I found that I can get benefits when I want to shift and unshift re... | TITLE:
How are deques in Python implemented, and when are they worse than lists?
QUESTION:
I've recently gotten into investigating how various data structures are implemented in Python in order to make my code more efficient. In investigating how lists and deques work, I found that I can get benefits when I want to sh... | [
"python",
"deque"
] | 110 | 105 | 52,119 | 4 | 0 | 2011-06-06T19:28:43.970000 | 2011-06-06T19:35:52.833000 |
6,256,989 | 6,257,040 | Pass property from controller to Model | I am trying to pass a variable from a method in my Controller to a method in a Model. Since the method in the Model takes one argument (which was designed earlier), I cannot pass my variable as an argument to the method in the Model. And also, the method in this Model is called by other controllers too, so if I change ... | Any reason why subclassing your model and overriding the GetItemInformation method wouldn't work? Or, even easier, why not just overload the GetItemInformation method with one that takes two strings? Your other controllers can still use the one that only takes a single string. public IList GetItemInformation(string ite... | Pass property from controller to Model I am trying to pass a variable from a method in my Controller to a method in a Model. Since the method in the Model takes one argument (which was designed earlier), I cannot pass my variable as an argument to the method in the Model. And also, the method in this Model is called by... | TITLE:
Pass property from controller to Model
QUESTION:
I am trying to pass a variable from a method in my Controller to a method in a Model. Since the method in the Model takes one argument (which was designed earlier), I cannot pass my variable as an argument to the method in the Model. And also, the method in this ... | [
"asp.net",
"asp.net-mvc-3",
"model",
"controller",
"parameter-passing"
] | 0 | 1 | 94 | 2 | 0 | 2011-06-06T19:29:08.443000 | 2011-06-06T19:35:00.297000 |
6,256,999 | 6,300,986 | WIX-based installation results in an invalid configuration file | EDIT I've decided to try to find a simpler way to ask this question: If my WIX-based installation needs to modify an XML file that looks like this: into one that looks like this: Can it be done without a custom action? Using the XmlConfig element, the closest I can get is this: The problem, if I have not made it plain,... | XmlConfig and XmlFile get converted to custom actions btw. Can you start with a different xml file such that you can add all children nodes to the parent in the correct sequence? Otherwise, you can request this behavior as a new feature request to the WiX team here: http://sourceforge.net/tracker/?group_id=105970&atid=... | WIX-based installation results in an invalid configuration file EDIT I've decided to try to find a simpler way to ask this question: If my WIX-based installation needs to modify an XML file that looks like this: into one that looks like this: Can it be done without a custom action? Using the XmlConfig element, the clos... | TITLE:
WIX-based installation results in an invalid configuration file
QUESTION:
EDIT I've decided to try to find a simpler way to ask this question: If my WIX-based installation needs to modify an XML file that looks like this: into one that looks like this: Can it be done without a custom action? Using the XmlConfig... | [
"web-config",
"wix",
"wix3.5"
] | 0 | 0 | 218 | 1 | 0 | 2011-06-06T19:30:13.570000 | 2011-06-10T01:10:47.493000 |
6,257,004 | 6,268,455 | using Codeigniter session class across multiple php files (controllers) | I have two controllers, user and module. By default the user controller is loaded and the user first logs in. Once the user is authenticated (by the school), a token is issued which is used to make all the calls to the school's API. I create a session and store the token in it. $this->session->set_userdata('token', $_G... | hope this one solve your problem:) General problems regards loading libraries, and hooks | using Codeigniter session class across multiple php files (controllers) I have two controllers, user and module. By default the user controller is loaded and the user first logs in. Once the user is authenticated (by the school), a token is issued which is used to make all the calls to the school's API. I create a sess... | TITLE:
using Codeigniter session class across multiple php files (controllers)
QUESTION:
I have two controllers, user and module. By default the user controller is loaded and the user first logs in. Once the user is authenticated (by the school), a token is issued which is used to make all the calls to the school's AP... | [
"php",
"codeigniter"
] | 1 | 1 | 1,001 | 2 | 0 | 2011-06-06T19:30:31.210000 | 2011-06-07T16:24:22.163000 |
6,257,011 | 6,257,213 | XUL: How to include and extend another .xul file? | I like to create a window by extending the basic Firefox window which is defined in chrome://browser/content/browser.xul as the top level element (is not overlay). My question is about branching/forking from basic window definition before any modification applied to it by other extension and is not about how to apply o... | Your question is still about overlays. Your overlay should go like this:... This example will add a element to the root of the browser window (which happens to be a element with ID main-window ). Edit: It appears that the question wasn't about adding elements on the top level but rather about making a fork of an existi... | XUL: How to include and extend another .xul file? I like to create a window by extending the basic Firefox window which is defined in chrome://browser/content/browser.xul as the top level element (is not overlay). My question is about branching/forking from basic window definition before any modification applied to it ... | TITLE:
XUL: How to include and extend another .xul file?
QUESTION:
I like to create a window by extending the basic Firefox window which is defined in chrome://browser/content/browser.xul as the top level element (is not overlay). My question is about branching/forking from basic window definition before any modificat... | [
"firefox-addon",
"xul"
] | 2 | 2 | 1,018 | 1 | 0 | 2011-06-06T19:31:18.840000 | 2011-06-06T19:48:06.817000 |
6,257,013 | 6,257,106 | How to combine overload and stdcall in Delphi? | I have a SOAP Data Module that exports this function function MyFunction(MyParam1, MyParam2): boolean; stdcall; I can use this function from another exe. Everything works. Now I want to use the same function from inside the same project it's in. I added its unit to the uses clause but it didn't recognise it (I got Unde... | Your problem has nothing to do with the calling convention. A few things to notice: A silly bug First, function MyFunction(MyParam1, MyParam2): boolean; stdcall; is a syntax error. You have forgotten to specify the types of MyParam1 and MyParam2. Visibility Consider the unit unit Unit1;
interface
uses Windows, Messag... | How to combine overload and stdcall in Delphi? I have a SOAP Data Module that exports this function function MyFunction(MyParam1, MyParam2): boolean; stdcall; I can use this function from another exe. Everything works. Now I want to use the same function from inside the same project it's in. I added its unit to the use... | TITLE:
How to combine overload and stdcall in Delphi?
QUESTION:
I have a SOAP Data Module that exports this function function MyFunction(MyParam1, MyParam2): boolean; stdcall; I can use this function from another exe. Everything works. Now I want to use the same function from inside the same project it's in. I added i... | [
"delphi",
"delphi-7"
] | 2 | 8 | 1,380 | 2 | 0 | 2011-06-06T19:31:29.963000 | 2011-06-06T19:40:41.513000 |
6,257,017 | 6,257,100 | .net WinForms control validation - how to explicitly validate all controls | If I create a simple Winforms app with a button and a textbox, and the following event handlers, I'd expect to see "False" when I hit the button. When I hit the button, it actually produces "True". Why is the form valid? It doesn't appear that the validating event is executing at all, even though the docs say that pass... | It looks like you're trying to validate a child control of the Form. If that's the case, you should use one of the ValidateChildren methods instead of Validate. | .net WinForms control validation - how to explicitly validate all controls If I create a simple Winforms app with a button and a textbox, and the following event handlers, I'd expect to see "False" when I hit the button. When I hit the button, it actually produces "True". Why is the form valid? It doesn't appear that t... | TITLE:
.net WinForms control validation - how to explicitly validate all controls
QUESTION:
If I create a simple Winforms app with a button and a textbox, and the following event handlers, I'd expect to see "False" when I hit the button. When I hit the button, it actually produces "True". Why is the form valid? It doe... | [
"c#",
"winforms",
"validation"
] | 1 | 4 | 2,192 | 1 | 0 | 2011-06-06T19:31:54.807000 | 2011-06-06T19:40:21.140000 |
6,257,022 | 6,257,059 | Convince a skeptic! Why do I need a "Roles" table in my database? | When designing the database tables for storing simple User/Role information, can anyone tell me why it would be a bad idea to store the Role information directly on the User table (for example, Comma-Separated in a Roles column). Thoughts: The database doesn't need to know about the roles, that's the UI's domain The qu... | Because it violates 3rd normal form. You want to seperate all of your entities as different objects which means you need a seperate table, as well as a relationship table. Violation of data If you keep all of this in one table you are placing too much irrelevant information about a user in a user's table. A user's tabl... | Convince a skeptic! Why do I need a "Roles" table in my database? When designing the database tables for storing simple User/Role information, can anyone tell me why it would be a bad idea to store the Role information directly on the User table (for example, Comma-Separated in a Roles column). Thoughts: The database d... | TITLE:
Convince a skeptic! Why do I need a "Roles" table in my database?
QUESTION:
When designing the database tables for storing simple User/Role information, can anyone tell me why it would be a bad idea to store the Role information directly on the User table (for example, Comma-Separated in a Roles column). Though... | [
"database-design",
"user-roles"
] | 2 | 2 | 519 | 5 | 0 | 2011-06-06T19:32:37.390000 | 2011-06-06T19:36:34.970000 |
6,257,023 | 6,264,777 | Can ServiceStack use binary serializers for non-HTTP clients, e.g. Google Protocol Buffers? | As a followup to Does ServiceStack support binary responses?, I'm wondering whether there are injection points built (or planned) to use binary serializers such as Mark Gravell's protobuf-net for efficiency between non-HTTP clients. In fact, it might not be long before protocol buffers work in JavaScript. | Yep, ServiceStack has a custom pluggable format API where its own built-in CSV Format and HTML Report Format are both registered using it. The tutorial of Nortwind Database's custom v-card media type shows how to register your own format/media type using this API. Support for protobuf-net is planned for the near future... | Can ServiceStack use binary serializers for non-HTTP clients, e.g. Google Protocol Buffers? As a followup to Does ServiceStack support binary responses?, I'm wondering whether there are injection points built (or planned) to use binary serializers such as Mark Gravell's protobuf-net for efficiency between non-HTTP clie... | TITLE:
Can ServiceStack use binary serializers for non-HTTP clients, e.g. Google Protocol Buffers?
QUESTION:
As a followup to Does ServiceStack support binary responses?, I'm wondering whether there are injection points built (or planned) to use binary serializers such as Mark Gravell's protobuf-net for efficiency bet... | [
"servicestack"
] | 2 | 1 | 573 | 1 | 0 | 2011-06-06T19:32:42.133000 | 2011-06-07T11:53:16.613000 |
6,257,031 | 6,257,120 | A question about Template in C++ | I know the basics of templates in C++, but I am still learning it. I have a question regarding to the following code: #include using namespace std;
class PNG { public: static void draw() { cout<<"PNG drawing"< void draw() { Image::draw(); }
int main() {
draw (); } the function draw(), I pass the type Image to it, an... | Your first question if I call this template function draw() in main in this way: draw(); is it allowed? As you have realised, the compiler cannot deduce by itself that you mean draw if there are no function arguments from which to figure it out. So, you have to write (as you already do): int main() { draw (); } You can... | A question about Template in C++ I know the basics of templates in C++, but I am still learning it. I have a question regarding to the following code: #include using namespace std;
class PNG { public: static void draw() { cout<<"PNG drawing"< void draw() { Image::draw(); }
int main() {
draw (); } the function draw()... | TITLE:
A question about Template in C++
QUESTION:
I know the basics of templates in C++, but I am still learning it. I have a question regarding to the following code: #include using namespace std;
class PNG { public: static void draw() { cout<<"PNG drawing"< void draw() { Image::draw(); }
int main() {
draw (); } t... | [
"c++",
"templates"
] | 0 | 4 | 141 | 3 | 0 | 2011-06-06T19:33:33.287000 | 2011-06-06T19:41:42.870000 |
6,257,041 | 6,257,085 | Why does the list style disappear when display: block is added to a list item in a list (<ul> or <ol>)? | This seems to valid for display: inline; and display: inline-block; too. This is what I mean: ul li { display: block; /* Or display: inline; */ /* Or display: inline-block; */ } list item1 list item3 list item3 And with list style I mean the actual "bullets" or "numbers" (when is used) | That's because normally, display is set to list-item for elements. See the W3C CSS3 specification: http://www.w3.org/TR/css3-lists/#declaring-a-list-item. To declare a list item, the ‘display’ property should be set to ‘list-item’. Note that you can give arbitrary HTML elements the same behaviour; set display: list-ite... | Why does the list style disappear when display: block is added to a list item in a list (<ul> or <ol>)? This seems to valid for display: inline; and display: inline-block; too. This is what I mean: ul li { display: block; /* Or display: inline; */ /* Or display: inline-block; */ } list item1 list item3 list item3 And w... | TITLE:
Why does the list style disappear when display: block is added to a list item in a list (<ul> or <ol>)?
QUESTION:
This seems to valid for display: inline; and display: inline-block; too. This is what I mean: ul li { display: block; /* Or display: inline; */ /* Or display: inline-block; */ } list item1 list item... | [
"html",
"css",
"html-lists"
] | 30 | 53 | 26,206 | 6 | 0 | 2011-06-06T19:35:10.370000 | 2011-06-06T19:39:00.330000 |
6,257,049 | 6,282,868 | Java Desktop.browse occasionally returning "requested lookup key not found in any active activation context" | I am really struggling with this issue as it seems to occur randomly for me. When I call, Desktop.browse("some url"); Internet Explorer will not display. The exception message is as follows, The requested lookup key was not found in any active activation context. When it occurs it occurs consistently until I restart th... | I narrowed down the problem and discovered what was TRULY causing this, it had nothing to do with the time after all. java.awt.Desktop.browse("some url"); was throwing this error because in a previous step in the application an ActiveXObject was opened programmatically using the JACOB framework. The developer that wrot... | Java Desktop.browse occasionally returning "requested lookup key not found in any active activation context" I am really struggling with this issue as it seems to occur randomly for me. When I call, Desktop.browse("some url"); Internet Explorer will not display. The exception message is as follows, The requested lookup... | TITLE:
Java Desktop.browse occasionally returning "requested lookup key not found in any active activation context"
QUESTION:
I am really struggling with this issue as it seems to occur randomly for me. When I call, Desktop.browse("some url"); Internet Explorer will not display. The exception message is as follows, Th... | [
"java",
"internet-explorer",
"activexobject",
"jacob"
] | 0 | 0 | 867 | 1 | 0 | 2011-06-06T19:35:52.833000 | 2011-06-08T17:34:59.690000 |
6,257,051 | 6,260,315 | Mongoid Syntax Question | In episode 189 of Railscasts, there is a named scope in the User model which is as follows: field:roles_mask,:type => Integer ROLES = %w[admin moderator author]
named_scope:with_role, lambda { |role| {:conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0"} }
# roles related def roles=(roles) self.roles_mask =... | That episode of Railscasts was really designed for databases that don't support arrays as native types (which Mongoid does). Then you could just create a scope which uses one of the array query criteria. For example: class User include Mongoid::Document
field:email field:roles,:type => Array
ROLES = %w[admin moderato... | Mongoid Syntax Question In episode 189 of Railscasts, there is a named scope in the User model which is as follows: field:roles_mask,:type => Integer ROLES = %w[admin moderator author]
named_scope:with_role, lambda { |role| {:conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0"} }
# roles related def roles=(... | TITLE:
Mongoid Syntax Question
QUESTION:
In episode 189 of Railscasts, there is a named scope in the User model which is as follows: field:roles_mask,:type => Integer ROLES = %w[admin moderator author]
named_scope:with_role, lambda { |role| {:conditions => "roles_mask & #{2**ROLES.index(role.to_s)} > 0"} }
# roles r... | [
"ruby-on-rails",
"mongoid",
"railscasts"
] | 0 | 4 | 510 | 2 | 0 | 2011-06-06T19:36:08.927000 | 2011-06-07T03:27:19.400000 |
6,257,055 | 6,257,282 | Retrieving relative url path of file inside a include file, jsp | I have a file called Main.jsp, located at the absolute url path of "http://Mywebpage.com/Open/This/Folder/Main.jsp". Inside Main.jsp, there is a jsp include: <%@ include file="../../Top.jsp" %> Now, inside the Top.jsp page, I have other jsp and javascript statements which reference files: <%@ taglib uri="emonogram.tld"... | The The leading slash will make it relative to the domain root. However, if your webapp is not deployed on the domain root per se, but on a context path, such as /Open in your (oversimplified) example, and your JS file is actually located in http://Mywebpage.com/Open/HL.js then you need to prepend the URL with HttpServ... | Retrieving relative url path of file inside a include file, jsp I have a file called Main.jsp, located at the absolute url path of "http://Mywebpage.com/Open/This/Folder/Main.jsp". Inside Main.jsp, there is a jsp include: <%@ include file="../../Top.jsp" %> Now, inside the Top.jsp page, I have other jsp and javascript ... | TITLE:
Retrieving relative url path of file inside a include file, jsp
QUESTION:
I have a file called Main.jsp, located at the absolute url path of "http://Mywebpage.com/Open/This/Folder/Main.jsp". Inside Main.jsp, there is a jsp include: <%@ include file="../../Top.jsp" %> Now, inside the Top.jsp page, I have other j... | [
"jsp",
"url",
"path",
"include",
"relative-path"
] | 3 | 13 | 18,645 | 1 | 0 | 2011-06-06T19:36:25.823000 | 2011-06-06T19:53:34.613000 |
6,257,060 | 6,257,123 | What resources can I use to convince the management to adopt unit testing? | So where i work.. they are still not doing any unit testing. I need some good articles to present management the importance of unit testing. Has anyone has good resources which I can use to present it to management? Looking for some article written by some gurus so I can pass along making my suggestion to management mo... | Check out this question which has nearly 200 upvotes: Is Unit Testing worth the effort? You might find some other helpful questions by clicking on the unit-testing tag. | What resources can I use to convince the management to adopt unit testing? So where i work.. they are still not doing any unit testing. I need some good articles to present management the importance of unit testing. Has anyone has good resources which I can use to present it to management? Looking for some article writ... | TITLE:
What resources can I use to convince the management to adopt unit testing?
QUESTION:
So where i work.. they are still not doing any unit testing. I need some good articles to present management the importance of unit testing. Has anyone has good resources which I can use to present it to management? Looking for... | [
"unit-testing",
"testing"
] | 0 | 0 | 106 | 2 | 0 | 2011-06-06T19:36:41.803000 | 2011-06-06T19:41:46.127000 |
6,257,069 | 6,257,190 | Facebook Like - Fanpage not current URL with API | Currently I'm hitting the API through the JS SDK. What I am trying to do is accomplish is having a like button on my website. But rather than liking the URL you are on..like the fan page. Is this possible? | Yes, it is possible. With the iframe version: you would assign the href value to the URL you'd want to like. In your case, the url of the facebook fan page. Just make sure you escape the characters in the url correctly. For example: http://www.facebook.com/yourpage would become: http%3A%2F%2Fwww.facebook.com%2Fyourpage | Facebook Like - Fanpage not current URL with API Currently I'm hitting the API through the JS SDK. What I am trying to do is accomplish is having a like button on my website. But rather than liking the URL you are on..like the fan page. Is this possible? | TITLE:
Facebook Like - Fanpage not current URL with API
QUESTION:
Currently I'm hitting the API through the JS SDK. What I am trying to do is accomplish is having a like button on my website. But rather than liking the URL you are on..like the fan page. Is this possible?
ANSWER:
Yes, it is possible. With the iframe v... | [
"javascript",
"facebook",
"api"
] | 0 | 0 | 647 | 1 | 0 | 2011-06-06T19:38:13.673000 | 2011-06-06T19:46:23.710000 |
6,257,074 | 6,257,269 | LINQ Join with Multiple From Clauses | When writing LINQ queries in C#, I know I can perform a join using the join keyword. But what does the following do? from c in Companies from e in c.Employees select e; A LINQ book I have say it's a type of join, but not a proper join (which uses the join keyword). So exactly what type of join is it then? | Multiple "from" statements are considered compound linq statments. They are like nested foreach statements. The msdn page does list a great example here var scoreQuery = from student in students from score in student.Scores where score > 90 select new { Last = student.LastName, score }; this statement could be rewritte... | LINQ Join with Multiple From Clauses When writing LINQ queries in C#, I know I can perform a join using the join keyword. But what does the following do? from c in Companies from e in c.Employees select e; A LINQ book I have say it's a type of join, but not a proper join (which uses the join keyword). So exactly what t... | TITLE:
LINQ Join with Multiple From Clauses
QUESTION:
When writing LINQ queries in C#, I know I can perform a join using the join keyword. But what does the following do? from c in Companies from e in c.Employees select e; A LINQ book I have say it's a type of join, but not a proper join (which uses the join keyword).... | [
"c#",
"linq"
] | 62 | 63 | 41,154 | 4 | 0 | 2011-06-06T19:38:26.960000 | 2011-06-06T19:52:39.027000 |
6,257,075 | 6,257,215 | Filtering out empty tags in XML with C# | So I am using this code to parse a gigantic (80,000 line) XML document. However when it was handed to me it added unnessecary rows due to parent nodes(which was fixed by the if statement in the code), and now it is doubling up on empty nodes. Whenever I hit an empty node it will double up on the node before it... for e... | Does this work? case XmlNodeType.Element: elementName = reader.Name; elementText = null; // ADDED switch (elementName) { //display my title stuff } break;... case XmlNodeType.EndElement: if (elementName == reader.Name && elementText!= null) // MODIFIED { contractRowArray1[0] = elementName; contractRowArray1[1] = elemen... | Filtering out empty tags in XML with C# So I am using this code to parse a gigantic (80,000 line) XML document. However when it was handed to me it added unnessecary rows due to parent nodes(which was fixed by the if statement in the code), and now it is doubling up on empty nodes. Whenever I hit an empty node it will ... | TITLE:
Filtering out empty tags in XML with C#
QUESTION:
So I am using this code to parse a gigantic (80,000 line) XML document. However when it was handed to me it added unnessecary rows due to parent nodes(which was fixed by the if statement in the code), and now it is doubling up on empty nodes. Whenever I hit an e... | [
"c#",
"xml",
"tags"
] | 0 | 2 | 590 | 1 | 0 | 2011-06-06T19:38:35.483000 | 2011-06-06T19:48:14.467000 |
6,257,078 | 6,262,777 | Casting ClutterActor* to ClutterStage* | I am exploring the possibility of creating a Clutter binding for the D language ( http://d-programming-language.org/ ) and have started by trying some simple tests using dynamic loading of libclutter. I've run into a problem that might derive from the GObject inheritance system, and I'd appreciate any help getting it f... | The problem is that you don't declare the C functions as extern(C). Because of that dmd thinks you're calling a D function and uses the wrong calling convention. One way to do this correctly is like this: alias extern(C) void function(void*, const char*) setTitleFunc; auto clutter_stage_set_title = getSym!(setTitleFunc... | Casting ClutterActor* to ClutterStage* I am exploring the possibility of creating a Clutter binding for the D language ( http://d-programming-language.org/ ) and have started by trying some simple tests using dynamic loading of libclutter. I've run into a problem that might derive from the GObject inheritance system, a... | TITLE:
Casting ClutterActor* to ClutterStage*
QUESTION:
I am exploring the possibility of creating a Clutter binding for the D language ( http://d-programming-language.org/ ) and have started by trying some simple tests using dynamic loading of libclutter. I've run into a problem that might derive from the GObject inh... | [
"d",
"gobject",
"clutter"
] | 2 | 2 | 273 | 2 | 0 | 2011-06-06T19:38:40.643000 | 2011-06-07T08:49:01.150000 |
6,257,080 | 6,258,819 | Search results, filter by access rights | I have implemented search for my customers master successfully, and it searches the entire customer master. I have agents logged in who are doing the searching. Customer accounts are associated with agents. I need to restrict the search to customers associated to the agent (who is logged in). How do I do this? | Seems like you need to LEFT JOIN. Why don't you LEFT JOIN the tables that are in question. For ex: orders, sales_agents, customers... Might just work. | Search results, filter by access rights I have implemented search for my customers master successfully, and it searches the entire customer master. I have agents logged in who are doing the searching. Customer accounts are associated with agents. I need to restrict the search to customers associated to the agent (who i... | TITLE:
Search results, filter by access rights
QUESTION:
I have implemented search for my customers master successfully, and it searches the entire customer master. I have agents logged in who are doing the searching. Customer accounts are associated with agents. I need to restrict the search to customers associated t... | [
"php",
"mysql",
"search"
] | 0 | 1 | 174 | 2 | 0 | 2011-06-06T19:38:43.860000 | 2011-06-06T22:39:33.963000 |
6,257,087 | 6,257,168 | Using $_POST += array() for default values | I'm finishing up a small contact form and had a question about providing default values for $_POST. The reason I'm asking about default values is because within my form I have fields like this: Clearly I would like to retain the submitted value if I do not permit the data to clear. This raises errors when the page is f... | Even if you are doing so, put that data in your container, do not modify superglobals. Create class that'll contain your data - then you'll have the interface do sanitize, manipulate and get it te proper way. Import data from $_POST and then validate, if all necessary values are in. As for code: data = is_array($data)?... | Using $_POST += array() for default values I'm finishing up a small contact form and had a question about providing default values for $_POST. The reason I'm asking about default values is because within my form I have fields like this: Clearly I would like to retain the submitted value if I do not permit the data to c... | TITLE:
Using $_POST += array() for default values
QUESTION:
I'm finishing up a small contact form and had a question about providing default values for $_POST. The reason I'm asking about default values is because within my form I have fields like this: Clearly I would like to retain the submitted value if I do not pe... | [
"php",
"arrays",
"post"
] | 2 | 2 | 642 | 3 | 0 | 2011-06-06T19:39:21.327000 | 2011-06-06T19:45:04.173000 |
6,257,089 | 6,257,884 | Struts 1.x html:select with default "no selection" value -- best approach? | In a Struts 1.x application, I have a form with a simple single-selection html:select element. I want to force the user to touch the box and make a choice, rather than allowing the first option to be the de facto default value. An obvious first step is to add a stand-in html:option value as the first item in the list. ... | You could simply have the Please choose... option have value="" then make the field required in your validation. | Struts 1.x html:select with default "no selection" value -- best approach? In a Struts 1.x application, I have a form with a simple single-selection html:select element. I want to force the user to touch the box and make a choice, rather than allowing the first option to be the de facto default value. An obvious first ... | TITLE:
Struts 1.x html:select with default "no selection" value -- best approach?
QUESTION:
In a Struts 1.x application, I have a form with a simple single-selection html:select element. I want to force the user to touch the box and make a choice, rather than allowing the first option to be the de facto default value.... | [
"java",
"struts"
] | 0 | 0 | 2,086 | 2 | 0 | 2011-06-06T19:39:42.643000 | 2011-06-06T20:50:28.830000 |
6,257,099 | 6,257,127 | Php - Only show last part of value | I have a value from my database: 250.00$ 100x100cm or 1960.00$ 500x500cm How do I make it so that it cuts away the price and only shows the measurements? So it should only print out: 100x100cm or 500x500cm I hope that's easy enough to understand. | Try this: $value = "250.00$ 100x100cm"; $value_parts = explode(" ", $value); echo $value_parts[1]; | Php - Only show last part of value I have a value from my database: 250.00$ 100x100cm or 1960.00$ 500x500cm How do I make it so that it cuts away the price and only shows the measurements? So it should only print out: 100x100cm or 500x500cm I hope that's easy enough to understand. | TITLE:
Php - Only show last part of value
QUESTION:
I have a value from my database: 250.00$ 100x100cm or 1960.00$ 500x500cm How do I make it so that it cuts away the price and only shows the measurements? So it should only print out: 100x100cm or 500x500cm I hope that's easy enough to understand.
ANSWER:
Try this: $... | [
"php"
] | 0 | 0 | 163 | 7 | 0 | 2011-06-06T19:40:19.507000 | 2011-06-06T19:41:57.450000 |
6,257,114 | 6,257,600 | How to speed up this moving algorithm? In Javascript | I have an Array of 16 billiard balls in JS and want to move each ball smoothly with its direction and speed. For that I set up a timer, calling UpdateThis() every 42ms (for 24 fps). The problem is that UpdateThis() takes 53ms as firebug states. Now UpdateThis iterates over every ball and calls UpdateBall(ball). I assum... | What about separating the position updates from the drawing? So have something like this (untested code): function DrawBall(ball) { ball.MoveTo(); //Take this line out of UpdateBall } - function UpdateThis() { for(var i = 0; i < balls.length; i++) { var cur = balls[i]; UpdateBall(cur); balls[i] = cur; } } - function Dr... | How to speed up this moving algorithm? In Javascript I have an Array of 16 billiard balls in JS and want to move each ball smoothly with its direction and speed. For that I set up a timer, calling UpdateThis() every 42ms (for 24 fps). The problem is that UpdateThis() takes 53ms as firebug states. Now UpdateThis iterate... | TITLE:
How to speed up this moving algorithm? In Javascript
QUESTION:
I have an Array of 16 billiard balls in JS and want to move each ball smoothly with its direction and speed. For that I set up a timer, calling UpdateThis() every 42ms (for 24 fps). The problem is that UpdateThis() takes 53ms as firebug states. Now ... | [
"javascript",
"game-physics"
] | 5 | 2 | 476 | 3 | 0 | 2011-06-06T19:41:10.227000 | 2011-06-06T20:25:12.883000 |
6,257,124 | 6,261,584 | Fluent nHibernate mapping problem | I have these tables/classes (example): table FirstTable ( Id INTEGER NOT NULL DEFAULT AUTOINCREMENT, Name VARCHAR(100) NOT NULL, Document VARCHAR(20) NOT NULL )
table SecondTable ( Id INTEGER NOT NULL, Something VARCHAR(100) NULL, FOREIGN KEY (Id) REFERENCES FirstTable (Id) )
public class FirstClass { public string N... | It seems like NH is trying to save SecondClass first and fails to grab a generated ID from the not yet saved FirstClass. Try to move the.Cascade.SaveUpdate() to the References declaration in FirstClassMap and call the save command on FirstClass. | Fluent nHibernate mapping problem I have these tables/classes (example): table FirstTable ( Id INTEGER NOT NULL DEFAULT AUTOINCREMENT, Name VARCHAR(100) NOT NULL, Document VARCHAR(20) NOT NULL )
table SecondTable ( Id INTEGER NOT NULL, Something VARCHAR(100) NULL, FOREIGN KEY (Id) REFERENCES FirstTable (Id) )
public ... | TITLE:
Fluent nHibernate mapping problem
QUESTION:
I have these tables/classes (example): table FirstTable ( Id INTEGER NOT NULL DEFAULT AUTOINCREMENT, Name VARCHAR(100) NOT NULL, Document VARCHAR(20) NOT NULL )
table SecondTable ( Id INTEGER NOT NULL, Something VARCHAR(100) NULL, FOREIGN KEY (Id) REFERENCES FirstTab... | [
"c#",
"nhibernate",
"asp.net-mvc-3",
"fluent-nhibernate"
] | 2 | 2 | 609 | 1 | 0 | 2011-06-06T19:41:49.400000 | 2011-06-07T06:53:14.980000 |
6,257,131 | 6,257,203 | Are multiple variable assignments done by value or reference? | $a = $b = 0; In the above code, are both $a and $b assigned the value of 0, or is $a just referencing $b? | With raw types this is a copy. test.php $a = $b = 0;
$b = 3;
var_dump($a); var_dump($b); Output: int(0) int(3) With objects though, that is another story (PHP 5) test.php class Obj { public $_name; }
$a = $b = new Obj();
$b->_name = 'steve';
var_dump($a); var_dump($b); Output object(Obj)#1 (1) { ["_name"]=> string... | Are multiple variable assignments done by value or reference? $a = $b = 0; In the above code, are both $a and $b assigned the value of 0, or is $a just referencing $b? | TITLE:
Are multiple variable assignments done by value or reference?
QUESTION:
$a = $b = 0; In the above code, are both $a and $b assigned the value of 0, or is $a just referencing $b?
ANSWER:
With raw types this is a copy. test.php $a = $b = 0;
$b = 3;
var_dump($a); var_dump($b); Output: int(0) int(3) With objects... | [
"php",
"variables",
"variable-assignment"
] | 43 | 57 | 35,080 | 7 | 0 | 2011-06-06T19:42:09.947000 | 2011-06-06T19:47:10.763000 |
6,257,133 | 6,257,286 | How do I right align text within a JLabel? | I have the following code: JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for(int xx =0; xx < 3; xx++) { JLabel label = new JLabel("String"); label.setPreferredSize(new Dimension(300,15)); label.setHorizontalAlignment(JLabel.RIGHT);
panel.add(label); } This is how I would like t... | The setPreferredSize/MinimumSize/MaximumSize methods is dependent from the layout manager of the parent component (in this case panel). First try with setMaximumSize instead of setPreferredSize, if I'm not going wrong should work with BoxLayout. In addition: probably you have to use and play around with glues: panel.se... | How do I right align text within a JLabel? I have the following code: JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for(int xx =0; xx < 3; xx++) { JLabel label = new JLabel("String"); label.setPreferredSize(new Dimension(300,15)); label.setHorizontalAlignment(JLabel.RIGHT);
pan... | TITLE:
How do I right align text within a JLabel?
QUESTION:
I have the following code: JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
for(int xx =0; xx < 3; xx++) { JLabel label = new JLabel("String"); label.setPreferredSize(new Dimension(300,15)); label.setHorizontalAlignment(J... | [
"java",
"swing",
"jlabel",
"right-align"
] | 6 | 6 | 25,417 | 9 | 0 | 2011-06-06T19:42:19.713000 | 2011-06-06T19:54:09.167000 |
6,257,144 | 6,257,311 | How to set all data come from a certain table to be sorted with date? | I created a model.edmx from my database, What i want to do it to make all records come from one of the table to be sorted by DateCreated field, is that possible from the designer or how to do it? | No it is not possible. You must define OrderBy in linq-to-entities query. | How to set all data come from a certain table to be sorted with date? I created a model.edmx from my database, What i want to do it to make all records come from one of the table to be sorted by DateCreated field, is that possible from the designer or how to do it? | TITLE:
How to set all data come from a certain table to be sorted with date?
QUESTION:
I created a model.edmx from my database, What i want to do it to make all records come from one of the table to be sorted by DateCreated field, is that possible from the designer or how to do it?
ANSWER:
No it is not possible. You ... | [
"entity-framework-4.1"
] | 0 | 1 | 48 | 1 | 0 | 2011-06-06T19:42:47.333000 | 2011-06-06T19:56:40.560000 |
6,257,146 | 6,257,287 | Do I have to convert my PHP app into MVC in order to use Zend_search_lucene? | I have finished writing my own web application now. It is written in PHP with MYSQL DB and I did not use any MVC framework at all. Now I want to add a local search functionality for my app and from looking at the other posts here, Zend_Search_Lucene seems to be a good option for me. Now if I want to use Zend_Search_Luc... | You can just use the Zend_Search_Lucene package, you don't need to use the whole framework and/or MVC aspect of it. If you don't want to install the whole framework, you have to check package dependencies that Zend_Search_Lucene has. There are some automatic ways of doing this, here are some: ZF dependency manager Zend... | Do I have to convert my PHP app into MVC in order to use Zend_search_lucene? I have finished writing my own web application now. It is written in PHP with MYSQL DB and I did not use any MVC framework at all. Now I want to add a local search functionality for my app and from looking at the other posts here, Zend_Search_... | TITLE:
Do I have to convert my PHP app into MVC in order to use Zend_search_lucene?
QUESTION:
I have finished writing my own web application now. It is written in PHP with MYSQL DB and I did not use any MVC framework at all. Now I want to add a local search functionality for my app and from looking at the other posts ... | [
"php",
"mysql",
"zend-framework",
"zend-search-lucene"
] | 1 | 4 | 152 | 2 | 0 | 2011-06-06T19:42:50.483000 | 2011-06-06T19:54:12.370000 |
6,257,150 | 6,257,303 | Alternative to polling for job scheduler | We've got need for a job server here at work and I'm currently playing with Quartz.net, but the idea of creating my own appeals to me. At the very least understanding what Quartz.net may be doing under the covers can't hurt my understanding/chances of using it more effectively. So my question is how would you go about ... | You would create a queue of tasks to be fired off, ordered by time (shortest to longest time). There would be exactly one thread that waits for the time at the head of the queue. When that time expires you remove the item and fire off the task. If it's a repeating task recalculate and put back in queue. The only tricky... | Alternative to polling for job scheduler We've got need for a job server here at work and I'm currently playing with Quartz.net, but the idea of creating my own appeals to me. At the very least understanding what Quartz.net may be doing under the covers can't hurt my understanding/chances of using it more effectively. ... | TITLE:
Alternative to polling for job scheduler
QUESTION:
We've got need for a job server here at work and I'm currently playing with Quartz.net, but the idea of creating my own appeals to me. At the very least understanding what Quartz.net may be doing under the covers can't hurt my understanding/chances of using it ... | [
"c#",
".net",
"polling",
"quartz.net",
"job-scheduling"
] | 4 | 2 | 3,276 | 1 | 0 | 2011-06-06T19:43:06.040000 | 2011-06-06T19:55:47.347000 |
6,257,151 | 6,257,183 | Class Variables | Explain please, I can not understand. class Foo @a = 123 @@b = 123 end What are the advantages of variable objects-classes and the class variables? When should I use first, and in which the second? | Instance level variables area created anew for each instance of the class. For example, a variable @id should probably be unique for each instance of Foo. However, there may be some values that should be the same for every instance of the type. In that case, a class variable would be more appropriate. One important sid... | Class Variables Explain please, I can not understand. class Foo @a = 123 @@b = 123 end What are the advantages of variable objects-classes and the class variables? When should I use first, and in which the second? | TITLE:
Class Variables
QUESTION:
Explain please, I can not understand. class Foo @a = 123 @@b = 123 end What are the advantages of variable objects-classes and the class variables? When should I use first, and in which the second?
ANSWER:
Instance level variables area created anew for each instance of the class. For ... | [
"ruby",
"instance-variables",
"class-variables",
"class-instance-variables"
] | 0 | 4 | 116 | 2 | 0 | 2011-06-06T19:43:27.307000 | 2011-06-06T19:45:57.900000 |
6,257,154 | 6,257,218 | How do i swap out images in jquery | I have my site that the users can swap out three products and there are images for each product so rather then doing an ajax call every time the user clicks the button, I wanted to just have the image urls in the html with display none to grab when needed.. so for example, here is my html "> "> "> As you can see the on... | A clearer way to do this would be to render three tags and set their CSS so that they are on top of each other. Then use the jQuery show/hide functions to show the appropriate one. | How do i swap out images in jquery I have my site that the users can swap out three products and there are images for each product so rather then doing an ajax call every time the user clicks the button, I wanted to just have the image urls in the html with display none to grab when needed.. so for example, here is my ... | TITLE:
How do i swap out images in jquery
QUESTION:
I have my site that the users can swap out three products and there are images for each product so rather then doing an ajax call every time the user clicks the button, I wanted to just have the image urls in the html with display none to grab when needed.. so for ex... | [
"php",
"javascript",
"jquery"
] | 0 | 1 | 363 | 1 | 0 | 2011-06-06T19:43:37.503000 | 2011-06-06T19:48:21.033000 |
6,257,177 | 6,257,219 | Add downloaded resources (images) to Bundle? | I am developing an application which is a kind of contact list. This list is updated each times the applications starts. Each contact in the list has its own photo. A part of this list is common for every user of this application. For this part, I already have all the needed pics and I inlude them in the bundle/archive... | You can only add files to your App's Documents directory. The main bundle can't be modified after your App has been released. Read the documentation on how to write to the directory. Edit_: This should help you to get started http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogramminggui... | Add downloaded resources (images) to Bundle? I am developing an application which is a kind of contact list. This list is updated each times the applications starts. Each contact in the list has its own photo. A part of this list is common for every user of this application. For this part, I already have all the needed... | TITLE:
Add downloaded resources (images) to Bundle?
QUESTION:
I am developing an application which is a kind of contact list. This list is updated each times the applications starts. Each contact in the list has its own photo. A part of this list is common for every user of this application. For this part, I already h... | [
"ios",
"resources",
"uiimage",
"bundle",
"resourcebundle"
] | 3 | 1 | 3,384 | 2 | 0 | 2011-06-06T19:45:35.767000 | 2011-06-06T19:48:22.410000 |
6,257,192 | 6,257,306 | MVC3 uri with or without "/" show different response | What is difference between these two paths? http://www.mydomain.com/testmvc3 http://www.mydomain.com/testmvc3/ I put the code in HomeController: // GET: /Home/ public ActionResult Index() { if (Request.IsAuthenticated) { return RedirectToAction("Index", "Member"); } else { return View(); } } But only the second link wo... | You will want to leave the trailing slash off of a normal route, otherwise it indicates that there may be url parameters coming into the action. To enforce this you might want to check out the cleanurl filter that is in MvcCms. Source Code private bool IsTrailingSlashDirty(ref string path) { //we only want a trailing s... | MVC3 uri with or without "/" show different response What is difference between these two paths? http://www.mydomain.com/testmvc3 http://www.mydomain.com/testmvc3/ I put the code in HomeController: // GET: /Home/ public ActionResult Index() { if (Request.IsAuthenticated) { return RedirectToAction("Index", "Member"); } ... | TITLE:
MVC3 uri with or without "/" show different response
QUESTION:
What is difference between these two paths? http://www.mydomain.com/testmvc3 http://www.mydomain.com/testmvc3/ I put the code in HomeController: // GET: /Home/ public ActionResult Index() { if (Request.IsAuthenticated) { return RedirectToAction("Ind... | [
"asp.net-mvc-3",
"razor",
"uri",
"redirecttoaction"
] | 1 | 0 | 419 | 2 | 0 | 2011-06-06T19:46:29.117000 | 2011-06-06T19:56:02.957000 |
6,257,207 | 6,257,440 | Linq, entity framework and their usage | I had to develop system for my university which includes tracking of almost all data (lectures, lecturers, teaching assistants, students, etc..) My database have like 30 tables, and it's pretty complex. I used EF and linq to solve connecting to database and querying from it. But the more I'm going into, the more my que... | In general, Complexity can be reduced by abstracting your repetitive code into reusable, easily-maintainable components. In your particular case, the complexity can be reduced by implementing the Repository and Specification patterns to make your code more consistent, easier to read, and easier to maintain. There is a ... | Linq, entity framework and their usage I had to develop system for my university which includes tracking of almost all data (lectures, lecturers, teaching assistants, students, etc..) My database have like 30 tables, and it's pretty complex. I used EF and linq to solve connecting to database and querying from it. But t... | TITLE:
Linq, entity framework and their usage
QUESTION:
I had to develop system for my university which includes tracking of almost all data (lectures, lecturers, teaching assistants, students, etc..) My database have like 30 tables, and it's pretty complex. I used EF and linq to solve connecting to database and query... | [
"linq",
"entity-framework"
] | 0 | 1 | 168 | 3 | 0 | 2011-06-06T19:47:25.210000 | 2011-06-06T20:08:25.197000 |
6,257,237 | 6,257,267 | Rails 3 - how to find last inserted ID from mysql table | in my controller I have following sequence of commands: SAVE DATA INTO FIRST TABLE
_get ID of inserted item into table from first step_
SAVE DATA INTO SECOND TABLE WITH ID FROM FIRST COMMAND
if FIRST.save && SECOND.save do something And I am wondering, how to get id of item, which is immediately inserted into databa... | # SAVE DATA INTO FIRST TABLE first_instance = FirstModel.new(:foo =>:bar ) first_save = first_instance.save
# _get ID of inserted item into table from first step_ first_instance_id = first_instance.id
# SAVE DATA INTO SECOND TABLE WITH ID FROM FIRST COMMAND second_save = SecondModel.new(:first_model_id => first_insta... | Rails 3 - how to find last inserted ID from mysql table in my controller I have following sequence of commands: SAVE DATA INTO FIRST TABLE
_get ID of inserted item into table from first step_
SAVE DATA INTO SECOND TABLE WITH ID FROM FIRST COMMAND
if FIRST.save && SECOND.save do something And I am wondering, how to g... | TITLE:
Rails 3 - how to find last inserted ID from mysql table
QUESTION:
in my controller I have following sequence of commands: SAVE DATA INTO FIRST TABLE
_get ID of inserted item into table from first step_
SAVE DATA INTO SECOND TABLE WITH ID FROM FIRST COMMAND
if FIRST.save && SECOND.save do something And I am w... | [
"mysql",
"ruby-on-rails-3",
"lastinsertid"
] | 1 | 4 | 6,511 | 3 | 0 | 2011-06-06T19:49:34.800000 | 2011-06-06T19:52:31.227000 |
6,257,238 | 6,257,297 | Test c# email sending speed | I have a c# application that sends an email out to all employees in my database (not XPmail.) I have over 300 employees and I was told it is a little slow. IS there anyway I can test the speed of CC'ing 300 employees and sending it out? I cant time stamp each email since its all carbon copied after the read loop in the... | The first thing to check is whether you're sending 300 e-mails to 1 person each or 1 e-mail bcc'd (not to or cc'd, bcc'd) to 300 people. If the former, you really should do the latter. Even better, you should have a distribution list set up on your server for this. Regardless, the problem is almost certainly at your e-... | Test c# email sending speed I have a c# application that sends an email out to all employees in my database (not XPmail.) I have over 300 employees and I was told it is a little slow. IS there anyway I can test the speed of CC'ing 300 employees and sending it out? I cant time stamp each email since its all carbon copie... | TITLE:
Test c# email sending speed
QUESTION:
I have a c# application that sends an email out to all employees in my database (not XPmail.) I have over 300 employees and I was told it is a little slow. IS there anyway I can test the speed of CC'ing 300 employees and sending it out? I cant time stamp each email since it... | [
"c#",
"performance",
"email",
"carbon-copy"
] | 2 | 6 | 859 | 2 | 0 | 2011-06-06T19:49:38.960000 | 2011-06-06T19:55:07.107000 |
6,257,243 | 6,257,442 | What information does "Top" output while using MPI | I am trying to figure out how much memory my program which uses MPI needs. It was suggested to use the function "top" to obtain the usage of memory. However, I am unclear on what the information means. I wish to know how to estimate the system memory and how much it utilizes? top - 13:52:41 up 208 days, 19:50, 1 user, ... | The standard information displayed by top is, in order: The Process ID The owning username The kernel-assigned process priority (higher is "lower" priority) The "niceness" of the process (higher is "nicer" to other processes and gives the process a "lower" priority) The virtual memory allocated for the process in KiB T... | What information does "Top" output while using MPI I am trying to figure out how much memory my program which uses MPI needs. It was suggested to use the function "top" to obtain the usage of memory. However, I am unclear on what the information means. I wish to know how to estimate the system memory and how much it ut... | TITLE:
What information does "Top" output while using MPI
QUESTION:
I am trying to figure out how much memory my program which uses MPI needs. It was suggested to use the function "top" to obtain the usage of memory. However, I am unclear on what the information means. I wish to know how to estimate the system memory ... | [
"c++",
"memory-leaks",
"memory-management",
"mpi"
] | 0 | 1 | 320 | 1 | 0 | 2011-06-06T19:50:08.800000 | 2011-06-06T20:08:33.803000 |
6,257,244 | 6,278,488 | How to access database from configure method of a symfony task | You can create a symfony "task" by extending sfBaseTask; see http://www.symfony-project.org/cookbook/1_1/en/tasks for more details. However, I cannot see how to set up a database connection in the configure section. I want to do this so that I can have the detailedDescription property show some options that are only de... | If you check out the way symfony creates a custom Task Skeleton (./symfony generate:task yourTaskName ), you would see code that looks like this inside the execute function: protected function execute([..]) { $databaseManager = new sfDatabaseManager($this->configuration); $connection = $databaseManager->getDatabase($op... | How to access database from configure method of a symfony task You can create a symfony "task" by extending sfBaseTask; see http://www.symfony-project.org/cookbook/1_1/en/tasks for more details. However, I cannot see how to set up a database connection in the configure section. I want to do this so that I can have the ... | TITLE:
How to access database from configure method of a symfony task
QUESTION:
You can create a symfony "task" by extending sfBaseTask; see http://www.symfony-project.org/cookbook/1_1/en/tasks for more details. However, I cannot see how to set up a database connection in the configure section. I want to do this so th... | [
"symfony1",
"task"
] | 2 | 2 | 1,918 | 2 | 0 | 2011-06-06T19:50:18.790000 | 2011-06-08T12:11:37.043000 |
6,257,247 | 6,257,336 | ASP.NET MVC post a dropdownlist | When I post via the click on "btSave", in the controller I receive the model. In the model, I see the value off all fields (I show here only "FirstName" but there are others). But the doropdownlist value are null all the time. Do you have an idea why? Thanks, //Dropfown content public class LkpTypeCompany { public virt... | I see the overload that you were attempting to use but I have had good luch with using SelectListItem Try @Html.DropDownListFor( m => m.Customer.LkpTypeCompany, new SelectList(Model.LkpTypeCompany.Select(i => new SelectListItem { Text = i.Code, Value = (*somecondition*)? i.FR: i.NL, Selected = i.Code == Model.Customer.... | ASP.NET MVC post a dropdownlist When I post via the click on "btSave", in the controller I receive the model. In the model, I see the value off all fields (I show here only "FirstName" but there are others). But the doropdownlist value are null all the time. Do you have an idea why? Thanks, //Dropfown content public cl... | TITLE:
ASP.NET MVC post a dropdownlist
QUESTION:
When I post via the click on "btSave", in the controller I receive the model. In the model, I see the value off all fields (I show here only "FirstName" but there are others). But the doropdownlist value are null all the time. Do you have an idea why? Thanks, //Dropfown... | [
"asp.net-mvc",
"post",
"drop-down-menu"
] | 1 | 1 | 927 | 1 | 0 | 2011-06-06T19:50:53.627000 | 2011-06-06T19:59:17.197000 |
6,257,260 | 6,260,060 | Use vimdiff to replace entire file? | I'm using vimdiff for a git merge. Is there a quick way to select 1 file to use, right now i'm just selecting everything from one buffer, replacing the $MERGE with that, and then saving. I guess I can macro that, but was wondering if there is a better way. Thanks! | You should take a look at Tim Pope's Fugitive plugin. It's a really usefull plugin. When you run Gdiff in a conflicted file, 3 files are opened - target, merged and working copy. You would switch to the file you want to save, and execute Gwrite! to save that file. There is a whole Vimcast explaining how to resolve merg... | Use vimdiff to replace entire file? I'm using vimdiff for a git merge. Is there a quick way to select 1 file to use, right now i'm just selecting everything from one buffer, replacing the $MERGE with that, and then saving. I guess I can macro that, but was wondering if there is a better way. Thanks! | TITLE:
Use vimdiff to replace entire file?
QUESTION:
I'm using vimdiff for a git merge. Is there a quick way to select 1 file to use, right now i'm just selecting everything from one buffer, replacing the $MERGE with that, and then saving. I guess I can macro that, but was wondering if there is a better way. Thanks!
... | [
"vim",
"merge",
"git-merge",
"vimdiff"
] | 22 | 12 | 13,367 | 4 | 0 | 2011-06-06T19:51:39.157000 | 2011-06-07T02:23:55.510000 |
6,257,264 | 6,258,288 | Convert string timer to integer seconds | i'm trying to convert an string like "0:13:30", which consist of h:mm:ss, to an integer which will be an answer of (m*60)+(s), working only with the minutes and seconds in greasemonkey or jscript. What i curently have is: var t_str = ''; var t_int =0; var str1='';var str2='';var t_int1=0;var t_int2=0;
t_str="0:13:30";... | var time = t_str.split(":"), h = 3600 * parseInt(time[0], 10), m = 60 * parseInt(time[1], 10), s = parseInt(time[2], 10); alert(h+m+s); | Convert string timer to integer seconds i'm trying to convert an string like "0:13:30", which consist of h:mm:ss, to an integer which will be an answer of (m*60)+(s), working only with the minutes and seconds in greasemonkey or jscript. What i curently have is: var t_str = ''; var t_int =0; var str1='';var str2='';var ... | TITLE:
Convert string timer to integer seconds
QUESTION:
i'm trying to convert an string like "0:13:30", which consist of h:mm:ss, to an integer which will be an answer of (m*60)+(s), working only with the minutes and seconds in greasemonkey or jscript. What i curently have is: var t_str = ''; var t_int =0; var str1='... | [
"string",
"integer",
"greasemonkey"
] | 1 | 1 | 529 | 2 | 0 | 2011-06-06T19:51:56.583000 | 2011-06-06T21:34:52.883000 |
6,257,265 | 6,257,373 | What's the syntax to overload operator== as a free function with templated parameters? | I have a set of polymorphic classes, such as: class Apple {}; class Red: public Apple {}; class Green: public Apple {}; And free functions which compare them: bool operator==(const Apple&, const Apple&); bool operator< (const Apple&, const Apple&); I'm designing a copyable wrapper class which will allow me to use class... | Your template is declared as template bool operator==(const Copy & copy, const Cat& e) This doesn't match redCopy == Red() because Red() is of type Red, so the compiler deduces Red as the type of the second argument, i.e. Cat = Red, but then it expects the type of the first argument to be Copy, which it is not ( redCop... | What's the syntax to overload operator== as a free function with templated parameters? I have a set of polymorphic classes, such as: class Apple {}; class Red: public Apple {}; class Green: public Apple {}; And free functions which compare them: bool operator==(const Apple&, const Apple&); bool operator< (const Apple&,... | TITLE:
What's the syntax to overload operator== as a free function with templated parameters?
QUESTION:
I have a set of polymorphic classes, such as: class Apple {}; class Red: public Apple {}; class Green: public Apple {}; And free functions which compare them: bool operator==(const Apple&, const Apple&); bool operat... | [
"c++",
"templates",
"operator-overloading",
"non-member-functions"
] | 5 | 9 | 5,307 | 3 | 0 | 2011-06-06T19:51:57.940000 | 2011-06-06T20:02:24.547000 |
6,257,271 | 6,257,366 | CSS - Elements styled as inline-block with uniform width and height don't form a grid | I am having a little trouble understanding the following: test.html CSS Test Item 1 Item 2 - This item has more text than the first item and it shows because the text wraps around and changes the vertical size of the item. Item 3 Item 4 Item 5 test.css #id_main { width: 50%; margin-left: auto; margin-right: auto; backg... | You need to add vertical-align: top to div.item: http://jsfiddle.net/DZzc5/2/ div.item { border: 1px solid black; display: inline-block; vertical-align: top; width: 255px; text-align: center; background-color: grey; height: 129px; } To understand why this is required, I recommend you read this: http://blog.mozilla.com/... | CSS - Elements styled as inline-block with uniform width and height don't form a grid I am having a little trouble understanding the following: test.html CSS Test Item 1 Item 2 - This item has more text than the first item and it shows because the text wraps around and changes the vertical size of the item. Item 3 Item... | TITLE:
CSS - Elements styled as inline-block with uniform width and height don't form a grid
QUESTION:
I am having a little trouble understanding the following: test.html CSS Test Item 1 Item 2 - This item has more text than the first item and it shows because the text wraps around and changes the vertical size of the... | [
"html",
"css"
] | 0 | 2 | 2,458 | 3 | 0 | 2011-06-06T19:52:49.387000 | 2011-06-06T20:01:37.867000 |
6,257,279 | 6,257,795 | HttpContext.Current.Request.Url.Authority giving wrong Authority names | I have two production web servers that are load balanced and that sit in a DMZ. I have a form that needs to open another form based on certain criteria. One of the servers works fine and gives the full authority name ie, "host.n.n.com". The other prod server only returns "host" and as a result the page cannot be found.... | The Authority property comes from the request itself. If the request from the user is made from 'host.n.n.com' or 'host' This is what the property will reflect. You can test this locally by using http://localhost/yoursite/page.aspx vs http://yourcomputername/yoursite/page.aspx. The same page will return 'localhost` and... | HttpContext.Current.Request.Url.Authority giving wrong Authority names I have two production web servers that are load balanced and that sit in a DMZ. I have a form that needs to open another form based on certain criteria. One of the servers works fine and gives the full authority name ie, "host.n.n.com". The other pr... | TITLE:
HttpContext.Current.Request.Url.Authority giving wrong Authority names
QUESTION:
I have two production web servers that are load balanced and that sit in a DMZ. I have a form that needs to open another form based on certain criteria. One of the servers works fine and gives the full authority name ie, "host.n.n.... | [
"c#",
"asp.net",
"webforms",
"httpcontext"
] | 1 | 2 | 6,621 | 1 | 0 | 2011-06-06T19:53:24.237000 | 2011-06-06T20:42:01.690000 |
6,257,284 | 6,257,857 | Play framework JPA: how to implement one-to-many relationship? | I have a Posts model and every post also contains Blocks (also a model). I'm using the play framework for this website, and what I want to do is show X number of post with all of it's blocks on one page. JPA (or play framework's implementation, don't know which one it is) has the find() method with which I could query ... | Just use the one-to-many keyword: @OneToMany private List blockList; However it's not clear if you need the getBlocks method. If you are just getting the blocks from the database then you don't need this method. Note: you probably want to read more on @OneToMany. You can for example add the option @OneToMany(cascade = ... | Play framework JPA: how to implement one-to-many relationship? I have a Posts model and every post also contains Blocks (also a model). I'm using the play framework for this website, and what I want to do is show X number of post with all of it's blocks on one page. JPA (or play framework's implementation, don't know w... | TITLE:
Play framework JPA: how to implement one-to-many relationship?
QUESTION:
I have a Posts model and every post also contains Blocks (also a model). I'm using the play framework for this website, and what I want to do is show X number of post with all of it's blocks on one page. JPA (or play framework's implementa... | [
"java",
"sql",
"model-view-controller",
"jpa",
"playframework"
] | 6 | 11 | 8,668 | 1 | 0 | 2011-06-06T19:53:43.147000 | 2011-06-06T20:47:31.527000 |
6,257,293 | 6,257,937 | union all on views based on table | i have a database table with a list of sql views i want to create a new view or stored procedure that based on which views are in that table will return those views unioned like this SELECT ALINE1, HOME, EMAIL, EXPIRE, EDATE7, type FROM dbo.campaign_membership_30 UNION ALL SELECT ALINE1, HOME, EMAIL, EXPIRE, EDATE7, ty... | There are a lot of major caveats here. First, using dynamic SQL is often dangerous. It can open up your database to SQL injection attacks. If you don't understand what these are then you need to do a lot of educating of yourself before I would suggest that you use dynamic SQL. Second, this kind of a pattern (storing ta... | union all on views based on table i have a database table with a list of sql views i want to create a new view or stored procedure that based on which views are in that table will return those views unioned like this SELECT ALINE1, HOME, EMAIL, EXPIRE, EDATE7, type FROM dbo.campaign_membership_30 UNION ALL SELECT ALINE... | TITLE:
union all on views based on table
QUESTION:
i have a database table with a list of sql views i want to create a new view or stored procedure that based on which views are in that table will return those views unioned like this SELECT ALINE1, HOME, EMAIL, EXPIRE, EDATE7, type FROM dbo.campaign_membership_30 UNIO... | [
"sql",
"sql-server-2005",
"stored-procedures",
"dynamic-sql"
] | 0 | 0 | 1,998 | 2 | 0 | 2011-06-06T19:54:45.877000 | 2011-06-06T20:55:39.810000 |
6,257,295 | 6,257,471 | How do I prevent Visual SourceSafe from writing the vssver2.scc file when getting a file with Microsoft.VisualStudio.SourceSafe.Interop? | I get a file from Visual SourceSafe using the below code: IVSSItem vssFile = vssDataBase.get_VSSItem(vssFilePath + @"/" + fileName, false);
VSSItem itemVer = vssFile.get_Version(latestVersionNumber); itemVer.Get(ref getFilePath, (int)VSSFlags.VSSFLAG_FORCEDIRNO | (int)VSSFlags.VSSFLAG_REPREPLACE | (int)VSSFlags.VSSFLA... | I realized my interest in getting files cleanly via SourceSafe.Interop was more aesthetic than practical. I'm still interested in a solution but I ended up doing this after all the files were checked out. foreach (FileInfo visualSourceSafeFile in testDirectoryInfo.GetFiles("*.scc", SearchOption.AllDirectories)) { visua... | How do I prevent Visual SourceSafe from writing the vssver2.scc file when getting a file with Microsoft.VisualStudio.SourceSafe.Interop? I get a file from Visual SourceSafe using the below code: IVSSItem vssFile = vssDataBase.get_VSSItem(vssFilePath + @"/" + fileName, false);
VSSItem itemVer = vssFile.get_Version(late... | TITLE:
How do I prevent Visual SourceSafe from writing the vssver2.scc file when getting a file with Microsoft.VisualStudio.SourceSafe.Interop?
QUESTION:
I get a file from Visual SourceSafe using the below code: IVSSItem vssFile = vssDataBase.get_VSSItem(vssFilePath + @"/" + fileName, false);
VSSItem itemVer = vssFil... | [
"c#",
"visual-sourcesafe"
] | 1 | 1 | 1,420 | 1 | 0 | 2011-06-06T19:54:49.220000 | 2011-06-06T20:11:11.117000 |
6,257,307 | 6,257,359 | jquery alerts several times | Why does the following code cause jquery to alert 3 times?.note_text is a class within.note_content. $('.note_content').click(function() { var note_text = $(this).find(".note_text"); $(note_text).focus();
// save its contents: var original_text = note_text.html();
$(note_text).blur(function() { if (note_text.html()!=... | $(note_text).blur(function() { That line binds an event handler. Every time the element is blurred, that handler will run. You assign a new handler every time the click handler on.note_content is triggered, so you will have multiple alerts. The way around this is to store data on the element, rather than in a closure. ... | jquery alerts several times Why does the following code cause jquery to alert 3 times?.note_text is a class within.note_content. $('.note_content').click(function() { var note_text = $(this).find(".note_text"); $(note_text).focus();
// save its contents: var original_text = note_text.html();
$(note_text).blur(functio... | TITLE:
jquery alerts several times
QUESTION:
Why does the following code cause jquery to alert 3 times?.note_text is a class within.note_content. $('.note_content').click(function() { var note_text = $(this).find(".note_text"); $(note_text).focus();
// save its contents: var original_text = note_text.html();
$(note_... | [
"jquery"
] | 0 | 1 | 441 | 2 | 0 | 2011-06-06T19:56:05.723000 | 2011-06-06T20:00:56.200000 |
6,257,309 | 6,258,564 | NHibernate issue "Unable to find the requested .Net Framework Data Provider. It may not be installed. " | I'm running into a problem using NHibernate 3.0 with SQL server 2008 in a asp.net 4.0 project. During the configuration task of NHibernate, the BuildSessionFactory() method raise an exception: "Unable to find the requested.Net Framework Data Provider. It may not be installed." Here's the hibernate configuration file: N... | You are trying to use MsSql2008Dialect with OracleDataClientDriver. Do you see anything wrong with that?:-) Use the correct driver and the problem will go away. | NHibernate issue "Unable to find the requested .Net Framework Data Provider. It may not be installed. " I'm running into a problem using NHibernate 3.0 with SQL server 2008 in a asp.net 4.0 project. During the configuration task of NHibernate, the BuildSessionFactory() method raise an exception: "Unable to find the req... | TITLE:
NHibernate issue "Unable to find the requested .Net Framework Data Provider. It may not be installed. "
QUESTION:
I'm running into a problem using NHibernate 3.0 with SQL server 2008 in a asp.net 4.0 project. During the configuration task of NHibernate, the BuildSessionFactory() method raise an exception: "Unab... | [
"asp.net",
"sql-server",
"nhibernate",
"dataprovider"
] | 3 | 2 | 2,571 | 1 | 0 | 2011-06-06T19:56:29.923000 | 2011-06-06T22:04:30.580000 |
6,257,310 | 6,257,382 | Create an array of array in java | I need to create an array of array with Strings in java... For example, I read a file that contain for each column a sport and a player name..like: The goal at the end it's for populate a list grouped in section (sports) hockey,Wayne Gretsky hockey,Mario Lemieux baseball,Barry Bonds baseball,A Rod I need to create the ... | Bonjour Maxime, you should better store you data in a hasmap. This allows to associate some value to another. For instance, you could define a map that associates a sport to a list of player like this: Map > mapSportToPlayer = new Hashmap >(); or if you don't have a Player class (but better have one): Map > mapSportToP... | Create an array of array in java I need to create an array of array with Strings in java... For example, I read a file that contain for each column a sport and a player name..like: The goal at the end it's for populate a list grouped in section (sports) hockey,Wayne Gretsky hockey,Mario Lemieux baseball,Barry Bonds bas... | TITLE:
Create an array of array in java
QUESTION:
I need to create an array of array with Strings in java... For example, I read a file that contain for each column a sport and a player name..like: The goal at the end it's for populate a list grouped in section (sports) hockey,Wayne Gretsky hockey,Mario Lemieux baseba... | [
"java",
"algorithm"
] | 0 | 1 | 317 | 4 | 0 | 2011-06-06T19:56:38.170000 | 2011-06-06T20:03:04.570000 |
6,257,314 | 6,257,358 | php How to cache from web search for a pagination? | One moment ago, I visted http://www.123people.com, I am intersting in some technology from it. After a web photo search. how to cache the data then for a pagination? In the raw code, I haven't see he load all the data in the page then make a jquery pagination with div show, hidden. And I do not think, store into databa... | They can for example cache results as search "pages" [for example as files on hard drive], returning only information about current page and number of pages in collection. If data can change dynamically, they may store all the results in one place, and then "query" it for a specific subset of that data. You have really... | php How to cache from web search for a pagination? One moment ago, I visted http://www.123people.com, I am intersting in some technology from it. After a web photo search. how to cache the data then for a pagination? In the raw code, I haven't see he load all the data in the page then make a jquery pagination with div ... | TITLE:
php How to cache from web search for a pagination?
QUESTION:
One moment ago, I visted http://www.123people.com, I am intersting in some technology from it. After a web photo search. how to cache the data then for a pagination? In the raw code, I haven't see he load all the data in the page then make a jquery pa... | [
"php",
"caching"
] | 0 | 0 | 1,773 | 1 | 0 | 2011-06-06T19:56:51.380000 | 2011-06-06T20:00:54.890000 |
6,257,316 | 6,257,357 | Illegal Escape Character "\" | I want to get the name at the end of a link so I did that if( invName.substring(j,k).equals("\")){ copyf=invName.substring(0,j);} Eclipse said String literal is not properly closed by a double-quote How can I compare String with this char \? | The character '\' is a special character and needs to be escaped when used as part of a String, e.g., "\". Here is an example of a string comparison using the '\' character: if (invName.substring(j,k).equals("\\")) {...} You can also perform direct character comparisons using logic similar to the following: if (invName... | Illegal Escape Character "\" I want to get the name at the end of a link so I did that if( invName.substring(j,k).equals("\")){ copyf=invName.substring(0,j);} Eclipse said String literal is not properly closed by a double-quote How can I compare String with this char \? | TITLE:
Illegal Escape Character "\"
QUESTION:
I want to get the name at the end of a link so I did that if( invName.substring(j,k).equals("\")){ copyf=invName.substring(0,j);} Eclipse said String literal is not properly closed by a double-quote How can I compare String with this char \?
ANSWER:
The character '\' is a... | [
"java",
"string",
"escaping",
"char"
] | 26 | 34 | 196,013 | 5 | 0 | 2011-06-06T19:57:19.493000 | 2011-06-06T20:00:50.757000 |
6,257,322 | 6,259,076 | Free SMPP (jabber) libraries for .NET? | I'm looking for a lightweight easy to use SMPP library for.NET. Only requirement is that it must support Legacy SSL. Any tips? | For Jabber (XMPP), I've known people that have used agsXMPP SDK and have seemed to like it. | Free SMPP (jabber) libraries for .NET? I'm looking for a lightweight easy to use SMPP library for.NET. Only requirement is that it must support Legacy SSL. Any tips? | TITLE:
Free SMPP (jabber) libraries for .NET?
QUESTION:
I'm looking for a lightweight easy to use SMPP library for.NET. Only requirement is that it must support Legacy SSL. Any tips?
ANSWER:
For Jabber (XMPP), I've known people that have used agsXMPP SDK and have seemed to like it. | [
"javascript",
"asp.net",
"dynamic",
"loadcontrol"
] | 0 | 1 | 331 | 1 | 0 | 2011-06-06T19:57:50.023000 | 2011-06-06T23:15:34.560000 |
6,257,325 | 6,257,423 | How To Empty a Div On closing a dialog | Scenario I have a Dialog created by jquery UI dialog. It opens on a click with a form, form is submitted on a click. Feedback appears below the form announcing success. Before closing the dialog I want to remove the success message so that it doesn't appear the next time the dialog/form opens. Note: Its likely that the... | You got invalid syntax there. Add the comma between event and ui in beforeClose: function (event ui) { beforeClose: function (event, ui) { $("div#output1").empty(); }, working fine: http://jsfiddle.net/niklasvh/8DD9L/ | How To Empty a Div On closing a dialog Scenario I have a Dialog created by jquery UI dialog. It opens on a click with a form, form is submitted on a click. Feedback appears below the form announcing success. Before closing the dialog I want to remove the success message so that it doesn't appear the next time the dialo... | TITLE:
How To Empty a Div On closing a dialog
QUESTION:
Scenario I have a Dialog created by jquery UI dialog. It opens on a click with a form, form is submitted on a click. Feedback appears below the form announcing success. Before closing the dialog I want to remove the success message so that it doesn't appear the n... | [
"jquery",
"dialog"
] | 1 | 4 | 5,534 | 2 | 0 | 2011-06-06T19:58:02.230000 | 2011-06-06T20:07:14.623000 |
6,257,329 | 6,257,404 | How to tell if a form checkbox is checked through a pageload asp.net | Sorry if this is a duplicate, most of the questions that I looked at were similar but not the same question. I have a form with a checkbox: I do an ajax call in my JS to send all form data to a page load. I want to be able to know if that checkbox is checked during page load. Any ideas on how to do this? is there somet... | I added your input and an asp button to a page, clicked the button, and viewed the Request["policy"] in the debugger. When the checkbox is unchecked, Request["policy"] returns null. When it's checked, it returns "on". | How to tell if a form checkbox is checked through a pageload asp.net Sorry if this is a duplicate, most of the questions that I looked at were similar but not the same question. I have a form with a checkbox: I do an ajax call in my JS to send all form data to a page load. I want to be able to know if that checkbox is ... | TITLE:
How to tell if a form checkbox is checked through a pageload asp.net
QUESTION:
Sorry if this is a duplicate, most of the questions that I looked at were similar but not the same question. I have a form with a checkbox: I do an ajax call in my JS to send all form data to a page load. I want to be able to know if... | [
"c#",
"asp.net",
"checkbox",
"pageload"
] | 2 | 3 | 1,345 | 2 | 0 | 2011-06-06T19:58:39.727000 | 2011-06-06T20:04:49.803000 |
6,257,330 | 6,257,407 | Session Destroyed; Print Message in JSP and Servlets | When a session has been destroyed, how do I print a message on a JSP that notifies the user? I'm using a class that implements HttpSessionListener. | When the session is destroyed, you can't do anything from the server side on anyway. At the point of session destroy there is no guarantee that you have valid request/response objects at your hands. Your best bet is to handle it fully at the client side, using for example JS. You can get the remaining lifetime of the c... | Session Destroyed; Print Message in JSP and Servlets When a session has been destroyed, how do I print a message on a JSP that notifies the user? I'm using a class that implements HttpSessionListener. | TITLE:
Session Destroyed; Print Message in JSP and Servlets
QUESTION:
When a session has been destroyed, how do I print a message on a JSP that notifies the user? I'm using a class that implements HttpSessionListener.
ANSWER:
When the session is destroyed, you can't do anything from the server side on anyway. At the ... | [
"java",
"jsp",
"servlets"
] | 1 | 4 | 986 | 1 | 0 | 2011-06-06T19:58:49.353000 | 2011-06-06T20:04:52.500000 |
6,257,332 | 6,258,453 | Custom screen dim with Dialog | In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern? | Yes, it is. You can control it. After creating dialog: WindowManager.LayoutParams lp = dialog.getWindow().getAttributes(); lp.dimAmount = 0.0f; // Dim level. 0.0 - no dim, 1.0 - completely opaque dialog.getWindow().setAttributes(lp); Upd: you can even add blur behind the dialog: dialog.getWindow().addFlags(WindowManage... | Custom screen dim with Dialog In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern? | TITLE:
Custom screen dim with Dialog
QUESTION:
In Android when you pop up a dialog the screen behind it dims. Is there any way to control what that looks like? For example making it dim more or less or using some kind of a pattern?
ANSWER:
Yes, it is. You can control it. After creating dialog: WindowManager.LayoutPar... | [
"android",
"dialog"
] | 38 | 56 | 37,140 | 6 | 0 | 2011-06-06T19:59:08.300000 | 2011-06-06T21:51:39.227000 |
6,257,333 | 6,257,457 | Threads UI and nightmares | I have a class that handles some realtime action in a thread that it starts. There are other theads in play in this application as it is very complex. When This rt action starts i need to pop up a window and close it when it is done. Sounds easy. There are events that I hook to when this action starts and stops. In tho... | You should really specialize your thread and stop calling code managed by other thread form any thread. Use message queues to communicate actions to your thread. This is the safest way to do multi-threading. Example in pseudo-code: Thread1 { while (1) { read my last message in my queue; do something according to this m... | Threads UI and nightmares I have a class that handles some realtime action in a thread that it starts. There are other theads in play in this application as it is very complex. When This rt action starts i need to pop up a window and close it when it is done. Sounds easy. There are events that I hook to when this actio... | TITLE:
Threads UI and nightmares
QUESTION:
I have a class that handles some realtime action in a thread that it starts. There are other theads in play in this application as it is very complex. When This rt action starts i need to pop up a window and close it when it is done. Sounds easy. There are events that I hook ... | [
"winforms",
"multithreading",
"user-interface"
] | 0 | 1 | 1,664 | 3 | 0 | 2011-06-06T19:59:12.073000 | 2011-06-06T20:09:46.737000 |
6,257,337 | 6,257,581 | How commits are kept in order | Quick question on Mercurial. Suppose my colleague and I both have an up to date copy of trunk. We both make changes, then we both push/pull the changes from each other. I am guessing Mercurial keeps the changes in order based on the date of the commit (since there is no incrementing revision, just a GUID). So what happ... | Indeed, your changesets are timestamped (internally stored as seconds-since-the-UNIX-epoch and a timezone offset), and when displaying changeset, they are ordered by timestamp and your changesets will be displayed in the incorrect place as their timestamps are be incorrect. See https://www.mercurial-scm.org/wiki/Change... | How commits are kept in order Quick question on Mercurial. Suppose my colleague and I both have an up to date copy of trunk. We both make changes, then we both push/pull the changes from each other. I am guessing Mercurial keeps the changes in order based on the date of the commit (since there is no incrementing revisi... | TITLE:
How commits are kept in order
QUESTION:
Quick question on Mercurial. Suppose my colleague and I both have an up to date copy of trunk. We both make changes, then we both push/pull the changes from each other. I am guessing Mercurial keeps the changes in order based on the date of the commit (since there is no i... | [
"version-control",
"mercurial"
] | 5 | 6 | 157 | 3 | 0 | 2011-06-06T19:59:28.617000 | 2011-06-06T20:23:11.480000 |
6,257,344 | 6,257,392 | DIV width of "100%" scrolls off right end of page | I have a very simple layout with 2 DIVS: a fixed width left bar and a right area which should take up 100% of the remaining width. Both are 100% height, and I want the right item to have a vertical scroll bar if the height is taller than the window height. My current code takes up the whole browser window, but the righ... | When you give something width:100% it means 'whatever the width of my container, I will have the same width' -- it does not mean 'I will take up 100% of the available space' In other words, let's say your parent DIV was 300 pixels wide -- if you give the child div width: 100%, it will be 100% of 300 pixels. What you ca... | DIV width of "100%" scrolls off right end of page I have a very simple layout with 2 DIVS: a fixed width left bar and a right area which should take up 100% of the remaining width. Both are 100% height, and I want the right item to have a vertical scroll bar if the height is taller than the window height. My current co... | TITLE:
DIV width of "100%" scrolls off right end of page
QUESTION:
I have a very simple layout with 2 DIVS: a fixed width left bar and a right area which should take up 100% of the remaining width. Both are 100% height, and I want the right item to have a vertical scroll bar if the height is taller than the window hei... | [
"html"
] | 6 | 6 | 14,518 | 5 | 0 | 2011-06-06T19:59:59.803000 | 2011-06-06T20:03:34.990000 |
6,257,346 | 6,257,435 | Java kill suddenly | I am getting this error when writer.optimize() called I have caugh all exceptions but hopeless.writer is an instance of apache lucene Indexwriter and tomcat collapse when optimizing the indexwriter.I am trying to index a large number of file its works for a few number of file but when number of files increase it cause ... | As Stéphane says, try different JREs to see if you can get a different error message. There's a chance (but hard to quantify) that this is related to reaching a memory limit, but it'll be hard to be sure unless you do get an error saying which one! | Java kill suddenly I am getting this error when writer.optimize() called I have caugh all exceptions but hopeless.writer is an instance of apache lucene Indexwriter and tomcat collapse when optimizing the indexwriter.I am trying to index a large number of file its works for a few number of file but when number of files... | TITLE:
Java kill suddenly
QUESTION:
I am getting this error when writer.optimize() called I have caugh all exceptions but hopeless.writer is an instance of apache lucene Indexwriter and tomcat collapse when optimizing the indexwriter.I am trying to index a large number of file its works for a few number of file but wh... | [
"lucene",
"java"
] | 1 | 1 | 1,203 | 3 | 0 | 2011-06-06T20:00:04.720000 | 2011-06-06T20:08:09.843000 |
6,257,348 | 6,258,307 | How should I implement GetLastNode for TTreeNodes? | When I need to find the first node in a TTreeView, I call TTreeNodes.GetFirstNode. However, I sometimes need to locate the last node in a tree and there is no corresponding TTreeNodes.GetLastNode function. I don't want to use Items[Count-1] since that results in the entire tree being walked with Result:= Result.GetNext... | Although I am not a non-Exit purist, I think that when it is doable without Exit while keeping readability intact, one might prefer that option. So here is exactly the same code, for I don't think you can get any other way (faster) to the end node, but without Exit and slightly more compact: function TTreeNodes.GetLast... | How should I implement GetLastNode for TTreeNodes? When I need to find the first node in a TTreeView, I call TTreeNodes.GetFirstNode. However, I sometimes need to locate the last node in a tree and there is no corresponding TTreeNodes.GetLastNode function. I don't want to use Items[Count-1] since that results in the en... | TITLE:
How should I implement GetLastNode for TTreeNodes?
QUESTION:
When I need to find the first node in a TTreeView, I call TTreeNodes.GetFirstNode. However, I sometimes need to locate the last node in a tree and there is no corresponding TTreeNodes.GetLastNode function. I don't want to use Items[Count-1] since that... | [
"delphi"
] | 4 | 6 | 1,249 | 3 | 0 | 2011-06-06T20:00:04.913000 | 2011-06-06T21:36:49.430000 |
6,257,350 | 6,261,236 | Pass parameters for ocx registration during installation in VS setup project | I have an OCX that requires licensing in order for it to work. The vendor tells me to register it this way: regsvr32.exe "widget.ocx" "/i:licensekey" /s I am using Visual Studio 2008 Setup Project where the OCX is detected as a dependency. I have the Register property set to "vsdrfCOMSelfReg". However, I don't see a wa... | Since the file is registered in a special way, "vsdrfCOMSelfReg" won't work. Instead, you can try using a custom action which runs the registration command. Basically, you can write custom code which launches regsvr32.exe with the appropriate command line. For example, you can use ShellExecute. | Pass parameters for ocx registration during installation in VS setup project I have an OCX that requires licensing in order for it to work. The vendor tells me to register it this way: regsvr32.exe "widget.ocx" "/i:licensekey" /s I am using Visual Studio 2008 Setup Project where the OCX is detected as a dependency. I h... | TITLE:
Pass parameters for ocx registration during installation in VS setup project
QUESTION:
I have an OCX that requires licensing in order for it to work. The vendor tells me to register it this way: regsvr32.exe "widget.ocx" "/i:licensekey" /s I am using Visual Studio 2008 Setup Project where the OCX is detected as... | [
"installation",
"setup-project",
"registration",
"ocx",
"license-key"
] | 0 | 1 | 1,048 | 1 | 0 | 2011-06-06T20:00:07.853000 | 2011-06-07T06:14:38.767000 |
6,257,355 | 6,261,508 | MVC3 passing base class to partial View - submitting form only has parent class values | I have a number of child ViewModel classes which inherit from an base ViewModel class. I pass my child ViewModel into my View, which then passes itself into a partial view. The main view takes the child type, but the partial view takes the Parent type. Everything displays correctly when I manually populate the properti... | Unable to reproduce. Works fine for me. Notice that I am not using any constructors with my view models because the model binder wouldn't be able to call them and that all the properties must to have public getters and setters. Model: public abstract class BaseDetails { public string Name { get; set; } }
public class ... | MVC3 passing base class to partial View - submitting form only has parent class values I have a number of child ViewModel classes which inherit from an base ViewModel class. I pass my child ViewModel into my View, which then passes itself into a partial view. The main view takes the child type, but the partial view tak... | TITLE:
MVC3 passing base class to partial View - submitting form only has parent class values
QUESTION:
I have a number of child ViewModel classes which inherit from an base ViewModel class. I pass my child ViewModel into my View, which then passes itself into a partial view. The main view takes the child type, but th... | [
"asp.net-mvc-3",
"viewmodel",
"base-class"
] | 3 | 7 | 4,877 | 1 | 0 | 2011-06-06T20:00:42.043000 | 2011-06-07T06:45:12.213000 |
6,257,361 | 6,257,399 | Confusing array sorting in PHP | What's the best way to sort this array alphabetically, by String1? The key numbering should always be numerical still. Before: Key | String1 Int1 String2 Int2 -------------------------------------- 0 | Alligator 3 Cake 7 1 | Crocodile 17 foobar 9 2 | Bear 1 test 6 3 | Aardvark 2 lolwhat 3 After: Key | String1 Int1 Stri... | You probably want usort which lets you define a comparator callback function. http://www.php.net/manual/en/function.usort.php | Confusing array sorting in PHP What's the best way to sort this array alphabetically, by String1? The key numbering should always be numerical still. Before: Key | String1 Int1 String2 Int2 -------------------------------------- 0 | Alligator 3 Cake 7 1 | Crocodile 17 foobar 9 2 | Bear 1 test 6 3 | Aardvark 2 lolwhat 3... | TITLE:
Confusing array sorting in PHP
QUESTION:
What's the best way to sort this array alphabetically, by String1? The key numbering should always be numerical still. Before: Key | String1 Int1 String2 Int2 -------------------------------------- 0 | Alligator 3 Cake 7 1 | Crocodile 17 foobar 9 2 | Bear 1 test 6 3 | Aa... | [
"php",
"sorting"
] | 0 | 1 | 89 | 3 | 0 | 2011-06-06T20:01:08.923000 | 2011-06-06T20:04:23.087000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.