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,268,856 | 6,268,981 | Image png color css or html or javascript | I have this image in my website, is a png.I want to know if there is anyway with HTML5, javascript or css to change the color of the image? At least the image change to white (invert color black to white, not the transparency). Thanks in advance | You cannot do this in plain HTML or CSS. You can do this with JS/HTML Canvas, but there is probably a much easier and more compatible solution than JS/HTML Canvas for performing image manipulation. Depending on what you are trying to do, you may just want to create a second image that you swap out with the first. There... | Image png color css or html or javascript I have this image in my website, is a png.I want to know if there is anyway with HTML5, javascript or css to change the color of the image? At least the image change to white (invert color black to white, not the transparency). Thanks in advance | TITLE:
Image png color css or html or javascript
QUESTION:
I have this image in my website, is a png.I want to know if there is anyway with HTML5, javascript or css to change the color of the image? At least the image change to white (invert color black to white, not the transparency). Thanks in advance
ANSWER:
You c... | [
"javascript",
"html",
"css",
"image",
"png"
] | 2 | 3 | 4,752 | 2 | 0 | 2011-06-07T16:57:31.900000 | 2011-06-07T17:07:48.097000 |
6,268,861 | 6,270,775 | Rails updating multiple models on a single form | Im writing a form which uses formtastic to manage the BusinessUnit model, however when creating a new BusinessUnit it also has to create a number of other record types. The associations between the models are as below: class BusinessUnit < ActiveRecord::Base has_many:business_unit_sites has_many:locations
class Busine... | You probably want to do something like using the " fields_for " approach for the sub-objects in your form. See this related answer: Multiple objects in a Rails form More info about fields_for: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html http://apidock.com/rails/ActionView/Helpers/FormHelper/fi... | Rails updating multiple models on a single form Im writing a form which uses formtastic to manage the BusinessUnit model, however when creating a new BusinessUnit it also has to create a number of other record types. The associations between the models are as below: class BusinessUnit < ActiveRecord::Base has_many:busi... | TITLE:
Rails updating multiple models on a single form
QUESTION:
Im writing a form which uses formtastic to manage the BusinessUnit model, however when creating a new BusinessUnit it also has to create a number of other record types. The associations between the models are as below: class BusinessUnit < ActiveRecord::... | [
"ruby-on-rails",
"ruby-on-rails-3",
"activerecord",
"foreign-keys"
] | 3 | 3 | 8,403 | 1 | 0 | 2011-06-07T16:57:42.873000 | 2011-06-07T19:47:41.707000 |
6,268,865 | 6,282,583 | Django Unique properties in admin | I'm building a generic template that will be deployed for several sites, one of the customizing options we'd like to allow would be a custom font for the title text. I'd like to add this property to the admin interface. Is there a better technique then creating a model for these properties and doing a Model.objects.get... | I've currently implemented django-chunks from github It allows the use of {% load chunks %} {% chunk "key" %} where the chunk is a key,value set. I've used this technique to insert "dynamic css", (my admin can provide the css required to upload a custom font) Example: subtitle_font_css subtitle_font font-family: impact... | Django Unique properties in admin I'm building a generic template that will be deployed for several sites, one of the customizing options we'd like to allow would be a custom font for the title text. I'd like to add this property to the admin interface. Is there a better technique then creating a model for these proper... | TITLE:
Django Unique properties in admin
QUESTION:
I'm building a generic template that will be deployed for several sites, one of the customizing options we'd like to allow would be a custom font for the title text. I'd like to add this property to the admin interface. Is there a better technique then creating a mode... | [
"django",
"django-models",
"django-admin"
] | 0 | 0 | 88 | 2 | 0 | 2011-06-07T16:57:57.887000 | 2011-06-08T17:12:44.293000 |
6,268,866 | 6,269,215 | Collapsing drop-down nav automatically when mouse exits div area | I put together a simple drop-down navigation that expands when you hover over a link. When hovering over a link an absolute positioned div will expand, revealing the sub-navigation. My problem is that this div doesn't collapse automatically when the mouse leaves the navigation area, and that's what I need to happen. I'... | Instead of making #subnav1 a sibling of #nav, you can try make div#subnav1 a nested list; your nav structure would look like: About Products Booster.... Then you can use CSS (instead of javascript) to control the hiding and showing of the sub-nav. This can be done with the:hover pseudo-selector. The approach is to init... | Collapsing drop-down nav automatically when mouse exits div area I put together a simple drop-down navigation that expands when you hover over a link. When hovering over a link an absolute positioned div will expand, revealing the sub-navigation. My problem is that this div doesn't collapse automatically when the mouse... | TITLE:
Collapsing drop-down nav automatically when mouse exits div area
QUESTION:
I put together a simple drop-down navigation that expands when you hover over a link. When hovering over a link an absolute positioned div will expand, revealing the sub-navigation. My problem is that this div doesn't collapse automatica... | [
"javascript",
"navigation",
"drop-down-menu"
] | 0 | 2 | 1,244 | 1 | 0 | 2011-06-07T16:58:05.827000 | 2011-06-07T17:28:23.863000 |
6,268,867 | 6,268,962 | Extend length of button using CSS | I have the following snippet of HTML code which displays a button. Post Search In addition to the HTML code, there is the CSS style sheet..xp-b-submit-btn { background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: url("../../images/new_blue_button.png"); background-or... | Ok, here are a couple of options: This changes the padding, adding 10px on each side, giving you something closer to the desired width. Presumably the padding is not already at 0, so it's not exactly 10px additional on each side. You can adjust to your liking. (Think of padding as the distance between your content/text... | Extend length of button using CSS I have the following snippet of HTML code which displays a button. Post Search In addition to the HTML code, there is the CSS style sheet..xp-b-submit-btn { background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: url("../../images/ne... | TITLE:
Extend length of button using CSS
QUESTION:
I have the following snippet of HTML code which displays a button. Post Search In addition to the HTML code, there is the CSS style sheet..xp-b-submit-btn { background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: ur... | [
"html",
"css",
"background"
] | 0 | 1 | 6,546 | 3 | 0 | 2011-06-07T16:58:15.843000 | 2011-06-07T17:05:59.353000 |
6,268,868 | 6,268,904 | how do not duplicate a action in jquery | js: $(".test").focusout(function(){ var qtdCont = parseInt($(this).val()); if(qtdCont > 0) { var qtdProd = $(".value").val(); var qtdProdInt = parseInt(qtdProd); var qtdProdTot = qtdProd-qtdCont; $(".value").val(qtdProdTot); } }); Demo: Jsfiddle i need the subtract only the fist time when he lose the focus. because if ... | Use the data in the dom element: $(".test").focusout(function(){ var qtdCont = parseInt($(this).val()); if(qtdCont > 0 && $(this).data('done') == undefined) { var qtdProd = $(".value").val(); var qtdProdInt = parseInt(qtdProd); var qtdProdTot = qtdProd-qtdCont; $(".value").val(qtdProdTot); $(this).data('done', true); }... | how do not duplicate a action in jquery js: $(".test").focusout(function(){ var qtdCont = parseInt($(this).val()); if(qtdCont > 0) { var qtdProd = $(".value").val(); var qtdProdInt = parseInt(qtdProd); var qtdProdTot = qtdProd-qtdCont; $(".value").val(qtdProdTot); } }); Demo: Jsfiddle i need the subtract only the fist ... | TITLE:
how do not duplicate a action in jquery
QUESTION:
js: $(".test").focusout(function(){ var qtdCont = parseInt($(this).val()); if(qtdCont > 0) { var qtdProd = $(".value").val(); var qtdProdInt = parseInt(qtdProd); var qtdProdTot = qtdProd-qtdCont; $(".value").val(qtdProdTot); } }); Demo: Jsfiddle i need the subtr... | [
"javascript",
"jquery"
] | 0 | 2 | 95 | 2 | 0 | 2011-06-07T16:58:15.953000 | 2011-06-07T17:01:08.370000 |
6,268,877 | 6,268,911 | What is the academic route for converting C# number types from one to another? | Based on my tests, casting a decimal or double to an int or long simply keeps the whole number portion of the number and discards the decimal portion. Reversely, you can have an int variable and assign it directly to a decimal variable without casting and it will perform an implicit conversion. It works, but just becau... | You require the cast for decimal to int or double to int because the conversion results in a loss of precision, therefore rather than allowing you to inadvertently perform a lossy operation you are expected to be explicit about it. Going the other way around, a double or decimal can fully represent any value assigned f... | What is the academic route for converting C# number types from one to another? Based on my tests, casting a decimal or double to an int or long simply keeps the whole number portion of the number and discards the decimal portion. Reversely, you can have an int variable and assign it directly to a decimal variable witho... | TITLE:
What is the academic route for converting C# number types from one to another?
QUESTION:
Based on my tests, casting a decimal or double to an int or long simply keeps the whole number portion of the number and discards the decimal portion. Reversely, you can have an int variable and assign it directly to a deci... | [
"c#",
"types",
"numbers"
] | 1 | 1 | 130 | 3 | 0 | 2011-06-07T16:58:45.657000 | 2011-06-07T17:01:44.310000 |
6,268,884 | 6,268,936 | Security class in Codeigniter | I'm trying to use the Security class in Codeigniter 2.0.2 but I cant seem to find the class to load. Is it hidden somewhere? Security Library as shown in CI user guide: http://codeigniter.com/user_guide/libraries/security.html Tried searching /system/libraries but it is not there... Trying to load the security class wi... | It is in helper according to codeigniter user guide try $this->load->helper('security'); | Security class in Codeigniter I'm trying to use the Security class in Codeigniter 2.0.2 but I cant seem to find the class to load. Is it hidden somewhere? Security Library as shown in CI user guide: http://codeigniter.com/user_guide/libraries/security.html Tried searching /system/libraries but it is not there... Trying... | TITLE:
Security class in Codeigniter
QUESTION:
I'm trying to use the Security class in Codeigniter 2.0.2 but I cant seem to find the class to load. Is it hidden somewhere? Security Library as shown in CI user guide: http://codeigniter.com/user_guide/libraries/security.html Tried searching /system/libraries but it is n... | [
"php",
"mysql",
"codeigniter"
] | 5 | 13 | 12,468 | 1 | 0 | 2011-06-07T16:59:11.663000 | 2011-06-07T17:03:42.767000 |
6,268,895 | 6,268,960 | Data order by which table its in SQL | So this is a weird one. I have a search for a person that exists in the table "profile" and we have people that are allowed to become like a fan of a person. They can favorite them. [Profile] [uid, first, last, location] [Favorite] [A][B] The profile table consists of some basic information (more than that but thats al... | I think you can combine that into one simple query using a case statement and a left join: select p.firstname, p.lastname, p.location, p.uid, case when f.A is null then 1 else 2 end as type from profile as p left join favorites as f on p.uid = f.B and f.A = 'myid' where p.firstname like 'mich%' or p.lastname like 'mich... | Data order by which table its in SQL So this is a weird one. I have a search for a person that exists in the table "profile" and we have people that are allowed to become like a fan of a person. They can favorite them. [Profile] [uid, first, last, location] [Favorite] [A][B] The profile table consists of some basic inf... | TITLE:
Data order by which table its in SQL
QUESTION:
So this is a weird one. I have a search for a person that exists in the table "profile" and we have people that are allowed to become like a fan of a person. They can favorite them. [Profile] [uid, first, last, location] [Favorite] [A][B] The profile table consists... | [
"sql",
"data-mining"
] | 0 | 4 | 55 | 2 | 0 | 2011-06-07T17:00:01.930000 | 2011-06-07T17:05:36.450000 |
6,268,907 | 6,269,028 | Strange error while trying to clone a SVN repo via git | I tried to clone the repository of the Linux Libertine project. It is a SVN repo, but I wanted to use git as my personal backend. Now, I got a strange error message: $ git svn clone -s http://linuxlibertine.svn.sourceforge.net/svnroot Initialized empty Git repository in /home/robert/svnroot/.git/ Repository has been mo... | The URL you use actually suffers from a redirection loop (you can check it with your browser). However, according to the develop page of the project on SourceForge, you're not using the correct URL: you should use http://linuxlibertine.svn.sourceforge.net/svnroot/linuxlibertine instead. $ git svn clone -s http://linuxl... | Strange error while trying to clone a SVN repo via git I tried to clone the repository of the Linux Libertine project. It is a SVN repo, but I wanted to use git as my personal backend. Now, I got a strange error message: $ git svn clone -s http://linuxlibertine.svn.sourceforge.net/svnroot Initialized empty Git reposito... | TITLE:
Strange error while trying to clone a SVN repo via git
QUESTION:
I tried to clone the repository of the Linux Libertine project. It is a SVN repo, but I wanted to use git as my personal backend. Now, I got a strange error message: $ git svn clone -s http://linuxlibertine.svn.sourceforge.net/svnroot Initialized ... | [
"svn",
"git",
"git-svn"
] | 4 | 5 | 945 | 1 | 0 | 2011-06-07T17:01:22.913000 | 2011-06-07T17:13:11.227000 |
6,268,909 | 6,268,997 | Check if a string starts with certain words, and split it if it is | $str = 'foooo'; // <- true; how can I get 'foo' + 'oo'? $words = array( 'foo', 'oo' ); What's the fastest way I could find out if $str starts with one of the words from the array, and split it if it does? | Using $words and $str from your example: $pieces = preg_split('/^('.implode('|', $words).')/', $str, 0, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); Result: array(2) { [0]=> string(3) "foo" [1]=> string(2) "oo" } | Check if a string starts with certain words, and split it if it is $str = 'foooo'; // <- true; how can I get 'foo' + 'oo'? $words = array( 'foo', 'oo' ); What's the fastest way I could find out if $str starts with one of the words from the array, and split it if it does? | TITLE:
Check if a string starts with certain words, and split it if it is
QUESTION:
$str = 'foooo'; // <- true; how can I get 'foo' + 'oo'? $words = array( 'foo', 'oo' ); What's the fastest way I could find out if $str starts with one of the words from the array, and split it if it does?
ANSWER:
Using $words and $str... | [
"php",
"regex",
"arrays",
"string"
] | 3 | 5 | 1,450 | 4 | 0 | 2011-06-07T17:01:35.457000 | 2011-06-07T17:09:33.677000 |
6,268,915 | 6,269,292 | Grails controllers repeated code for all actions | Imagine this controller: class exampleController{
def action1 = {}
def action2 = {}
def action3 = {}
def action4 = {}
def action5 = {}
} I want to be able to return in all the action in this controller the same params. Imagining this: def user = session.user [user: user] Is there any way of doing this, besides wr... | A simple solution is to put this code in a method and call it from each action class exampleController{
def action1 = {getModel()}
def action2 = {getModel()}
def action3 = {getModel()}
def action4 = {getModel()}
def action5 = {getModel()}
private getModel() { def user = session.user [user: user] } } While this do... | Grails controllers repeated code for all actions Imagine this controller: class exampleController{
def action1 = {}
def action2 = {}
def action3 = {}
def action4 = {}
def action5 = {}
} I want to be able to return in all the action in this controller the same params. Imagining this: def user = session.user [user:... | TITLE:
Grails controllers repeated code for all actions
QUESTION:
Imagine this controller: class exampleController{
def action1 = {}
def action2 = {}
def action3 = {}
def action4 = {}
def action5 = {}
} I want to be able to return in all the action in this controller the same params. Imagining this: def user = s... | [
"grails",
"controller",
"action"
] | 2 | 5 | 312 | 3 | 0 | 2011-06-07T17:02:01.713000 | 2011-06-07T17:33:41.440000 |
6,268,916 | 6,269,069 | Can I find out if a coordinate is inside a city? | Let's say I have a LatLng object, is there any way of checking if it represents a possible location within a city? How can I get the limits of a city? I'm using Google Map V3. | Have you tried reverse geocoding? http://code.google.com/apis/maps/documentation/javascript/services.html#ReverseGeocoding You could check the formatted address to see if the city matches what you're looking for. I'm not sure how accurate this will be for your application, but it's an option. function codeLatLng() { va... | Can I find out if a coordinate is inside a city? Let's say I have a LatLng object, is there any way of checking if it represents a possible location within a city? How can I get the limits of a city? I'm using Google Map V3. | TITLE:
Can I find out if a coordinate is inside a city?
QUESTION:
Let's say I have a LatLng object, is there any way of checking if it represents a possible location within a city? How can I get the limits of a city? I'm using Google Map V3.
ANSWER:
Have you tried reverse geocoding? http://code.google.com/apis/maps/d... | [
"google-maps-api-3"
] | 9 | 8 | 8,474 | 3 | 0 | 2011-06-07T17:02:02.330000 | 2011-06-07T17:16:49.430000 |
6,268,937 | 6,270,788 | My Codeigniter method for safely deleting database entries | I've been searching about deleting db entries in Codeigniter and I finally created a solution that I think is secure. I would really appreciate any feedback! I'm not sure if I'm doing this right.. Advantages: Uses POST request ID of entry to be deleted is validated Uses CSRF protection (automatically generated by Codei... | If the ids are unique integers in your database, you could remove these rules: trim|xss_clean|numeric And add this one: is_natural_no_zero Returns FALSE if the form element contains anything other than a natural number, but not zero: 1, 2, 3, etc. The numeric rule allows some characters you probably don't want, like de... | My Codeigniter method for safely deleting database entries I've been searching about deleting db entries in Codeigniter and I finally created a solution that I think is secure. I would really appreciate any feedback! I'm not sure if I'm doing this right.. Advantages: Uses POST request ID of entry to be deleted is valid... | TITLE:
My Codeigniter method for safely deleting database entries
QUESTION:
I've been searching about deleting db entries in Codeigniter and I finally created a solution that I think is secure. I would really appreciate any feedback! I'm not sure if I'm doing this right.. Advantages: Uses POST request ID of entry to b... | [
"php",
"mysql",
"database",
"codeigniter"
] | 0 | 1 | 3,290 | 3 | 0 | 2011-06-07T17:03:43.877000 | 2011-06-07T19:48:16.577000 |
6,268,946 | 6,269,084 | JavasScript event handling best practice? | When defining a JavaScript call, like so: What is the best way to write the actual call? I've seen numerous method: javascript:someJavascriptFunction(); or justSomeJavaScriptFunction(); or withoutTheSemicolon() Are there any benefits or caveats to any of the methods? I realize that using addEventListener is more flexib... | If you want best practice, separate markup from script content. Assign your event handlers in script elements. As you say, using addEventListener is one way of doing this, although you have to use attachEvent as well if you want to support versions of Internet Explorer before version 9. It's perfectly valid, however, t... | JavasScript event handling best practice? When defining a JavaScript call, like so: What is the best way to write the actual call? I've seen numerous method: javascript:someJavascriptFunction(); or justSomeJavaScriptFunction(); or withoutTheSemicolon() Are there any benefits or caveats to any of the methods? I realize ... | TITLE:
JavasScript event handling best practice?
QUESTION:
When defining a JavaScript call, like so: What is the best way to write the actual call? I've seen numerous method: javascript:someJavascriptFunction(); or justSomeJavaScriptFunction(); or withoutTheSemicolon() Are there any benefits or caveats to any of the m... | [
"javascript",
"dom-events"
] | 1 | 4 | 1,935 | 6 | 0 | 2011-06-07T17:04:35.500000 | 2011-06-07T17:18:32.633000 |
6,268,956 | 6,269,070 | Understanding the Pearson Correlation Coefficient | As part of the calculations to generate a Pearson Correlation Coefficient, the following computation is performed: In the second formula: p_a,i is the predicted rating user a would give item i, n is the number of similar users being compared to, and ru,i is the rating of item i by user u. What value will be used if use... | According to the link, earlier calculations in step 1 of the algorithm are over a set of items, indexed 1 to m, whe m is the total number of items in common. Step 3 of the algorithm specifies: "To find a rating prediction for a particular user for a particular item, first select a number of users with the highest, weig... | Understanding the Pearson Correlation Coefficient As part of the calculations to generate a Pearson Correlation Coefficient, the following computation is performed: In the second formula: p_a,i is the predicted rating user a would give item i, n is the number of similar users being compared to, and ru,i is the rating o... | TITLE:
Understanding the Pearson Correlation Coefficient
QUESTION:
As part of the calculations to generate a Pearson Correlation Coefficient, the following computation is performed: In the second formula: p_a,i is the predicted rating user a would give item i, n is the number of similar users being compared to, and ru... | [
"recommendation-engine"
] | 2 | 1 | 2,819 | 2 | 0 | 2011-06-07T17:05:29.287000 | 2011-06-07T17:16:54.023000 |
6,268,958 | 6,268,982 | Making Generics with many types | I have a chunk of code where sometimes I need to create a new generic type, but with an unknown number of generic parameters. For example: public object MakeGenericAction(Type[] types) { return typeof(Action<>).MakeGenericType(paramTypes); } The problem is that if I have more than one Type in my array, then the program... | In that case, yes: Type actionType = Expression.GetActionType(types); The problem here though is that you will probably be using DynamicInvoke which is slow. An Action then access by index may outperform an Action<...> invoked with DynamicInvoke | Making Generics with many types I have a chunk of code where sometimes I need to create a new generic type, but with an unknown number of generic parameters. For example: public object MakeGenericAction(Type[] types) { return typeof(Action<>).MakeGenericType(paramTypes); } The problem is that if I have more than one Ty... | TITLE:
Making Generics with many types
QUESTION:
I have a chunk of code where sometimes I need to create a new generic type, but with an unknown number of generic parameters. For example: public object MakeGenericAction(Type[] types) { return typeof(Action<>).MakeGenericType(paramTypes); } The problem is that if I hav... | [
"c#",
"generics"
] | 7 | 5 | 573 | 2 | 0 | 2011-06-07T17:05:33.687000 | 2011-06-07T17:07:57.703000 |
6,268,963 | 6,298,753 | How do I concurrently increment a page view count using linq-to-sql? | I have an ASP.NET MVC 3 Web Application using Linq-to-SQL for my data access layer. I'm trying to increment a Views field every time the Details action is called, but I'm receiving a "Row not found or changed" error on db.SubmitChanges() if two people happen to hit the action at the same time. public ActionResult Detai... | You should not need transactions or stored procedures. Just use DataContext.ExecuteCommand: db.ExecuteCommand("UPDATE Ideas SET Views = Views + 1 WHERE IdeaPK = {0}", id); This will execute it as one SQL statement, and is thus atomic. | How do I concurrently increment a page view count using linq-to-sql? I have an ASP.NET MVC 3 Web Application using Linq-to-SQL for my data access layer. I'm trying to increment a Views field every time the Details action is called, but I'm receiving a "Row not found or changed" error on db.SubmitChanges() if two people... | TITLE:
How do I concurrently increment a page view count using linq-to-sql?
QUESTION:
I have an ASP.NET MVC 3 Web Application using Linq-to-SQL for my data access layer. I'm trying to increment a Views field every time the Details action is called, but I'm receiving a "Row not found or changed" error on db.SubmitChang... | [
"c#",
"asp.net-mvc",
"linq-to-sql",
"architecture",
"concurrency"
] | 5 | 2 | 1,722 | 5 | 0 | 2011-06-07T17:06:02.690000 | 2011-06-09T20:18:42.457000 |
6,268,967 | 6,269,102 | Basic awk help: want to scan a Rails log and find number of unique IPs per day | I have a Rails log that looks like this Started GET "[path-omitted]" for 166.137.138.210 at 2011-06-07 13:03:29 -0400 etc. I'd like to write an awk script that extracts the number of unique IP addresses per date. I'm an awk newbie. How I can do this? | If the IP is always in the fifth column: awk '{ ips[$5]++ } END { for (ip in ips) { print ip } }' your_log_file If you want to output the count, you can change the print statement to: print ips[ip]" "ip or something similar. | Basic awk help: want to scan a Rails log and find number of unique IPs per day I have a Rails log that looks like this Started GET "[path-omitted]" for 166.137.138.210 at 2011-06-07 13:03:29 -0400 etc. I'd like to write an awk script that extracts the number of unique IP addresses per date. I'm an awk newbie. How I can... | TITLE:
Basic awk help: want to scan a Rails log and find number of unique IPs per day
QUESTION:
I have a Rails log that looks like this Started GET "[path-omitted]" for 166.137.138.210 at 2011-06-07 13:03:29 -0400 etc. I'd like to write an awk script that extracts the number of unique IP addresses per date. I'm an awk... | [
"awk"
] | 0 | 4 | 373 | 2 | 0 | 2011-06-07T17:06:07.793000 | 2011-06-07T17:19:51.933000 |
6,268,968 | 6,269,233 | WPF Splash Screen Windows | I need to have a PNG (with transparency) as a splash screen. The transparent portions of the image should be clear so the user can see any windows behind it (or desktop). I also need to display the splash screen for 5 seconds (the contract specifically says 5 seconds) and it can't be any shorter. I am aware of the buil... | I had a similar problem, where i couldn't use the built-in splashscreen option, on a WPF project. That project is now open source, you have have a look here: https://code.google.com/p/theomniscientchimp/ It's an auto-updater (there are a few things you don't need i guess). This is the minimum you should need: WPF side:... | WPF Splash Screen Windows I need to have a PNG (with transparency) as a splash screen. The transparent portions of the image should be clear so the user can see any windows behind it (or desktop). I also need to display the splash screen for 5 seconds (the contract specifically says 5 seconds) and it can't be any short... | TITLE:
WPF Splash Screen Windows
QUESTION:
I need to have a PNG (with transparency) as a splash screen. The transparent portions of the image should be clear so the user can see any windows behind it (or desktop). I also need to display the splash screen for 5 seconds (the contract specifically says 5 seconds) and it ... | [
"c#",
"wpf",
"visual-studio-2010",
"c#-4.0",
"splash-screen"
] | 5 | 6 | 11,150 | 5 | 0 | 2011-06-07T17:06:08.057000 | 2011-06-07T17:29:34.950000 |
6,268,994 | 6,269,009 | php include or require echos for no reason | i'm working on a website. I have a file in php and I want to include it. The file contains a big array, nothing else. When I tried to include it, the page functioned normally but I needed to convert my included file from ANSI to UTF8. After converting (notepad++) i get a big space at the top of the screen. Using firebu... | Try to convert it to UTF-8 without BOM. Make sure your file looks like this (there is nothing before ): | php include or require echos for no reason i'm working on a website. I have a file in php and I want to include it. The file contains a big array, nothing else. When I tried to include it, the page functioned normally but I needed to convert my included file from ANSI to UTF8. After converting (notepad++) i get a big s... | TITLE:
php include or require echos for no reason
QUESTION:
i'm working on a website. I have a file in php and I want to include it. The file contains a big array, nothing else. When I tried to include it, the page functioned normally but I needed to convert my included file from ANSI to UTF8. After converting (notepa... | [
"php",
"utf-8"
] | 1 | 2 | 378 | 3 | 0 | 2011-06-07T17:09:10.307000 | 2011-06-07T17:11:18.537000 |
6,269,004 | 6,269,065 | How do I convert to DIP? | What is the formula for converting regular pixels to DIP? Assuming I have a photoshop document with a design in it that was intended for the Galaxy Tab (for example) which is 600x1024 actual pixels. What is the ratio between those and the DIP? I'm unclear on how Android translates this. I want to use DIP (rather than p... | Their formula is somewhere in the docs: truePixels = DIPs * (device DPI / 160) Ah, there it is: The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a "medium" density screen. At runtime, the system transparently handles any scali... | How do I convert to DIP? What is the formula for converting regular pixels to DIP? Assuming I have a photoshop document with a design in it that was intended for the Galaxy Tab (for example) which is 600x1024 actual pixels. What is the ratio between those and the DIP? I'm unclear on how Android translates this. I want ... | TITLE:
How do I convert to DIP?
QUESTION:
What is the formula for converting regular pixels to DIP? Assuming I have a photoshop document with a design in it that was intended for the Galaxy Tab (for example) which is 600x1024 actual pixels. What is the ratio between those and the DIP? I'm unclear on how Android transl... | [
"android",
"density-independent-pixel"
] | 5 | 11 | 5,815 | 1 | 0 | 2011-06-07T17:10:46.783000 | 2011-06-07T17:16:39.953000 |
6,269,011 | 6,269,140 | Update model from view model | What's the usual way to update a NHibernate entity from a view model? I have a view model editor where all of my data is displayed, which is fetched via a repository that returns a DTO. The DTO properties are then mapped to my view model properties. I could update my entity if I fetched it again, updated the select pro... | My usual approach is to have an EditXViewModel which handles change tracking for XViewModel and includes a SaveCommand which does the actual entity update. This ensures users can undo changes made without having to remember what they were in the database (it also cuts down on the number of transactions). The following ... | Update model from view model What's the usual way to update a NHibernate entity from a view model? I have a view model editor where all of my data is displayed, which is fetched via a repository that returns a DTO. The DTO properties are then mapped to my view model properties. I could update my entity if I fetched it ... | TITLE:
Update model from view model
QUESTION:
What's the usual way to update a NHibernate entity from a view model? I have a view model editor where all of my data is displayed, which is fetched via a repository that returns a DTO. The DTO properties are then mapped to my view model properties. I could update my entit... | [
"c#",
"nhibernate",
"mvvm"
] | 2 | 1 | 581 | 2 | 0 | 2011-06-07T17:11:41.450000 | 2011-06-07T17:23:12.430000 |
6,269,012 | 6,269,027 | How to use C# XNA timer? | I am using XNA my rocket is creating smoke objects when it fly. I need to know how to use some timer in XNA for these simple smoke objects. When the object is create...wait 2 seconds and destroy this object. Can somebody help pls? | Your update method should be being passed a GameTime object. Record the time in ctor or setup method, and compare it every update. Once a specified period has elapsed, run your teardown method. | How to use C# XNA timer? I am using XNA my rocket is creating smoke objects when it fly. I need to know how to use some timer in XNA for these simple smoke objects. When the object is create...wait 2 seconds and destroy this object. Can somebody help pls? | TITLE:
How to use C# XNA timer?
QUESTION:
I am using XNA my rocket is creating smoke objects when it fly. I need to know how to use some timer in XNA for these simple smoke objects. When the object is create...wait 2 seconds and destroy this object. Can somebody help pls?
ANSWER:
Your update method should be being pa... | [
"c#-4.0",
"xna-4.0"
] | 2 | 5 | 3,714 | 1 | 0 | 2011-06-07T17:11:48.043000 | 2011-06-07T17:13:08.783000 |
6,269,015 | 6,269,176 | nested select statement help | I am having trouble displaying the number of opencases that are found in my stored procedure, I am not sure if that select statement is placed properly. BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT C... | OpenCases should occur before the Join statements as OpenCases is a data Column BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT C.CaseNumber, O.OfficeName, CT.Description AS CaseType, DATEADD(dd, 0, DAT... | nested select statement help I am having trouble displaying the number of opencases that are found in my stored procedure, I am not sure if that select statement is placed properly. BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statement... | TITLE:
nested select statement help
QUESTION:
I am having trouble displaying the number of opencases that are found in my stored procedure, I am not sure if that select statement is placed properly. BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -... | [
"stored-procedures"
] | 0 | 1 | 2,071 | 1 | 0 | 2011-06-07T17:12:09.627000 | 2011-06-07T17:25:59.970000 |
6,269,023 | 6,269,081 | java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components | This the exception: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [MarkupContainer [Component id = textField1]], but component [MarkupContainer [Component id = textField2]] wants to be attached too at org.apache.wicket.behavior.Abstr... | Basically, you can't assign the same instance of a Behavior to multiple components. If you want to improve readability and maintainability, you can use: public class HomePage extends MasterPage { public HomePage() { add(new TextField ("textField1", new Model ("Text Field 1")).add(newOnClickBehavior())); add(new TextFie... | java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components This the exception: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [MarkupContainer [Component id = textField1]], but component [MarkupCon... | TITLE:
java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components
QUESTION:
This the exception: java.lang.IllegalStateException: this kind of handler cannot be attached to multiple components; it is already attached to component [MarkupContainer [Component id = textField1]], but co... | [
"java",
"ajax",
"wicket",
"behavior"
] | 2 | 7 | 1,261 | 2 | 0 | 2011-06-07T17:12:51.873000 | 2011-06-07T17:18:12.617000 |
6,269,029 | 6,269,125 | Task Cancellation with multiple sources | I currently have an application where I create a series of Tasks that execute one after the other, with a cancellation source that can interrupt execution between Tasks (i.e. at safe termination points.) I currently use this cancellation source only when the managing class is Disposed, as a way to cleanly and quickly a... | The core issue in your question seems to be relating to calling Dispose() on your Task and/or CancellationTokenSource objects. In this case, I would recommend just not calling Dispose on these, which should dramatically simplify your design. As justification I'll refer you to this thread. In particular, Stephen Toub (t... | Task Cancellation with multiple sources I currently have an application where I create a series of Tasks that execute one after the other, with a cancellation source that can interrupt execution between Tasks (i.e. at safe termination points.) I currently use this cancellation source only when the managing class is Dis... | TITLE:
Task Cancellation with multiple sources
QUESTION:
I currently have an application where I create a series of Tasks that execute one after the other, with a cancellation source that can interrupt execution between Tasks (i.e. at safe termination points.) I currently use this cancellation source only when the man... | [
"c#",
".net",
"task",
"task-parallel-library",
"cancellation"
] | 6 | 9 | 2,592 | 1 | 0 | 2011-06-07T17:13:22.633000 | 2011-06-07T17:21:55.720000 |
6,269,038 | 6,272,894 | GDB scripting to MOCK | I am trying to mock a function (for unit testing parent function) using GDB. One way to do it would be to set a break point in function you intend to mock and use GDB return command. However I am unable to do the same when GDB call command is used. (gdb) b secret_check Breakpoint 1 at 0x80483ba: file ut_gdb.c, line 6. ... | I would expect so. The limitation is probably that GDB cannot be stopped at (and able to continue from) two breakpoints at once. GDB has to maintain information about the current point where the program stopped in order to be able to continue. In order to support what you're trying to do, it would need to maintain a st... | GDB scripting to MOCK I am trying to mock a function (for unit testing parent function) using GDB. One way to do it would be to set a break point in function you intend to mock and use GDB return command. However I am unable to do the same when GDB call command is used. (gdb) b secret_check Breakpoint 1 at 0x80483ba: f... | TITLE:
GDB scripting to MOCK
QUESTION:
I am trying to mock a function (for unit testing parent function) using GDB. One way to do it would be to set a break point in function you intend to mock and use GDB return command. However I am unable to do the same when GDB call command is used. (gdb) b secret_check Breakpoint... | [
"embedded",
"gdb",
"embedded-linux"
] | 3 | 0 | 823 | 3 | 0 | 2011-06-07T17:14:14.173000 | 2011-06-07T23:58:28.237000 |
6,269,043 | 6,269,177 | Binding an object to a control | You'll have to forgive me if this makes no sense, as I'm still very new to ASP.NET. I have an arbitrarily long List of items (let's say it's a list of type Person) which I've figured out how to bind to a repeater control and display the item's properties (eg. the name of the person). What I'm interested to know is how ... | I think I know what you after, The code below will allow you delete a item from a repeater from the click of a link button. EDIT: In response to the comment I have changed the code to show how to pass an ID back to the command event. Change your top line to and the following line to your link button Then add the follow... | Binding an object to a control You'll have to forgive me if this makes no sense, as I'm still very new to ASP.NET. I have an arbitrarily long List of items (let's say it's a list of type Person) which I've figured out how to bind to a repeater control and display the item's properties (eg. the name of the person). What... | TITLE:
Binding an object to a control
QUESTION:
You'll have to forgive me if this makes no sense, as I'm still very new to ASP.NET. I have an arbitrarily long List of items (let's say it's a list of type Person) which I've figured out how to bind to a repeater control and display the item's properties (eg. the name of... | [
"c#",
"asp.net",
"postback",
"repeater"
] | 2 | 1 | 355 | 3 | 0 | 2011-06-07T17:14:31.983000 | 2011-06-07T17:26:03.530000 |
6,269,048 | 6,269,248 | Windows Azure, Differences Between Emulated and Actual Deployment | I am developing an azure application. There are only worker roles and each will call an external executable. Everything is working fine if I use the emulator. I only change the storageAccount to run an actual deployment. But it seems that the external program is not starting. By just changing the storage account, will ... | You need to make sure your executables are either included in your deployment package (e.g. setting 'Copy to Output Directory' to 'Copy Always' or 'Copy if newer') or copying them from blob storage on startup. The first option is easier for getting started, but not as efficient because the deployment package increases ... | Windows Azure, Differences Between Emulated and Actual Deployment I am developing an azure application. There are only worker roles and each will call an external executable. Everything is working fine if I use the emulator. I only change the storageAccount to run an actual deployment. But it seems that the external pr... | TITLE:
Windows Azure, Differences Between Emulated and Actual Deployment
QUESTION:
I am developing an azure application. There are only worker roles and each will call an external executable. Everything is working fine if I use the emulator. I only change the storageAccount to run an actual deployment. But it seems th... | [
"azure"
] | 2 | 1 | 194 | 1 | 0 | 2011-06-07T17:15:06.990000 | 2011-06-07T17:30:16.387000 |
6,269,050 | 6,269,109 | How to show progress indicator or progress Bar in the titleBar in android? | I have an http request and some UI change during that time and I want to show the activity indicator during that time. I want to show it in the title bar. I want to show progress indicator in the title in android like activity indicator in iphone? | From your activity code: getWindow().requestFeature(Window.FEATURE_INDETERMINATE_PROGRESS);... // when you need to show progress: setProgressBarIndeterminate([true|false]); | How to show progress indicator or progress Bar in the titleBar in android? I have an http request and some UI change during that time and I want to show the activity indicator during that time. I want to show it in the title bar. I want to show progress indicator in the title in android like activity indicator in iphon... | TITLE:
How to show progress indicator or progress Bar in the titleBar in android?
QUESTION:
I have an http request and some UI change during that time and I want to show the activity indicator during that time. I want to show it in the title bar. I want to show progress indicator in the title in android like activity ... | [
"android"
] | 3 | 7 | 2,892 | 2 | 0 | 2011-06-07T17:15:11.460000 | 2011-06-07T17:20:18 |
6,269,051 | 6,269,098 | jQuery plugins vs widgets | Few months ago I started some experiments with jQuery plugin. I found some tutorials on the Interenet and I started to put something together. A couple of days ago I had the need to build my own "plugin" and got back to my old project. Trying to find some more informations on the internet, I bumped in these new "things... | You can either write a jQuery plugin or a jQuery UI widget. Depends on what you want to do. Neither of these is outdated. If you write a widget, it will depend on jQuery UI (and jQuery of course), if you write a plugin, it will only depend on jQuery. Really, it depends on what you want to achieve. | jQuery plugins vs widgets Few months ago I started some experiments with jQuery plugin. I found some tutorials on the Interenet and I started to put something together. A couple of days ago I had the need to build my own "plugin" and got back to my old project. Trying to find some more informations on the internet, I b... | TITLE:
jQuery plugins vs widgets
QUESTION:
Few months ago I started some experiments with jQuery plugin. I found some tutorials on the Interenet and I started to put something together. A couple of days ago I had the need to build my own "plugin" and got back to my old project. Trying to find some more informations on... | [
"javascript",
"jquery",
"jquery-ui",
"jquery-plugins",
"jquery-widgets"
] | 25 | 25 | 10,524 | 2 | 0 | 2011-06-07T17:15:26.840000 | 2011-06-07T17:19:44.850000 |
6,269,062 | 6,269,120 | .NET Reflection: how do I loop through an object that is an array type? | I've got a method that returns an array, the type of which I have stored in a Type object further up. The code I have for this is thus: Type StoryType = Type.GetType("my.ns.Story"); Type StoryTypeArray = Type.GetType("my.ns.Story[]");
object stories = SomeMethodInfo.Invoke(BigFatObject,some_params); In this example, I... | It's not clear from your question if the Story type is actually known to you at compile time. If it is, the solution is trivial; just cast stores to Story[] and iterate over it as usual: foreach(Story instance in (Story[])stories) {... } This also means that StoryType can be written as typeof(Story) and StoryTypeArray ... | .NET Reflection: how do I loop through an object that is an array type? I've got a method that returns an array, the type of which I have stored in a Type object further up. The code I have for this is thus: Type StoryType = Type.GetType("my.ns.Story"); Type StoryTypeArray = Type.GetType("my.ns.Story[]");
object stori... | TITLE:
.NET Reflection: how do I loop through an object that is an array type?
QUESTION:
I've got a method that returns an array, the type of which I have stored in a Type object further up. The code I have for this is thus: Type StoryType = Type.GetType("my.ns.Story"); Type StoryTypeArray = Type.GetType("my.ns.Story[... | [
"c#",
".net",
"reflection"
] | 8 | 12 | 7,611 | 2 | 0 | 2011-06-07T17:16:28.090000 | 2011-06-07T17:21:17.640000 |
6,269,071 | 6,269,211 | Telerik Reporting Class Library not found C# | I created a new Telerik reporting class library (single report for now) which builds successfully in VS2010 [10.0.30319.1 RTMRel] I want to test/debug, so I add a WinForms project called "Tester" to my solution containing the above class library, and I make Tester the startup project. In Solution Explorer, I right clic... | So your winform project, besides referencing your class library. Do you also have references for Telerik.Reporting, and Telerik.ReportViewer.WinForms? And when you look at the reference for "MytelerikClassLibrary" try setting Copy Local to True. | Telerik Reporting Class Library not found C# I created a new Telerik reporting class library (single report for now) which builds successfully in VS2010 [10.0.30319.1 RTMRel] I want to test/debug, so I add a WinForms project called "Tester" to my solution containing the above class library, and I make Tester the startu... | TITLE:
Telerik Reporting Class Library not found C#
QUESTION:
I created a new Telerik reporting class library (single report for now) which builds successfully in VS2010 [10.0.30319.1 RTMRel] I want to test/debug, so I add a WinForms project called "Tester" to my solution containing the above class library, and I make... | [
"c#",
"visual-studio-2010",
"telerik-reporting"
] | 1 | 1 | 2,032 | 1 | 0 | 2011-06-07T17:17:19.937000 | 2011-06-07T17:28:13.013000 |
6,269,072 | 6,269,263 | Why can't I use a where clause on both tables in a LINQ Group Join? | Here's what I want to do: Dim queryX = From m In db.Master Where m.Field = value Group Join d In db.Detail On m.Id Equals d.MasterId Into Group Where d.Field = value In English, I want to join the master and detail tables, specifying conditions on each. But this causes the following compiler error: "Name 'd' is either ... | Are you sure you need a group join here and not just a join like this try Dim queryX = From m In db.Master Where m.Field = value Join d In db.Detail On m.Id Equals d.MasterId Where d.Field = value;? | Why can't I use a where clause on both tables in a LINQ Group Join? Here's what I want to do: Dim queryX = From m In db.Master Where m.Field = value Group Join d In db.Detail On m.Id Equals d.MasterId Into Group Where d.Field = value In English, I want to join the master and detail tables, specifying conditions on each... | TITLE:
Why can't I use a where clause on both tables in a LINQ Group Join?
QUESTION:
Here's what I want to do: Dim queryX = From m In db.Master Where m.Field = value Group Join d In db.Detail On m.Id Equals d.MasterId Into Group Where d.Field = value In English, I want to join the master and detail tables, specifying ... | [
"vb.net",
"linq"
] | 1 | 1 | 326 | 1 | 0 | 2011-06-07T17:17:22.697000 | 2011-06-07T17:31:30.520000 |
6,269,075 | 6,269,367 | How to undo an Update on SVN | I'm using SVN with Xcode. After implementing a certain functionality in my working copy, I was ready to commit my code to the repository. However the server copy had been modified since my last checkout. So I thought the best thing to do would be to update my project first, resolve conflicts if any, and then finally co... | XCode allows you to update code to a specific revision. I'm not sure how to do this in XCode 4, but in XCode 3.2 you right click on a class file and click "Get Info". In the info window, go to the "SCM" tab. Over there you'll see a list of all the SVN revisions for that class file. You should see your coworker's revisi... | How to undo an Update on SVN I'm using SVN with Xcode. After implementing a certain functionality in my working copy, I was ready to commit my code to the repository. However the server copy had been modified since my last checkout. So I thought the best thing to do would be to update my project first, resolve conflict... | TITLE:
How to undo an Update on SVN
QUESTION:
I'm using SVN with Xcode. After implementing a certain functionality in my working copy, I was ready to commit my code to the repository. However the server copy had been modified since my last checkout. So I thought the best thing to do would be to update my project first... | [
"iphone",
"xcode",
"ios",
"svn",
"xcode4"
] | 0 | 1 | 2,277 | 2 | 0 | 2011-06-07T17:17:40.287000 | 2011-06-07T17:38:52.830000 |
6,269,078 | 6,269,094 | Proper way to close an OutputStream in Java? | This almost seems silly but what is the most reliable pattern to follow when closing an OutputStream? Right now I have something like the following which just seem to be try-catch-finally-overkill: private void writeContentsToFile(OutputStream ostream, Properties contents) { try { contents.store(ostream, "comments"); }... | If you are using Apache Commons, then IOUtils.closeQuietly() does the job nicely. See http://commons.apache.org/proper/commons-io/javadocs/api-1.4/org/apache/commons/io/IOUtils.html#closeQuietly(java.io.OutputStream) | Proper way to close an OutputStream in Java? This almost seems silly but what is the most reliable pattern to follow when closing an OutputStream? Right now I have something like the following which just seem to be try-catch-finally-overkill: private void writeContentsToFile(OutputStream ostream, Properties contents) {... | TITLE:
Proper way to close an OutputStream in Java?
QUESTION:
This almost seems silly but what is the most reliable pattern to follow when closing an OutputStream? Right now I have something like the following which just seem to be try-catch-finally-overkill: private void writeContentsToFile(OutputStream ostream, Prop... | [
"java"
] | 23 | 19 | 27,202 | 3 | 0 | 2011-06-07T17:17:44.367000 | 2011-06-07T17:19:31.700000 |
6,269,087 | 6,269,327 | Reading images in jsf | I'm using following code for reading images from database but when i call getter method of pb in h:datatable value to display images on jsf page i got the error "oracle.sql.BLOB cannot be cast to java.lang.String".Any idea please? Java class is having pb property. Java code for reading image: public List getPb() throws... | You're making a conceptual mistake here. In HTML, images are to be represented by element with a src attribute which should point to the image's URL. This is in JSF represented by the component whose value attribute will render the src attribute. It expects a String which in turn represents the image's URL. It does not... | Reading images in jsf I'm using following code for reading images from database but when i call getter method of pb in h:datatable value to display images on jsf page i got the error "oracle.sql.BLOB cannot be cast to java.lang.String".Any idea please? Java class is having pb property. Java code for reading image: publ... | TITLE:
Reading images in jsf
QUESTION:
I'm using following code for reading images from database but when i call getter method of pb in h:datatable value to display images on jsf page i got the error "oracle.sql.BLOB cannot be cast to java.lang.String".Any idea please? Java class is having pb property. Java code for r... | [
"jsf",
"jsf-2"
] | 2 | 3 | 6,624 | 1 | 0 | 2011-06-07T17:18:43.277000 | 2011-06-07T17:35:38.790000 |
6,269,100 | 6,269,411 | How to Load the Progress Dialog in android? | I have developed an android application.In that application getting information from web and displayed in the screen.At the time of getting information i want to load a progress dialog to the screen after getting the information i want dismiss the dialog Please any one help me how to do this with some sample code Thank... | You need to implement an AsyncTask. Example: class YourAsyncTask extends AsyncTask {
private ProgressDialog progressDialog;
@Override protected void onPreExecute() { //show your dialog here progressDialog = ProgressDialog.show(this, "title", "message", true, false) }
@Override protected Void doInBackground(Void... p... | How to Load the Progress Dialog in android? I have developed an android application.In that application getting information from web and displayed in the screen.At the time of getting information i want to load a progress dialog to the screen after getting the information i want dismiss the dialog Please any one help m... | TITLE:
How to Load the Progress Dialog in android?
QUESTION:
I have developed an android application.In that application getting information from web and displayed in the screen.At the time of getting information i want to load a progress dialog to the screen after getting the information i want dismiss the dialog Ple... | [
"android",
"progressdialog"
] | 0 | 2 | 458 | 2 | 0 | 2011-06-07T17:19:49.247000 | 2011-06-07T17:42:47.383000 |
6,269,103 | 6,269,228 | Refactoring functions to make more generic | I have the following code copy/pasted multiple times. The values that change are the string literals ("TabStates" changes to "ContentStates" etc..) and the value of the dictionary (RadTabSetting -> ContentSetting). public static SerializableDictionary GetTabStates() { SerializableDictionary _tabStates = new Serializabl... | Martin Fowler's book is the standard source for refactoring. But for your specific example, just create a new method that takes in parameters representing the things that change in your example. So you'll want a string parameter for your "TabStates" or "ContentStates" value, and another representing your Value for Key ... | Refactoring functions to make more generic I have the following code copy/pasted multiple times. The values that change are the string literals ("TabStates" changes to "ContentStates" etc..) and the value of the dictionary (RadTabSetting -> ContentSetting). public static SerializableDictionary GetTabStates() { Serializ... | TITLE:
Refactoring functions to make more generic
QUESTION:
I have the following code copy/pasted multiple times. The values that change are the string literals ("TabStates" changes to "ContentStates" etc..) and the value of the dictionary (RadTabSetting -> ContentSetting). public static SerializableDictionary GetTabS... | [
"c#",
"refactoring"
] | 3 | 4 | 201 | 1 | 0 | 2011-06-07T17:19:52.120000 | 2011-06-07T17:29:03.130000 |
6,269,106 | 6,269,273 | C Server - "The connection was reset" | I modified beej's guide to networking example (as seen below) to pass back a html response to a browser. I am getting "The connection was reset" every few refreshes, and can't seem to figure out why? Its as if it is closing the connection before it sends out the html response. Any ideas, or suggestions to debug? Edit: ... | So there's 2 errors here (3 really, the last one being that if you want to talk to a browser you really have to implement HTTP properly which is non-trivial) You're sending the response immediately when you accept a client. A browser being a bit slow might then receive a response even before it's finished sending a req... | C Server - "The connection was reset" I modified beej's guide to networking example (as seen below) to pass back a html response to a browser. I am getting "The connection was reset" every few refreshes, and can't seem to figure out why? Its as if it is closing the connection before it sends out the html response. Any ... | TITLE:
C Server - "The connection was reset"
QUESTION:
I modified beej's guide to networking example (as seen below) to pass back a html response to a browser. I am getting "The connection was reset" every few refreshes, and can't seem to figure out why? Its as if it is closing the connection before it sends out the h... | [
"c++",
"c",
"sockets",
"webserver"
] | 0 | 4 | 2,357 | 1 | 0 | 2011-06-07T17:20:12.337000 | 2011-06-07T17:32:10.600000 |
6,269,112 | 6,269,151 | XML jquery parse help | I have a weird XML file that I'm trying to parse. STUFF MORE STUFF EVEN MORE STUFF Different STUFF MORE Different STUFF EVEN MORE Different STUFF I tried getting the data by using "Row" which works but how do I call the individual field names? In firebug they all look like "Field". I tried: myvalue: $("whatever", this)... | You can do this with the attribute equals selector [attrname="value"]. For instance: $('Row', this).eq(0).find('Field[name="whatever2"]').text() This finds the Field element whose name is whatever2 within the first (index 0 ) Row element. | XML jquery parse help I have a weird XML file that I'm trying to parse. STUFF MORE STUFF EVEN MORE STUFF Different STUFF MORE Different STUFF EVEN MORE Different STUFF I tried getting the data by using "Row" which works but how do I call the individual field names? In firebug they all look like "Field". I tried: myvalu... | TITLE:
XML jquery parse help
QUESTION:
I have a weird XML file that I'm trying to parse. STUFF MORE STUFF EVEN MORE STUFF Different STUFF MORE Different STUFF EVEN MORE Different STUFF I tried getting the data by using "Row" which works but how do I call the individual field names? In firebug they all look like "Field... | [
"javascript",
"jquery",
"xml",
"parsing"
] | 0 | 1 | 322 | 2 | 0 | 2011-06-07T17:20:40.637000 | 2011-06-07T17:24:00.073000 |
6,269,123 | 6,269,255 | generating WPF styles containing Triggers from C# code | i had some trouble generating WPF styles containing Triggers from C# code. Here's the WPF code i want to generate trough C#. I alredy tried to generate like this: Style style = new Style(); Trigger trigger = new Trigger(); Setter setter = new Setter();
style.Triggers.Add(trigger); trigger.Property = (DependencyPropert... | The direct translation would be: OuterGlowBitmapEffect effect = new OuterGlowBitmapEffect(); effect.GlowColor = Colors.Gold; effect.GlowSize = 10;
Setter setter = new Setter(); setter.Property = UIElement.BitmapEffectProperty; setter.Value = effect;
Trigger trigger = new Trigger(); trigger.Property = UIElement.IsMous... | generating WPF styles containing Triggers from C# code i had some trouble generating WPF styles containing Triggers from C# code. Here's the WPF code i want to generate trough C#. I alredy tried to generate like this: Style style = new Style(); Trigger trigger = new Trigger(); Setter setter = new Setter();
style.Trigg... | TITLE:
generating WPF styles containing Triggers from C# code
QUESTION:
i had some trouble generating WPF styles containing Triggers from C# code. Here's the WPF code i want to generate trough C#. I alredy tried to generate like this: Style style = new Style(); Trigger trigger = new Trigger(); Setter setter = new Sett... | [
"c#",
"wpf",
"xaml",
"styles"
] | 8 | 13 | 10,996 | 1 | 0 | 2011-06-07T17:21:53.733000 | 2011-06-07T17:30:40.353000 |
6,269,124 | 6,269,306 | Perfectly emulate nullptr | I got tired of waiting for compiler support of nullptr ( gcc 4.6 does but it's so new few distributions support it). So as a stop gap until nullptr is fully supported I decided to emulate it. There are two examples of emulation: one from here, and one from wikibooks. Of note, neither implementation mentions an operator... | You compiled it with C++0x compiler that failed for unknown reason. It compiles fine in C++03. | Perfectly emulate nullptr I got tired of waiting for compiler support of nullptr ( gcc 4.6 does but it's so new few distributions support it). So as a stop gap until nullptr is fully supported I decided to emulate it. There are two examples of emulation: one from here, and one from wikibooks. Of note, neither implement... | TITLE:
Perfectly emulate nullptr
QUESTION:
I got tired of waiting for compiler support of nullptr ( gcc 4.6 does but it's so new few distributions support it). So as a stop gap until nullptr is fully supported I decided to emulate it. There are two examples of emulation: one from here, and one from wikibooks. Of note,... | [
"c++",
"null",
"c++11",
"nullptr"
] | 5 | 3 | 1,524 | 3 | 0 | 2011-06-07T17:21:54.363000 | 2011-06-07T17:34:32.343000 |
6,269,127 | 6,269,178 | Pulling out a copy of repo up to a particular commit? | Is there a way to pull out a copy of my repo up to a certain commit? I'm using github, and I see a particular checkin has the following ids on its page: commit: abc tree: def parent: xyz So I'd like to do something like: git clone -option-up-to-commit "abc" So I can get a snapshot of my project at that point in time? T... | If it doesn't matter that you clone the whole repo first, just do $ git clone repo $ cd repo $ git checkout commit-hash | Pulling out a copy of repo up to a particular commit? Is there a way to pull out a copy of my repo up to a certain commit? I'm using github, and I see a particular checkin has the following ids on its page: commit: abc tree: def parent: xyz So I'd like to do something like: git clone -option-up-to-commit "abc" So I can... | TITLE:
Pulling out a copy of repo up to a particular commit?
QUESTION:
Is there a way to pull out a copy of my repo up to a certain commit? I'm using github, and I see a particular checkin has the following ids on its page: commit: abc tree: def parent: xyz So I'd like to do something like: git clone -option-up-to-com... | [
"git",
"github"
] | 0 | 4 | 1,065 | 2 | 0 | 2011-06-07T17:21:59.030000 | 2011-06-07T17:26:04.880000 |
6,269,129 | 6,269,277 | When to use collections vs multiple properties | I'm building a relatively simple class (ex: Person) for an ASP.NET application that has several related boolean properties (ex: Certifications). I have the option of storing them as multiple properties: Class Person Property HasCertL1 Property HasCertL2 Property HasCertL3 End Class Or using a collection and enum: Enum ... | My vote is to use a collection. Here's why: when you set the class up with a property for each level of certification, if you were to add a level of certification, you'd have to add extra code to check that people had that extra level. That requires, possibly, a change to every other class that uses Person. If you use ... | When to use collections vs multiple properties I'm building a relatively simple class (ex: Person) for an ASP.NET application that has several related boolean properties (ex: Certifications). I have the option of storing them as multiple properties: Class Person Property HasCertL1 Property HasCertL2 Property HasCertL3 ... | TITLE:
When to use collections vs multiple properties
QUESTION:
I'm building a relatively simple class (ex: Person) for an ASP.NET application that has several related boolean properties (ex: Certifications). I have the option of storing them as multiple properties: Class Person Property HasCertL1 Property HasCertL2 P... | [
".net",
"class",
"collections",
"properties"
] | 5 | 3 | 239 | 4 | 0 | 2011-06-07T17:22:10.370000 | 2011-06-07T17:32:24.563000 |
6,269,131 | 6,269,317 | customizing vertical scrollbar with css/jquery | I have a div as with some tags within it. I am setting the style for div as follows: #content{ height:200px; overflow-y:scroll; } Is there a way I can customize the scrollbar. I mean I want to change the scrollbar color as well as its background. | There is no valid cross-browser code, which is capable of coloring the scrollbars. You should respect the UI configuration of the users who are visiting your page. Maybe you want to have jQuery scrollbars, which are fully customizable: http://www.net-kit.com/jquery-custom-scrollbar-plugins/ | customizing vertical scrollbar with css/jquery I have a div as with some tags within it. I am setting the style for div as follows: #content{ height:200px; overflow-y:scroll; } Is there a way I can customize the scrollbar. I mean I want to change the scrollbar color as well as its background. | TITLE:
customizing vertical scrollbar with css/jquery
QUESTION:
I have a div as with some tags within it. I am setting the style for div as follows: #content{ height:200px; overflow-y:scroll; } Is there a way I can customize the scrollbar. I mean I want to change the scrollbar color as well as its background.
ANSWER:... | [
"jquery",
"css"
] | 0 | 1 | 5,674 | 2 | 0 | 2011-06-07T17:22:17.010000 | 2011-06-07T17:35:01.147000 |
6,269,134 | 6,269,172 | foreach with one item array | I'm making a script that parses an xml and outputs a html form. This is what part of the parsed xml looks like (print_r). [title] => Base [id] => base [type] => radio [items] => Array ( [item] => Array ( [title] => item [id] => item_id )
) This is the code that displays the html output: foreach($category["items"]["ite... | You need: foreach($category["items"] as $item){ because item it's just key of first element of array items. | foreach with one item array I'm making a script that parses an xml and outputs a html form. This is what part of the parsed xml looks like (print_r). [title] => Base [id] => base [type] => radio [items] => Array ( [item] => Array ( [title] => item [id] => item_id )
) This is the code that displays the html output: for... | TITLE:
foreach with one item array
QUESTION:
I'm making a script that parses an xml and outputs a html form. This is what part of the parsed xml looks like (print_r). [title] => Base [id] => base [type] => radio [items] => Array ( [item] => Array ( [title] => item [id] => item_id )
) This is the code that displays th... | [
"php",
"arrays",
"for-loop",
"foreach"
] | 3 | 8 | 16,192 | 2 | 0 | 2011-06-07T17:22:28.343000 | 2011-06-07T17:25:21.300000 |
6,269,144 | 6,269,220 | Fatal error: Uncaught exception too long | I'm using throw new Exception(...) to handle errors, but these errors are huge! With 7 stack traces I get a 5 line error. Let's say I call for a property that doesn't exist. I want to simply display the property X doesn't exist message, and the location where it was called: in file.php, line Y Is that possible? | I assume you simply want this for your own personal debugging. You could do a few things: a) Learn how to read the exception errors b) Create an exception handler and only output a few things: set_exception_handler(function(Exception $e) { echo $e->getMessage(); // echo out whatever you want to see die(); }); Reference... | Fatal error: Uncaught exception too long I'm using throw new Exception(...) to handle errors, but these errors are huge! With 7 stack traces I get a 5 line error. Let's say I call for a property that doesn't exist. I want to simply display the property X doesn't exist message, and the location where it was called: in f... | TITLE:
Fatal error: Uncaught exception too long
QUESTION:
I'm using throw new Exception(...) to handle errors, but these errors are huge! With 7 stack traces I get a 5 line error. Let's say I call for a property that doesn't exist. I want to simply display the property X doesn't exist message, and the location where i... | [
"php",
"exception"
] | 0 | 1 | 139 | 2 | 0 | 2011-06-07T17:23:24.923000 | 2011-06-07T17:28:46.203000 |
6,269,147 | 6,269,303 | Java Object Construction In Multi-Threaded Environment | I am reading this book called "Java Concurrency in Practice" and the author gives an example of an unsafe object publication. Here is the example. public Holder holder;
public void initialize(){ holder = new Holder(42); } and public class Holder { private int n; public Holder(int n) { this.n = n; } public void assertS... | A problem can occur if the assertSanity method is pre-empted between the first and second load of n (the first load would see 0 and the second load would see the value set by the constructor). The problem is that the basic operations are: Allocate space for the object Call the constructor Set holder to the new instance... | Java Object Construction In Multi-Threaded Environment I am reading this book called "Java Concurrency in Practice" and the author gives an example of an unsafe object publication. Here is the example. public Holder holder;
public void initialize(){ holder = new Holder(42); } and public class Holder { private int n; p... | TITLE:
Java Object Construction In Multi-Threaded Environment
QUESTION:
I am reading this book called "Java Concurrency in Practice" and the author gives an example of an unsafe object publication. Here is the example. public Holder holder;
public void initialize(){ holder = new Holder(42); } and public class Holder ... | [
"java",
"multithreading",
"object",
"concurrency"
] | 5 | 3 | 685 | 3 | 0 | 2011-06-07T17:23:39.647000 | 2011-06-07T17:34:19.007000 |
6,269,159 | 6,269,179 | Read from textfile on server using jquery | I have a textfile (.txt) on a server. It contains only one word i.e. ON or OFF. How can i use JQuery or Pure Javascript to read that word from the file. I am thinking along the lines of $.ajax. | You could use the $.get method to send a GET AJAX request to a resource located on the server: $.get('/foo.txt', function(result) { if (result == 'ON') { alert('ON'); } else if (result == 'OFF') { alert('OFF'); } else { alert(result); } }); | Read from textfile on server using jquery I have a textfile (.txt) on a server. It contains only one word i.e. ON or OFF. How can i use JQuery or Pure Javascript to read that word from the file. I am thinking along the lines of $.ajax. | TITLE:
Read from textfile on server using jquery
QUESTION:
I have a textfile (.txt) on a server. It contains only one word i.e. ON or OFF. How can i use JQuery or Pure Javascript to read that word from the file. I am thinking along the lines of $.ajax.
ANSWER:
You could use the $.get method to send a GET AJAX request... | [
"javascript",
"jquery",
"text"
] | 8 | 15 | 12,929 | 3 | 0 | 2011-06-07T17:24:26.130000 | 2011-06-07T17:26:06.730000 |
6,269,161 | 6,269,227 | LINQ Where(), what to do if I need to get everything? | Consider the next example: public List GetAllergies(int? ingredientId = null) { var allergies = new List ();
var preSelect = ingredientId!= null? _dataContext.Ingredients.Where(x=> x.Id == ingredientId).SelectMany(x=>x.Allergies.AsQueryable()): _dataContext.Allergies.AsQueryable();
preSelect.ToList().ForEach(x => { v... | Try this: var preSelect = _dataContext.Ingredients.Where ( x=> (!ingredientId.HasValue || x.Id == ingredientId) ).SelectMany(x=>x.Allergies.AsQueryable()); | LINQ Where(), what to do if I need to get everything? Consider the next example: public List GetAllergies(int? ingredientId = null) { var allergies = new List ();
var preSelect = ingredientId!= null? _dataContext.Ingredients.Where(x=> x.Id == ingredientId).SelectMany(x=>x.Allergies.AsQueryable()): _dataContext.Allergi... | TITLE:
LINQ Where(), what to do if I need to get everything?
QUESTION:
Consider the next example: public List GetAllergies(int? ingredientId = null) { var allergies = new List ();
var preSelect = ingredientId!= null? _dataContext.Ingredients.Where(x=> x.Id == ingredientId).SelectMany(x=>x.Allergies.AsQueryable()): _d... | [
"linq",
"c#-4.0"
] | 1 | 1 | 87 | 2 | 0 | 2011-06-07T17:24:35.567000 | 2011-06-07T17:29:02.470000 |
6,269,174 | 6,269,252 | How to find out what function the Python interpreter is calling from callable PyObject? | I'm trying to trace through the Python source code where a certain function is actually called and how to get its name. In abstract.c: PyObject * PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { ternaryfunc call; if((call = func->ob_type->tp_name)!= NULL){ PyObject *result;... result = (*call)(func, arg, kw... | The __name__ attribute of the function object should contain the name. The arguments are in arg as a tuple and kw as a dict. | How to find out what function the Python interpreter is calling from callable PyObject? I'm trying to trace through the Python source code where a certain function is actually called and how to get its name. In abstract.c: PyObject * PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { ternaryfunc call; if((cal... | TITLE:
How to find out what function the Python interpreter is calling from callable PyObject?
QUESTION:
I'm trying to trace through the Python source code where a certain function is actually called and how to get its name. In abstract.c: PyObject * PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { ternary... | [
"python",
"python-2.6",
"cpython"
] | 0 | 1 | 334 | 1 | 0 | 2011-06-07T17:25:25.843000 | 2011-06-07T17:30:32.343000 |
6,269,188 | 6,269,254 | How do I escape only single quotes? | I am writing some JavaScript code that uses a string rendered with PHP. How can I escape single quotes (and only single quotes) in my PHP string? | Quite simply: echo str_replace('\'', '\\\'', $myString); However, I'd suggest use of JSON and json_encode() function as it will be more reliable (quotes new lines for instance): '...');?> | How do I escape only single quotes? I am writing some JavaScript code that uses a string rendered with PHP. How can I escape single quotes (and only single quotes) in my PHP string? | TITLE:
How do I escape only single quotes?
QUESTION:
I am writing some JavaScript code that uses a string rendered with PHP. How can I escape single quotes (and only single quotes) in my PHP string?
ANSWER:
Quite simply: echo str_replace('\'', '\\\'', $myString); However, I'd suggest use of JSON and json_encode() fun... | [
"php",
"escaping"
] | 83 | 69 | 199,898 | 11 | 0 | 2011-06-07T17:26:42.210000 | 2011-06-07T17:30:34.467000 |
6,269,197 | 6,269,243 | C# generic interface type inference question | I'm not sure how to phrase this question concisely without just giving the example so here goes: public interface IThing { void Do(T obj); }
public class ThingOne: IThing { public void Do(int obj) { } }
public class ThingTwo: IThing { public void Do(string obj) { } }
public class ThingFactory { public IThing Create ... | No, you can't do this because the result of your Create factory method will be evaluated at runtime based on the value of the parameter. Generics are for compile-time safety and in your case you cannot have such safety because the parameter value will be known only at runtime. | C# generic interface type inference question I'm not sure how to phrase this question concisely without just giving the example so here goes: public interface IThing { void Do(T obj); }
public class ThingOne: IThing { public void Do(int obj) { } }
public class ThingTwo: IThing { public void Do(string obj) { } }
publ... | TITLE:
C# generic interface type inference question
QUESTION:
I'm not sure how to phrase this question concisely without just giving the example so here goes: public interface IThing { void Do(T obj); }
public class ThingOne: IThing { public void Do(int obj) { } }
public class ThingTwo: IThing { public void Do(strin... | [
"c#",
"generics",
"types",
"inference"
] | 1 | 0 | 278 | 2 | 0 | 2011-06-07T17:27:24.840000 | 2011-06-07T17:29:59.430000 |
6,269,204 | 6,269,281 | How do I open an included java class(for example JButton) in IntelliJ IDEA 10? | I want to be able to open up the JButton class and see the code inside it. The reason is because I want to override one of the methods, but I want to make sure I include all the functionality that that method normally has. Also, it'd be a good way to learn. I know I can do it when I've had errors by clicking on the cla... | Go To | Class ( Ctrl + N ), type JButton (Include non-project classes checkbox will be enabled automatically if no such classes are found in your project). If you already have JButton usage in your code, you can navigate to its source using Ctrl + B while the caret is on it. Of course you need sources attached to the J... | How do I open an included java class(for example JButton) in IntelliJ IDEA 10? I want to be able to open up the JButton class and see the code inside it. The reason is because I want to override one of the methods, but I want to make sure I include all the functionality that that method normally has. Also, it'd be a go... | TITLE:
How do I open an included java class(for example JButton) in IntelliJ IDEA 10?
QUESTION:
I want to be able to open up the JButton class and see the code inside it. The reason is because I want to override one of the methods, but I want to make sure I include all the functionality that that method normally has. ... | [
"java",
"intellij-idea"
] | 2 | 1 | 323 | 4 | 0 | 2011-06-07T17:27:52.147000 | 2011-06-07T17:32:54.373000 |
6,269,222 | 6,269,316 | C# Get Rows From DataGridView | I need to get all the rows in a DataGridView in a foreach function. How can I do this? I.E. foreach() for each row, so for each row I could run code that would utilize the first and second column data. This is in c# Thanks, Christian | I think the best way of accessing this data is either through the Data Source: dataGridView.DataSource = someData; someData.property; OR, if the user is entering data on the page, you can access from the FindControl method: name = ((TextBox)dataGridView.Rows[e.RowIndex].FindControl("name")).Text; In this case, if you'v... | C# Get Rows From DataGridView I need to get all the rows in a DataGridView in a foreach function. How can I do this? I.E. foreach() for each row, so for each row I could run code that would utilize the first and second column data. This is in c# Thanks, Christian | TITLE:
C# Get Rows From DataGridView
QUESTION:
I need to get all the rows in a DataGridView in a foreach function. How can I do this? I.E. foreach() for each row, so for each row I could run code that would utilize the first and second column data. This is in c# Thanks, Christian
ANSWER:
I think the best way of acces... | [
"c#",
"winforms",
"datagridview"
] | 2 | 2 | 10,611 | 3 | 0 | 2011-06-07T17:28:47.140000 | 2011-06-07T17:35:01.130000 |
6,269,235 | 6,269,373 | Is there any way to define a model's attribute as always html_safe? | I have a model called Feature with a variable called body_string, which contains HTML markup I'd like to render, rather than escape. Every time I reference body_string in my views, I need to use <%=raw or.html_safe. This seems redundant and not-so-DRY. Is there any way that I can establish once-and-for-all the body_str... | Just use read_attribute to avoid the recursive call to body_string: def body_string read_attribute(:body_string).html_safe end read_attribute is complemented by write_attribute for setting attributes from within your model. A note on style: Don't use explicit return s unless you actually need them. The result of the la... | Is there any way to define a model's attribute as always html_safe? I have a model called Feature with a variable called body_string, which contains HTML markup I'd like to render, rather than escape. Every time I reference body_string in my views, I need to use <%=raw or.html_safe. This seems redundant and not-so-DRY.... | TITLE:
Is there any way to define a model's attribute as always html_safe?
QUESTION:
I have a model called Feature with a variable called body_string, which contains HTML markup I'd like to render, rather than escape. Every time I reference body_string in my views, I need to use <%=raw or.html_safe. This seems redunda... | [
"ruby-on-rails",
"ruby-on-rails-3",
"xss"
] | 6 | 9 | 1,471 | 4 | 0 | 2011-06-07T17:29:39.370000 | 2011-06-07T17:39:07.530000 |
6,269,249 | 6,269,336 | Removing empty Input Elements from a form | I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serialization so that I do not create form inputs and form validation set rules. I am at a loss as to how to go about this. Where I have the alert in the Jquery... | This will remove all the text fields which have a value of length 0: $('#send').click(function(){ $(':input[type="text"]').filter(function(e){ if (this.value.length===0){ return true; } }).remove(); }); example: http://jsfiddle.net/niklasvh/ZBSyX/ | Removing empty Input Elements from a form I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serialization so that I do not create form inputs and form validation set rules. I am at a loss as to how to go about ... | TITLE:
Removing empty Input Elements from a form
QUESTION:
I have a simple form that goes on to create all the form and validation requirements for codeigniter. What I want to do is filter out any empty inputs prior to serialization so that I do not create form inputs and form validation set rules. I am at a loss as t... | [
"php",
"jquery",
"codeigniter"
] | 2 | 3 | 4,369 | 4 | 0 | 2011-06-07T17:30:16.810000 | 2011-06-07T17:36:30.927000 |
6,269,261 | 6,269,347 | Response.Headers and IIS6 | So I'm trying to iterate over Response.Headers for a custom caching job, but I'm getting the following error when I touch the thing: This operation requires IIS integrated pipeline mode It this possible to do in IIS6? Is there a workaround? var allHeaders = HttpContext.Current.Response.Headers; // error thrown as soon ... | AFAIK you cannot access the HTTP response headers unless you are running in integrated mode because they are sent by the server at a later stage of the execution of the request when running in standard mode. | Response.Headers and IIS6 So I'm trying to iterate over Response.Headers for a custom caching job, but I'm getting the following error when I touch the thing: This operation requires IIS integrated pipeline mode It this possible to do in IIS6? Is there a workaround? var allHeaders = HttpContext.Current.Response.Headers... | TITLE:
Response.Headers and IIS6
QUESTION:
So I'm trying to iterate over Response.Headers for a custom caching job, but I'm getting the following error when I touch the thing: This operation requires IIS integrated pipeline mode It this possible to do in IIS6? Is there a workaround? var allHeaders = HttpContext.Curren... | [
"asp.net",
"iis-6",
"http-headers",
"integrated-pipeline-mode"
] | 0 | 4 | 1,267 | 1 | 0 | 2011-06-07T17:31:14.590000 | 2011-06-07T17:37:27.400000 |
6,269,265 | 6,269,312 | PHP Last Array Key Issue | I have this simple code for pasting images from a directory, I've sorted them into an array but the problem I can't seem to work out is how to get the last array to be different. This is my code so far: foreach($images as $image){ echo("{image: '$image'}, "); } I'm looking to keep print the single items in the array bu... | Simple. function doit($image) { return "{image: '$image'}" }
$images = array_map('doit',$images); $images = implode(', ',$images); | PHP Last Array Key Issue I have this simple code for pasting images from a directory, I've sorted them into an array but the problem I can't seem to work out is how to get the last array to be different. This is my code so far: foreach($images as $image){ echo("{image: '$image'}, "); } I'm looking to keep print the sin... | TITLE:
PHP Last Array Key Issue
QUESTION:
I have this simple code for pasting images from a directory, I've sorted them into an array but the problem I can't seem to work out is how to get the last array to be different. This is my code so far: foreach($images as $image){ echo("{image: '$image'}, "); } I'm looking to ... | [
"php"
] | 1 | 5 | 136 | 8 | 0 | 2011-06-07T17:31:43.330000 | 2011-06-07T17:34:42.063000 |
6,269,267 | 6,269,286 | Converting values (kg to lbs) in MVVM pattern | I am building an app that can track weight. I allow the user to select their unit preference of kg or lbs. I want to keep the data in the DB standard (kg) so if the user selects lbs as their preference I need the data converted from kg to lbs in the UI. | This conversion can be handled very easily in the ViewModel. This is one of the huge advantages of having a ViewModel - you can have easily testable logic, such as conversion between units, which stays completely separate from the user interface code. | Converting values (kg to lbs) in MVVM pattern I am building an app that can track weight. I allow the user to select their unit preference of kg or lbs. I want to keep the data in the DB standard (kg) so if the user selects lbs as their preference I need the data converted from kg to lbs in the UI. | TITLE:
Converting values (kg to lbs) in MVVM pattern
QUESTION:
I am building an app that can track weight. I allow the user to select their unit preference of kg or lbs. I want to keep the data in the DB standard (kg) so if the user selects lbs as their preference I need the data converted from kg to lbs in the UI.
A... | [
"mvvm"
] | 2 | 7 | 1,047 | 4 | 0 | 2011-06-07T17:31:55.027000 | 2011-06-07T17:33:20.587000 |
6,269,269 | 6,269,333 | htaccess mod rewrite ignoring forward slash | I've been searching and searching with no success for this simple htaccess redirect from a non-www URL to a www. I have the following in the site's root htaccess: RewriteEngine On RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] From what I've read this sho... | Tested solution that just works (at least on all my production servers): RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] | htaccess mod rewrite ignoring forward slash I've been searching and searching with no success for this simple htaccess redirect from a non-www URL to a www. I have the following in the site's root htaccess: RewriteEngine On RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ http://www.domain.c... | TITLE:
htaccess mod rewrite ignoring forward slash
QUESTION:
I've been searching and searching with no success for this simple htaccess redirect from a non-www URL to a www. I have the following in the site's root htaccess: RewriteEngine On RewriteBase /
RewriteCond %{HTTP_HOST} ^domain.com$ [NC] RewriteRule ^(.*)$ h... | [
".htaccess",
"mod-rewrite"
] | 1 | 0 | 468 | 1 | 0 | 2011-06-07T17:32:00.133000 | 2011-06-07T17:36:18.413000 |
6,269,299 | 6,309,082 | JAXB XSLT Property substitution | I apologize for the elementary question. I have an XML file, as well as an XSL to translate it into another format (KML). Within the KML I wish to inject a dynamic attribute which is not present in the original XML document. I want to emit a node like the following: This is a pop-up message. You will only see this once... | Thanks to @jtahlborn for setting me on the right track. It is possible to do this, but I wasn't putting all the pieces together. First, define xsl:param. Second, insert a reference to this xsl:param. If you need to embed it within the content of a node, as I did, use an xsl:value-of node. sessionID= Otherwise, if you n... | JAXB XSLT Property substitution I apologize for the elementary question. I have an XML file, as well as an XSL to translate it into another format (KML). Within the KML I wish to inject a dynamic attribute which is not present in the original XML document. I want to emit a node like the following: This is a pop-up mess... | TITLE:
JAXB XSLT Property substitution
QUESTION:
I apologize for the elementary question. I have an XML file, as well as an XSL to translate it into another format (KML). Within the KML I wish to inject a dynamic attribute which is not present in the original XML document. I want to emit a node like the following: Thi... | [
"java",
"xml",
"xslt",
"jaxb"
] | 1 | 1 | 1,422 | 2 | 0 | 2011-06-07T17:34:10.350000 | 2011-06-10T16:08:02.220000 |
6,269,320 | 6,269,370 | Manually bind JQuery validation after Ajax request | I'm requesting an ASP.net MVC view into a live box and the view contains form fields that have been marked up with attributes to be used by JQuery's unobtrusive validators plug-in. The client script is not however working and my theory is that its because the validation framework is only being triggered on page load wh... | You may take a look at the following blog post. And here's another one. | Manually bind JQuery validation after Ajax request I'm requesting an ASP.net MVC view into a live box and the view contains form fields that have been marked up with attributes to be used by JQuery's unobtrusive validators plug-in. The client script is not however working and my theory is that its because the validatio... | TITLE:
Manually bind JQuery validation after Ajax request
QUESTION:
I'm requesting an ASP.net MVC view into a live box and the view contains form fields that have been marked up with attributes to be used by JQuery's unobtrusive validators plug-in. The client script is not however working and my theory is that its bec... | [
"asp.net-mvc-3",
"jquery-validate",
"unobtrusive-validation"
] | 5 | 6 | 8,287 | 5 | 0 | 2011-06-07T17:35:04.717000 | 2011-06-07T17:39:00.240000 |
6,269,338 | 6,278,035 | I don't understand what this type family stuff in yesod is for | I went through yesod book and the source and learned pretty much how everything works. But before I write my own stuff, there is one thing in the scaffolded site that I just don't understand. So I scaffold a site "copywww" and in the file CopyWWWState.hs there is the code: instance YesodPersist CopyWWWState where type ... | There's quite a bit going on in the scaffold that might not be immediately obvious. In the config/model, there is a persistent entity defined something like: User name String foo String This will create a type User which is an instance of PersistEntity and a type UserId which is used as such: instance PersistEntity Use... | I don't understand what this type family stuff in yesod is for I went through yesod book and the source and learned pretty much how everything works. But before I write my own stuff, there is one thing in the scaffolded site that I just don't understand. So I scaffold a site "copywww" and in the file CopyWWWState.hs th... | TITLE:
I don't understand what this type family stuff in yesod is for
QUESTION:
I went through yesod book and the source and learned pretty much how everything works. But before I write my own stuff, there is one thing in the scaffolded site that I just don't understand. So I scaffold a site "copywww" and in the file ... | [
"haskell",
"yesod"
] | 13 | 7 | 783 | 2 | 0 | 2011-06-07T17:36:42.797000 | 2011-06-08T11:29:18.137000 |
6,269,340 | 6,269,423 | Looking for a Javascript unit testing framework | What do you recommend as the best and most documented Unit Test Framework for Javascript? | Jasmine is a BDD testing framework for javascript that works client-side or server-side. It works well in Rails, Node, Maven, etc. There's also a lot of plugins for things like jQuery. | Looking for a Javascript unit testing framework What do you recommend as the best and most documented Unit Test Framework for Javascript? | TITLE:
Looking for a Javascript unit testing framework
QUESTION:
What do you recommend as the best and most documented Unit Test Framework for Javascript?
ANSWER:
Jasmine is a BDD testing framework for javascript that works client-side or server-side. It works well in Rails, Node, Maven, etc. There's also a lot of pl... | [
"javascript",
"unit-testing",
"frameworks",
"tdd"
] | 3 | 5 | 963 | 6 | 0 | 2011-06-07T17:36:56.713000 | 2011-06-07T17:43:26.983000 |
6,269,341 | 6,269,426 | Subclassing UIBarButtonItem | I'm trying to make a subclass of the UIBarButtonItem class. The button is added in the nib file and I set its class to my custom class in the interface builder. Now if this was a UIView class or subclass I would have override the - (id)initWithCoder:(NSCoder *)decoder method to start the extra customization, however UI... | It's because you use IB. When you create an object in IB it does not call the init method for the class, it uses the archive version of the object. So to make custom initializations use this method instead: -(void)awakeFromNib{ //initialize here } | Subclassing UIBarButtonItem I'm trying to make a subclass of the UIBarButtonItem class. The button is added in the nib file and I set its class to my custom class in the interface builder. Now if this was a UIView class or subclass I would have override the - (id)initWithCoder:(NSCoder *)decoder method to start the ext... | TITLE:
Subclassing UIBarButtonItem
QUESTION:
I'm trying to make a subclass of the UIBarButtonItem class. The button is added in the nib file and I set its class to my custom class in the interface builder. Now if this was a UIView class or subclass I would have override the - (id)initWithCoder:(NSCoder *)decoder metho... | [
"objective-c",
"cocoa-touch",
"ios",
"ipad",
"uibarbuttonitem"
] | 2 | 6 | 3,169 | 1 | 0 | 2011-06-07T17:36:59.383000 | 2011-06-07T17:43:55.400000 |
6,269,354 | 6,269,424 | Is it possible to access cookies which exists on another application in IIS? | I have 2 website on my IIS7, I can put the same domain for both of them, I want some cookies of both applications to be shared between them, so than I can create the cookie from one of them and read it from the other one, is that possible? do I need any custom configurations to do that? note: My websites, 1 is asp.net ... | When you create the cookie specify the domain: var cookie = new HttpCookie("foo", "bar") { // indicates that only server side scripts can read this cookie HttpOnly = true,
// indicates that the cookie will be available throughout the entire domain Domain = "example.com" }; Response.AppendCookie(cookie); Now on the oth... | Is it possible to access cookies which exists on another application in IIS? I have 2 website on my IIS7, I can put the same domain for both of them, I want some cookies of both applications to be shared between them, so than I can create the cookie from one of them and read it from the other one, is that possible? do ... | TITLE:
Is it possible to access cookies which exists on another application in IIS?
QUESTION:
I have 2 website on my IIS7, I can put the same domain for both of them, I want some cookies of both applications to be shared between them, so than I can create the cookie from one of them and read it from the other one, is ... | [
"asp.net-mvc",
"cookies",
"iis-7",
"hosting"
] | 1 | 2 | 2,297 | 4 | 0 | 2011-06-07T17:37:52.550000 | 2011-06-07T17:43:49.117000 |
6,269,358 | 6,269,395 | On a web shopping cart written in PHP, should I check IP address everytime? | Are too many people on rotating IP for this to be a good security measure (among others of course) or is this a standard practice? Also can anybody enlighten me on some concepts I should pay particular attention to in securing a shopping cart? So far I have form validation, rotating session keys, no sensitive informati... | To quote 0xA3: I don't think that this is a good idea. Subsequent request from the same users might not necessarily come from the same IP address because the request might come from a different proxy. IIRC this used to be the case for all AOL users and might be the case for other providers or some corporate networks, t... | On a web shopping cart written in PHP, should I check IP address everytime? Are too many people on rotating IP for this to be a good security measure (among others of course) or is this a standard practice? Also can anybody enlighten me on some concepts I should pay particular attention to in securing a shopping cart? ... | TITLE:
On a web shopping cart written in PHP, should I check IP address everytime?
QUESTION:
Are too many people on rotating IP for this to be a good security measure (among others of course) or is this a standard practice? Also can anybody enlighten me on some concepts I should pay particular attention to in securing... | [
"php",
"security"
] | 0 | 2 | 279 | 2 | 0 | 2011-06-07T17:38:13.517000 | 2011-06-07T17:41:31.503000 |
6,269,366 | 6,289,328 | Fancybox stoping other jquery animation on run | Fancy box stops the jquery animation when starting. I have this js script: $("a[class=fancybox]").fancybox({ 'hideOnContentClick': true, 'titlePosition': 'outside', 'overlayColor': '#3d6a87', 'overlayOpacity': 0.9 });
$('.portfoliobox').live('mouseenter', function(e) { $(this).closest('.portfoliobox').find('div.portfo... | Solved like this: I added 2 call functions when FANCYBOX starts, at start and when it is close $("a[rel=gallery]").fancybox({ 'onStart': hidedetails, 'onClosed': hidedetails, 'titlePosition': 'outside', 'overlayColor': '#3d6a87', 'overlayOpacity': 0.9 }); | Fancybox stoping other jquery animation on run Fancy box stops the jquery animation when starting. I have this js script: $("a[class=fancybox]").fancybox({ 'hideOnContentClick': true, 'titlePosition': 'outside', 'overlayColor': '#3d6a87', 'overlayOpacity': 0.9 });
$('.portfoliobox').live('mouseenter', function(e) { $(... | TITLE:
Fancybox stoping other jquery animation on run
QUESTION:
Fancy box stops the jquery animation when starting. I have this js script: $("a[class=fancybox]").fancybox({ 'hideOnContentClick': true, 'titlePosition': 'outside', 'overlayColor': '#3d6a87', 'overlayOpacity': 0.9 });
$('.portfoliobox').live('mouseenter'... | [
"jquery"
] | 1 | 1 | 651 | 2 | 0 | 2011-06-07T17:38:47.883000 | 2011-06-09T07:14:49.493000 |
6,269,387 | 6,271,784 | graph database for social network | I am doing a system similar to a social network. The number max of users must be eventually 50.000 or 70.000 at best. At the moment i am using mysqli+prepared statments. The ERD have now 30 tables, eventually may reach to 40 tables. So, my question is: i never used a graph database...i have the ERD done by mysql workbe... | Graphs are nice and fast when stored in SQL, if you've access to recursive queries (which is not the case in MySQL, but which are available in PostgreSQL ) and your queries involve a max-depth criteria (which is probably your case on a social network), or if they're indexed properly. There are multiple methods to index... | graph database for social network I am doing a system similar to a social network. The number max of users must be eventually 50.000 or 70.000 at best. At the moment i am using mysqli+prepared statments. The ERD have now 30 tables, eventually may reach to 40 tables. So, my question is: i never used a graph database...i... | TITLE:
graph database for social network
QUESTION:
I am doing a system similar to a social network. The number max of users must be eventually 50.000 or 70.000 at best. At the moment i am using mysqli+prepared statments. The ERD have now 30 tables, eventually may reach to 40 tables. So, my question is: i never used a ... | [
"mysql",
"database",
"database-design",
"social-networking"
] | 1 | 3 | 2,881 | 1 | 0 | 2011-06-07T17:40:47.903000 | 2011-06-07T21:18:38.283000 |
6,269,393 | 6,277,548 | WPF DataGrid showing empty double cells but correct column headers | I am trying to populate a WPF datagrid but it's only showing the column headers and the content cells of the first(!) column. All other cells are empty: The DataGrid is defined like this: Classifications is defined in the code-behind file like this: public DataView Classifications { get { return ClassificationDataTable... | I figured it out with the help of Jimmy W's question: I had some brackets and dots in the column names which somehow broke the binding of the cells. Changing the values of the feature names in table.Columns.Add(featureComparison.FeatureName, typeof (double)); fixed my problem. | WPF DataGrid showing empty double cells but correct column headers I am trying to populate a WPF datagrid but it's only showing the column headers and the content cells of the first(!) column. All other cells are empty: The DataGrid is defined like this: Classifications is defined in the code-behind file like this: pub... | TITLE:
WPF DataGrid showing empty double cells but correct column headers
QUESTION:
I am trying to populate a WPF datagrid but it's only showing the column headers and the content cells of the first(!) column. All other cells are empty: The DataGrid is defined like this: Classifications is defined in the code-behind f... | [
"wpf",
"data-binding",
"datagrid",
"datatable"
] | 2 | 4 | 2,255 | 1 | 0 | 2011-06-07T17:41:19.633000 | 2011-06-08T10:48:54.300000 |
6,270,521 | 6,270,558 | run code on a edittext depending on what is focused | I want to change some property's of a edittext depending on what is focused. This is what I have so far. Am I doing this right? if so what do I enter in the try-catch statement, I am new to using them try{ textbox = (EditText) findViewById(getCurrentFocus().getId()); }catch(???){ return; } | You would better add OnFocusChange Listeners to the other UI elements, and change the proreties from this listeners... this should work | run code on a edittext depending on what is focused I want to change some property's of a edittext depending on what is focused. This is what I have so far. Am I doing this right? if so what do I enter in the try-catch statement, I am new to using them try{ textbox = (EditText) findViewById(getCurrentFocus().getId()); ... | TITLE:
run code on a edittext depending on what is focused
QUESTION:
I want to change some property's of a edittext depending on what is focused. This is what I have so far. Am I doing this right? if so what do I enter in the try-catch statement, I am new to using them try{ textbox = (EditText) findViewById(getCurrent... | [
"android",
"try-catch",
"android-edittext"
] | 0 | 0 | 117 | 1 | 0 | 2011-06-07T19:26:11.350000 | 2011-06-07T19:29:45.887000 |
6,270,522 | 6,270,836 | Is Scala doing anything in parallel on its own? | I have little program creating a maze. It uses lots of collections (the default variant, which is immutable, or at least used as an immutable). The program calculates 30 mazes with increasing dimensions. Using a for comprehension over (1 to 30) Since with the latest versions the parallel collections framework became av... | The 30% per core version is just a poor scheduler (sounds like Windows 7) migrating the process from core to core very frequently. It's probably closer to 25% per core (1/4) for your process plus misc other load making 30%. If you run the same example under Linux you would probably see one core pegged. When you convert... | Is Scala doing anything in parallel on its own? I have little program creating a maze. It uses lots of collections (the default variant, which is immutable, or at least used as an immutable). The program calculates 30 mazes with increasing dimensions. Using a for comprehension over (1 to 30) Since with the latest versi... | TITLE:
Is Scala doing anything in parallel on its own?
QUESTION:
I have little program creating a maze. It uses lots of collections (the default variant, which is immutable, or at least used as an immutable). The program calculates 30 mazes with increasing dimensions. Using a for comprehension over (1 to 30) Since wit... | [
"scala",
"collections",
"parallel-processing"
] | 7 | 9 | 302 | 1 | 0 | 2011-06-07T19:26:14.467000 | 2011-06-07T19:52:27.367000 |
6,270,525 | 6,270,689 | Sending a C# string as an argument to a unmanaged C++ DLL function | I want to send my C# string to a C++ DLL function. I have succeeded, both with StringBuilder: [C#] public static extern int installHook(StringBuilder directory); StringBuilder myText = new StringBuilder(512); myfunc(myText);
[C++] int OPENGLHOOK_API myfunc(char* directory) {::MessageBoxA(NULL,directory,"test123",0); }... | I believe the problem is the default calling convention between the two languages. C# is __stdcall and c++ is __cdecl, I believe. Try explicitly stating __stdcall on your C++ method signatures and see if that doesn't resolve the error. C++: int OPENGLHOOK_API __stdcall installHook(wchar* directory) C#: [DllImport( "you... | Sending a C# string as an argument to a unmanaged C++ DLL function I want to send my C# string to a C++ DLL function. I have succeeded, both with StringBuilder: [C#] public static extern int installHook(StringBuilder directory); StringBuilder myText = new StringBuilder(512); myfunc(myText);
[C++] int OPENGLHOOK_API my... | TITLE:
Sending a C# string as an argument to a unmanaged C++ DLL function
QUESTION:
I want to send my C# string to a C++ DLL function. I have succeeded, both with StringBuilder: [C#] public static extern int installHook(StringBuilder directory); StringBuilder myText = new StringBuilder(512); myfunc(myText);
[C++] int... | [
"c#",
"c++",
"dll",
"interop"
] | 2 | 3 | 2,689 | 2 | 0 | 2011-06-07T19:26:51.087000 | 2011-06-07T19:40:53.340000 |
6,270,528 | 6,270,625 | CFForm vs Form in Coldfusion | I have been using plain forms and input fields in coldfusion for some time now but recently discovered that cfinput tags will automagically prevent some xss attacks for me. This has made me wonder, if there is any disadvantages to using cffrom and cfinput over normal form and input tags in coldfusion. The only disadvan... | I prefer to write my own JS around my forms. I started out with cfform back in the day, but eventually wanted to do more robust things (validations, etc) than cfform was able to handle. That forced me to learn JS, and I've been very happy writing my own JS since. So I guess I'd say one big drawback is that you're restr... | CFForm vs Form in Coldfusion I have been using plain forms and input fields in coldfusion for some time now but recently discovered that cfinput tags will automagically prevent some xss attacks for me. This has made me wonder, if there is any disadvantages to using cffrom and cfinput over normal form and input tags in ... | TITLE:
CFForm vs Form in Coldfusion
QUESTION:
I have been using plain forms and input fields in coldfusion for some time now but recently discovered that cfinput tags will automagically prevent some xss attacks for me. This has made me wonder, if there is any disadvantages to using cffrom and cfinput over normal form ... | [
"forms",
"coldfusion",
"cfform"
] | 6 | 10 | 7,874 | 4 | 0 | 2011-06-07T19:26:56.613000 | 2011-06-07T19:35:41.827000 |
6,270,529 | 6,270,639 | How to speed up calculation using multiple threads? | I'm trying to compute Pi, but what I really want to achieve is efficiency when using more than one thread. The algorithm is simple: I randomly generate points in the unit square and after that count how many of them are in the circle inscribed within the square. (more here: http://math.fullerton.edu/mathews/n2003/monte... | Your threads could be fighting/waiting for Math.random() which is synchronized, you should create an instance of java.util.Random for each thread. Also in this case speedup with multiple threads will only happen if you have more than one core/cpu. From the javadoc of Math.random(): This method is properly synchronized ... | How to speed up calculation using multiple threads? I'm trying to compute Pi, but what I really want to achieve is efficiency when using more than one thread. The algorithm is simple: I randomly generate points in the unit square and after that count how many of them are in the circle inscribed within the square. (more... | TITLE:
How to speed up calculation using multiple threads?
QUESTION:
I'm trying to compute Pi, but what I really want to achieve is efficiency when using more than one thread. The algorithm is simple: I randomly generate points in the unit square and after that count how many of them are in the circle inscribed within... | [
"java",
"multithreading",
"performance"
] | 6 | 12 | 5,703 | 2 | 0 | 2011-06-07T19:27:04.997000 | 2011-06-07T19:36:52.140000 |
6,270,531 | 6,270,623 | Is possible to insert a denormalized bean with Hibernate? | I have one bean like: public class Car{ String color; List wheels;.... } And public class Wheel{ int size;.... } Assuming an standard hibernate configuration configuration I may get some inserts like insert into car (id, color) values (1,'blue') insert into car (id, color) values (2,'red') insert into car (id, color) v... | If using collections - no. You will have to "denormalize" your object model as well. That is, make your entity have 3 fields - id, color and wheelsize | Is possible to insert a denormalized bean with Hibernate? I have one bean like: public class Car{ String color; List wheels;.... } And public class Wheel{ int size;.... } Assuming an standard hibernate configuration configuration I may get some inserts like insert into car (id, color) values (1,'blue') insert into car ... | TITLE:
Is possible to insert a denormalized bean with Hibernate?
QUESTION:
I have one bean like: public class Car{ String color; List wheels;.... } And public class Wheel{ int size;.... } Assuming an standard hibernate configuration configuration I may get some inserts like insert into car (id, color) values (1,'blue'... | [
"java",
"hibernate",
"denormalization"
] | 2 | 1 | 672 | 1 | 0 | 2011-06-07T19:27:13.657000 | 2011-06-07T19:35:15.670000 |
6,270,536 | 6,271,509 | msysgit 1.7.4 preview fails to install on win xp | I'm trying to install 1.7.4 msysgit on WinXP. Installed it on one system but can't on the other. When I launch the installer on the 2nd system (a laptop) the installer starts and abruptly terminates with nothing in any logs I could locate or the event viewer. I tried running the installer as the administrator, disablin... | Don't use the installer and install with xcopy to a dev/tools folder anywhere you like. Then just add the path or make shortcuts to the exes. | msysgit 1.7.4 preview fails to install on win xp I'm trying to install 1.7.4 msysgit on WinXP. Installed it on one system but can't on the other. When I launch the installer on the 2nd system (a laptop) the installer starts and abruptly terminates with nothing in any logs I could locate or the event viewer. I tried run... | TITLE:
msysgit 1.7.4 preview fails to install on win xp
QUESTION:
I'm trying to install 1.7.4 msysgit on WinXP. Installed it on one system but can't on the other. When I launch the installer on the 2nd system (a laptop) the installer starts and abruptly terminates with nothing in any logs I could locate or the event v... | [
"git",
"window",
"windows-installer"
] | 0 | 1 | 169 | 2 | 0 | 2011-06-07T19:28:15.620000 | 2011-06-07T20:52:37.490000 |
6,270,543 | 6,271,475 | JSTL EL conditional error | I am using the following conditional check using JSTL but its throwing the error "javax.servlet.jsp.el.ELException: No function is mapped to the name "fn:length" Found Nothing Found something What am I doing wrong here? I just need to compare the length of roll number. | As per the documentation, the fn:length() only works on String (which would return the value of String#length() method) and on Collection (which would return the value of Collection#size() method). You however seem to be passing in a number. An integer or something. The fn:length() doesn't work on numbers and would alw... | JSTL EL conditional error I am using the following conditional check using JSTL but its throwing the error "javax.servlet.jsp.el.ELException: No function is mapped to the name "fn:length" Found Nothing Found something What am I doing wrong here? I just need to compare the length of roll number. | TITLE:
JSTL EL conditional error
QUESTION:
I am using the following conditional check using JSTL but its throwing the error "javax.servlet.jsp.el.ELException: No function is mapped to the name "fn:length" Found Nothing Found something What am I doing wrong here? I just need to compare the length of roll number.
ANSWE... | [
"java",
"jsp",
"jstl"
] | 0 | 2 | 8,635 | 2 | 0 | 2011-06-07T19:28:53.630000 | 2011-06-07T20:50:45.957000 |
6,270,546 | 6,270,860 | Detect when a PrintDocument successfully prints (not just previewed) | I'm doing some custom printing using a PrintDocument in my application. I have a requirement of logging when our items are successfully printed. I originally achieved this with something like: print_doc.EndPrint += (o,e) => printed_callback (); To make my printed_callback get invoked when a print finished. However, now... | Ok, so I actually managed to figure this out myself, using the PrintDocument.PrintController property, and checking the IsPreview property of the controller. My final coded ended up as follows: doc.EndPrint += (o,e) => { if (doc.PrintController.IsPreview) return;
print_callback (); } | Detect when a PrintDocument successfully prints (not just previewed) I'm doing some custom printing using a PrintDocument in my application. I have a requirement of logging when our items are successfully printed. I originally achieved this with something like: print_doc.EndPrint += (o,e) => printed_callback (); To mak... | TITLE:
Detect when a PrintDocument successfully prints (not just previewed)
QUESTION:
I'm doing some custom printing using a PrintDocument in my application. I have a requirement of logging when our items are successfully printed. I originally achieved this with something like: print_doc.EndPrint += (o,e) => printed_c... | [
"c#",
".net",
"winforms",
"printing"
] | 11 | 15 | 9,331 | 2 | 0 | 2011-06-07T19:28:56.093000 | 2011-06-07T19:54:31.350000 |
6,270,552 | 6,290,059 | Issue in custom action in install shield 2010 | I want to make a script that open port in installation and close it in un-installation I made the both scripts but every time script for open port runs in install and in uninstall so after uninstalling i have 2 rules for open that port and close port never run I have attached screen shots about my configuration in this... | Use below conditions NOT Installed to run only during install. REMOVE="ALL" to run only during uninstall. | Issue in custom action in install shield 2010 I want to make a script that open port in installation and close it in un-installation I made the both scripts but every time script for open port runs in install and in uninstall so after uninstalling i have 2 rules for open that port and close port never run I have attach... | TITLE:
Issue in custom action in install shield 2010
QUESTION:
I want to make a script that open port in installation and close it in un-installation I made the both scripts but every time script for open port runs in install and in uninstall so after uninstalling i have 2 rules for open that port and close port never... | [
"installshield-2010"
] | 0 | 0 | 368 | 1 | 0 | 2011-06-07T19:29:26.387000 | 2011-06-09T08:29:49.297000 |
6,270,553 | 6,270,699 | ajax status = 0 | i'm trying to get information from a remote server on my local machine. readyState has no problem, i.e. ==4. however, status is always 0(instead of 200) when I hit the button, it returns nothing. here is the code,: Let AJAX change this text Change Content It's basically from w3shcools. simply replaced the url. the url ... | Check that you are not making a cross domain request. If for example you are not serving this page from http://www.spartanbook.com then the expected result would be access denied, which oddly enough gives a readyState of 4, but a status of 0. If you need to make a cross domain request, then you need to use a proxy. | ajax status = 0 i'm trying to get information from a remote server on my local machine. readyState has no problem, i.e. ==4. however, status is always 0(instead of 200) when I hit the button, it returns nothing. here is the code,: Let AJAX change this text Change Content It's basically from w3shcools. simply replaced t... | TITLE:
ajax status = 0
QUESTION:
i'm trying to get information from a remote server on my local machine. readyState has no problem, i.e. ==4. however, status is always 0(instead of 200) when I hit the button, it returns nothing. here is the code,: Let AJAX change this text Change Content It's basically from w3shcools.... | [
"javascript",
"ajax",
"status"
] | 1 | 6 | 10,303 | 3 | 0 | 2011-06-07T19:29:28.257000 | 2011-06-07T19:42:09.763000 |
6,270,565 | 6,270,818 | Passing XML between .NET and native c++ | I have a project in native c++ that currently communicates with a c# project through COM. I'd like to replace COM with a c++\cli wrapper. Both projects use XML, and pass it back and forth using COM Variant. If I switched to a c++/cli wrapper, what could I use to pass XML between the layers? | Well, we had a similar arrangement and we switched to use a simple socket to pass the messages. In our case it was a native c/c++ app and a managed app - so two processes. Gave us the advantage to put them on separate PCs as well. If the native project is just a DLL you call into you might just want to add a SendMessag... | Passing XML between .NET and native c++ I have a project in native c++ that currently communicates with a c# project through COM. I'd like to replace COM with a c++\cli wrapper. Both projects use XML, and pass it back and forth using COM Variant. If I switched to a c++/cli wrapper, what could I use to pass XML between ... | TITLE:
Passing XML between .NET and native c++
QUESTION:
I have a project in native c++ that currently communicates with a c# project through COM. I'd like to replace COM with a c++\cli wrapper. Both projects use XML, and pass it back and forth using COM Variant. If I switched to a c++/cli wrapper, what could I use to... | [
"c#",
"c++",
"xml"
] | 0 | 0 | 392 | 1 | 0 | 2011-06-07T19:29:52.110000 | 2011-06-07T19:50:31.400000 |
6,270,574 | 6,271,612 | Rhino Mocks: Instantiating Mock property so Expectation can reference it | I'm writing a unit test with a mock and I'm having trouble writing it successfully. One of the properties is a collection and I need to reference it when setting an expectation for the mock. Right now the expectation statement throws a null. Here's what it roughly looks like. IFoo myMock = MockRepository.GenerateMock (... | I'm not overly familiar with Rhino Mocks, but I think your expectations aren't actually hooked up until you call.Replay() - the mocking methodology you hint at in your example looks more like Moq to me. That said, I think you're doing something more fundamentally wrong here. Exactly what is it that you want to test? Is... | Rhino Mocks: Instantiating Mock property so Expectation can reference it I'm writing a unit test with a mock and I'm having trouble writing it successfully. One of the properties is a collection and I need to reference it when setting an expectation for the mock. Right now the expectation statement throws a null. Here'... | TITLE:
Rhino Mocks: Instantiating Mock property so Expectation can reference it
QUESTION:
I'm writing a unit test with a mock and I'm having trouble writing it successfully. One of the properties is a collection and I need to reference it when setting an expectation for the mock. Right now the expectation statement th... | [
"c#",
"unit-testing",
"rhino-mocks"
] | 1 | 1 | 903 | 2 | 0 | 2011-06-07T19:31:34.200000 | 2011-06-07T21:01:45.587000 |
6,270,587 | 6,271,526 | how to merge tables using mysql database? | I have two tables suppose table 1 has two columns with short names and full names of USA and another table has only short name. I want to write a MySQL query to update all short names of table 2 with a full name in table 1 on matching with short same of table 1 Table 1 Table 2 after query I want Table 2
C1 C2 C6 C6
N... | Assuming that Table 2 has a STATE field wide enough to support the full state name and that you want to overwrite the short state name with the long state name. On MySQL 5.0 I believe the UPDATE JOIN statement should be written more like this: UPDATE Table2 INNER JOIN Table1 on Table2.state=Table1.state SET Table2.stat... | how to merge tables using mysql database? I have two tables suppose table 1 has two columns with short names and full names of USA and another table has only short name. I want to write a MySQL query to update all short names of table 2 with a full name in table 1 on matching with short same of table 1 Table 1 Table 2 ... | TITLE:
how to merge tables using mysql database?
QUESTION:
I have two tables suppose table 1 has two columns with short names and full names of USA and another table has only short name. I want to write a MySQL query to update all short names of table 2 with a full name in table 1 on matching with short same of table ... | [
"mysql",
"merge"
] | 1 | 1 | 441 | 1 | 0 | 2011-06-07T19:32:19.783000 | 2011-06-07T20:54:13.570000 |
6,270,600 | 6,270,662 | Dapper: can I use parameters for anything? | I am writing some code that will prepare my database for my application. In the code there are some repetitive SQL statements when I am creating a table, and I want to hide them in some methods (there are only two for now: creating the primary key and making the id of the table an auto-increment one in postgres). For t... | If I remember correctly, Dapper uses a parameterized IDbCommand to execute its queries. Parameterized queries are simply string replacement operations. To be more specific, a parameterized query lets you have parameters in your query, sends the values for those parameters, and then SQL Server handles compiling the quer... | Dapper: can I use parameters for anything? I am writing some code that will prepare my database for my application. In the code there are some repetitive SQL statements when I am creating a table, and I want to hide them in some methods (there are only two for now: creating the primary key and making the id of the tabl... | TITLE:
Dapper: can I use parameters for anything?
QUESTION:
I am writing some code that will prepare my database for my application. In the code there are some repetitive SQL statements when I am creating a table, and I want to hide them in some methods (there are only two for now: creating the primary key and making ... | [
"parameter-passing",
"npgsql",
"dapper"
] | 3 | 2 | 1,511 | 1 | 0 | 2011-06-07T19:33:27.083000 | 2011-06-07T19:38:31.107000 |
6,270,606 | 6,270,817 | C# trouble webbrowser onclick elementid | What i'm trying to do is crawl this webpage using C# http://www.madisonhonda.com/Preowned-Inventory.aspx?layout=layout1# What I have so far is this public const string TestURL = "http://www.madisonhonda.com/PreownedInventory.aspx#layout=layout1"; static void kickOFF() { WebBrowser wb = new WebBrowser();
//wb.DocumentC... | Does it have to be done using the hosted WinForms WebBrowser control? If you can do what ever you need through a normal browser I would suggest you use a dedicated web testing framework such as Selenium or Watin to perform this level of automation rather than trying to get the WebBrowser control to do it. | C# trouble webbrowser onclick elementid What i'm trying to do is crawl this webpage using C# http://www.madisonhonda.com/Preowned-Inventory.aspx?layout=layout1# What I have so far is this public const string TestURL = "http://www.madisonhonda.com/PreownedInventory.aspx#layout=layout1"; static void kickOFF() { WebBrowse... | TITLE:
C# trouble webbrowser onclick elementid
QUESTION:
What i'm trying to do is crawl this webpage using C# http://www.madisonhonda.com/Preowned-Inventory.aspx?layout=layout1# What I have so far is this public const string TestURL = "http://www.madisonhonda.com/PreownedInventory.aspx#layout=layout1"; static void kic... | [
"c#",
"browser"
] | 1 | 0 | 494 | 1 | 0 | 2011-06-07T19:34:02.140000 | 2011-06-07T19:50:30.027000 |
6,270,607 | 6,270,751 | Suggestions for creating an array of objects | I am looking at registry keys for a specific services. So I created a class so i could create my objects for the regKeys for the specific service. There are multiple services that all have multiple reg keys for that specific service. My class class Component { private String regkey; private String regpath;
//regkey pr... | I am guessing a bit of what it exactly is you are asking but i assume you want to keep a list of more than 1 Component objects. You could achieve this by doing something like this: List syncItems = new List ();
foreach (/* not sure how you loop over the items */) { Component sync = new Component(); sync.regKeyProp =..... | Suggestions for creating an array of objects I am looking at registry keys for a specific services. So I created a class so i could create my objects for the regKeys for the specific service. There are multiple services that all have multiple reg keys for that specific service. My class class Component { private String... | TITLE:
Suggestions for creating an array of objects
QUESTION:
I am looking at registry keys for a specific services. So I created a class so i could create my objects for the regKeys for the specific service. There are multiple services that all have multiple reg keys for that specific service. My class class Componen... | [
"c#",
"object"
] | 0 | 0 | 129 | 3 | 0 | 2011-06-07T19:34:03.383000 | 2011-06-07T19:46:21.860000 |
6,270,615 | 6,270,682 | Check if a login and a password is already in Preferences | I saw some tutorials for auto login for exemple this one link, but when i use the app for the first time, how do i check if the login and password have already been inserted in Preferences Activity? What condition should i put? | SharedPreferences sp=PreferenceManager. getDefaultSharedPreferences(context); if(sp.contains("Username")){ //login exists assuming you are saving the username to a preference with the name "Username" } | Check if a login and a password is already in Preferences I saw some tutorials for auto login for exemple this one link, but when i use the app for the first time, how do i check if the login and password have already been inserted in Preferences Activity? What condition should i put? | TITLE:
Check if a login and a password is already in Preferences
QUESTION:
I saw some tutorials for auto login for exemple this one link, but when i use the app for the first time, how do i check if the login and password have already been inserted in Preferences Activity? What condition should i put?
ANSWER:
SharedP... | [
"android",
"authentication",
"passwords",
"android-preferences"
] | 3 | 7 | 1,302 | 1 | 0 | 2011-06-07T19:34:28.210000 | 2011-06-07T19:40:19.047000 |
6,270,627 | 6,271,158 | Slow Performing OpenJPA Query | I have the following query method that has slow performance: @Override public Map getFeatureCounts() {
StopWatch timer = new StopWatch(); timer.start(); Map resultMap = new LinkedHashMap (); // I want to ensure that the features are in alpha order
EntityManager em = entityManagerFactory.createEntityManager();
String... | The COUNT(DISTINCT F.id) seems unnecessary. A COUNT(1) would give you the same result. And probably better performance;-). | Slow Performing OpenJPA Query I have the following query method that has slow performance: @Override public Map getFeatureCounts() {
StopWatch timer = new StopWatch(); timer.start(); Map resultMap = new LinkedHashMap (); // I want to ensure that the features are in alpha order
EntityManager em = entityManagerFactory.... | TITLE:
Slow Performing OpenJPA Query
QUESTION:
I have the following query method that has slow performance: @Override public Map getFeatureCounts() {
StopWatch timer = new StopWatch(); timer.start(); Map resultMap = new LinkedHashMap (); // I want to ensure that the features are in alpha order
EntityManager em = ent... | [
"java",
"openjpa"
] | 1 | 2 | 445 | 1 | 0 | 2011-06-07T19:35:51.563000 | 2011-06-07T20:22:06.303000 |
6,270,628 | 6,270,645 | "setText: is deprecated" warning | When I run my app, a warning pops up that says "'setText:' is deprecated.how can i rewrite this line of code to get rid of the error? cell.text = [moreArray objectAtIndex:row]; Thanks | Use this: cell.textLabel.text = [moreArray objectAtIndex:row]; | "setText: is deprecated" warning When I run my app, a warning pops up that says "'setText:' is deprecated.how can i rewrite this line of code to get rid of the error? cell.text = [moreArray objectAtIndex:row]; Thanks | TITLE:
"setText: is deprecated" warning
QUESTION:
When I run my app, a warning pops up that says "'setText:' is deprecated.how can i rewrite this line of code to get rid of the error? cell.text = [moreArray objectAtIndex:row]; Thanks
ANSWER:
Use this: cell.textLabel.text = [moreArray objectAtIndex:row]; | [
"objective-c",
"ios",
"compiler-warnings"
] | 1 | 7 | 274 | 1 | 0 | 2011-06-07T19:35:55.820000 | 2011-06-07T19:37:09.337000 |
6,270,630 | 6,271,025 | PHP/SQL script to increment value of a record field is not updating the record | HTML: A B C D F PHP: if (isset($_POST['grade'])) { $name = $_POST['name']; $grade = $_POST['grade']; $sql = "UPDATE grade SET total=total+'$grade', numvotes=numvotes+1 WHERE name='$name'"; Hi everyone... I'm working on a project to add grades associated with names on a menu. My HTML code for the radial menu for the gra... | You're using names as strings in the SQL query. So change the following: echo " ".$temp['name']." "; to: echo " ".htmlspecialchars($temp['name'])." "; For live projects, always use htmlspecialchars() when echo() ing something to the browser, and always use mysql_real_escape_string() when composing SQL queries from user... | PHP/SQL script to increment value of a record field is not updating the record HTML: A B C D F PHP: if (isset($_POST['grade'])) { $name = $_POST['name']; $grade = $_POST['grade']; $sql = "UPDATE grade SET total=total+'$grade', numvotes=numvotes+1 WHERE name='$name'"; Hi everyone... I'm working on a project to add grade... | TITLE:
PHP/SQL script to increment value of a record field is not updating the record
QUESTION:
HTML: A B C D F PHP: if (isset($_POST['grade'])) { $name = $_POST['name']; $grade = $_POST['grade']; $sql = "UPDATE grade SET total=total+'$grade', numvotes=numvotes+1 WHERE name='$name'"; Hi everyone... I'm working on a pr... | [
"php",
"mysql"
] | 2 | 3 | 1,251 | 4 | 0 | 2011-06-07T19:35:58.973000 | 2011-06-07T20:10:12.003000 |
6,270,632 | 6,270,644 | get last element with linq to sql | I have this: var result = (from t in MyDC where t.UserID == 6 orderby t.UpdateTime select t.ID).Last(); Basically, I'm using Linq-to-Sql and it doesn't support the.Last operator. I could retrieve all the records of the user and then using linq to objects to get my value but I'm wondering how to do this with linq-to-sql... | Just order by descending and use.First() instead: var result = (from t in MyDC where t.UserID == 6 orderby t.UpdateTime descending select t.ID).First(); | get last element with linq to sql I have this: var result = (from t in MyDC where t.UserID == 6 orderby t.UpdateTime select t.ID).Last(); Basically, I'm using Linq-to-Sql and it doesn't support the.Last operator. I could retrieve all the records of the user and then using linq to objects to get my value but I'm wonderi... | TITLE:
get last element with linq to sql
QUESTION:
I have this: var result = (from t in MyDC where t.UserID == 6 orderby t.UpdateTime select t.ID).Last(); Basically, I'm using Linq-to-Sql and it doesn't support the.Last operator. I could retrieve all the records of the user and then using linq to objects to get my val... | [
"c#",
"linq",
"linq-to-sql"
] | 15 | 39 | 23,201 | 2 | 0 | 2011-06-07T19:36:05.220000 | 2011-06-07T19:37:04.260000 |
6,270,642 | 6,271,008 | Surfaceview re-draw | I have two images on a surfaceview and only one of the images is animated, the second image is static and keeps drawing itself over itself and so this makes the program slow. How can i prevent this? | Override draw in your SurfaceView and manually draw what you want. Alex | Surfaceview re-draw I have two images on a surfaceview and only one of the images is animated, the second image is static and keeps drawing itself over itself and so this makes the program slow. How can i prevent this? | TITLE:
Surfaceview re-draw
QUESTION:
I have two images on a surfaceview and only one of the images is animated, the second image is static and keeps drawing itself over itself and so this makes the program slow. How can i prevent this?
ANSWER:
Override draw in your SurfaceView and manually draw what you want. Alex | [
"android",
"draw",
"surfaceview"
] | 0 | 0 | 269 | 1 | 0 | 2011-06-07T19:36:53.707000 | 2011-06-07T20:09:07.087000 |
6,270,643 | 6,270,843 | Bit Mask Question | Readng the documentation for a point of sale system, here is the example they give for a mask that is supposed to tell you what seats are selected. I can't figure this out. I completely understand bit masking. Is this example just wrong? Function This system variable is an eight character string that contains the seat ... | These are 8-digit hexadecimal numbers, which can store as much as a 32-digit binary number. (16^8 = 2^32 = 4,294,967,296) In a binary representation, each digit corresponds to a seat: hex binary 80000000 = 10000000000000000000000000000000 00000001 = 00000000000000000000000000000001 50a00000 = 01010000101000000000000000... | Bit Mask Question Readng the documentation for a point of sale system, here is the example they give for a mask that is supposed to tell you what seats are selected. I can't figure this out. I completely understand bit masking. Is this example just wrong? Function This system variable is an eight character string that ... | TITLE:
Bit Mask Question
QUESTION:
Readng the documentation for a point of sale system, here is the example they give for a mask that is supposed to tell you what seats are selected. I can't figure this out. I completely understand bit masking. Is this example just wrong? Function This system variable is an eight char... | [
"bitmask",
"bit-masks"
] | 2 | 2 | 5,288 | 4 | 0 | 2011-06-07T19:36:56.250000 | 2011-06-07T19:52:47.140000 |
6,270,654 | 6,271,394 | Rails 3 - render :template is not the same as current_page? | I've recently ran into a little for when an object fails to save due to serving content based of the current_page? method. I'm using a near scaffolding controller: def create @topic = Topics.new(params[:topic])
respond_to do |format| if @topic.save format.html { redirect_to(topic_links_path(@topic),:notice => "New Top... | You should reconsider how your custom toolbar display thing works, instead of using current_page? you should use action_name and check whether it's equal to new or to create | Rails 3 - render :template is not the same as current_page? I've recently ran into a little for when an object fails to save due to serving content based of the current_page? method. I'm using a near scaffolding controller: def create @topic = Topics.new(params[:topic])
respond_to do |format| if @topic.save format.htm... | TITLE:
Rails 3 - render :template is not the same as current_page?
QUESTION:
I've recently ran into a little for when an object fails to save due to serving content based of the current_page? method. I'm using a near scaffolding controller: def create @topic = Topics.new(params[:topic])
respond_to do |format| if @top... | [
"ruby-on-rails",
"ruby-on-rails-3"
] | 0 | 4 | 776 | 2 | 0 | 2011-06-07T19:37:57.283000 | 2011-06-07T20:43:55.133000 |
6,270,655 | 6,270,713 | How to start, where to learn ( Farseer ) | Last few days I'm trying to start with farseer library, however i just can't get anything work properly. Documentation is very poor and there aren't many ( any? ) resources on the internet relating to 3.3.1 version. It's my first time trying to use physics engine, so it is even bigger problem to me. | There are examples in their tutorial section as well as their sample source code. In particular, if you want to see how a certain function can be used, you should go through their Test Bed source code which demonstrates how to the use main functions in XNA. For theory, and possibly other methods, you can look for docum... | How to start, where to learn ( Farseer ) Last few days I'm trying to start with farseer library, however i just can't get anything work properly. Documentation is very poor and there aren't many ( any? ) resources on the internet relating to 3.3.1 version. It's my first time trying to use physics engine, so it is even ... | TITLE:
How to start, where to learn ( Farseer )
QUESTION:
Last few days I'm trying to start with farseer library, however i just can't get anything work properly. Documentation is very poor and there aren't many ( any? ) resources on the internet relating to 3.3.1 version. It's my first time trying to use physics engi... | [
"c#",
"xna",
"xna-4.0",
"farseer"
] | 2 | 5 | 4,512 | 3 | 0 | 2011-06-07T19:37:58.137000 | 2011-06-07T19:43:32.363000 |
6,270,671 | 6,270,881 | What is the new format for rake tasks? (task :t, arg, :needs => [deps] versus task :t, [args] => [deps]) | I'm using Rails 3.1 beta with Ruby 1.9.2 and rake 0.9.2, and have a bunch of rake tasks I've written. Here is an example: namespace:data do desc "dump the nodes and edges for a graph" task:dump_graph,:species_id,:needs =>:environment do |t,args| args.with_defaults(:species_id => 'Hs') #... end end When my rails app loa... | I know it is sometimes hard to decipher but the error message gives you the new format: task:t, [args] => [deps] So for your example: task:dump_graph,:species_id =>:environment http://www.postal-code.com/binarycode/2011/06/02/rake-needs-deprecated/ | What is the new format for rake tasks? (task :t, arg, :needs => [deps] versus task :t, [args] => [deps]) I'm using Rails 3.1 beta with Ruby 1.9.2 and rake 0.9.2, and have a bunch of rake tasks I've written. Here is an example: namespace:data do desc "dump the nodes and edges for a graph" task:dump_graph,:species_id,:ne... | TITLE:
What is the new format for rake tasks? (task :t, arg, :needs => [deps] versus task :t, [args] => [deps])
QUESTION:
I'm using Rails 3.1 beta with Ruby 1.9.2 and rake 0.9.2, and have a bunch of rake tasks I've written. Here is an example: namespace:data do desc "dump the nodes and edges for a graph" task:dump_gra... | [
"rake",
"ruby-on-rails-3.1"
] | 19 | 10 | 5,469 | 2 | 0 | 2011-06-07T19:39:12.020000 | 2011-06-07T19:56:50.880000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.