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,222,775
6,222,807
Jquery and scope issues with $.post
I am having one small problem with my code. I am sending a POST request to my page, after I am done it should return "OK" meaning it worked. From inside my handler function I call set_var(data) to set my global variables text, but the problem is my print_info() returns undefined. I've spent a lot of time on this and re...
AJAX requests are, as evidenced by the first A in the acronym, asynchronous. So, when you call $.post(), execution of the ajax_post function continues on its merry way more or less immediately, without waiting for the request to finish. You get to your "RETURN" alert before your return_handler has run to set the global...
Jquery and scope issues with $.post I am having one small problem with my code. I am sending a POST request to my page, after I am done it should return "OK" meaning it worked. From inside my handler function I call set_var(data) to set my global variables text, but the problem is my print_info() returns undefined. I'v...
TITLE: Jquery and scope issues with $.post QUESTION: I am having one small problem with my code. I am sending a POST request to my page, after I am done it should return "OK" meaning it worked. From inside my handler function I call set_var(data) to set my global variables text, but the problem is my print_info() retu...
[ "ajax", "jquery" ]
0
2
234
2
0
2011-06-03T03:48:02.587000
2011-06-03T03:56:12.777000
6,222,778
6,222,989
How do I limit the number of form fields I can add with jquery?
I followed the instructions in Railscasts #197 http://railscasts.com/episodes/197-nested-model-form-part-2 about how to add links that dynamically add form fields in rails. This is awesome! I never would have figured this out on my own. I'm trying to figure out if there is a way to limit the number of fields that a use...
If you are creating elements dynamically, you can limit it by using following code: if($("input,select").length <5){ //create element dynamically } Also check this tutorial jQuery - Dynamically Adding Form Elements
How do I limit the number of form fields I can add with jquery? I followed the instructions in Railscasts #197 http://railscasts.com/episodes/197-nested-model-form-part-2 about how to add links that dynamically add form fields in rails. This is awesome! I never would have figured this out on my own. I'm trying to figur...
TITLE: How do I limit the number of form fields I can add with jquery? QUESTION: I followed the instructions in Railscasts #197 http://railscasts.com/episodes/197-nested-model-form-part-2 about how to add links that dynamically add form fields in rails. This is awesome! I never would have figured this out on my own. I...
[ "jquery", "ruby-on-rails", "forms" ]
2
1
465
2
0
2011-06-03T03:48:47.990000
2011-06-03T04:33:56.397000
6,222,785
6,230,140
Can we ever determine if the request was sent from another domain?
I've read these webpages: PHP Form Security With Referer and http://www.mustap.com/phpzone_post_62_how-to-bypass-the-referer-se So basically my question is how do we determine for certain that the request was sent from our own domain? Or is there no way at all? (Question targeted at any server side language including b...
So basically my question is how do we determine for certain that the request was sent from our own domain? Or is there no way at all? You are asking the impossible. There is no way to know for certain that a submit button on a page on your domain generated the request. You say it's not about CSRF, so I don't know why y...
Can we ever determine if the request was sent from another domain? I've read these webpages: PHP Form Security With Referer and http://www.mustap.com/phpzone_post_62_how-to-bypass-the-referer-se So basically my question is how do we determine for certain that the request was sent from our own domain? Or is there no way...
TITLE: Can we ever determine if the request was sent from another domain? QUESTION: I've read these webpages: PHP Form Security With Referer and http://www.mustap.com/phpzone_post_62_how-to-bypass-the-referer-se So basically my question is how do we determine for certain that the request was sent from our own domain? ...
[ "php", "asp.net", "web-services", "jsp" ]
2
2
3,075
3
0
2011-06-03T03:50:13.550000
2011-06-03T16:49:26.407000
6,222,787
6,223,189
How to break on access of a specific global variable in gdb?
Possible Duplicate: Can I set a breakpoint on 'memory access' in GDB? I want to trace how a specific variable is initialized, can gdb do this kind of job?
The gdb command watch sets a breakpoint on write, rwatch on read, and awatch on read or write. You can use them as you would with breakpoints, with two considerations: You can't use gdb expressions in them (like $esp+... ) You need support for them. Software support is much, much slower than hardware. To find out if yo...
How to break on access of a specific global variable in gdb? Possible Duplicate: Can I set a breakpoint on 'memory access' in GDB? I want to trace how a specific variable is initialized, can gdb do this kind of job?
TITLE: How to break on access of a specific global variable in gdb? QUESTION: Possible Duplicate: Can I set a breakpoint on 'memory access' in GDB? I want to trace how a specific variable is initialized, can gdb do this kind of job? ANSWER: The gdb command watch sets a breakpoint on write, rwatch on read, and awatch ...
[ "c", "gdb" ]
1
1
692
1
0
2011-06-03T03:50:31.360000
2011-06-03T05:08:55.803000
6,222,792
6,222,813
Jquery add values from dropdown to text input
I'm having trouble trying to accomplishing this.. Whatever option I select from a dropdown list named programs_dropdown I want to add to a text field named programs_input and separate the options values by a comma. e.g. php, jquery, html Below the dropdown list I have an add div. On click, it should add what I selected...
The select has to multi option if you want to select multiple. Change it to Then it would start working. Demo EDIT: $(document).ready(function(){ $('#add').click(function() { var program = $("#programs_dropdown").val(); //get value of selected option var programs = $('#programs_input').val().split(","); if (programs[0]...
Jquery add values from dropdown to text input I'm having trouble trying to accomplishing this.. Whatever option I select from a dropdown list named programs_dropdown I want to add to a text field named programs_input and separate the options values by a comma. e.g. php, jquery, html Below the dropdown list I have an ad...
TITLE: Jquery add values from dropdown to text input QUESTION: I'm having trouble trying to accomplishing this.. Whatever option I select from a dropdown list named programs_dropdown I want to add to a text field named programs_input and separate the options values by a comma. e.g. php, jquery, html Below the dropdown...
[ "javascript", "jquery", "html", "forms" ]
0
1
5,561
2
0
2011-06-03T03:52:21.743000
2011-06-03T03:57:15.717000
6,222,809
6,223,004
Newbie question on grails "createCriteria"
I am new to Grails criteria builder, can someone please explain what does the following mean? def c = Account.createCriteria() def results = c { like("holderFirstName", "Fred%") and { between("balance", 500, 1000) eq("branch", "London") } maxResults(10) order("holderLastName", "desc") } Does it mean Select * from acco...
Your example would execute as: select * from account where holderFirstName like 'Fred%' and balance between 500 and 1000 and branch = 'London' All top level conditions are implied to be AND'ed together. You could create the same Criteria as: def c = Account.createCriteria() def results = c { like("holderFirstName", "Fr...
Newbie question on grails "createCriteria" I am new to Grails criteria builder, can someone please explain what does the following mean? def c = Account.createCriteria() def results = c { like("holderFirstName", "Fred%") and { between("balance", 500, 1000) eq("branch", "London") } maxResults(10) order("holderLastName"...
TITLE: Newbie question on grails "createCriteria" QUESTION: I am new to Grails criteria builder, can someone please explain what does the following mean? def c = Account.createCriteria() def results = c { like("holderFirstName", "Fred%") and { between("balance", 500, 1000) eq("branch", "London") } maxResults(10) orde...
[ "grails", "criteria" ]
1
8
6,277
2
0
2011-06-03T03:56:40.413000
2011-06-03T04:36:31.130000
6,222,816
6,222,833
ruby on rails fetch activerecords with where clause
I have a simple question - basically I want to fetch all ActiveRecords of some model X which adhere to some conditions. I am trying to use the X.where method here but I am not sure how it will work. Basically, my model X has_many Y. I have a list of ids for model Y objects. I want to find all of model X which has at le...
Here is what I would do: Modelx.joins(:modelys).where(:modelys => {:id => list_of_ids }).all Another solution that I prefer is to use scopes: def Modelx < ActiveRecord::Base has_many:modelys has_many:modelzs scope:has_modely_ids, lambda { |ids| joins(:modelys).where(:modelys => {:id => [*ids] }) } scope:has_modelz_ids...
ruby on rails fetch activerecords with where clause I have a simple question - basically I want to fetch all ActiveRecords of some model X which adhere to some conditions. I am trying to use the X.where method here but I am not sure how it will work. Basically, my model X has_many Y. I have a list of ids for model Y ob...
TITLE: ruby on rails fetch activerecords with where clause QUESTION: I have a simple question - basically I want to fetch all ActiveRecords of some model X which adhere to some conditions. I am trying to use the X.where method here but I am not sure how it will work. Basically, my model X has_many Y. I have a list of ...
[ "ruby-on-rails", "activerecord", "model", "has-many" ]
0
0
703
1
0
2011-06-03T03:57:31.407000
2011-06-03T04:01:27.420000
6,222,827
6,222,958
How do you find the limiting factor of a program?
I've created a program that parses data from a file and imports it into a relational postgresql database. The program has been running for 2 weeks and looks like it has a few more days left. It is averaging ~150 imports a second. How can I find the limiting factor and make it go faster? The CPU for my program does not ...
You should have killed this process many, many days ago and asked not how to find the limiting factor of the app but rather: Is there a faster way to import data into pgSQL? Take a look at this question and then the pgSQL COPY documentation. It's possible that the import process you're running could be achieved in hour...
How do you find the limiting factor of a program? I've created a program that parses data from a file and imports it into a relational postgresql database. The program has been running for 2 weeks and looks like it has a few more days left. It is averaging ~150 imports a second. How can I find the limiting factor and m...
TITLE: How do you find the limiting factor of a program? QUESTION: I've created a program that parses data from a file and imports it into a relational postgresql database. The program has been running for 2 weeks and looks like it has a few more days left. It is averaging ~150 imports a second. How can I find the lim...
[ "postgresql", "benchmarking", "bulkinsert" ]
1
2
175
1
0
2011-06-03T04:00:47.400000
2011-06-03T04:27:04.917000
6,222,837
6,223,041
Arbitrary Substring Attribute Value Selector not working in IE7
I have a Tag cloud that i need to style. Unfortunately it has no classes and I cannot edit the code. The Problem: I'm using the following code:.tag-cloud a[style*="xx-large"]{ font-size:140%!important; } To target: Events the doctype is: This is not working in Internet Explorer 7. As far as i know it is meant to work. ...
If you're not against using javascript, this could be solved really easily using jQuery: $(function() { $(".tag-cloud a[style='font-size:xx-large']").css("font-size", "140%"); });
Arbitrary Substring Attribute Value Selector not working in IE7 I have a Tag cloud that i need to style. Unfortunately it has no classes and I cannot edit the code. The Problem: I'm using the following code:.tag-cloud a[style*="xx-large"]{ font-size:140%!important; } To target: Events the doctype is: This is not workin...
TITLE: Arbitrary Substring Attribute Value Selector not working in IE7 QUESTION: I have a Tag cloud that i need to style. Unfortunately it has no classes and I cannot edit the code. The Problem: I'm using the following code:.tag-cloud a[style*="xx-large"]{ font-size:140%!important; } To target: Events the doctype is: ...
[ "html", "css", "internet-explorer-7", "css-selectors" ]
0
1
334
1
0
2011-06-03T04:02:14.630000
2011-06-03T04:44:58.953000
6,222,842
6,222,978
To what extent is Postgres able to reuse indices?
For example if I build an index on A, B, C And then subsequently build an index on A, B, D Is the original A, B portion reused or is everything built again from scratch?
No, each index is a new individual object. Check pg_class. Edit: You don't have to create two indexes holding the A and B columns twice. Create an index on A, B and C and then another index on D. PostgreSQL can use two indexes, when needed.
To what extent is Postgres able to reuse indices? For example if I build an index on A, B, C And then subsequently build an index on A, B, D Is the original A, B portion reused or is everything built again from scratch?
TITLE: To what extent is Postgres able to reuse indices? QUESTION: For example if I build an index on A, B, C And then subsequently build an index on A, B, D Is the original A, B portion reused or is everything built again from scratch? ANSWER: No, each index is a new individual object. Check pg_class. Edit: You don'...
[ "postgresql" ]
2
4
391
2
0
2011-06-03T04:03:30.893000
2011-06-03T04:30:40.513000
6,222,843
6,222,896
Is it possible to display full screen ad directly in iPhone?
I want to know that is it possible to display full screen ad directly in iPhone?as i don't want to display small banner ad and wants direct full screen ad. and if yes then how? For that what to use i mean how can i show it with iAd or AdWhirl or AdMob or other? Thanks.
yes you can by using rich media iads but they are supported only on iPad & ios 4.3.Check the documentation. http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/iAd_Guide/Full-ScreenAdvertisements/Full-ScreenAdvertisements.html
Is it possible to display full screen ad directly in iPhone? I want to know that is it possible to display full screen ad directly in iPhone?as i don't want to display small banner ad and wants direct full screen ad. and if yes then how? For that what to use i mean how can i show it with iAd or AdWhirl or AdMob or othe...
TITLE: Is it possible to display full screen ad directly in iPhone? QUESTION: I want to know that is it possible to display full screen ad directly in iPhone?as i don't want to display small banner ad and wants direct full screen ad. and if yes then how? For that what to use i mean how can i show it with iAd or AdWhir...
[ "iphone", "fullscreen", "ads" ]
0
1
612
1
0
2011-06-03T04:03:40.487000
2011-06-03T04:15:53.860000
6,222,844
6,222,943
Using Try/catch with Do/While
this is more of a conceptual question. Is it aceptable/good programming mixing do/while loops with try/catch? ex: '; return 0; } catch (Exception $e) { return 1; } } function bar() { try { echo 'DO BAR STUFF '; return 0; } catch (Exception $e) { return 1; } }?> The reason I'm asking is that I read somewhere that mixin...
There is no reason to avoid mixing try/catch with do/while. But the example you give has less problems with do/while and more with swallowing exceptions in the try/catch block. Catching the base exception type and swallowing it is a bad practice in any language, PHP or otherwise. It is best to only catch specific excep...
Using Try/catch with Do/While this is more of a conceptual question. Is it aceptable/good programming mixing do/while loops with try/catch? ex: '; return 0; } catch (Exception $e) { return 1; } } function bar() { try { echo 'DO BAR STUFF '; return 0; } catch (Exception $e) { return 1; } }?> The reason I'm asking is th...
TITLE: Using Try/catch with Do/While QUESTION: this is more of a conceptual question. Is it aceptable/good programming mixing do/while loops with try/catch? ex: '; return 0; } catch (Exception $e) { return 1; } } function bar() { try { echo 'DO BAR STUFF '; return 0; } catch (Exception $e) { return 1; } }?> The reaso...
[ "php" ]
4
3
3,910
3
0
2011-06-03T04:03:45.993000
2011-06-03T04:23:52.100000
6,222,846
6,230,025
Help with Inverse Kinematics Algorithm
I'm trying to implement CCD Inverse Kinematics in 2D This function is supposed to do 1 iteration of CCD Right now as a test case I start it on a left foot and have it stop at the pelvis. every time this function is called, the skeleton's bones are updated. The way my bones work is: getFrameX,Y,Angle return the absolute...
No, there is nothing obviously wrong in the program listing you have given. You are correctly computing the change of angle rotAng and the new position (endX, endY) of the end-effector. You can compute rotAng more simply as double rotAng = atan2(curToTargetY, curToTargetX) - atan2(curToEndY, curToEndX); which gives ide...
Help with Inverse Kinematics Algorithm I'm trying to implement CCD Inverse Kinematics in 2D This function is supposed to do 1 iteration of CCD Right now as a test case I start it on a left foot and have it stop at the pelvis. every time this function is called, the skeleton's bones are updated. The way my bones work is...
TITLE: Help with Inverse Kinematics Algorithm QUESTION: I'm trying to implement CCD Inverse Kinematics in 2D This function is supposed to do 1 iteration of CCD Right now as a test case I start it on a left foot and have it stop at the pelvis. every time this function is called, the skeleton's bones are updated. The wa...
[ "c++", "algorithm", "inverse-kinematics" ]
1
2
2,990
1
0
2011-06-03T04:04:16.727000
2011-06-03T16:36:43.323000
6,222,847
6,222,860
Php Framework which support multiple database instance at a time
is theire any php Framework which will support multiple database instance @ single time.?????
Yes, Zend Framework http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.multidb I'd say it's safe to assume there are others. From memory, Doctrine supports multiple connections out-of-the-box so you can probably include Symfony.
Php Framework which support multiple database instance at a time is theire any php Framework which will support multiple database instance @ single time.?????
TITLE: Php Framework which support multiple database instance at a time QUESTION: is theire any php Framework which will support multiple database instance @ single time.????? ANSWER: Yes, Zend Framework http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources...
[ "model-view-controller", "frameworks", "php" ]
1
1
308
1
0
2011-06-03T04:04:26.393000
2011-06-03T04:08:00.533000
6,222,849
6,222,877
How to set selected value of 's:radio' button in 's:textarea' with JavaScript?
I need to set 's:textarea' value which is selected in 's:radio' button. I am currently using the code below to do it. But it always set the 'In test' value in 's:textarea' which is the first value in 's:radio' button list. function handleCommentChange() { var comment = document.getElementById('comment'); var radioComm...
Pass a reference to the clicked radio in to your handleCommentChange() function. You can pass this, which will give the function a reference to the radio element and let you access all of its properties, etc., or you can pass this.value directly and have the function assign that string to your textarea. I prefer to pas...
How to set selected value of 's:radio' button in 's:textarea' with JavaScript? I need to set 's:textarea' value which is selected in 's:radio' button. I am currently using the code below to do it. But it always set the 'In test' value in 's:textarea' which is the first value in 's:radio' button list. function handleCom...
TITLE: How to set selected value of 's:radio' button in 's:textarea' with JavaScript? QUESTION: I need to set 's:textarea' value which is selected in 's:radio' button. I am currently using the code below to do it. But it always set the 'In test' value in 's:textarea' which is the first value in 's:radio' button list. ...
[ "javascript", "html", "struts2" ]
0
2
3,294
1
0
2011-06-03T04:05:03.253000
2011-06-03T04:10:50.017000
6,222,850
6,222,865
Is Android Cloud 2 Device Messaging (C2DM) compatible with Google's 2-step verification?
I've been reading up on Android's cloud 2 device messaging (C2DM) and all the documentation mention ClientLogin as the authentication method. However the ClienLogin info page specifically states its not compatible with 2-step verification and recomments using OAuth2. Can I use OAuth2 as a replacement for ClientLogin fo...
The account that gets authenticated with C2DM is the pole account that you provided when you signed up for C2DM. As long as that account does not use 2-step verification, everything is fine. It does not use the user's credentials. Rather, it does not use the user's credentials to push messages. The user must be signed ...
Is Android Cloud 2 Device Messaging (C2DM) compatible with Google's 2-step verification? I've been reading up on Android's cloud 2 device messaging (C2DM) and all the documentation mention ClientLogin as the authentication method. However the ClienLogin info page specifically states its not compatible with 2-step verif...
TITLE: Is Android Cloud 2 Device Messaging (C2DM) compatible with Google's 2-step verification? QUESTION: I've been reading up on Android's cloud 2 device messaging (C2DM) and all the documentation mention ClientLogin as the authentication method. However the ClienLogin info page specifically states its not compatible...
[ "android", "oauth-2.0", "android-c2dm" ]
3
3
1,517
1
0
2011-06-03T04:05:06.897000
2011-06-03T04:09:01.153000
6,222,861
6,234,152
Cassandra and Hector = MultiGetSliceQuery, with Column-Values of various different types?
Hallo, I do not understand, how to query cassandra with hector, but the column-values returned are not of one single type, but of many: I put in???? where I do not know what to do: MultigetSliceQuery multigetSliceQuery = HFactory.createMultigetSliceQuery(keyspace, stringSerializer, stringSerializer,???????); For for ex...
You can use the ByteBufferSerializer, and then convert the ByteBuffers returned from ByteBufferSerializer as the argument to StringSerializer and IntegerSerializer to convert the columns which are Strings and Integers.
Cassandra and Hector = MultiGetSliceQuery, with Column-Values of various different types? Hallo, I do not understand, how to query cassandra with hector, but the column-values returned are not of one single type, but of many: I put in???? where I do not know what to do: MultigetSliceQuery multigetSliceQuery = HFactory....
TITLE: Cassandra and Hector = MultiGetSliceQuery, with Column-Values of various different types? QUESTION: Hallo, I do not understand, how to query cassandra with hector, but the column-values returned are not of one single type, but of many: I put in???? where I do not know what to do: MultigetSliceQuery multigetSlic...
[ "java", "cassandra", "hector" ]
3
5
2,637
2
0
2011-06-03T04:08:07.863000
2011-06-04T01:42:06.483000
6,222,875
6,224,652
Drupal: Views taxonomy exposed filter, show tree/hierarchy in drop down menu
I have an exposed taxonomy filter that allows the user the filter by term. The vocabulary is 2 tiers, however in the exposed filter menu the hierarchy appears flat. Is there a method/module to show the hierarchy with indentation or prefixing child terms with "-", similar to the taxonomy term selection menu from the nod...
The filter Taxonomy: Term ID (with Depth) will display the option "Show Hierarchy In Dropdown" when you select the Dropdown widget.
Drupal: Views taxonomy exposed filter, show tree/hierarchy in drop down menu I have an exposed taxonomy filter that allows the user the filter by term. The vocabulary is 2 tiers, however in the exposed filter menu the hierarchy appears flat. Is there a method/module to show the hierarchy with indentation or prefixing c...
TITLE: Drupal: Views taxonomy exposed filter, show tree/hierarchy in drop down menu QUESTION: I have an exposed taxonomy filter that allows the user the filter by term. The vocabulary is 2 tiers, however in the exposed filter menu the hierarchy appears flat. Is there a method/module to show the hierarchy with indentat...
[ "drupal", "drupal-6", "view", "taxonomy" ]
0
2
7,421
1
0
2011-06-03T04:10:37.537000
2011-06-03T08:19:11.260000
6,222,878
6,224,320
Remove invalid entry in SDK console
I have a playground on Windows 7 with the App Engine Console. I get the following error message when accessing the SDK console. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 700, in __call__ handler.get(*groups) File "C:\Program Files\Go...
It looks like a bug in the App Engine SDK -- it should at least fail gracefully. I would: File a bug report against the App Engine SDK, and Write a little App Engine web script which deletes the offending entry, and run it (sort of a hack way to delete something without using the admin console). Alternatively, the App ...
Remove invalid entry in SDK console I have a playground on Windows 7 with the App Engine Console. I get the following error message when accessing the SDK console. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 700, in __call__ handler.ge...
TITLE: Remove invalid entry in SDK console QUESTION: I have a playground on Windows 7 with the App Engine Console. I get the following error message when accessing the SDK console. Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 700, in _...
[ "python", "google-app-engine" ]
2
1
115
1
0
2011-06-03T04:12:32.320000
2011-06-03T07:41:17.397000
6,222,880
6,223,045
MySQL join two tables based on a time field returning the largest previous time
I have two tables like so: EventTable (EID, Name, EventTime) VideoTable (VID, StartTime, Video, DurationSecs) The EventTable contains events that occur at a particular time. The VideoTable contains a list of video files and their starting times. What I would like to return is a list of all events and the correct video ...
SELECT e.Name, v.Video, TO_SECONDS(v.StartTime) - TO_SECONDS(e.EventTime) AS SecsIntoVideo FROM EventTable e LEFT JOIN VideoTable v ON e.EventTime BETWEEN v.StartTime AND v.starttime + INTERVAL (v.DurationSecs)
MySQL join two tables based on a time field returning the largest previous time I have two tables like so: EventTable (EID, Name, EventTime) VideoTable (VID, StartTime, Video, DurationSecs) The EventTable contains events that occur at a particular time. The VideoTable contains a list of video files and their starting t...
TITLE: MySQL join two tables based on a time field returning the largest previous time QUESTION: I have two tables like so: EventTable (EID, Name, EventTime) VideoTable (VID, StartTime, Video, DurationSecs) The EventTable contains events that occur at a particular time. The VideoTable contains a list of video files an...
[ "mysql", "sql", "join" ]
1
2
275
3
0
2011-06-03T04:12:44.843000
2011-06-03T04:45:37.410000
6,222,882
6,222,908
CSS Floats Right
I would like to know the best way to have my header float right so that it's position right next my image. I've notice that since it's contained inside a div which stetches 100% wide that when I float the title right it goes to the furthest right point of the div rather than next to my image. I can absolute or relative...
If you need your container to be 100% width you'll need another 'inner' container that is not 100% width and that contains all the things you want floated to the right: My Header goes here Style: #holder{width:100%;} #innerHolder{float:right;}
CSS Floats Right I would like to know the best way to have my header float right so that it's position right next my image. I've notice that since it's contained inside a div which stetches 100% wide that when I float the title right it goes to the furthest right point of the div rather than next to my image. I can abs...
TITLE: CSS Floats Right QUESTION: I would like to know the best way to have my header float right so that it's position right next my image. I've notice that since it's contained inside a div which stetches 100% wide that when I float the title right it goes to the furthest right point of the div rather than next to m...
[ "html", "css", "css-float" ]
0
0
307
3
0
2011-06-03T04:13:07.157000
2011-06-03T04:17:57.053000
6,222,884
6,222,953
VB.NET : FromBase64String Error
I am getting following error when I am trying to use Convert.FromBase64String "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters." Dim payloadBytes = Convert.FromBase64String(payloadBase64) Basica...
The issue is that the dash is not a valid character in the Base64String. Here is a quote from MSDN: The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used fo...
VB.NET : FromBase64String Error I am getting following error when I am trying to use Convert.FromBase64String "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters." Dim payloadBytes = Convert.FromBa...
TITLE: VB.NET : FromBase64String Error QUESTION: I am getting following error when I am trying to use Convert.FromBase64String "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters." Dim payloadByte...
[ "asp.net", "vb.net", "base64" ]
1
2
8,407
4
0
2011-06-03T04:13:42.223000
2011-06-03T04:25:25.127000
6,222,885
6,222,976
JQuery $.get() question
Ive got the following question and im trying to figure out the answer: You can find the following code here: http://7.testaddress.com/test.php Do you think the code will work, explain? $.get('http://1.testaddress.com/ajax/remote.php?id='+id, responseCallback); Is the answer no it wont work because its not located at th...
Yes it wont work because it is from a different sub-domain. At the bottom of the bottom of the jQuery documentation for the Get method there's this little chestnut: Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a dif...
JQuery $.get() question Ive got the following question and im trying to figure out the answer: You can find the following code here: http://7.testaddress.com/test.php Do you think the code will work, explain? $.get('http://1.testaddress.com/ajax/remote.php?id='+id, responseCallback); Is the answer no it wont work becau...
TITLE: JQuery $.get() question QUESTION: Ive got the following question and im trying to figure out the answer: You can find the following code here: http://7.testaddress.com/test.php Do you think the code will work, explain? $.get('http://1.testaddress.com/ajax/remote.php?id='+id, responseCallback); Is the answer no ...
[ "jquery" ]
0
3
69
2
0
2011-06-03T04:13:49.520000
2011-06-03T04:30:31.480000
6,222,886
6,222,930
Managing configuration in Erlang application
I need to distribute some sort of static configuration through my application. What is the best practice to do that? I see three options: Call application:get_env directly whenever a module requires to get configuration value. Plus: simpler than other options. Minus: how to test such modules without bringing the whole ...
Another approach is to transform your configuration data into an Erlang source module that makes the configuration data available through exports. Then you can change the configuration at any time in a running system by simply loading a new version of the configuration module.
Managing configuration in Erlang application I need to distribute some sort of static configuration through my application. What is the best practice to do that? I see three options: Call application:get_env directly whenever a module requires to get configuration value. Plus: simpler than other options. Minus: how to ...
TITLE: Managing configuration in Erlang application QUESTION: I need to distribute some sort of static configuration through my application. What is the best practice to do that? I see three options: Call application:get_env directly whenever a module requires to get configuration value. Plus: simpler than other optio...
[ "configuration", "erlang" ]
20
13
8,352
5
0
2011-06-03T04:13:59.933000
2011-06-03T04:21:42.780000
6,222,892
6,222,913
Accessing annotations defined in the interface, in the class implementing it?
I'm working with java. I have an interface that has an annotated method in it. Is there a way to access that annotation in a class implementing that interface? Thanks. Edit: sorry, I shoudl've been clearer: I'm using reflection to access elements of Java, and I'm wondering how to access the annotations in a class imple...
Sure. Reflection allows you to check for the presence of an annotation. There are methods at the class, method, paramter levels: reflection and annotations
Accessing annotations defined in the interface, in the class implementing it? I'm working with java. I have an interface that has an annotated method in it. Is there a way to access that annotation in a class implementing that interface? Thanks. Edit: sorry, I shoudl've been clearer: I'm using reflection to access elem...
TITLE: Accessing annotations defined in the interface, in the class implementing it? QUESTION: I'm working with java. I have an interface that has an annotated method in it. Is there a way to access that annotation in a class implementing that interface? Thanks. Edit: sorry, I shoudl've been clearer: I'm using reflect...
[ "java", "annotations" ]
1
0
158
1
0
2011-06-03T04:14:53.993000
2011-06-03T04:18:44.913000
6,222,917
6,222,948
How to set the shadow color for Image?
Hai, I am doing one application, in that i want to provide the shadow color for image after setting the border color. But border color and shadow color both are different. So please tell me any more suggestions.
Have you looked at CALayer? It has a property called shadowColor. This works you are referring to an UIImageView object. If you're referring to the image, you can look at CGContextSetShadowWithColor to add an image using Quartz.
How to set the shadow color for Image? Hai, I am doing one application, in that i want to provide the shadow color for image after setting the border color. But border color and shadow color both are different. So please tell me any more suggestions.
TITLE: How to set the shadow color for Image? QUESTION: Hai, I am doing one application, in that i want to provide the shadow color for image after setting the border color. But border color and shadow color both are different. So please tell me any more suggestions. ANSWER: Have you looked at CALayer? It has a prope...
[ "iphone" ]
0
0
254
1
0
2011-06-03T04:19:32.473000
2011-06-03T04:24:55.730000
6,222,926
6,223,465
Zend Action Helpers not loading through Action HelperBroker
In my module bootstrap: setParam('api_allowedMethods', array('POST')); } protected function _initActionHelperBrokers() { Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH. '/modules/api/controllers/helpers', 'Api_Controller_Action_Helper_'); Zend_Controller_Action_HelperBroker::addHelper(new Api_Controlle...
The problem here is that the module autoloader does not know about controller action helper resources. Try something like this in your module bootstrap protected function _initResourceLoader() { $resourceLoader = $this->getResourceLoader(); $resourceLoader->addResourceType('actionhelper', 'controllers/helpers', 'Contr...
Zend Action Helpers not loading through Action HelperBroker In my module bootstrap: setParam('api_allowedMethods', array('POST')); } protected function _initActionHelperBrokers() { Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH. '/modules/api/controllers/helpers', 'Api_Controller_Action_Helper_'); Zend...
TITLE: Zend Action Helpers not loading through Action HelperBroker QUESTION: In my module bootstrap: setParam('api_allowedMethods', array('POST')); } protected function _initActionHelperBrokers() { Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH. '/modules/api/controllers/helpers', 'Api_Controller_Actio...
[ "php", "zend-framework" ]
0
2
1,204
1
0
2011-06-03T04:20:48.917000
2011-06-03T05:53:07.063000
6,222,928
6,223,120
Ajax Forms Return Success
I'm trying to learn from the http://jquery.malsup.com/form/#getting-started example. When I click submit, the alert of "Thank you for your comment" should pop up, however, it is not working for me. I was wondering if there was something you had to specifically add in comment.php that is being called by the form? Mine i...
I just got it to work after I noticed that the page wasn't actually loading any scripts. If you copied-and-pasted the example HTML, as I did, try changing the src of the javascript, so that the scripts load and don't return 404s. I.e. instead of jquery-1.3.2.js, insert the full http://jquery.malsup.com/jquery-1.3.2.js....
Ajax Forms Return Success I'm trying to learn from the http://jquery.malsup.com/form/#getting-started example. When I click submit, the alert of "Thank you for your comment" should pop up, however, it is not working for me. I was wondering if there was something you had to specifically add in comment.php that is being ...
TITLE: Ajax Forms Return Success QUESTION: I'm trying to learn from the http://jquery.malsup.com/form/#getting-started example. When I click submit, the alert of "Thank you for your comment" should pop up, however, it is not working for me. I was wondering if there was something you had to specifically add in comment....
[ "ajax", "jquery" ]
0
1
240
1
0
2011-06-03T04:21:11.673000
2011-06-03T04:59:19.657000
6,222,952
6,222,969
How can i get the class of a div by clicking another div?
I have 2 div,in both the div i have the same id but different class. When clicked on one div we can get its attribute id.its ok.. This id is same for the other div. How can i get the class of this 2nd div using this id? Hi this is the first div Hi This is the second div
You cannot have two elements with the same id like that. That is an invalid HTML document and any DOM inspection/manipulation relying on duplicated id attributes is likely going to have unpredictable results across different browsers. That said, if I had to quickly and roughly edit your above code to do what you're ask...
How can i get the class of a div by clicking another div? I have 2 div,in both the div i have the same id but different class. When clicked on one div we can get its attribute id.its ok.. This id is same for the other div. How can i get the class of this 2nd div using this id? Hi this is the first div Hi This is the se...
TITLE: How can i get the class of a div by clicking another div? QUESTION: I have 2 div,in both the div i have the same id but different class. When clicked on one div we can get its attribute id.its ok.. This id is same for the other div. How can i get the class of this 2nd div using this id? Hi this is the first div...
[ "javascript", "html", "click" ]
2
4
356
2
0
2011-06-03T04:25:24.080000
2011-06-03T04:29:12.927000
6,222,954
6,233,680
Textview inside RelativeLayout in custom View not applying gravity correctly?
So I have a setup where I'm creating my own View and I'm adding some TextViews into it. However, the gravity setting is broken for it. (It centers horizontally, but not vertically) I'm doing it this way because there's other stuff I'm also drawing within my view besides just the TextViews, but those work fine. There's ...
Ok.. So I figured this out. I just had to run the measure() method on each TextView.. So my new code looks like: textView1.measure(MeasureSpec.makeMeasureSpec(width1, MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(height1, MeasureSpec.EXACTLY)); textView1.layout(left1, top1, left1 + width1, top1 + height1); textView...
Textview inside RelativeLayout in custom View not applying gravity correctly? So I have a setup where I'm creating my own View and I'm adding some TextViews into it. However, the gravity setting is broken for it. (It centers horizontally, but not vertically) I'm doing it this way because there's other stuff I'm also dr...
TITLE: Textview inside RelativeLayout in custom View not applying gravity correctly? QUESTION: So I have a setup where I'm creating my own View and I'm adding some TextViews into it. However, the gravity setting is broken for it. (It centers horizontally, but not vertically) I'm doing it this way because there's other...
[ "android", "view", "textview", "gravity" ]
7
9
5,385
3
0
2011-06-03T04:25:49.660000
2011-06-03T23:44:50.320000
6,222,956
6,223,033
Implicit creation of helpers - routes.rb and 'match' statements
I am reading Obie Fernandez' "The Rails 3 Way", and there is a bit of it that I am not sure I understand correctly. I am new to rails, and want to make sure I understand it correctly. I have some experience with vanilla Ruby. Not much, but some. The text in question is as follows: (regarding routing and the config/rout...
Yes, it is the:as => 'named_route' part that creates the named route (which in turn creates the helpers). As for leaving it off, are you referring to instances of resources:something in routes.rb? The resources method generates a set of URL helpers based on the name of the resource automagically.
Implicit creation of helpers - routes.rb and 'match' statements I am reading Obie Fernandez' "The Rails 3 Way", and there is a bit of it that I am not sure I understand correctly. I am new to rails, and want to make sure I understand it correctly. I have some experience with vanilla Ruby. Not much, but some. The text i...
TITLE: Implicit creation of helpers - routes.rb and 'match' statements QUESTION: I am reading Obie Fernandez' "The Rails 3 Way", and there is a bit of it that I am not sure I understand correctly. I am new to rails, and want to make sure I understand it correctly. I have some experience with vanilla Ruby. Not much, bu...
[ "ruby-on-rails" ]
3
1
1,303
2
0
2011-06-03T04:26:19.067000
2011-06-03T04:43:22.487000
6,222,959
6,223,019
django record update error
here's my form... class PercentForm(forms.Form): percent = forms.IntegerField() here's my view that uses this: formx = PercentForm(request.POST or None) if formx.is_valid(): px = Pxxx.objects.get(id = user.id ) pcx = formx.cleaned_data['percent'] pc = (float(pcx / 10) px.percentage_instant = pc px.save() pxxx model per...
If pcx is an integer then pcx / 10 will still be an integer on 2.x. Perhaps you meant float(pcx) / 10 or pcx / 10.0.
django record update error here's my form... class PercentForm(forms.Form): percent = forms.IntegerField() here's my view that uses this: formx = PercentForm(request.POST or None) if formx.is_valid(): px = Pxxx.objects.get(id = user.id ) pcx = formx.cleaned_data['percent'] pc = (float(pcx / 10) px.percentage_instant = ...
TITLE: django record update error QUESTION: here's my form... class PercentForm(forms.Form): percent = forms.IntegerField() here's my view that uses this: formx = PercentForm(request.POST or None) if formx.is_valid(): px = Pxxx.objects.get(id = user.id ) pcx = formx.cleaned_data['percent'] pc = (float(pcx / 10) px.per...
[ "django", "django-forms", "django-views" ]
0
1
55
1
0
2011-06-03T04:27:14.853000
2011-06-03T04:39:54.953000
6,222,966
6,223,205
Extjs virtual keyboard
I am using ExtJs virtual keyboard Ref: http://efattal.fr/extjs-dev/examples/virtualkeyboard I want to fire an ajax request on press of "enter" key of the virtual keyboard. Is there any way to capture the "Enter" key press event? Thanks!
i was facing same problem. try dis listeners: { keypress: function(keyboard, keyValue){ if(typeof console!= 'undefined') console.log(keyValue); if(keyValue=="\n") { //your code here } } }
Extjs virtual keyboard I am using ExtJs virtual keyboard Ref: http://efattal.fr/extjs-dev/examples/virtualkeyboard I want to fire an ajax request on press of "enter" key of the virtual keyboard. Is there any way to capture the "Enter" key press event? Thanks!
TITLE: Extjs virtual keyboard QUESTION: I am using ExtJs virtual keyboard Ref: http://efattal.fr/extjs-dev/examples/virtualkeyboard I want to fire an ajax request on press of "enter" key of the virtual keyboard. Is there any way to capture the "Enter" key press event? Thanks! ANSWER: i was facing same problem. try di...
[ "keyboard", "extjs3" ]
0
0
802
1
0
2011-06-03T04:28:56.530000
2011-06-03T05:11:19.450000
6,222,975
6,222,992
sudo: pear: command not found
I have snow leopard which apparently has php with pear pre-installed. I enabled php but could not find any signs of PEAR. So I have installed it and now phpinfo() shows its installation include_path.:/usr/lib/php/share/pear Still when I type in any pear command $ sudo pear I get an error: sudo: pear: command not found ...
Many ways to skin this cat, but I would type this if you have locate installed (which you probably do): $ locate bin/pear That should list one or more things, one of which will look like the path to pear. Let's say it says something like /usr/local/bin/pear. Then your next command is: $ sudo /usr/local/bin/pear Two cav...
sudo: pear: command not found I have snow leopard which apparently has php with pear pre-installed. I enabled php but could not find any signs of PEAR. So I have installed it and now phpinfo() shows its installation include_path.:/usr/lib/php/share/pear Still when I type in any pear command $ sudo pear I get an error: ...
TITLE: sudo: pear: command not found QUESTION: I have snow leopard which apparently has php with pear pre-installed. I enabled php but could not find any signs of PEAR. So I have installed it and now phpinfo() shows its installation include_path.:/usr/lib/php/share/pear Still when I type in any pear command $ sudo pea...
[ "php", "macos", "pear" ]
3
7
29,198
4
0
2011-06-03T04:30:08.847000
2011-06-03T04:34:11.117000
6,222,984
6,223,013
Timezone issues on new XAMPP install with PHP 5.3
In response to the announcement that WordPress 3.2 (due later this month) will require PHP 5.2.4+, I upgraded my Windows test machine today from XAMPP 1.5.5 to 1.7.4, which in turn bumped me up from PHP 5.2.0 to 5.3.5. I've got just about everything working again, but one test page is behaving strangely. I have a MySQL...
The TZ environment variable is ignored under PHP 5.3. (The PHP manual page for date_default_timezone_get describes the order the various settings will be considered in, including that TZ only applies for PHP < 5.3). Simple solution: instead of putenv, use date_default_timezone_set to set your different timezones. The a...
Timezone issues on new XAMPP install with PHP 5.3 In response to the announcement that WordPress 3.2 (due later this month) will require PHP 5.2.4+, I upgraded my Windows test machine today from XAMPP 1.5.5 to 1.7.4, which in turn bumped me up from PHP 5.2.0 to 5.3.5. I've got just about everything working again, but o...
TITLE: Timezone issues on new XAMPP install with PHP 5.3 QUESTION: In response to the announcement that WordPress 3.2 (due later this month) will require PHP 5.2.4+, I upgraded my Windows test machine today from XAMPP 1.5.5 to 1.7.4, which in turn bumped me up from PHP 5.2.0 to 5.3.5. I've got just about everything wo...
[ "php", "date", "timezone", "xampp" ]
2
3
4,018
1
0
2011-06-03T04:32:33.753000
2011-06-03T04:38:01.510000
6,222,996
6,223,279
Backbone.js - Help With Approach for Static Menus
I am very new at using Backbone. Please forgive me in advance as I am struggling to think in new ways building web apps. I am confused about how to go about using it for items that are never really covered in any of the tutorials. All the tutorials give the basic "here is a model", "here is a collection of models", "he...
The important thing to remember here is that collections in backbone.js inherit a bunch of cool features from underscore.js. Included in these is filter (or select), which allows you to get only those members of a collection which match your perameters. For example: render: function(){ myCollection.filter(function(item...
Backbone.js - Help With Approach for Static Menus I am very new at using Backbone. Please forgive me in advance as I am struggling to think in new ways building web apps. I am confused about how to go about using it for items that are never really covered in any of the tutorials. All the tutorials give the basic "here ...
TITLE: Backbone.js - Help With Approach for Static Menus QUESTION: I am very new at using Backbone. Please forgive me in advance as I am struggling to think in new ways building web apps. I am confused about how to go about using it for items that are never really covered in any of the tutorials. All the tutorials giv...
[ "backbone.js" ]
4
4
2,063
1
0
2011-06-03T04:34:51.033000
2011-06-03T05:22:20.933000
6,223,005
6,223,067
Any advantages when using an ORM Tool (Framework)?
I searched over.... I see many advantages, but it seems that all the advantages comes from a comparison over in-line SQL. I know in-line SQL is bad. But why compare with a bad one to show the other better? If stored procedures are used (possibly exclusively), it seems none of the advantages still exists. Stored procedu...
ORM Tools make possible to develop abstraction layer between database and the model in the OO environment. The main advantage of this layer is that the developers who are not familiar with SQL can work with the model.
Any advantages when using an ORM Tool (Framework)? I searched over.... I see many advantages, but it seems that all the advantages comes from a comparison over in-line SQL. I know in-line SQL is bad. But why compare with a bad one to show the other better? If stored procedures are used (possibly exclusively), it seems ...
TITLE: Any advantages when using an ORM Tool (Framework)? QUESTION: I searched over.... I see many advantages, but it seems that all the advantages comes from a comparison over in-line SQL. I know in-line SQL is bad. But why compare with a bad one to show the other better? If stored procedures are used (possibly exclu...
[ "orm", "ado.net" ]
3
0
576
3
0
2011-06-03T04:36:37.073000
2011-06-03T04:48:47.307000
6,223,006
6,226,025
Find and replace html code for multiple files within multiple directories
I have a very basic understanding of shell scripting, but what I need to do requires more complex commands. For one task, I need to find and replace html code within the index.html files on my server. These files are in multiple directories with a consistent naming convention. ([letter][3-digit number]) See the example...
You have three separate sub-problems: replacing text in a file coping with special characters selecting files to apply the transformation to ​1. The canonical text replacement tool is sed: sed -e 's/PATTERN/REPLACEMENT/g' OUTPUT_FILE If you have GNU sed (e.g. on Linux or Cygwin), pass -i to transform the file in place....
Find and replace html code for multiple files within multiple directories I have a very basic understanding of shell scripting, but what I need to do requires more complex commands. For one task, I need to find and replace html code within the index.html files on my server. These files are in multiple directories with ...
TITLE: Find and replace html code for multiple files within multiple directories QUESTION: I have a very basic understanding of shell scripting, but what I need to do requires more complex commands. For one task, I need to find and replace html code within the index.html files on my server. These files are in multiple...
[ "shell", "unix", "search", "scripting", "replace" ]
2
2
1,991
2
0
2011-06-03T04:36:44.963000
2011-06-03T10:40:37.050000
6,223,022
6,223,995
how to integrate generated web services stubs file into Xcode
I am doing a project where iphone or ipad is a client side.. problem here is using WSDL file we have generated stubs using a software... the generated stubs are in the format.h and.m file but how to run this file in xcode or integrate with the xcode.... I am not getting any links or tutorial to do so please suggest me ...
Depends on a software that you have used to generate proxy classes from wsdl. We have successfully used http://code.google.com/p/wsdl2objc/, and just added generated files to project (project->add existing files). Bear in mind that those are just proxy classes, project structure and code to consume the webservice you h...
how to integrate generated web services stubs file into Xcode I am doing a project where iphone or ipad is a client side.. problem here is using WSDL file we have generated stubs using a software... the generated stubs are in the format.h and.m file but how to run this file in xcode or integrate with the xcode.... I am...
TITLE: how to integrate generated web services stubs file into Xcode QUESTION: I am doing a project where iphone or ipad is a client side.. problem here is using WSDL file we have generated stubs using a software... the generated stubs are in the format.h and.m file but how to run this file in xcode or integrate with ...
[ "iphone", "objective-c", "xcode" ]
2
0
1,076
2
0
2011-06-03T04:40:31.233000
2011-06-03T06:59:08.227000
6,223,023
6,225,906
Parsing JSON with GSON, object sometimes contains list sometimes contains object
I'm working with an API that sometimes contains a list of child objects: { 'obj': { children: [ {id: "1"}, {id: "2"} ] } } I can parse this no problem. But if there just one child it doesn't return it as a list: { 'obj': { children: {id: "1"} } } My parser which expects a list then breaks. Does anyone have a suggestion...
With Gson, the only way I know how to handle situations like this is with a custom Deserializer. For example: // outputs: // [Container: obj=[ChildContainer: children=[[Child: id=1], [Child: id=2]]]] // [Container: obj=[ChildContainer: children=[[Child: id=1]]]] public class Foo { static String json1 = "{\"obj\":{\"ch...
Parsing JSON with GSON, object sometimes contains list sometimes contains object I'm working with an API that sometimes contains a list of child objects: { 'obj': { children: [ {id: "1"}, {id: "2"} ] } } I can parse this no problem. But if there just one child it doesn't return it as a list: { 'obj': { children: {id: "...
TITLE: Parsing JSON with GSON, object sometimes contains list sometimes contains object QUESTION: I'm working with an API that sometimes contains a list of child objects: { 'obj': { children: [ {id: "1"}, {id: "2"} ] } } I can parse this no problem. But if there just one child it doesn't return it as a list: { 'obj': ...
[ "java", "gson" ]
12
16
6,684
1
0
2011-06-03T04:40:39.937000
2011-06-03T10:29:45.430000
6,223,027
6,232,793
Weird problems with program and debugger in xcode
Okay, I have a program that I'm trying to test on my iPad. I have it all set up so that the app is able to get on the iPad just fine, but running it on the iPad is a different story. Now, the thing is, my program was working fine on the debug configuration, but now it won't work on that, either. It's strange, because b...
Turns out that, when I went and changed the name of several UILabels in the header of GameViewController, I forgot to fix the names in the interface builder, too. Don't know if that was what was causing the debugger to act weird, but everything is working now!
Weird problems with program and debugger in xcode Okay, I have a program that I'm trying to test on my iPad. I have it all set up so that the app is able to get on the iPad just fine, but running it on the iPad is a different story. Now, the thing is, my program was working fine on the debug configuration, but now it w...
TITLE: Weird problems with program and debugger in xcode QUESTION: Okay, I have a program that I'm trying to test on my iPad. I have it all set up so that the app is able to get on the iPad just fine, but running it on the iPad is a different story. Now, the thing is, my program was working fine on the debug configura...
[ "objective-c", "xcode", "ipad" ]
1
0
121
1
0
2011-06-03T04:41:42.050000
2011-06-03T21:18:52.830000
6,223,037
6,231,705
How does INRIX traffic monitoring work?
How does INRIX traffic monitoring work? How would I develop a Java application that uses Inrix?
Thor is right. The place to go is the INRIX DevZone. I'm a developer on the mobile team at INRIX and recognize that gaining access to our APIs isn't as easy as it could be. We're looking at how we can improve that experience and make them available in a more friction-free manner. Stay tuned.
How does INRIX traffic monitoring work? How does INRIX traffic monitoring work? How would I develop a Java application that uses Inrix?
TITLE: How does INRIX traffic monitoring work? QUESTION: How does INRIX traffic monitoring work? How would I develop a Java application that uses Inrix? ANSWER: Thor is right. The place to go is the INRIX DevZone. I'm a developer on the mobile team at INRIX and recognize that gaining access to our APIs isn't as easy ...
[ "java" ]
2
0
864
2
0
2011-06-03T04:44:03.300000
2011-06-03T19:25:33.373000
6,223,039
6,224,149
Push to multiple remote repositories from a single local repo in Mercurial
I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration. Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration. Is it possible to have 2 remote repositories for a single local repository? So when I push comm...
You can set multiple remote repository aliases in the [paths] section of the repository configuration file. This file is in.hg/hgrc, and you would add paths like this [paths] default = http://kilnhg.com/repo bitbucket = http://bitbucket.org/repo Then you would run hg push bitbucket to push to bitbucket and hg push to p...
Push to multiple remote repositories from a single local repo in Mercurial I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration. Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration. Is it possible to ha...
TITLE: Push to multiple remote repositories from a single local repo in Mercurial QUESTION: I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration. Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration. Is...
[ "version-control", "mercurial", "bitbucket", "kiln", "appharbor" ]
29
45
7,026
2
0
2011-06-03T04:44:27.630000
2011-06-03T07:20:48.333000
6,223,047
6,226,818
Object Relationship Design
I just happen to ponder of a OO concept which may sound quite trivial but I don't know why I find it quite confusing. Anyway, I am thinking for example, if I have an Animal class and a Location class. And I only allow one animal to be at one location at any time. So it is kind of like a 1-to-1 relationship. At the same...
1.Location/Map in our case is a real world object and has boundaries. 2.Map can not hold more than one animal at any pont 3.An animal can not occupy more than one location Above are the facts associated to the problem. Location can be considered as a matrix. A 2-D array. For the time being we assume that one animal hol...
Object Relationship Design I just happen to ponder of a OO concept which may sound quite trivial but I don't know why I find it quite confusing. Anyway, I am thinking for example, if I have an Animal class and a Location class. And I only allow one animal to be at one location at any time. So it is kind of like a 1-to-...
TITLE: Object Relationship Design QUESTION: I just happen to ponder of a OO concept which may sound quite trivial but I don't know why I find it quite confusing. Anyway, I am thinking for example, if I have an Animal class and a Location class. And I only allow one animal to be at one location at any time. So it is ki...
[ "java", "oop", "object-reference" ]
3
2
504
4
0
2011-06-03T04:45:41.240000
2011-06-03T11:58:37.017000
6,223,050
6,223,095
When to use anonymous JavaScript functions?
I'm trying to understand when to use anonymous JavaScript functions. State differences between the functions? Explain when you would use each. var test1 = function(){ $(" ").html("test1").appendTo(body) }; function test2() { $(" ").html("test2").appendTo(body) } I think the answer is that one uses anonymous function a...
In your example it really doesn't make a huge difference. The only difference is that functions declared using function foo() { } are accessible anywhere within the same scope at any time, while functions declared using var foo = function () { } are only accessible after the code that does the assignment has run. foo()...
When to use anonymous JavaScript functions? I'm trying to understand when to use anonymous JavaScript functions. State differences between the functions? Explain when you would use each. var test1 = function(){ $(" ").html("test1").appendTo(body) }; function test2() { $(" ").html("test2").appendTo(body) } I think the ...
TITLE: When to use anonymous JavaScript functions? QUESTION: I'm trying to understand when to use anonymous JavaScript functions. State differences between the functions? Explain when you would use each. var test1 = function(){ $(" ").html("test1").appendTo(body) }; function test2() { $(" ").html("test2").appendTo(bo...
[ "javascript", "jquery" ]
3
6
286
3
0
2011-06-03T04:46:02.097000
2011-06-03T04:54:09.450000
6,223,052
6,234,930
jQuery datepicker--how to turn off ellipse tooltip when hovering over little calendar icon
I'm using the datepicker with icon (little calendar). When I hover over it with my mouse before clicking on it to get the datepicker calendar, an annoying little light gray box with an ellipse shows up (tooltip?) in all browsers. It's ugly! How do I get rid of it? I see it on this demo pagefor the plug-in, so it's not ...
I finally figured this out. It's described under options at jQuery Datepicker Options. The option is called buttonText. In my code, I had button Image Text. Wrong! To show "Calendar" in the tooltips, the option should be: buttonText: "Calendar" To get rid of the tooltip, the option should be: buttonText: "" The full co...
jQuery datepicker--how to turn off ellipse tooltip when hovering over little calendar icon I'm using the datepicker with icon (little calendar). When I hover over it with my mouse before clicking on it to get the datepicker calendar, an annoying little light gray box with an ellipse shows up (tooltip?) in all browsers....
TITLE: jQuery datepicker--how to turn off ellipse tooltip when hovering over little calendar icon QUESTION: I'm using the datepicker with icon (little calendar). When I hover over it with my mouse before clicking on it to get the datepicker calendar, an annoying little light gray box with an ellipse shows up (tooltip?...
[ "jquery", "datepicker" ]
8
10
6,539
2
0
2011-06-03T04:46:36.560000
2011-06-04T05:26:08.037000
6,223,057
6,223,176
How does Google know server side code?
Maybe I'm a little behind the eight ball. Hopefully someone can explain this. I had a webpage that I didn't want displayed to the public, for my eyes only (temporarily). It wasn't confidential or that important so I put a simple "if variable is not set, redirect". Thinking nothing could figure out the variable, it woul...
You didn't exit() after setting the redirect header(), so the rest of the page was generated and returned to the client, anyway.
How does Google know server side code? Maybe I'm a little behind the eight ball. Hopefully someone can explain this. I had a webpage that I didn't want displayed to the public, for my eyes only (temporarily). It wasn't confidential or that important so I put a simple "if variable is not set, redirect". Thinking nothing...
TITLE: How does Google know server side code? QUESTION: Maybe I'm a little behind the eight ball. Hopefully someone can explain this. I had a webpage that I didn't want displayed to the public, for my eyes only (temporarily). It wasn't confidential or that important so I put a simple "if variable is not set, redirect"...
[ "php" ]
2
5
146
4
0
2011-06-03T04:47:17.517000
2011-06-03T05:06:59.843000
6,223,058
6,223,071
How to calculate difference between the dates in PHP?
Possible Duplicate: How to calculate the difference between two dates using PHP? How to calculate difference between the dates? Is there any default function for to calculate the date differences?.. Thanks Ravi
date_diff() example: $datetime1 = date_create('2009-10-11'); $datetime2 = date_create('2009-10-13'); $interval = date_diff($datetime1, $datetime2); echo $interval->format('%R%a days');
How to calculate difference between the dates in PHP? Possible Duplicate: How to calculate the difference between two dates using PHP? How to calculate difference between the dates? Is there any default function for to calculate the date differences?.. Thanks Ravi
TITLE: How to calculate difference between the dates in PHP? QUESTION: Possible Duplicate: How to calculate the difference between two dates using PHP? How to calculate difference between the dates? Is there any default function for to calculate the date differences?.. Thanks Ravi ANSWER: date_diff() example: $dateti...
[ "php", "date" ]
2
3
244
2
0
2011-06-03T04:47:19.133000
2011-06-03T04:49:10.467000
6,223,062
6,223,142
java array passing, I keep getting the last array everywhere
I am having a problem in this code. what i am trying to do is read a file and store a studentID and score into an array of scores into the scores property of a student object, but I keep getting the last scores only when I print. Here is the code. can you tell me if my setter property is a correct way of assigning an a...
I havent tested the code with my suggestion, but take a look at: int[] studentScoreArray = new int[5]; You create this once and once only for the whole file. A simple and easy fix is to do it for every new line read instead. like this: int[] studentScoreArray = new int[5]; int quizNumberCounter = 0; while(..) {...}
java array passing, I keep getting the last array everywhere I am having a problem in this code. what i am trying to do is read a file and store a studentID and score into an array of scores into the scores property of a student object, but I keep getting the last scores only when I print. Here is the code. can you tel...
TITLE: java array passing, I keep getting the last array everywhere QUESTION: I am having a problem in this code. what i am trying to do is read a file and store a studentID and score into an array of scores into the scores property of a student object, but I keep getting the last scores only when I print. Here is the...
[ "java" ]
3
0
754
3
0
2011-06-03T04:48:10.083000
2011-06-03T05:02:42.560000
6,223,064
6,224,207
Symbolic links in TFS 2010 Source Control?
As far as I know, Team Foundation Server 2010's source control (and prior versions) doesn't support linking (Symbolic links) of files. Linking (per Visual SourceSafe) was the concept of providing one "hard" file in a folder, and then "linking" to it in other locations - exactly like file system hard links are designed....
This thread is more recent (2010), about TFS 2008 and 2010: TFS (2008 and 2010) do not have support for links. There is a server-side extension for TFS 2010 (ie. what VS2010 used for gated checkin) but this sounds like a client-side solution since the link must be converted to a file to be recognized by the client OM. ...
Symbolic links in TFS 2010 Source Control? As far as I know, Team Foundation Server 2010's source control (and prior versions) doesn't support linking (Symbolic links) of files. Linking (per Visual SourceSafe) was the concept of providing one "hard" file in a folder, and then "linking" to it in other locations - exactl...
TITLE: Symbolic links in TFS 2010 Source Control? QUESTION: As far as I know, Team Foundation Server 2010's source control (and prior versions) doesn't support linking (Symbolic links) of files. Linking (per Visual SourceSafe) was the concept of providing one "hard" file in a folder, and then "linking" to it in other ...
[ "tfs", "version-control", "symlink", "tfvc" ]
19
5
8,979
3
0
2011-06-03T04:48:13.797000
2011-06-03T07:26:41.413000
6,223,065
6,223,089
jQuery Validation not working in server! Works Locally. Why?
When I tried jQuery validation locally it works fine. But when I upload to my server the validation is not working. The page just simply reloads. Why is it so? Here is the fiddle. http://jsfiddle.net/anish/Q9qes/3/
In your JSFiddle, under Manage Resources, your link to the jQuery Validation plugin is giving a 404 error. Maybe that's why it's not working on your server. EDIT: There is no such tag as. Remove those. Perhaps run your HTML & CSS through a validator. Also, the version of your jQuery Validation plugin is not up to date ...
jQuery Validation not working in server! Works Locally. Why? When I tried jQuery validation locally it works fine. But when I upload to my server the validation is not working. The page just simply reloads. Why is it so? Here is the fiddle. http://jsfiddle.net/anish/Q9qes/3/
TITLE: jQuery Validation not working in server! Works Locally. Why? QUESTION: When I tried jQuery validation locally it works fine. But when I upload to my server the validation is not working. The page just simply reloads. Why is it so? Here is the fiddle. http://jsfiddle.net/anish/Q9qes/3/ ANSWER: In your JSFiddle,...
[ "javascript", "jquery", "html", "jquery-validate" ]
3
2
5,853
3
0
2011-06-03T04:48:27.487000
2011-06-03T04:53:35.743000
6,223,069
6,223,086
Zoom page while printing in javascript
Hi I am taking print as Landscape in javascript, as there was no standard code, so i changed it to like that i rotate my page div to 90 degree, which makes it landscape way and then perform window.print(), but the problem is, i made it fool as basically it is PORTRAIT printing in landscape way, so the text is quite sma...
Use a stylesheet specifically for printing or media queries @media print { body { font-size: 10pt } } @media screen { body { font-size: 13px } } @media screen, print { body { line-height: 1.2 } }
Zoom page while printing in javascript Hi I am taking print as Landscape in javascript, as there was no standard code, so i changed it to like that i rotate my page div to 90 degree, which makes it landscape way and then perform window.print(), but the problem is, i made it fool as basically it is PORTRAIT printing in ...
TITLE: Zoom page while printing in javascript QUESTION: Hi I am taking print as Landscape in javascript, as there was no standard code, so i changed it to like that i rotate my page div to 90 degree, which makes it landscape way and then perform window.print(), but the problem is, i made it fool as basically it is POR...
[ "javascript", "jquery", "asp.net" ]
2
4
4,331
1
0
2011-06-03T04:48:49.987000
2011-06-03T04:53:22.183000
6,223,075
6,223,090
How do I define a generic class that implements an interface and constrains the type parameter?
class Sample: IDisposable // case A { public void Dispose() { throw new NotImplementedException(); } } class SampleB where T: IDisposable // case B { } class SampleC: IDisposable, T: IDisposable // case C { public void Dispose() { throw new NotImplementedException(); } } Case C is the combination of case A and case B...
First the implemented interfaces, then the generic type constraints separated by where: class SampleC: IDisposable where T: IDisposable // case C { // ↑ public void Dispose() { throw new NotImplementedException(); } }
How do I define a generic class that implements an interface and constrains the type parameter? class Sample: IDisposable // case A { public void Dispose() { throw new NotImplementedException(); } } class SampleB where T: IDisposable // case B { } class SampleC: IDisposable, T: IDisposable // case C { public void Dis...
TITLE: How do I define a generic class that implements an interface and constrains the type parameter? QUESTION: class Sample: IDisposable // case A { public void Dispose() { throw new NotImplementedException(); } } class SampleB where T: IDisposable // case B { } class SampleC: IDisposable, T: IDisposable // case C...
[ "c#", "generics", "inheritance", "constraints" ]
65
104
56,849
5
0
2011-06-03T04:50:34.810000
2011-06-03T04:53:39.297000
6,223,076
6,223,113
Finding Room for a Shape on a Grid
I'm working on a game where you have an 8x12 grid where each cell is the same size and all the cells are directly next to one another. You drag around various Tetris-like shapes and place them on the grid in valid locations, a valid location being one where all the cells that the shape will occupy are not occupied by s...
As described, the algorithm would be quite simple. Arbitrarily choose a starting block on your shape, and try to match it to each open cell of the grid. If "drawing" the shape with the block aligned with the current cell doesn't cause a collision, you've found a valid position.
Finding Room for a Shape on a Grid I'm working on a game where you have an 8x12 grid where each cell is the same size and all the cells are directly next to one another. You drag around various Tetris-like shapes and place them on the grid in valid locations, a valid location being one where all the cells that the shap...
TITLE: Finding Room for a Shape on a Grid QUESTION: I'm working on a game where you have an 8x12 grid where each cell is the same size and all the cells are directly next to one another. You drag around various Tetris-like shapes and place them on the grid in valid locations, a valid location being one where all the c...
[ "algorithm", "grid" ]
1
1
526
1
0
2011-06-03T04:50:50.513000
2011-06-03T04:58:17.577000
6,223,081
6,231,413
Constraining a polymorphic type
I've got a range type defined as: type 'a range = Full | Range of ('a * 'a) However, I'd like to constrain 'a to be integer or float or char, with no other valid types for 'a. Range(0,10) (* valid *) Range(0.0, 10.0) (* valid *) Range('a', 'z') (* valid *) Range("string1", "string2") (* other types like this shouldn't ...
Taking a hint from what Haskell would do (declare a type class (Sequential a) => Range a ) you could use a functor: module Range (S: sig type t end) = struct type range = Full | Range of (S.t * S.t) end and use it to provide the required modules: module IntRange = Range (struct type t = int end) module FloatRange = Ran...
Constraining a polymorphic type I've got a range type defined as: type 'a range = Full | Range of ('a * 'a) However, I'd like to constrain 'a to be integer or float or char, with no other valid types for 'a. Range(0,10) (* valid *) Range(0.0, 10.0) (* valid *) Range('a', 'z') (* valid *) Range("string1", "string2") (* ...
TITLE: Constraining a polymorphic type QUESTION: I've got a range type defined as: type 'a range = Full | Range of ('a * 'a) However, I'd like to constrain 'a to be integer or float or char, with no other valid types for 'a. Range(0,10) (* valid *) Range(0.0, 10.0) (* valid *) Range('a', 'z') (* valid *) Range("string...
[ "types", "functional-programming", "ocaml" ]
12
10
239
3
0
2011-06-03T04:52:49.180000
2011-06-03T18:53:40.913000
6,223,087
6,223,134
Detect HTTPS using SharpPCap
I am using SharpPCap to filter packets. Does anyone know how to detect if a packet is for a secured http connection?
You would have to sniff the traffic from the start of the TCP session to observe the SSL handshake go back and forth. Once the encrypted session is set up, any individual packet is going to be indistinguishable from random noise. To discover otherwise is to find a major flaw in the symmetric cipher. (Yes, the encryptio...
Detect HTTPS using SharpPCap I am using SharpPCap to filter packets. Does anyone know how to detect if a packet is for a secured http connection?
TITLE: Detect HTTPS using SharpPCap QUESTION: I am using SharpPCap to filter packets. Does anyone know how to detect if a packet is for a secured http connection? ANSWER: You would have to sniff the traffic from the start of the TCP session to observe the SSL handshake go back and forth. Once the encrypted session is...
[ "https", "packet", "sharppcap" ]
3
0
730
1
0
2011-06-03T04:53:26.283000
2011-06-03T05:01:19.123000
6,223,092
6,223,130
What will be the SQL query for this problem?
I want to fetch some data from the following database table 'article'. i want to fetch an article information whose category_id is 4. But the result should contain all the records of its parent categories. for example: 'article1' has parent 'Sub Category1' and its parent is 'Main Category'. So the result should have th...
Please refer to this article: Managing Hierarchical Data in MySQL. Actually, they have purposed model to get Hierarchical data without recursion. In that they use lft(left) and rgt(right) this to extra column for storing structural information of table. lft and rgt are set as follows Root lft is 1. then its first child...
What will be the SQL query for this problem? I want to fetch some data from the following database table 'article'. i want to fetch an article information whose category_id is 4. But the result should contain all the records of its parent categories. for example: 'article1' has parent 'Sub Category1' and its parent is ...
TITLE: What will be the SQL query for this problem? QUESTION: I want to fetch some data from the following database table 'article'. i want to fetch an article information whose category_id is 4. But the result should contain all the records of its parent categories. for example: 'article1' has parent 'Sub Category1' ...
[ "sql" ]
5
4
238
4
0
2011-06-03T04:53:58.153000
2011-06-03T05:00:45.733000
6,223,102
6,223,132
is java byte the same as C# byte?
Native method from dll works in java if the input parameter is array of bytes - byte[]. If we use the same method from c# it throws EntryPointNotFoundException. Is that because of byte[] in java and c# are different things? and if it's so how should I use native function from c#?
Java lacks the unsigned types. In particular, Java lacks a primitive type for an unsigned byte. The Java byte type is signed, while the C# byte is unsigned and sbyte is signed.
is java byte the same as C# byte? Native method from dll works in java if the input parameter is array of bytes - byte[]. If we use the same method from c# it throws EntryPointNotFoundException. Is that because of byte[] in java and c# are different things? and if it's so how should I use native function from c#?
TITLE: is java byte the same as C# byte? QUESTION: Native method from dll works in java if the input parameter is array of bytes - byte[]. If we use the same method from c# it throws EntryPointNotFoundException. Is that because of byte[] in java and c# are different things? and if it's so how should I use native funct...
[ "c#", "java", "dll", "byte", "native" ]
13
16
10,619
4
0
2011-06-03T04:55:31.473000
2011-06-03T05:00:55.093000
6,223,111
6,223,178
Why can't subclasses create new objects with a base class protected constructor?
I'm porting some Java code to C#, and I ran into this idiom used to copy objects: class Base { int x; public Base(int x) { this.x = x; } protected Base(Base other) { x = other.x; } } class Derived: Base { Base foo; public Derived(Derived other): base(other) { foo = new Base(other.foo); // Error CS1540 } } Error CS1540...
its not accessible you can check this post for details: Many Questions: Protected Constructors
Why can't subclasses create new objects with a base class protected constructor? I'm porting some Java code to C#, and I ran into this idiom used to copy objects: class Base { int x; public Base(int x) { this.x = x; } protected Base(Base other) { x = other.x; } } class Derived: Base { Base foo; public Derived(Derived ...
TITLE: Why can't subclasses create new objects with a base class protected constructor? QUESTION: I'm porting some Java code to C#, and I ran into this idiom used to copy objects: class Base { int x; public Base(int x) { this.x = x; } protected Base(Base other) { x = other.x; } } class Derived: Base { Base foo; publi...
[ "c#", "inheritance", "constructor", "protected" ]
10
2
3,108
4
0
2011-06-03T04:57:43.463000
2011-06-03T05:07:15.280000
6,223,124
6,223,337
Resetting the View in Zend Action Helper
I am checking an ACL in the pre-dispatch method of an ACL Action Helper. If the action is-allowed, the controller/action should continue as per normal. (No problems there). If it's NOT allowed, however, I would like to: leave the requsted URI in the browser skip executing the requested action method generate an 'access...
This is most easily solved by simply throwing a Zend_Controller_Action_Exception, preferably with code 401 (Unauthorized). This will be caught by the error handler plugin and forwarded to the Error controller. You can then check for this error code and handle it appropriately. This is in my error controller if ($errors...
Resetting the View in Zend Action Helper I am checking an ACL in the pre-dispatch method of an ACL Action Helper. If the action is-allowed, the controller/action should continue as per normal. (No problems there). If it's NOT allowed, however, I would like to: leave the requsted URI in the browser skip executing the re...
TITLE: Resetting the View in Zend Action Helper QUESTION: I am checking an ACL in the pre-dispatch method of an ACL Action Helper. If the action is-allowed, the controller/action should continue as per normal. (No problems there). If it's NOT allowed, however, I would like to: leave the requsted URI in the browser ski...
[ "php", "zend-framework" ]
2
3
278
1
0
2011-06-03T04:59:47.303000
2011-06-03T05:30:48.013000
6,223,129
6,223,248
Advise on which is the better way of creating the database in android
I'm trying to create an app which synchronizes with the server to populate a list. However as I'm writing from scratch, I would want to at least populate some dummy data into it to test it out. Should I be populating it from a dummy server or should i try to populate it with a sqlite.db file first and insert it later o...
You can create new Sqlite file using SQlite manager and then use these links to copy that database in your application.First put the database (SQlite file)in assets folder and then copy it using method shown in these answers: Database not copying from assets adding your own SQLite database to an android application
Advise on which is the better way of creating the database in android I'm trying to create an app which synchronizes with the server to populate a list. However as I'm writing from scratch, I would want to at least populate some dummy data into it to test it out. Should I be populating it from a dummy server or should ...
TITLE: Advise on which is the better way of creating the database in android QUESTION: I'm trying to create an app which synchronizes with the server to populate a list. However as I'm writing from scratch, I would want to at least populate some dummy data into it to test it out. Should I be populating it from a dummy...
[ "android", "sqlite", "database-design" ]
0
0
256
3
0
2011-06-03T05:00:42.540000
2011-06-03T05:17:51.247000
6,223,137
6,223,241
Verifying ctypes type precision in Python
If an API expects a 64 bit type, how can I check that a ctypes type has that many bits if sizeof returns the number of bytes? How do I know how many bits are in each byte on the current platform? Where is CHAR_BIT defined in Python?
C/C++ function signatures are written with C/C++ types, like "int" or "double" or "uint32_t". All of these have corresponding ctypes equivalents, so normally you do not care about the number of bits. That said... import os print os.sysconf('SC_CHAR_BIT')...is about as close as you will get, I think. Does not work on no...
Verifying ctypes type precision in Python If an API expects a 64 bit type, how can I check that a ctypes type has that many bits if sizeof returns the number of bytes? How do I know how many bits are in each byte on the current platform? Where is CHAR_BIT defined in Python?
TITLE: Verifying ctypes type precision in Python QUESTION: If an API expects a 64 bit type, how can I check that a ctypes type has that many bits if sizeof returns the number of bytes? How do I know how many bits are in each byte on the current platform? Where is CHAR_BIT defined in Python? ANSWER: C/C++ function sig...
[ "python", "c", "limit", "ansi-c" ]
8
6
370
1
0
2011-06-03T05:02:05.530000
2011-06-03T05:16:56.343000
6,223,149
6,223,247
django post checkbox data
I'm using a checkbox form in my template and in my view im trying to check if the box has been checked or not I have the following code in my view: if request.POST['check'] == True: but then it throws an error if it is unchecked. How do i check if there is a value 'check' in my post data? Thanks
The Python docs are your friend: if request.POST.get('check', False):...do stuff... You could also do this ( more Python docs ): if "check" in request.POST:... do stuff...
django post checkbox data I'm using a checkbox form in my template and in my view im trying to check if the box has been checked or not I have the following code in my view: if request.POST['check'] == True: but then it throws an error if it is unchecked. How do i check if there is a value 'check' in my post data? Than...
TITLE: django post checkbox data QUESTION: I'm using a checkbox form in my template and in my view im trying to check if the box has been checked or not I have the following code in my view: if request.POST['check'] == True: but then it throws an error if it is unchecked. How do i check if there is a value 'check' in ...
[ "django", "django-forms" ]
15
24
19,596
2
0
2011-06-03T05:03:27.413000
2011-06-03T05:17:43.560000
6,223,153
6,223,265
MVC2 Model design related question
I am working in asp.net MVC2 application and I have question related to design of model. I have an edmx file which has all the entities. I have a viewmodel named whiteoutviewmodel which uses Three list of entities and three other collections like this: public class WhiteoutViewModel { public List Servers { get; set; } ...
I try and keep the view completely separate from anything related to Data Access and this includes anything generated by an ORM. What you want is to keep your views as dumb as possible. ViewModels are there to only give your view what it needs and in return, give you some information back about some possibly entered da...
MVC2 Model design related question I am working in asp.net MVC2 application and I have question related to design of model. I have an edmx file which has all the entities. I have a viewmodel named whiteoutviewmodel which uses Three list of entities and three other collections like this: public class WhiteoutViewModel {...
TITLE: MVC2 Model design related question QUESTION: I am working in asp.net MVC2 application and I have question related to design of model. I have an edmx file which has all the entities. I have a viewmodel named whiteoutviewmodel which uses Three list of entities and three other collections like this: public class W...
[ "asp.net", "entity-framework", "asp.net-mvc-2" ]
0
1
80
2
0
2011-06-03T05:04:00.993000
2011-06-03T05:19:54.723000
6,223,156
6,223,376
In a view how do I get the id of a join model in rails with a has_many through relationship?
If I have two modals joined with a has many two relationship, lets say (teams and players) and they are joined through (lineups) Is there a way to access the join model id (lineups_id) in the view after calling something like: @teams.players.each_with_index |players, index| do players.lineups_id end
As far as I know there's no way to do this. But it can be solved fairly easily by rearranging your code a bit. @team.lineups.includes(:player).each_with_index |lineup, index| do lineup.id lineup.player end The.includes(:player) isn't actually necessary but it will improve your performance by eager loading the players.
In a view how do I get the id of a join model in rails with a has_many through relationship? If I have two modals joined with a has many two relationship, lets say (teams and players) and they are joined through (lineups) Is there a way to access the join model id (lineups_id) in the view after calling something like: ...
TITLE: In a view how do I get the id of a join model in rails with a has_many through relationship? QUESTION: If I have two modals joined with a has many two relationship, lets say (teams and players) and they are joined through (lineups) Is there a way to access the join model id (lineups_id) in the view after callin...
[ "ruby-on-rails", "has-many-through" ]
1
1
131
1
0
2011-06-03T05:04:25.090000
2011-06-03T05:38:20.580000
6,223,157
6,224,256
Is it possible to add the entire eclipse Plugin Project to a Eclipse RCP Application
I have developed an eclipse Plugin Project with SampleFormPage with multiple forms with using formtoolkit and formPage. Now I want to change the scenario of the project and want to change the eclipse Plugin project to Eclipse RCP standalone application. Is it possible to do? If yes, what all the measures I should keep ...
Yes, it is possible to create an RCP application based on a plugin. After all, writing an RCP app basically amounts to writing a set of plugins for the platform. Take a look at this tutorial.
Is it possible to add the entire eclipse Plugin Project to a Eclipse RCP Application I have developed an eclipse Plugin Project with SampleFormPage with multiple forms with using formtoolkit and formPage. Now I want to change the scenario of the project and want to change the eclipse Plugin project to Eclipse RCP stand...
TITLE: Is it possible to add the entire eclipse Plugin Project to a Eclipse RCP Application QUESTION: I have developed an eclipse Plugin Project with SampleFormPage with multiple forms with using formtoolkit and formPage. Now I want to change the scenario of the project and want to change the eclipse Plugin project to...
[ "eclipse", "eclipse-plugin", "eclipse-rcp" ]
3
2
188
1
0
2011-06-03T05:04:29.973000
2011-06-03T07:33:12.410000
6,223,161
6,223,269
Why is my SQL Server ORDER BY slow despite the ordered column being indexed?
I have an SQL query (generated by LINQ to Entities) which is roughly like the following: SELECT * FROM [mydb].[dbo].[employees] JOIN [mydb].[dbo].[industry] ON jobs.industryId = industry.id JOIN [mydb].[dbo].[state] ON jobs.stateId = state.id JOIN [mydb].[dbo].[positionType] ON jobs.positionTypeId = positionType.id JOI...
If your query does not contain an order by then it will return the data in whatever order it was found. There is no guarantee that the data will even be returned in the same order when you run the query again. When you include an order by clause, the database has to build a list of the rows in the correct order and the...
Why is my SQL Server ORDER BY slow despite the ordered column being indexed? I have an SQL query (generated by LINQ to Entities) which is roughly like the following: SELECT * FROM [mydb].[dbo].[employees] JOIN [mydb].[dbo].[industry] ON jobs.industryId = industry.id JOIN [mydb].[dbo].[state] ON jobs.stateId = state.id ...
TITLE: Why is my SQL Server ORDER BY slow despite the ordered column being indexed? QUESTION: I have an SQL query (generated by LINQ to Entities) which is roughly like the following: SELECT * FROM [mydb].[dbo].[employees] JOIN [mydb].[dbo].[industry] ON jobs.industryId = industry.id JOIN [mydb].[dbo].[state] ON jobs.s...
[ "sql", "sql-server", "sql-server-2005", "linq-to-entities" ]
23
20
54,330
5
0
2011-06-03T05:04:46.477000
2011-06-03T05:20:50.377000
6,223,166
6,224,370
Create new ChannelFactory<T> when Faulted
What would be the most reliable way of recreating a ChannelFactory in a thread safe manner when it enters a faulted state? This scenario has expected concurrency (let's say 50 concurrent clients for the sake of argument). I would like to know some recommended approaches/thoughts/opinions for achieving this goal (or an ...
How do you think this solution will help you? You will lock the section so that only one thread can go into that section and check if ChannelFactory is faulted and recreate it but the instance for channel factory is shared - you return it from the property so: If you make a check and create the instance the other threa...
Create new ChannelFactory<T> when Faulted What would be the most reliable way of recreating a ChannelFactory in a thread safe manner when it enters a faulted state? This scenario has expected concurrency (let's say 50 concurrent clients for the sake of argument). I would like to know some recommended approaches/thought...
TITLE: Create new ChannelFactory<T> when Faulted QUESTION: What would be the most reliable way of recreating a ChannelFactory in a thread safe manner when it enters a faulted state? This scenario has expected concurrency (let's say 50 concurrent clients for the sake of argument). I would like to know some recommended ...
[ "c#", "multithreading", "wcf", "thread-safety", "channelfactory" ]
1
4
4,786
2
0
2011-06-03T05:05:16.807000
2011-06-03T07:47:49.407000
6,223,177
6,223,329
How to create image from silverlight control or its part?
I would like to save up my current form (actually its part, a specific kind of crop image) look and use it as image on another silverlight control/page (dynamiccally and programatically obviously) I have found a question here about this which is 2 years old and its answered there is no way to do so in SL2.0 Silverlight...
Use the WriteableBitmap class. int PreviewWidth = 200; int PreviewHeight = 200; var writeableBitmap = new WriteableBitmap(PreviewWidth, PreviewHeight); writeableBitmap.Render(, null); writeableBitmap.Invalidate();
How to create image from silverlight control or its part? I would like to save up my current form (actually its part, a specific kind of crop image) look and use it as image on another silverlight control/page (dynamiccally and programatically obviously) I have found a question here about this which is 2 years old and ...
TITLE: How to create image from silverlight control or its part? QUESTION: I would like to save up my current form (actually its part, a specific kind of crop image) look and use it as image on another silverlight control/page (dynamiccally and programatically obviously) I have found a question here about this which i...
[ "silverlight", "silverlight-4.0" ]
0
5
1,426
2
0
2011-06-03T05:07:02.570000
2011-06-03T05:30:14.973000
6,223,181
6,225,789
Javascript Date selector
I need the user to select his/her date of birth and I'm using javascript & php. var date_arr = new Array; var days_arr = new Array; date_arr[0]=new Option("January",31); date_arr[1]=new Option("February",28); date_arr[2]=new Option("March",31); date_arr[3]=new Option("April",30); date_arr[4]=new Option("May",31); date...
You might want to safe yourself from the hassle of calculating the leap years and all, and use the jQuery UI datepicker instead. Because the value of the options are used when you hit 'submit', you do not want the month values to contain their number of days (28, 30, 31), but their actual number instead (1-12). So chan...
Javascript Date selector I need the user to select his/her date of birth and I'm using javascript & php. var date_arr = new Array; var days_arr = new Array; date_arr[0]=new Option("January",31); date_arr[1]=new Option("February",28); date_arr[2]=new Option("March",31); date_arr[3]=new Option("April",30); date_arr[4]=n...
TITLE: Javascript Date selector QUESTION: I need the user to select his/her date of birth and I'm using javascript & php. var date_arr = new Array; var days_arr = new Array; date_arr[0]=new Option("January",31); date_arr[1]=new Option("February",28); date_arr[2]=new Option("March",31); date_arr[3]=new Option("April",...
[ "javascript", "datepicker" ]
0
0
681
1
0
2011-06-03T05:07:44.747000
2011-06-03T10:18:34.080000
6,223,185
6,223,221
PHP preg_match UUID v4
I've got a string that contains UUID v4 $uuid = 'http://domain.com/images/123/b85066fc-248f-4ea9-b13d-0858dbf4efc1_small.jpg'; How would i get the b85066fc-248f-4ea9-b13d-0858dbf4efc1 value from the above using preg_match()? More info on UUID v4 can be be found here
$uuid = 'http://domain.com/images/123/b85066fc-248f-4ea9-b13d-0858dbf4efc1_small.jpg'; preg_match('!/images/\d+/([a-z0-9\-]*)_!i', $uuid, $m); And preg_match('/[a-f0-9]{8}\-[a-f0-9]{4}\-4[a-f0-9]{3}\-(8|9|a|b)[a-f0-9]{3‌​}\-[a-f0-9]{12}/', $uuid, $m); works too. Taken from here, but I don't know if we can rely on that.
PHP preg_match UUID v4 I've got a string that contains UUID v4 $uuid = 'http://domain.com/images/123/b85066fc-248f-4ea9-b13d-0858dbf4efc1_small.jpg'; How would i get the b85066fc-248f-4ea9-b13d-0858dbf4efc1 value from the above using preg_match()? More info on UUID v4 can be be found here
TITLE: PHP preg_match UUID v4 QUESTION: I've got a string that contains UUID v4 $uuid = 'http://domain.com/images/123/b85066fc-248f-4ea9-b13d-0858dbf4efc1_small.jpg'; How would i get the b85066fc-248f-4ea9-b13d-0858dbf4efc1 value from the above using preg_match()? More info on UUID v4 can be be found here ANSWER: $uu...
[ "php", "preg-match", "uuid" ]
15
22
16,283
4
0
2011-06-03T05:08:23.620000
2011-06-03T05:12:50.013000
6,223,191
6,223,347
Dealing With Asynchronous Signals In Multi Threaded Program
The Linux Programming Interface Book has mentioned a method for dealing with asynchronous signals in a multi threaded program: All threads block all of the asynchronous signals that the process might receive. The simplest way to do this is to block the signals in the main thread before any other thread are created. Eac...
When the kernel delivers a process-directed signal, it chooses one of the threads that does not have the signal blocked. This means that it never chooses any of the threads apart from the signal-handling thread (which acts like it has the signal unblocked while it is blocked in sigwaitinfo() or similar). In other words...
Dealing With Asynchronous Signals In Multi Threaded Program The Linux Programming Interface Book has mentioned a method for dealing with asynchronous signals in a multi threaded program: All threads block all of the asynchronous signals that the process might receive. The simplest way to do this is to block the signals...
TITLE: Dealing With Asynchronous Signals In Multi Threaded Program QUESTION: The Linux Programming Interface Book has mentioned a method for dealing with asynchronous signals in a multi threaded program: All threads block all of the asynchronous signals that the process might receive. The simplest way to do this is to...
[ "c", "multithreading", "pthreads", "signals" ]
13
9
5,053
3
0
2011-06-03T05:08:59.740000
2011-06-03T05:32:01.947000
6,223,192
6,225,625
Load UIView Dynamically from several dll files
I have a Navigation controller in my project. now I want to load views from different dll files, and add them into the Navigation Controller. I am not sure it is possible or not. If possible how could I do this? how could I create the separate dll for each View? Please note that I am using Monotouch and C#.
Create a MonoTouch Library project and create your UIViews there using code (not with interface builder, it will not work) Then, from an other project, add a reference to the library you created and add the views to the navigation controller.
Load UIView Dynamically from several dll files I have a Navigation controller in my project. now I want to load views from different dll files, and add them into the Navigation Controller. I am not sure it is possible or not. If possible how could I do this? how could I create the separate dll for each View? Please not...
TITLE: Load UIView Dynamically from several dll files QUESTION: I have a Navigation controller in my project. now I want to load views from different dll files, and add them into the Navigation Controller. I am not sure it is possible or not. If possible how could I do this? how could I create the separate dll for eac...
[ "c#", "uiview", "uinavigationcontroller", "xamarin.ios", "dynamic-loading" ]
0
0
151
2
0
2011-06-03T05:09:08.840000
2011-06-03T10:03:29.137000
6,223,200
6,223,312
Multithreading causes UITableView to trip out on selection
I am trying to implement the UIActivityIndicator as an accessory view inside of a UITableView when a user selects a cell but sometimes it bugs out when the user selects something. Right now my pseudocode is like this: User selects cell Cell sets accessory view Calls exhaustive method in background thread In background ...
Without code, hard to say precisely what is going on. The question, though, indicates what is most likely; you are manipulating UIKit state from a thread in a fashion that isn't supported. In general, any manipulation of the UI must be done in the main thread unless explicitly documented as being safe to do from a back...
Multithreading causes UITableView to trip out on selection I am trying to implement the UIActivityIndicator as an accessory view inside of a UITableView when a user selects a cell but sometimes it bugs out when the user selects something. Right now my pseudocode is like this: User selects cell Cell sets accessory view ...
TITLE: Multithreading causes UITableView to trip out on selection QUESTION: I am trying to implement the UIActivityIndicator as an accessory view inside of a UITableView when a user selects a cell but sometimes it bugs out when the user selects something. Right now my pseudocode is like this: User selects cell Cell se...
[ "objective-c", "multithreading", "uitableview", "uiactivityindicatorview" ]
0
1
183
1
0
2011-06-03T05:10:51.557000
2011-06-03T05:27:57.370000
6,223,206
6,223,343
Default login to rails application
I'm using devise gem for login functionality in my Rails3 application.The gem as provides functionality for login along with sign up & sign out.I want to change this functionality and implement a default login only for the admin with no sign up.I cannot figure out what changes to be made..Do reply if any queries.. Than...
If you want to disable sign_up you should be able to just not pass the:registerable parameter to the devise method in your User model. class User < ActiveModel::Base devise:database_authenticatable,:rememberable,:trackable #,:registerable end
Default login to rails application I'm using devise gem for login functionality in my Rails3 application.The gem as provides functionality for login along with sign up & sign out.I want to change this functionality and implement a default login only for the admin with no sign up.I cannot figure out what changes to be m...
TITLE: Default login to rails application QUESTION: I'm using devise gem for login functionality in my Rails3 application.The gem as provides functionality for login along with sign up & sign out.I want to change this functionality and implement a default login only for the admin with no sign up.I cannot figure out wh...
[ "ruby-on-rails", "authentication", "devise" ]
1
3
325
1
0
2011-06-03T05:11:22.663000
2011-06-03T05:31:35.060000
6,223,207
6,223,297
jQuery how to split today's date from input into month, day, year when datepicker NOT used
I have a datepicker input that is populated with today's date when the page loads. When datepicker is used, the date is split into month, day, and year and put into three hidden fields that are sent to the sever with the post data. The problem comes when the user decides today's date is fine and doesn't use the datepic...
Split out your onSelect() functionality into a separate function, which can them be called twice. Having the same function performing both tasks allows you to deal with any changes to your functionality or HTML structure. so... $(function() { function populateHidden(dateText){ var pieces = dateText.split("/"); $("#CID"...
jQuery how to split today's date from input into month, day, year when datepicker NOT used I have a datepicker input that is populated with today's date when the page loads. When datepicker is used, the date is split into month, day, and year and put into three hidden fields that are sent to the sever with the post dat...
TITLE: jQuery how to split today's date from input into month, day, year when datepicker NOT used QUESTION: I have a datepicker input that is populated with today's date when the page loads. When datepicker is used, the date is split into month, day, and year and put into three hidden fields that are sent to the sever...
[ "jquery", "datepicker" ]
1
4
21,889
2
0
2011-06-03T05:11:26.553000
2011-06-03T05:25:49.187000
6,223,210
6,223,353
How to retrieve the colour list to set at run time
I am new to I-Phone application development.I am facing an problem. I like to change the colour of text at run time. I have an button I like to retrieve all the colour option as an TableView.After choosing the colour from the table the colour of text should change automatically.. How to retrieve the colour list to ente...
I'm pretty sure there isn't a way to get the list of colors automatically. You need to make an NSArray and fill it yourself with whichever colors you want. If you want to attach each color a name, either create a class (let's call this NamedColor ) with UIColor *color; NSString *name; and add the class components into ...
How to retrieve the colour list to set at run time I am new to I-Phone application development.I am facing an problem. I like to change the colour of text at run time. I have an button I like to retrieve all the colour option as an TableView.After choosing the colour from the table the colour of text should change auto...
TITLE: How to retrieve the colour list to set at run time QUESTION: I am new to I-Phone application development.I am facing an problem. I like to change the colour of text at run time. I have an button I like to retrieve all the colour option as an TableView.After choosing the colour from the table the colour of text ...
[ "objective-c" ]
0
1
175
1
0
2011-06-03T05:11:38.217000
2011-06-03T05:32:58.370000
6,223,217
6,223,257
Is it possible to have a dynamic select clause columns defined by a subselect?
For example SELECT (SELECT col_name FROM column_names WHERE col_id = 1) FROM my_table It returns the value of col_name instead of the value of table.col_name e.g. if col_name is x1 then the above select will return "x1" instead of the value of SELECT x1 FROM my_table Is there a way to do it in Microsoft SQL Sever 2008?...
In SQL Server you can use dynamic SQL, something like this: declare @TableName sysname = quotename('Test') declare @ColumnList varchar(max) select @ColumnList = isnull(@ColumnList + ', ', '') + quotename(name) from sys.columns where object_name(object_id) = @TableName declare @SqlCommand varchar(max) = 'select ' + @...
Is it possible to have a dynamic select clause columns defined by a subselect? For example SELECT (SELECT col_name FROM column_names WHERE col_id = 1) FROM my_table It returns the value of col_name instead of the value of table.col_name e.g. if col_name is x1 then the above select will return "x1" instead of the value ...
TITLE: Is it possible to have a dynamic select clause columns defined by a subselect? QUESTION: For example SELECT (SELECT col_name FROM column_names WHERE col_id = 1) FROM my_table It returns the value of col_name instead of the value of table.col_name e.g. if col_name is x1 then the above select will return "x1" ins...
[ "sql", "sql-server-2008", "oracle11g", "subquery" ]
4
2
2,083
4
0
2011-06-03T05:12:39.020000
2011-06-03T05:19:02.443000
6,223,223
6,223,267
Wait! which config file? (Entity Framework Connection String)
So, I created my entity model in a separate class library. I had to add the connection string to the app.config file of that class library. Then I added a ref for that project in my web application. I added the same connection string in the web.config of my web application thinking this is where Entity Framework will b...
We ran into the same situation. I've asked each developer to only ever compile the EF assembly with the first connection string selected. This way, when deployed, only one connection string is needed in the web.config. Eventually, if each development machine and deployment server has the correct connection information ...
Wait! which config file? (Entity Framework Connection String) So, I created my entity model in a separate class library. I had to add the connection string to the app.config file of that class library. Then I added a ref for that project in my web application. I added the same connection string in the web.config of my ...
TITLE: Wait! which config file? (Entity Framework Connection String) QUESTION: So, I created my entity model in a separate class library. I had to add the connection string to the app.config file of that class library. Then I added a ref for that project in my web application. I added the same connection string in the...
[ ".net", "entity-framework", "connection-string", "entity-framework-4.1" ]
18
12
8,671
1
0
2011-06-03T05:12:53.757000
2011-06-03T05:20:24.100000
6,223,229
6,223,252
IQueryable return type with Lambda statements
i am facing problem with the return type for this function and not really getting anywhere near solving can someone help me with this? here goes the function, public IQueryable >> GetDiscussion_categoriesWithBoards() { return GetDiscussion_categories().Select(c => new { Category = c, Boards = GetDiscussion_boardsByCate...
Since you're calling ToDictionary(), your method returns a Dictionary<>, not an IQueryable<>: public Dictionary > GetDiscussion_categoriesWithBoards() { //... } If you absolutely want to return an IQueryable<> you can write something like: public IQueryable >> GetDiscussion_categoriesWithBoards() { return new[] { GetDi...
IQueryable return type with Lambda statements i am facing problem with the return type for this function and not really getting anywhere near solving can someone help me with this? here goes the function, public IQueryable >> GetDiscussion_categoriesWithBoards() { return GetDiscussion_categories().Select(c => new { Cat...
TITLE: IQueryable return type with Lambda statements QUESTION: i am facing problem with the return type for this function and not really getting anywhere near solving can someone help me with this? here goes the function, public IQueryable >> GetDiscussion_categoriesWithBoards() { return GetDiscussion_categories().Sel...
[ "c#", "silverlight", "lambda", "iqueryable", "return-type" ]
1
3
270
5
0
2011-06-03T05:14:40.373000
2011-06-03T05:18:22.883000
6,223,232
6,223,289
Android: Imageview showing an image according to edittext option
I have 10 animal images in my res/drawable folder and I want to show the images one by one according to the edit text options. I mean in the edit text when we enter our weight, according to the range of the weight (if weight is between 60-70 image view shows tiger) for each weight Image view shows different animal (acc...
As per your Edittext value you can pass that value in below function private void displayImg(int value){ ImageView im = (ImageView)findViewById(R.id.img1); if (value >= 0 && value < 10){ im.setBackgroundResource(R.drawable.animal1); }else if (value >=10 && value <20){ im.setBackgroundResource(R.drawable.animal2); }.......
Android: Imageview showing an image according to edittext option I have 10 animal images in my res/drawable folder and I want to show the images one by one according to the edit text options. I mean in the edit text when we enter our weight, according to the range of the weight (if weight is between 60-70 image view sh...
TITLE: Android: Imageview showing an image according to edittext option QUESTION: I have 10 animal images in my res/drawable folder and I want to show the images one by one according to the edit text options. I mean in the edit text when we enter our weight, according to the range of the weight (if weight is between 6...
[ "android", "imageview", "android-edittext" ]
1
2
362
2
0
2011-06-03T05:15:29.407000
2011-06-03T05:24:21.937000
6,223,235
6,223,250
javascript converting and exploding string to number
What can I use to convert this string into a number? "$148,326.00" I am guessing that I need to explode it and take the dollar sign off, and then use parseFloat()? Would that be the wisest way? This is how I am getting the number: var homestead = xmlDoc.getElementsByTagName("sc2cash"); document.getElementById('num1').i...
You need to remove the dollar signs and commas, (string replace), then convert to a float value Try this: parseFloat('$148,326.00'.replace(/\$|,/g, '')) See: http://www.w3schools.com/jsref/jsref_parseFloat.asp Or: http://www.bradino.com/javascript/string-replace/ To handle other currency symbols you could use the follo...
javascript converting and exploding string to number What can I use to convert this string into a number? "$148,326.00" I am guessing that I need to explode it and take the dollar sign off, and then use parseFloat()? Would that be the wisest way? This is how I am getting the number: var homestead = xmlDoc.getElementsBy...
TITLE: javascript converting and exploding string to number QUESTION: What can I use to convert this string into a number? "$148,326.00" I am guessing that I need to explode it and take the dollar sign off, and then use parseFloat()? Would that be the wisest way? This is how I am getting the number: var homestead = xm...
[ "javascript" ]
8
30
11,992
4
0
2011-06-03T05:15:33.973000
2011-06-03T05:18:12.400000
6,223,237
6,223,629
How can I import and parse unicode text files with standard C stream in iPhone app?
I made multi-language unicode files and tried to use it in my app, but failed. I tried fgets and fgetws, and saved text file to various encodings(ex: UTF-8, ASCII, Unicode, Unicode(BE)) but no use. Please tell me how to import unicode text files in iPhone app.
Is there any reason to stick to C API's? Also, its tricky to rely on wchar (and wide char functions) for Unicode support on different platforms (you shall be warned about this in Unicode specifications "Section 5.2 of Unicode specifications" http://www.unicode.org/versions/Unicode6.0.0/ch05.pdf ). If reading Unicode is...
How can I import and parse unicode text files with standard C stream in iPhone app? I made multi-language unicode files and tried to use it in my app, but failed. I tried fgets and fgetws, and saved text file to various encodings(ex: UTF-8, ASCII, Unicode, Unicode(BE)) but no use. Please tell me how to import unicode t...
TITLE: How can I import and parse unicode text files with standard C stream in iPhone app? QUESTION: I made multi-language unicode files and tried to use it in my app, but failed. I tried fgets and fgetws, and saved text file to various encodings(ex: UTF-8, ASCII, Unicode, Unicode(BE)) but no use. Please tell me how t...
[ "iphone", "objective-c", "parsing", "text", "unicode" ]
0
1
1,008
1
0
2011-06-03T05:16:12.667000
2011-06-03T06:16:28.107000
6,223,240
6,251,309
After importing into eclipse using eGit, can't compile and run. What do I do?
After importing a standard.java file into Eclipse using Git, I tried to compile and run the file. Eclipse gave me this error: "Unable to launch: The selection cannot be launched, and there are no recent launches." What do I do?
You must make sure your java code is in a java project. If the git source builds from ant, there is a "File>New>Other..>Java project from ant build file". Otherwise you need to create a java project in eclipse and then 1) import the source into the proj /src directory or 2) create a linked folder in eclipse that points...
After importing into eclipse using eGit, can't compile and run. What do I do? After importing a standard.java file into Eclipse using Git, I tried to compile and run the file. Eclipse gave me this error: "Unable to launch: The selection cannot be launched, and there are no recent launches." What do I do?
TITLE: After importing into eclipse using eGit, can't compile and run. What do I do? QUESTION: After importing a standard.java file into Eclipse using Git, I tried to compile and run the file. Eclipse gave me this error: "Unable to launch: The selection cannot be launched, and there are no recent launches." What do I ...
[ "java", "eclipse" ]
6
5
6,109
3
0
2011-06-03T05:16:50.410000
2011-06-06T11:24:52.113000
6,223,243
6,223,495
Haskell mutable Heap structure
I want to make my heap data structure. Also i want to make operations with it in STM monad in multi-threaded application. The heap have size of 10 millions of elements. There are many operations on heap. I have looked on this packages http://hackage.haskell.org/package/heap http://hackage.haskell.org/package/heaps As i...
As Ankur points out, you may be outside the bounds of the pure functional side of Haskell. At least I have never seen a pure extract-min data structure with good memory performance -- don't take that to mean there isn't one. Have you profiled the existing libraries to make sure that they are not adequate for your needs...
Haskell mutable Heap structure I want to make my heap data structure. Also i want to make operations with it in STM monad in multi-threaded application. The heap have size of 10 millions of elements. There are many operations on heap. I have looked on this packages http://hackage.haskell.org/package/heap http://hackage...
TITLE: Haskell mutable Heap structure QUESTION: I want to make my heap data structure. Also i want to make operations with it in STM monad in multi-threaded application. The heap have size of 10 millions of elements. There are many operations on heap. I have looked on this packages http://hackage.haskell.org/package/h...
[ "haskell", "functional-programming", "heap", "mutable" ]
2
2
591
2
0
2011-06-03T05:17:12.807000
2011-06-03T05:57:19.760000
6,223,249
6,223,443
How to determine closest, largest city name with Android?
I was wondering how I would go about getting the closest city name based on the phones current location or IP address on an Android device. I'm open to using other APIs in order to translate GPS coordinates or IP addresses to city names. What is the best method to do this? (I'm not using the Google Maps front end but I...
You can us the GeoCoder which is avalilable in android.location.Geocoder package. The JavaDocs are here JavaDocs here Sample Code List list = geoCoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); if (list!= null & list.size() > 0) { Address address = list.get(0); result = address.getLocality(); ...
How to determine closest, largest city name with Android? I was wondering how I would go about getting the closest city name based on the phones current location or IP address on an Android device. I'm open to using other APIs in order to translate GPS coordinates or IP addresses to city names. What is the best method ...
TITLE: How to determine closest, largest city name with Android? QUESTION: I was wondering how I would go about getting the closest city name based on the phones current location or IP address on an Android device. I'm open to using other APIs in order to translate GPS coordinates or IP addresses to city names. What i...
[ "android", "location" ]
3
4
2,422
1
0
2011-06-03T05:17:53.350000
2011-06-03T05:48:47.083000
6,223,258
6,223,307
can I set a regexp for an object's method/property selector?
var regxp = /[\S]/; //any char, not sure if it's /.*/ or something else var obj = { atr1: "bla" } var blahs = obj[regxp]; //returns atr1 I'm looking for a shortcut to get methods/properties names from an object, because for..in is slow compared to a for loop for instance. I want this for a special case when I know the ...
Yes, you can try to access a property of an object using a regular expression but no, it won't do what you want: it will convert the regex into a string and use that property name. The only way to find a property name on an object by matching a regular expression is a for... in loop, like you mentioned. The performance...
can I set a regexp for an object's method/property selector? var regxp = /[\S]/; //any char, not sure if it's /.*/ or something else var obj = { atr1: "bla" } var blahs = obj[regxp]; //returns atr1 I'm looking for a shortcut to get methods/properties names from an object, because for..in is slow compared to a for loop ...
TITLE: can I set a regexp for an object's method/property selector? QUESTION: var regxp = /[\S]/; //any char, not sure if it's /.*/ or something else var obj = { atr1: "bla" } var blahs = obj[regxp]; //returns atr1 I'm looking for a shortcut to get methods/properties names from an object, because for..in is slow compa...
[ "javascript", "regex", "object", "methods", "properties" ]
5
7
8,354
3
0
2011-06-03T05:19:07.237000
2011-06-03T05:27:17.063000
6,223,281
6,249,459
Autocompleter for Mootools to set multiple form values
I need a Mootools based autocompleter that retrieves data by ajax, and will fill in multiple form input elements when an option is selected. I.E, a user searches for "foo", and one of the options might be "foobar", which has associated with it the variables objecttype AND objectid, both of which need to be set in the f...
You could use the Meio.Autocomplete's onSelect event with an identifier, that JSON encodes all of the needed properties. var data = [ {value: 'name1', identifier: { id: 'id1', type: 'type1' }},... } I made a quick example
Autocompleter for Mootools to set multiple form values I need a Mootools based autocompleter that retrieves data by ajax, and will fill in multiple form input elements when an option is selected. I.E, a user searches for "foo", and one of the options might be "foobar", which has associated with it the variables objectt...
TITLE: Autocompleter for Mootools to set multiple form values QUESTION: I need a Mootools based autocompleter that retrieves data by ajax, and will fill in multiple form input elements when an option is selected. I.E, a user searches for "foo", and one of the options might be "foobar", which has associated with it the...
[ "autocomplete", "mootools" ]
1
1
1,075
1
0
2011-06-03T05:22:37.587000
2011-06-06T08:34:40.443000
6,223,284
6,223,362
PHP force download of Amazon S3 link
I have the following code header("Content-Description: File Transfer"); header('Content-Type: audio/mp3'); header("Content-Disposition: attachment; filename=". $arrResults['audioLink']. ".mp3"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("...
Is the.mp3 extension really not part of the filename as it's stored on S3? You're appending.mp3 to the filename in the Content-Disposition header, but not the URL you're passing to readfile.
PHP force download of Amazon S3 link I have the following code header("Content-Description: File Transfer"); header('Content-Type: audio/mp3'); header("Content-Disposition: attachment; filename=". $arrResults['audioLink']. ".mp3"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'...
TITLE: PHP force download of Amazon S3 link QUESTION: I have the following code header("Content-Description: File Transfer"); header('Content-Type: audio/mp3'); header("Content-Disposition: attachment; filename=". $arrResults['audioLink']. ".mp3"); header('Expires: 0'); header('Cache-Control: must-revalidate, post-che...
[ "php", "amazon-s3", "download" ]
0
0
1,206
1
0
2011-06-03T05:23:04.100000
2011-06-03T05:35:30.550000
6,223,296
6,223,310
how to detect direction of shake in iphone
I have an image of a bottle, whenever user shakes the device i want to move that image in that direction. like up, down, left or right. For example: if user is shaking the device in left direction i want to move that image in left direction. i can detect shake event using - (void)motionEnded:(UIEventSubtype)motion with...
A shake is typically a back and forth movement. Use the accelerometer data to detect a sudden movement in one particular direction (e.g. left) or a tilt towards a different orientation.
how to detect direction of shake in iphone I have an image of a bottle, whenever user shakes the device i want to move that image in that direction. like up, down, left or right. For example: if user is shaking the device in left direction i want to move that image in left direction. i can detect shake event using - (v...
TITLE: how to detect direction of shake in iphone QUESTION: I have an image of a bottle, whenever user shakes the device i want to move that image in that direction. like up, down, left or right. For example: if user is shaking the device in left direction i want to move that image in left direction. i can detect shak...
[ "iphone", "objective-c", "ios4", "iphone-sdk-3.0" ]
1
2
1,594
2
0
2011-06-03T05:25:29.100000
2011-06-03T05:27:44.377000
6,223,300
6,223,391
how to populate mysql column value based on a formula?
I have created a mysql table with the following columns... item_price, discount, delivery_charge, grand_total The value of item_price, discount, and delivery_charge all vary depending on the item under consideration, and these would be filled into the table manually. I would like to have mysql populate the value in the...
Here's an example of a trigger that will work. Note that you'll need both update and insert triggers due to your "ad hoc update" requirements. delimiter ~ create trigger my_table_update before update on my_table for each row begin set new.grand_total = new.item_price - new.discount + new.delivery_charge; end~ create ...
how to populate mysql column value based on a formula? I have created a mysql table with the following columns... item_price, discount, delivery_charge, grand_total The value of item_price, discount, and delivery_charge all vary depending on the item under consideration, and these would be filled into the table manuall...
TITLE: how to populate mysql column value based on a formula? QUESTION: I have created a mysql table with the following columns... item_price, discount, delivery_charge, grand_total The value of item_price, discount, and delivery_charge all vary depending on the item under consideration, and these would be filled into...
[ "mysql", "formula", "calculated-field" ]
3
7
11,524
2
0
2011-06-03T05:26:05.830000
2011-06-03T05:41:00.707000
6,223,301
6,223,315
Is There A HTTP Client Class For Java (Android)?
I am currently writing a Android application. I need to connect to a internet web server, send username/password credentials and accept cookies from the server for use for subsequent requests to the same server. Do you know of a HTTP client class or anything I can use in the SDK that currently supports this?
DefaultHttpclient and HttpClient class are already there. You can use either one of this.
Is There A HTTP Client Class For Java (Android)? I am currently writing a Android application. I need to connect to a internet web server, send username/password credentials and accept cookies from the server for use for subsequent requests to the same server. Do you know of a HTTP client class or anything I can use in...
TITLE: Is There A HTTP Client Class For Java (Android)? QUESTION: I am currently writing a Android application. I need to connect to a internet web server, send username/password credentials and accept cookies from the server for use for subsequent requests to the same server. Do you know of a HTTP client class or any...
[ "java", "android", "http" ]
1
6
629
3
0
2011-06-03T05:26:07.247000
2011-06-03T05:28:11.363000
6,223,305
6,223,318
How can I encrypt userid and password from user?
I want to save userid and password in a MySql database for my WinForms project. One of my friends told me that this is not secure; I should encrypt and save that. I don't know about encryption. How can I do this?
Usually passwords are not stored in database at all. Instead hash of the password is stored. You can take a look at SHA156 class for example. There are plenty articles in the web on how to hash passwords. For example Storing Passwords - done right!
How can I encrypt userid and password from user? I want to save userid and password in a MySql database for my WinForms project. One of my friends told me that this is not secure; I should encrypt and save that. I don't know about encryption. How can I do this?
TITLE: How can I encrypt userid and password from user? QUESTION: I want to save userid and password in a MySql database for my WinForms project. One of my friends told me that this is not secure; I should encrypt and save that. I don't know about encryption. How can I do this? ANSWER: Usually passwords are not store...
[ "c#", ".net", "winforms", "security", "encryption" ]
5
5
4,120
5
0
2011-06-03T05:26:36.707000
2011-06-03T05:28:35.640000
6,223,317
6,223,435
Get the value of columns on Check_changed Event of checkbox in gridview
I have a grid view which contains date and time string in dataBound field and check box in item template field. Now when user check any check box, i want to make isChecked field of my data table(Which is data source for gridview and isCheck is added programatically) true/false accourdingly. How can I get date time stri...
You can do like... protected void CheckBox1_CheckedChanged(object sender, EventArgs e) { String Date = ((Label)((CheckBox)sender).Parent.FindControl("lblDate")).Text; }
Get the value of columns on Check_changed Event of checkbox in gridview I have a grid view which contains date and time string in dataBound field and check box in item template field. Now when user check any check box, i want to make isChecked field of my data table(Which is data source for gridview and isCheck is adde...
TITLE: Get the value of columns on Check_changed Event of checkbox in gridview QUESTION: I have a grid view which contains date and time string in dataBound field and check box in item template field. Now when user check any check box, i want to make isChecked field of my data table(Which is data source for gridview a...
[ "c#", ".net", "asp.net", "gridview", "checkbox" ]
3
2
2,776
1
0
2011-06-03T05:28:23.007000
2011-06-03T05:47:45.170000
6,223,320
6,223,463
android how to compare between simpleCursorAdapter and ArrayAdapter
I have an application. I want to optimize that one. how can i do that. For example I am using simpleCursorAdapter to bind listview and it fetch data from database. But if i retrieve data from cursor into an string array and then by using ArrayAdapter I can bind listview. So I want to know which one is the better one me...
Please try to test by your self. Have a look on the following steps to check performance difference Create a sample application where you write both of the technique. also print two print statements for displaying and free heap memory one statement before calling database second statement after creation of list view In...
android how to compare between simpleCursorAdapter and ArrayAdapter I have an application. I want to optimize that one. how can i do that. For example I am using simpleCursorAdapter to bind listview and it fetch data from database. But if i retrieve data from cursor into an string array and then by using ArrayAdapter I...
TITLE: android how to compare between simpleCursorAdapter and ArrayAdapter QUESTION: I have an application. I want to optimize that one. how can i do that. For example I am using simpleCursorAdapter to bind listview and it fetch data from database. But if i retrieve data from cursor into an string array and then by us...
[ "android" ]
0
3
1,243
1
0
2011-06-03T05:28:59.340000
2011-06-03T05:52:35.957000
6,223,325
6,250,700
Qlistview Selectionchanged event not found in Qt?
Qlistview Selectionchanged event not found in Qt What is the equivalent of selection changed event in Qlistview in Qt?
It's just about selection, so the focus? When using QListView: QAbstractItemView::currentChanged ( const QModelIndex & current, const QModelIndex & previous ) When using QListWidget, you can also use: QListWidget::currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) Docs: QListView::currentChang...
Qlistview Selectionchanged event not found in Qt? Qlistview Selectionchanged event not found in Qt What is the equivalent of selection changed event in Qlistview in Qt?
TITLE: Qlistview Selectionchanged event not found in Qt? QUESTION: Qlistview Selectionchanged event not found in Qt What is the equivalent of selection changed event in Qlistview in Qt? ANSWER: It's just about selection, so the focus? When using QListView: QAbstractItemView::currentChanged ( const QModelIndex & curre...
[ "qt", "qlistview" ]
8
3
9,746
2
0
2011-06-03T05:29:46.173000
2011-06-06T10:28:46.727000
6,223,330
6,223,361
Format not a string literal
I would appreciate understanding how to rewrite this line of code to eliminate the compiler warning. The code is: if (string == nil) [NSException raise:NSInvalidArgumentException format:nil]; The warning is: Format not a string literal and no format arguments. I found answers pertaining to NSLog, but not to NSException...
That error applies to anything which expects a format string. You simply need to replace nil with @"", as in: [NSException raise:NSInvalidArgumentException format:@""];
Format not a string literal I would appreciate understanding how to rewrite this line of code to eliminate the compiler warning. The code is: if (string == nil) [NSException raise:NSInvalidArgumentException format:nil]; The warning is: Format not a string literal and no format arguments. I found answers pertaining to N...
TITLE: Format not a string literal QUESTION: I would appreciate understanding how to rewrite this line of code to eliminate the compiler warning. The code is: if (string == nil) [NSException raise:NSInvalidArgumentException format:nil]; The warning is: Format not a string literal and no format arguments. I found answe...
[ "ios" ]
1
6
1,219
2
0
2011-06-03T05:30:18.127000
2011-06-03T05:35:20.650000
6,223,333
6,223,421
Please help me understand the "while" loop in this JavaScript snippet
I have seen a snippet like this for detecting IE in JavaScript using conditional comments. var ie = (function(){ var undef, v = 3, div = document.createElement('div'); // the while loop is used without an associated block: {} // so, only the condition within the () is executed. // semicolons arent allowed within the...
(Assuming I haven't bungled this up horribly) the while loop is equivalent to the following: var elt; do { v++; div.innerHTML = ' ' elt = div.getElementsByTagName('i')[0]; } (while elt); does mdc or any good ones cover this while(stmt1, stmt2) thing. Here's what MDC says about while: while (condition) statement condit...
Please help me understand the "while" loop in this JavaScript snippet I have seen a snippet like this for detecting IE in JavaScript using conditional comments. var ie = (function(){ var undef, v = 3, div = document.createElement('div'); // the while loop is used without an associated block: {} // so, only the condit...
TITLE: Please help me understand the "while" loop in this JavaScript snippet QUESTION: I have seen a snippet like this for detecting IE in JavaScript using conditional comments. var ie = (function(){ var undef, v = 3, div = document.createElement('div'); // the while loop is used without an associated block: {} // s...
[ "javascript", "code-snippets" ]
4
2
181
3
0
2011-06-03T05:30:25.240000
2011-06-03T05:46:11.727000
6,223,334
6,243,739
Sound implementation in Symbian^3
I am looking around to implement sound in my Symbian^3 game application. Are the examples of Symbian S60 work well for Symbian^3 devices? I am in doubt because syntax is different for S60 and Symbian^3. If anybody can provide me any link where I could find any method to implement sound in Symbian^3 application. Looking...
Have you looked at CMdaAudioPlayerUtility link. Although the link is to a 3rd ed doc, the Class remains mostly the same.
Sound implementation in Symbian^3 I am looking around to implement sound in my Symbian^3 game application. Are the examples of Symbian S60 work well for Symbian^3 devices? I am in doubt because syntax is different for S60 and Symbian^3. If anybody can provide me any link where I could find any method to implement sound...
TITLE: Sound implementation in Symbian^3 QUESTION: I am looking around to implement sound in my Symbian^3 game application. Are the examples of Symbian S60 work well for Symbian^3 devices? I am in doubt because syntax is different for S60 and Symbian^3. If anybody can provide me any link where I could find any method ...
[ "symbian", "implementation", "nokia", "audio" ]
2
0
82
1
0
2011-06-03T05:30:25.287000
2011-06-05T15:10:25.167000
6,223,348
6,223,619
Pass in an animation with ScrollTo?
When using the scrollTo function (a member of the slideView object), is it possible to pass in an animation as well so that I can control the speed of the scrolling and other pertinent variables? If not, what other options do I have?
Are you talking about a tableView.scrollToIndex in which the second property is the animation. Or are you talking about scrollView.scrollTo in which the properties are x, y? If it's this one then I don't believe there is a way to animate it using the scrollTo method.
Pass in an animation with ScrollTo? When using the scrollTo function (a member of the slideView object), is it possible to pass in an animation as well so that I can control the speed of the scrolling and other pertinent variables? If not, what other options do I have?
TITLE: Pass in an animation with ScrollTo? QUESTION: When using the scrollTo function (a member of the slideView object), is it possible to pass in an animation as well so that I can control the speed of the scrolling and other pertinent variables? If not, what other options do I have? ANSWER: Are you talking about a...
[ "uiscrollview", "titanium", "scrollto" ]
0
1
520
1
0
2011-06-03T05:32:23.660000
2011-06-03T06:13:59.403000