PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
4,084,204
11/03/2010 04:22:05
479,201
10/18/2010 10:44:29
61
11
How to make provisioning profile for iphone app?
Hi everyone i would like to know that how to make the provisioning profile for iphone app.I want to test my app on the device and i don't know what i need to do to make that possible to test the app.Please anyone can help me in the steps for that. Thanks in advance.
iphone
null
null
null
null
null
open
How to make provisioning profile for iphone app? === Hi everyone i would like to know that how to make the provisioning profile for iphone app.I want to test my app on the device and i don't know what i need to do to make that possible to test the app.Please anyone can help me in the steps for that. Thanks in advance.
0
8,746,631
01/05/2012 17:12:04
9,951
09/15/2008 20:34:12
47,122
447
What happen when I do git pull origin master in the develop branch?
Let's say I have a private topic branch called develop with 2 commits ahead of master. What does `git pull origin master` do ? Pull everything from the remote master in the local develop and merge it ? Pull everything in the local master branch and merge it ? And is there a way to update master from develop without `checkout master` before ?
git
pull
null
null
null
null
open
What happen when I do git pull origin master in the develop branch? === Let's say I have a private topic branch called develop with 2 commits ahead of master. What does `git pull origin master` do ? Pull everything from the remote master in the local develop and merge it ? Pull everything in the local master branch and merge it ? And is there a way to update master from develop without `checkout master` before ?
0
10,092,843
04/10/2012 16:40:16
1,295,913
03/27/2012 15:09:50
13
0
Sorting a list of tuples, where each tuple consists of a string and a set
I would like to take my list of tuples, where each tuple consists of a string and a set, and rearrange it so that it is sorted by the string with most entries in it's associated set first. Pointers on how to go about this?
python
sorting
set
tuples
null
04/11/2012 12:51:37
not a real question
Sorting a list of tuples, where each tuple consists of a string and a set === I would like to take my list of tuples, where each tuple consists of a string and a set, and rearrange it so that it is sorted by the string with most entries in it's associated set first. Pointers on how to go about this?
1
4,056,586
10/29/2010 23:51:03
485,680
10/24/2010 15:51:57
63
0
jQuery Edit in Place - Plugin
I wanted check-in with all the jQuery folks to see, whats the latest, best plugin for In Place Editing? I've used Jeditable way back when and figured there is likely something better by now as Jeditable doesn't appear to be maintained and it's a huge download (24kb+s?) Any suggestions? I'm using Rails 3, so hopefully it supports PUTs. Thanks!
jquery
ruby-on-rails
jquery-plugins
null
null
07/24/2012 00:57:19
not constructive
jQuery Edit in Place - Plugin === I wanted check-in with all the jQuery folks to see, whats the latest, best plugin for In Place Editing? I've used Jeditable way back when and figured there is likely something better by now as Jeditable doesn't appear to be maintained and it's a huge download (24kb+s?) Any suggestions? I'm using Rails 3, so hopefully it supports PUTs. Thanks!
4
1,339,148
08/27/2009 06:15:02
45,525
12/11/2008 21:55:35
31
2
Avoiding implicit def ambiguity in Scala
I am trying to create an implicit conversion from any type (say, Int) to a String... An implicit conversion to String means RichString methods (like reverse) are not available. implicit def intToString(i: Int) = String.valueOf(i) 100.toCharArray // => Array[Char] = Array(1, 0, 0) 100.reverse // => error: value reverse is not a member of Int 100.length // => 3 An implicit conversion to RichString means String methods (like toCharArray) are not available implicit def intToRichString(i: Int) = new RichString(String.valueOf(i)) 100.reverse // => "001" 100.toCharArray // => error: value toCharArray is not a member of Int 100.length // => 3 Using both implicit conversions means duplicated methods (like length) are ambiguous. implicit def intToString(i: Int) = String.valueOf(i) implicit def intToRichString(i: Int) = new RichString(String.valueOf(i)) 100.toCharArray // => Array[Char] = Array(1, 0, 0) 100.reverse // => "001" 100.length // => both method intToString in object $iw of type // (Int)java.lang.String and method intToRichString in object // $iw of type (Int)scala.runtime.RichString are possible // conversion functions from Int to ?{val length: ?} So, is it possible to implicitly convert to String and still support all String and RichString methods?
scala
implicit
string
ambiguous
null
null
open
Avoiding implicit def ambiguity in Scala === I am trying to create an implicit conversion from any type (say, Int) to a String... An implicit conversion to String means RichString methods (like reverse) are not available. implicit def intToString(i: Int) = String.valueOf(i) 100.toCharArray // => Array[Char] = Array(1, 0, 0) 100.reverse // => error: value reverse is not a member of Int 100.length // => 3 An implicit conversion to RichString means String methods (like toCharArray) are not available implicit def intToRichString(i: Int) = new RichString(String.valueOf(i)) 100.reverse // => "001" 100.toCharArray // => error: value toCharArray is not a member of Int 100.length // => 3 Using both implicit conversions means duplicated methods (like length) are ambiguous. implicit def intToString(i: Int) = String.valueOf(i) implicit def intToRichString(i: Int) = new RichString(String.valueOf(i)) 100.toCharArray // => Array[Char] = Array(1, 0, 0) 100.reverse // => "001" 100.length // => both method intToString in object $iw of type // (Int)java.lang.String and method intToRichString in object // $iw of type (Int)scala.runtime.RichString are possible // conversion functions from Int to ?{val length: ?} So, is it possible to implicitly convert to String and still support all String and RichString methods?
0
6,804,495
07/24/2011 01:54:12
679,414
03/27/2011 22:25:58
16
0
Scrape all search results from one URL that defaults to ten results
I am a student programmer working on project, where i wrote a php script to scrape the following page, http://gisjobs.com/search_results_jobs/?action=search&listing_type%5Bequal%5D=Job&keywords%5Blike%5D=&Country%5Bmulti_like%5D%5B%5D=United+States&State%5Bmulti_like%5D%5B%5D=&City%5Blike%5D=&Salary%5Bnot_less%5D=&Salary%5Bnot_more%5D=&SalaryType%5Bmulti_like%5D%5B%5D= ,that displays search results for us gis job postings and exports to xml to geocode and google map. However the results page defaults to 10 results per page. You can change the results to display 100 post search, enough to cover all the results by scraping one page. But when you change to display 100 results, the URL changes to this: http://gisjobs.com/search_results_jobs/?listings_per_page=100&restore=&page=1 ,which brings up a blank query when called from php. Is there a way to structure the URL to display all results (up to 100), so that only one page needs to be scraped? sry if this is super easy but i can't figure it out!
php
url
url-rewriting
null
null
11/10/2011 17:07:53
too localized
Scrape all search results from one URL that defaults to ten results === I am a student programmer working on project, where i wrote a php script to scrape the following page, http://gisjobs.com/search_results_jobs/?action=search&listing_type%5Bequal%5D=Job&keywords%5Blike%5D=&Country%5Bmulti_like%5D%5B%5D=United+States&State%5Bmulti_like%5D%5B%5D=&City%5Blike%5D=&Salary%5Bnot_less%5D=&Salary%5Bnot_more%5D=&SalaryType%5Bmulti_like%5D%5B%5D= ,that displays search results for us gis job postings and exports to xml to geocode and google map. However the results page defaults to 10 results per page. You can change the results to display 100 post search, enough to cover all the results by scraping one page. But when you change to display 100 results, the URL changes to this: http://gisjobs.com/search_results_jobs/?listings_per_page=100&restore=&page=1 ,which brings up a blank query when called from php. Is there a way to structure the URL to display all results (up to 100), so that only one page needs to be scraped? sry if this is super easy but i can't figure it out!
3
11,163,018
06/22/2012 19:40:39
1,053,821
11/18/2011 12:52:31
473
6
send id to another php file using JS
i write below code for sending id to another php file function selectCheckBox(k) { answer = confirm("Do you really want check?"); if(answer==true) { var e= document.Check.elements.length; var cnt=0; total=document.Check.elements[k].value; PostVar ="id="+total; alert(PostVar); makePostRequest("check.php",PostVar); } } in this code i got PostVar value as id=121 in check.php code is as shown require 'dbconnect.php'; $id=$_REQUEST['id']; $query="update members set status_admin='Yes' where userid='$id'"; $result=mysql_query($query); but results in the mysql table are not updated please guide me
php
javascript
mysql
null
null
null
open
send id to another php file using JS === i write below code for sending id to another php file function selectCheckBox(k) { answer = confirm("Do you really want check?"); if(answer==true) { var e= document.Check.elements.length; var cnt=0; total=document.Check.elements[k].value; PostVar ="id="+total; alert(PostVar); makePostRequest("check.php",PostVar); } } in this code i got PostVar value as id=121 in check.php code is as shown require 'dbconnect.php'; $id=$_REQUEST['id']; $query="update members set status_admin='Yes' where userid='$id'"; $result=mysql_query($query); but results in the mysql table are not updated please guide me
0
3,191,953
07/07/2010 04:35:44
148,222
07/31/2009 02:24:16
126
6
Getting ID of new record after insert
I'm just getting my head around insert statements today after getting sick of cheating with Dreamweaver's methods to do this for so long now (please don't laugh). One thing I'm trying to figure out is how to get the ID value of a newly inserted record so I can redirect the user to that page if successful. I have seen some examples which talk about stored procedures, but they're double dutch for me at the moment and I'm yet to learn about these, let alone how to use these from within my web pages. **Summary** How do I, using my code below retrieve the record ID for what the user has just inserted. **Workflow** Using a HTML form presented on an ASP page (add.asp), a user will submit new information which is inserted into a table of a database (treebay_transaction). On pressing submit, the form data is passed to another page (add_sql.asp) which takes the submitted data along with additional information, and inserts it into the required table. If the insert is successful, the id value of the new record (stored in the column `treebay_transaction_id`) needs to be extracted to use as part of a querystring before the user is redirected to a page showing the newly inserted record (view.asp?id=value). **Sample code - add_sql.asp** <!--#include virtual="/Connections/IntranetDB.asp" --> ... <html> <body> <% set conn = Server.CreateObject("ADODB.Connection") conn.ConnectionString = MM_IntranetDB_STRING conn.Open ConnectionString ... sql="INSERT INTO treebay_transaction (treebay_transaction_seller,treebay_transaction_start_date,treebay_transaction_expiry_date,treebay_transaction_title,treebay_transaction_transaction_type,treebay_transaction_category,treebay_transaction_description,treebay_transaction_status)" sql=sql & " VALUES " sql=sql & "('" & CurrentUser & "'," sql=sql & "'" & timestampCurrent & "'," sql=sql & "'" & timestampExpiry & "'," sql=sql & "'" & Request.Form("treebay_transaction_title") & "'," sql=sql & "'" & Request.Form("treebay_transaction_transaction_type") & "'," sql=sql & "'" & Request.Form("treebay_transaction_category") & "'," sql=sql & "'" & Request.Form("xhtml1") & "'," sql=sql & "'3')" on error resume next conn.Execute sql,recaffected if err<>0 then %> <h1>Error!</h1> <p> ...error text and diagnostics here... </p> <% else ' this is where I should be figuring out what the new record ID is recordID = ?? ' the X below represents where that value should be going Response.Redirect("index.asp?view.asp?id='" & recordID & "'") end if conn.close %> </body> </html>
tsql
asp-classic
ado
null
null
null
open
Getting ID of new record after insert === I'm just getting my head around insert statements today after getting sick of cheating with Dreamweaver's methods to do this for so long now (please don't laugh). One thing I'm trying to figure out is how to get the ID value of a newly inserted record so I can redirect the user to that page if successful. I have seen some examples which talk about stored procedures, but they're double dutch for me at the moment and I'm yet to learn about these, let alone how to use these from within my web pages. **Summary** How do I, using my code below retrieve the record ID for what the user has just inserted. **Workflow** Using a HTML form presented on an ASP page (add.asp), a user will submit new information which is inserted into a table of a database (treebay_transaction). On pressing submit, the form data is passed to another page (add_sql.asp) which takes the submitted data along with additional information, and inserts it into the required table. If the insert is successful, the id value of the new record (stored in the column `treebay_transaction_id`) needs to be extracted to use as part of a querystring before the user is redirected to a page showing the newly inserted record (view.asp?id=value). **Sample code - add_sql.asp** <!--#include virtual="/Connections/IntranetDB.asp" --> ... <html> <body> <% set conn = Server.CreateObject("ADODB.Connection") conn.ConnectionString = MM_IntranetDB_STRING conn.Open ConnectionString ... sql="INSERT INTO treebay_transaction (treebay_transaction_seller,treebay_transaction_start_date,treebay_transaction_expiry_date,treebay_transaction_title,treebay_transaction_transaction_type,treebay_transaction_category,treebay_transaction_description,treebay_transaction_status)" sql=sql & " VALUES " sql=sql & "('" & CurrentUser & "'," sql=sql & "'" & timestampCurrent & "'," sql=sql & "'" & timestampExpiry & "'," sql=sql & "'" & Request.Form("treebay_transaction_title") & "'," sql=sql & "'" & Request.Form("treebay_transaction_transaction_type") & "'," sql=sql & "'" & Request.Form("treebay_transaction_category") & "'," sql=sql & "'" & Request.Form("xhtml1") & "'," sql=sql & "'3')" on error resume next conn.Execute sql,recaffected if err<>0 then %> <h1>Error!</h1> <p> ...error text and diagnostics here... </p> <% else ' this is where I should be figuring out what the new record ID is recordID = ?? ' the X below represents where that value should be going Response.Redirect("index.asp?view.asp?id='" & recordID & "'") end if conn.close %> </body> </html>
0
3,093,728
06/22/2010 13:49:37
373,242
06/22/2010 13:49:36
1
0
File size limit for upload in Adobe Air
I am building an Adobe AIR app and integrated an FTP client for file transfers. But I found out that maximum file upload size is 100 MB. I need to transfer bigger files. Any suggestions or workarounds?
flex
ftp
air
null
null
null
open
File size limit for upload in Adobe Air === I am building an Adobe AIR app and integrated an FTP client for file transfers. But I found out that maximum file upload size is 100 MB. I need to transfer bigger files. Any suggestions or workarounds?
0
5,955,941
05/10/2011 20:17:37
187,854
10/11/2009 02:13:20
1,458
56
Does anyone know what happened to the official FastCGI website?
Ok, I know this is really off-topic (and down-vote me if you want for it), but I can't find anywhere else with a large enough group of programmers or general people in the know to ask this. Does anyone know what happened to the official FastCGI website? It's been replaced by the website of a New York charity (screenshot [here][1]) The reason I ask is because I was looking to download the FastCGI developer's kit they wrote, as well as read the FastCGI specification, but it's now all gone. If anyone has access to the latest FastCGI dev kit and the FastCGI specification, could you link it to me in the answers below? [1]: http://tinypic.com/r/4tlzic/7
fastcgi
null
null
null
null
05/11/2011 04:50:07
off topic
Does anyone know what happened to the official FastCGI website? === Ok, I know this is really off-topic (and down-vote me if you want for it), but I can't find anywhere else with a large enough group of programmers or general people in the know to ask this. Does anyone know what happened to the official FastCGI website? It's been replaced by the website of a New York charity (screenshot [here][1]) The reason I ask is because I was looking to download the FastCGI developer's kit they wrote, as well as read the FastCGI specification, but it's now all gone. If anyone has access to the latest FastCGI dev kit and the FastCGI specification, could you link it to me in the answers below? [1]: http://tinypic.com/r/4tlzic/7
2
11,149,190
06/22/2012 01:37:58
114,887
05/30/2009 19:44:38
590
4
Which Haskell compiler has the informative error messages?
I'm starting to learn Haskell and I've heard that many Haskell compilers have especially cryptic error messages. Which compiler would be the best for a beginner learning the language?
haskell
compiler-errors
null
null
null
06/22/2012 08:35:02
not constructive
Which Haskell compiler has the informative error messages? === I'm starting to learn Haskell and I've heard that many Haskell compilers have especially cryptic error messages. Which compiler would be the best for a beginner learning the language?
4
11,348,828
07/05/2012 16:42:26
1,426,327
05/30/2012 14:51:06
30
1
Python adding to a running total
I need to write a script with python that counts and adds it to a total. Fx: 1 + 2 + 3 + 4 etc. Any tips will be highly appreciated... i mean like i will give it a an integer (n) i'll need an x to keep the total. then i need a function to read n and if it fx is 5 the function will add 1 + 2 + 3 + 4 + 5 to x so x will be ecual to 15
python-3.x
null
null
null
null
07/05/2012 17:36:08
not a real question
Python adding to a running total === I need to write a script with python that counts and adds it to a total. Fx: 1 + 2 + 3 + 4 etc. Any tips will be highly appreciated... i mean like i will give it a an integer (n) i'll need an x to keep the total. then i need a function to read n and if it fx is 5 the function will add 1 + 2 + 3 + 4 + 5 to x so x will be ecual to 15
1
7,391,353
09/12/2011 17:03:11
113,124
05/27/2009 12:28:44
6,125
44
How to run a script and not wait for it in Perl?
I have a system call in Perl that looks like this: system('/path/to/utility >> /redirect/to/log file'); But this waits for `utility` to complete. I just want to trigger this and let the Perl script finish irrespective of whether the `utility` call finished or not. **How can I do this?** I tried changing the line to system('/path/to/utility >> /redirect/to/log file &'); but this syntax still waits for the call to finish on Windows. I need to make it work on Linux as well as Windows.
perl
cross-platform
platform-independent
null
null
null
open
How to run a script and not wait for it in Perl? === I have a system call in Perl that looks like this: system('/path/to/utility >> /redirect/to/log file'); But this waits for `utility` to complete. I just want to trigger this and let the Perl script finish irrespective of whether the `utility` call finished or not. **How can I do this?** I tried changing the line to system('/path/to/utility >> /redirect/to/log file &'); but this syntax still waits for the call to finish on Windows. I need to make it work on Linux as well as Windows.
0
9,319,456
02/16/2012 21:35:53
1,192,472
02/06/2012 14:13:48
6
0
HTML Input (Javascript)
please help me I have a script which works on First Page Load, And when i use the function of this script again is doesn't work until i refresh the page, Means i want this script to work always, Not only when i will refresh the page, here is the script: ------------------- $(function(){ var fullEmail = $('#email').val(); console.log(fullEmail.length); if(fullEmail.length>15) { textDot = fullEmail.substr(0, 14)+'...'; $('#email').val(textDot); } var oldText = $('#email').val(); $('#email').bind({ mouseover : function () { $('#email').val(fullEmail); }, mouseout: function () { $('#email').val(oldText); } }); }); ------------------- thanks in advance..
javascript
jquery
html
null
null
02/18/2012 03:37:16
not a real question
HTML Input (Javascript) === please help me I have a script which works on First Page Load, And when i use the function of this script again is doesn't work until i refresh the page, Means i want this script to work always, Not only when i will refresh the page, here is the script: ------------------- $(function(){ var fullEmail = $('#email').val(); console.log(fullEmail.length); if(fullEmail.length>15) { textDot = fullEmail.substr(0, 14)+'...'; $('#email').val(textDot); } var oldText = $('#email').val(); $('#email').bind({ mouseover : function () { $('#email').val(fullEmail); }, mouseout: function () { $('#email').val(oldText); } }); }); ------------------- thanks in advance..
1
3,222,316
07/11/2010 08:04:26
257,796
01/24/2010 12:23:00
439
7
Why would PHP not be a 'real' programming language?
So I realise this is possibly subjective - well, hey, I'm sorry, there is a bit of technical knowledge behind it that I'd like to be educated on! :) I did an induction lesson into my A-Level Computing Class in school two days ago - we're using Java for the first year of the course. I'm unfamiliar with Java but have a pretty good grasp on general programming fundamentals (variables, functions, Object-Orientation, loops, etc. etc.). Our first task the teacher ran through ridiculously fast. She didn't bother to explain any of the concepts, how they work, or what you would realistically use them for, and seemed to take great pleasure in watching most of the students (who were, on the whole, new to programming) squirm in their seats at the uncomfortableness of not having the vaguest idea what she was on about. In hindsight, I reckon she went through it incredibly quickly to see who could really 'handle' taking Computing A-Level, since students still have a chance to change their subjects before September begins. The first and only task was to write a Java command-line application to convert Binary to Denary (decimal). We had a two-hour taster session to do this in, after explaining how the Binary system works we had to begin (despite, on the whole, nobody really having the foggiest idea where to begin). After an hour of us all trying our best, some further than others but nobody having really achieved anything significant, the teacher herself became so confused she called in another teacher from next door. He came round to help people and see where to go next. Since (without meaning to sound bragging, but, I guess I did have the most experience in the class) I had gotten the furthest, he asked me if I'd had any previous experience. I said yes, particularly in PHP, and jokingly commented that I could write something to convert Binary to Denary in just a few lines of PHP whilst the Java application was growing rapidly onto several screen's worth of scrolling. His reply: "PHP isn't a real programming language!"...! After some discussion, his reasons for this statement were: - It's not compiled - It's scripted - It doesn't run on every platform So, 3 fairly weak reasons (in my opinion!). I pointed out that you can run PHP on any platform by installing Apache, but I don't think he really knew what it was and was having none of that! **So, in the 'definition of a programming language', what makes PHP *not* a 'proper' one? What's your definition of a 'real' programming language? Does it have to be compiled to be taken seriously?** Thanks for reading all that! Jack
php
opinion
programming-fundamentals
null
null
07/12/2010 17:28:37
not constructive
Why would PHP not be a 'real' programming language? === So I realise this is possibly subjective - well, hey, I'm sorry, there is a bit of technical knowledge behind it that I'd like to be educated on! :) I did an induction lesson into my A-Level Computing Class in school two days ago - we're using Java for the first year of the course. I'm unfamiliar with Java but have a pretty good grasp on general programming fundamentals (variables, functions, Object-Orientation, loops, etc. etc.). Our first task the teacher ran through ridiculously fast. She didn't bother to explain any of the concepts, how they work, or what you would realistically use them for, and seemed to take great pleasure in watching most of the students (who were, on the whole, new to programming) squirm in their seats at the uncomfortableness of not having the vaguest idea what she was on about. In hindsight, I reckon she went through it incredibly quickly to see who could really 'handle' taking Computing A-Level, since students still have a chance to change their subjects before September begins. The first and only task was to write a Java command-line application to convert Binary to Denary (decimal). We had a two-hour taster session to do this in, after explaining how the Binary system works we had to begin (despite, on the whole, nobody really having the foggiest idea where to begin). After an hour of us all trying our best, some further than others but nobody having really achieved anything significant, the teacher herself became so confused she called in another teacher from next door. He came round to help people and see where to go next. Since (without meaning to sound bragging, but, I guess I did have the most experience in the class) I had gotten the furthest, he asked me if I'd had any previous experience. I said yes, particularly in PHP, and jokingly commented that I could write something to convert Binary to Denary in just a few lines of PHP whilst the Java application was growing rapidly onto several screen's worth of scrolling. His reply: "PHP isn't a real programming language!"...! After some discussion, his reasons for this statement were: - It's not compiled - It's scripted - It doesn't run on every platform So, 3 fairly weak reasons (in my opinion!). I pointed out that you can run PHP on any platform by installing Apache, but I don't think he really knew what it was and was having none of that! **So, in the 'definition of a programming language', what makes PHP *not* a 'proper' one? What's your definition of a 'real' programming language? Does it have to be compiled to be taken seriously?** Thanks for reading all that! Jack
4
9,757,135
03/18/2012 09:00:25
1,266,092
03/13/2012 09:32:45
124
3
How to install Ubuntu in Windows 7 ?
when i installed Ubuntu in windows 7,it's generate such error. show this image ![ERROR][1] [1]: http://i.stack.imgur.com/ZGFu6.png
windows
ubuntu
windows-7
null
null
03/20/2012 05:54:21
off topic
How to install Ubuntu in Windows 7 ? === when i installed Ubuntu in windows 7,it's generate such error. show this image ![ERROR][1] [1]: http://i.stack.imgur.com/ZGFu6.png
2
6,437,935
06/22/2011 09:48:52
810,074
06/22/2011 09:35:25
1
0
Memory leaks in Simplemodal plugin for jQuery
Simplemodal have a memory leaks on IE8. To see it run [Basic Demo][1] in [sIEve][2]. On every click on Demo button leak near 4 MB! Anybody from developers can to fix it? [1]: http://simplemodal.googlecode.com/files/simplemodal-demo-basic-1.4.1.zip [2]: http://www.softpedia.com/get/Programming/Other-Programming-Files/sIEve.shtml
jquery-ui
simplemodal
null
null
null
06/22/2011 20:57:35
not a real question
Memory leaks in Simplemodal plugin for jQuery === Simplemodal have a memory leaks on IE8. To see it run [Basic Demo][1] in [sIEve][2]. On every click on Demo button leak near 4 MB! Anybody from developers can to fix it? [1]: http://simplemodal.googlecode.com/files/simplemodal-demo-basic-1.4.1.zip [2]: http://www.softpedia.com/get/Programming/Other-Programming-Files/sIEve.shtml
1
4,221,574
11/19/2010 02:21:01
93,448
04/20/2009 21:44:12
1,692
78
Date Validation In Rails 3
I've got a Rails 3 app (using Mongodb and Mongoid if that makes a difference), and in one of my models I have a field defined as a Date type. <pre><code>class Participant include Mongoid::Document field :birth_date, :type => Date end </code></pre> The view renders a simple textbox for input, due to requirements from the user. They don't want a calendar control, or any drop lists or anything like that. I also need to ensure that the date is valid in case the user doesn't have javascript enabled, etc. All this boils down to: how do I do date validation in Rail 3 models? And i'm not just asking about making sure the date is past a certain point, or prior to a certain point... I want to ensure that if the user types in something completely invalid, like "this is is not a date", that they don't get an exception, but get a nice validation message. I've tried using a validate_with class, I've tried using validates_format_with, etc. but I'm not really getting the results I want. In the end, I'm looking for my validation to be done using <code>DateTime.parse</code> or something else that won't have the limitations of format validation with a regex, etc. I'm sure I'm doing something wrong, because I can't be the first person to want this done... I'm just not sure what's available.
validation
date
ruby-on-rails-3
mongodb
null
null
open
Date Validation In Rails 3 === I've got a Rails 3 app (using Mongodb and Mongoid if that makes a difference), and in one of my models I have a field defined as a Date type. <pre><code>class Participant include Mongoid::Document field :birth_date, :type => Date end </code></pre> The view renders a simple textbox for input, due to requirements from the user. They don't want a calendar control, or any drop lists or anything like that. I also need to ensure that the date is valid in case the user doesn't have javascript enabled, etc. All this boils down to: how do I do date validation in Rail 3 models? And i'm not just asking about making sure the date is past a certain point, or prior to a certain point... I want to ensure that if the user types in something completely invalid, like "this is is not a date", that they don't get an exception, but get a nice validation message. I've tried using a validate_with class, I've tried using validates_format_with, etc. but I'm not really getting the results I want. In the end, I'm looking for my validation to be done using <code>DateTime.parse</code> or something else that won't have the limitations of format validation with a regex, etc. I'm sure I'm doing something wrong, because I can't be the first person to want this done... I'm just not sure what's available.
0
8,122,308
11/14/2011 13:31:03
644,541
03/04/2011 10:32:46
31
0
Spot the sql error
I recently got my upload bit to work in the below code, but the INSERT command doesn't work. My table is still empty, although. it uploads the image to a directory. What do you think the error is? Please, I've got the uploading bit to work, but I can't get the insert to work. Please does anyone know why <?php include("connect.php"); ?> <?php //This is the directory where images will be saved $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $title=$_POST['title']; $name=$_POST['name']; $description=$_POST['description']; $pic=($_FILES['photo']['name']); $url=$_POST['url']; $country=$_POST['country']; $endDate=$_POST['endDate']; //Writes the information to the database mysql_query("INSERT INTO `authors` VALUES ('$title', '$name', '$description', '$pic', '$url', '$country', '$endDate')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok $result = "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not $result = "Sorry, there was a problem uploading your file."; } ?>
php
sql
insert
null
null
11/14/2011 19:31:51
not a real question
Spot the sql error === I recently got my upload bit to work in the below code, but the INSERT command doesn't work. My table is still empty, although. it uploads the image to a directory. What do you think the error is? Please, I've got the uploading bit to work, but I can't get the insert to work. Please does anyone know why <?php include("connect.php"); ?> <?php //This is the directory where images will be saved $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $title=$_POST['title']; $name=$_POST['name']; $description=$_POST['description']; $pic=($_FILES['photo']['name']); $url=$_POST['url']; $country=$_POST['country']; $endDate=$_POST['endDate']; //Writes the information to the database mysql_query("INSERT INTO `authors` VALUES ('$title', '$name', '$description', '$pic', '$url', '$country', '$endDate')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok $result = "The file ". basename( $_FILES['photo']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not $result = "Sorry, there was a problem uploading your file."; } ?>
1
9,751,473
03/17/2012 16:03:22
746,461
05/10/2011 08:39:24
82
2
Must custom controls be placed in the App_Code?
I wrote a custom control inherited from WebControl. (Note: not a user control). using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI.WebControls; namespace Taopi.WebComponents { public class RatingLabel : WebControl { public RatingLabel() : base("span") { } //... I placed it in `/App_Code`, and on a web page it is registered and used as following: <%@ Register TagPrefix="uc" Namespace="Taopi.WebComponents" %> ... <uc:RatingLabel Rating='<%# Eval("rating") %>' runat="server" /> They run well until I move RatingLabel to `/Components`, which is folder cerated by me. I got an error saying "*Unknown server tag uc: RatingLabel*" when I try to run the website. I believe the registration is wrong, so what modification is needed? Must custom controls be placed in the App_Code? I have another question that where do you usually place your custom controls (except for refering a external DLL)? Are there any "suggested" locations?
asp.net
custom-controls
null
null
null
null
open
Must custom controls be placed in the App_Code? === I wrote a custom control inherited from WebControl. (Note: not a user control). using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI.WebControls; namespace Taopi.WebComponents { public class RatingLabel : WebControl { public RatingLabel() : base("span") { } //... I placed it in `/App_Code`, and on a web page it is registered and used as following: <%@ Register TagPrefix="uc" Namespace="Taopi.WebComponents" %> ... <uc:RatingLabel Rating='<%# Eval("rating") %>' runat="server" /> They run well until I move RatingLabel to `/Components`, which is folder cerated by me. I got an error saying "*Unknown server tag uc: RatingLabel*" when I try to run the website. I believe the registration is wrong, so what modification is needed? Must custom controls be placed in the App_Code? I have another question that where do you usually place your custom controls (except for refering a external DLL)? Are there any "suggested" locations?
0
1,111,920
07/10/2009 20:49:53
76,682
03/11/2009 14:42:35
466
22
Multiple Firefox Versions on Same PC
Was wondering if its possible (and if so, how) to run both Firefox 3.0 and 3.5 on the same system? Seems to me that 3.5 REPLACES 3.0. I am using Windows XP. Thanks -
firefox
null
null
null
null
null
open
Multiple Firefox Versions on Same PC === Was wondering if its possible (and if so, how) to run both Firefox 3.0 and 3.5 on the same system? Seems to me that 3.5 REPLACES 3.0. I am using Windows XP. Thanks -
0
3,446,002
08/10/2010 04:22:45
358,218
06/04/2010 07:56:18
144
3
What's wrong with my code?
There is a null error, and i've been trying to solve it for 2 days. Booking.java package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; import android.widget.TextView; import android.widget.AdapterView.OnItemSelectedListener; public class Booking extends Activity { private DBAdapter db; private Spinner colourSpinner; public Cursor myCursor; public TextView txtArrival; /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); db = new DBAdapter(this); this.setContentView(R.layout.booking); txtArrival = (TextView) findViewById(R.id.txtArrival); // Member assignment colourSpinner = (Spinner) findViewById(R.id.myspinner); // Member assignment db.open(); fillData(); db.close(); colourSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } private void fillData() { myCursor = db.getSpinnerData(); startManagingCursor(myCursor); String[] from = new String[]{DBAdapter.KEY_ARRIVAL}; int[] to = new int[]{android.R.id.text1}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.booking, myCursor, from, to ); adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item ); // Removed this line, since members is set in onCreate colourSpinner.setAdapter(adapter); } public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> arg0, View v,int position, long id) { boolean result = Booking.this.myCursor.moveToPosition(position); if (result) { String title=Booking.this.myCursor.getString(1); Booking.this.txtArrival.setText(title); } } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }; } LogCat 08-10 03:45:06.467: ERROR/AndroidRuntime(750): Uncaught handler: thread main exiting due to uncaught exception 08-10 03:45:06.567: ERROR/AndroidRuntime(750): java.lang.NullPointerException 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at one.two.Booking$MyOnItemSelectedListener.onItemSelected(Booking.java:54) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView.fireOnSelected(AdapterView.java:856) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView.access$200(AdapterView.java:41) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:827) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Handler.handleCallback(Handler.java:587) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Handler.dispatchMessage(Handler.java:92) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Looper.loop(Looper.java:123) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.app.ActivityThread.main(ActivityThread.java:3948) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at java.lang.reflect.Method.invokeNative(Native Method) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at java.lang.reflect.Method.invoke(Method.java:521) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at dalvik.system.NativeStart.main(Native Method) Thank you.
android
eclipse
sqlite
null
null
09/03/2011 01:57:53
too localized
What's wrong with my code? === There is a null error, and i've been trying to solve it for 2 days. Booking.java package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.SimpleCursorAdapter; import android.widget.Spinner; import android.widget.TextView; import android.widget.AdapterView.OnItemSelectedListener; public class Booking extends Activity { private DBAdapter db; private Spinner colourSpinner; public Cursor myCursor; public TextView txtArrival; /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); db = new DBAdapter(this); this.setContentView(R.layout.booking); txtArrival = (TextView) findViewById(R.id.txtArrival); // Member assignment colourSpinner = (Spinner) findViewById(R.id.myspinner); // Member assignment db.open(); fillData(); db.close(); colourSpinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } private void fillData() { myCursor = db.getSpinnerData(); startManagingCursor(myCursor); String[] from = new String[]{DBAdapter.KEY_ARRIVAL}; int[] to = new int[]{android.R.id.text1}; SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,R.layout.booking, myCursor, from, to ); adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item ); // Removed this line, since members is set in onCreate colourSpinner.setAdapter(adapter); } public class MyOnItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> arg0, View v,int position, long id) { boolean result = Booking.this.myCursor.moveToPosition(position); if (result) { String title=Booking.this.myCursor.getString(1); Booking.this.txtArrival.setText(title); } } @Override public void onNothingSelected(AdapterView<?> arg0) { // TODO Auto-generated method stub } }; } LogCat 08-10 03:45:06.467: ERROR/AndroidRuntime(750): Uncaught handler: thread main exiting due to uncaught exception 08-10 03:45:06.567: ERROR/AndroidRuntime(750): java.lang.NullPointerException 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at one.two.Booking$MyOnItemSelectedListener.onItemSelected(Booking.java:54) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView.fireOnSelected(AdapterView.java:856) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView.access$200(AdapterView.java:41) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:827) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Handler.handleCallback(Handler.java:587) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Handler.dispatchMessage(Handler.java:92) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.os.Looper.loop(Looper.java:123) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at android.app.ActivityThread.main(ActivityThread.java:3948) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at java.lang.reflect.Method.invokeNative(Native Method) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at java.lang.reflect.Method.invoke(Method.java:521) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 08-10 03:45:06.567: ERROR/AndroidRuntime(750): at dalvik.system.NativeStart.main(Native Method) Thank you.
3
6,297,543
06/09/2011 18:32:32
781,937
06/02/2011 22:42:24
-3
0
retrieve data from database using jsf
following is my code my bean enter code here import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; /** * * @author utilisateur */ @ManagedBean(name="Beansearch") @SessionScoped public class Beansearch extends HttpServlet { ResultSet rs; private String cond; public String getcond() { return this.cond; } public void setcond(String cond) { this.cond= cond; } private List perInfoAll = new ArrayList(); private int i; public List getperInfoAll(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { String value = req.getParameter("cond"); try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } Connection con = null; try { con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:gmao", "pfe", "gmao"); } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } Statement st = null; try { st = con.createStatement(); } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } try { rs = st.executeQuery("selectusername, jobposition from user_details="+value+""); /** Creates a new instance of Beansearch */ } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } while(rs.next()) { perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2))); i++; } return perInfoAll; } public class perInfo { private String username; private String jobposition; public perInfo(String username,String jobposition) { this.username = username; this.jobposition = jobposition; } public String getusername() { return username; } public String getjobposition() { return jobposition; } } } my page jsf enter code here <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h:form> <h:dataTable id="dt1" value="#{Beansearch.perInfoAll}" var="item" bgcolor="#F1F1F1" border="10" cellpadding="5" cellspacing="3" rows="4" width="50%" dir="LTR" frame="hsides" rules="all" summary="This is a JSF code to create dataTable." > <f:facet name="header"> <h:outputText value="This is 'dataTable' demo" /> </f:facet> <h:column> <f:facet name="header"> <h:outputText value="First Name" /> </f:facet> <h:outputText style="" value="#{item.username}" ></h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Last Name"/> </f:facet> <h:outputText value="#{item.jobposition}"></h:outputText> </h:column> this code used to display data from a database in a jsf page what I need is how to display data by entering the search criteria and show only the corresponding elements with the request (select * from mytable where id ="+v+") the question is how we can get "v" (enter value) how change my code to realize this(entering the search criteria in textbox and retrieve only the corresponding elements) can you help me please and give me an example if it is possible thanks
java
jsf
jdb
null
null
06/09/2011 21:05:53
not a real question
retrieve data from database using jsf === following is my code my bean enter code here import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; /** * * @author utilisateur */ @ManagedBean(name="Beansearch") @SessionScoped public class Beansearch extends HttpServlet { ResultSet rs; private String cond; public String getcond() { return this.cond; } public void setcond(String cond) { this.cond= cond; } private List perInfoAll = new ArrayList(); private int i; public List getperInfoAll(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException, SQLException { String value = req.getParameter("cond"); try { Class.forName("oracle.jdbc.driver.OracleDriver"); } catch (ClassNotFoundException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } Connection con = null; try { con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:gmao", "pfe", "gmao"); } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } Statement st = null; try { st = con.createStatement(); } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } try { rs = st.executeQuery("selectusername, jobposition from user_details="+value+""); /** Creates a new instance of Beansearch */ } catch (SQLException ex) { Logger.getLogger(Beansearch.class.getName()).log(Level.SEVERE, null, ex); } while(rs.next()) { perInfoAll.add(i,new perInfo(rs.getString(1),rs.getString(2))); i++; } return perInfoAll; } public class perInfo { private String username; private String jobposition; public perInfo(String username,String jobposition) { this.username = username; this.jobposition = jobposition; } public String getusername() { return username; } public String getjobposition() { return jobposition; } } } my page jsf enter code here <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h:form> <h:dataTable id="dt1" value="#{Beansearch.perInfoAll}" var="item" bgcolor="#F1F1F1" border="10" cellpadding="5" cellspacing="3" rows="4" width="50%" dir="LTR" frame="hsides" rules="all" summary="This is a JSF code to create dataTable." > <f:facet name="header"> <h:outputText value="This is 'dataTable' demo" /> </f:facet> <h:column> <f:facet name="header"> <h:outputText value="First Name" /> </f:facet> <h:outputText style="" value="#{item.username}" ></h:outputText> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Last Name"/> </f:facet> <h:outputText value="#{item.jobposition}"></h:outputText> </h:column> this code used to display data from a database in a jsf page what I need is how to display data by entering the search criteria and show only the corresponding elements with the request (select * from mytable where id ="+v+") the question is how we can get "v" (enter value) how change my code to realize this(entering the search criteria in textbox and retrieve only the corresponding elements) can you help me please and give me an example if it is possible thanks
1
7,930,500
10/28/2011 14:21:44
956,868
09/21/2011 11:50:39
59
0
File Existing in Android
I have the ID of my resource in my raw folder, something like: 73837383 how can I check if the file exists in the app? Thanks for any help you can provide...
android
null
null
null
null
null
open
File Existing in Android === I have the ID of my resource in my raw folder, something like: 73837383 how can I check if the file exists in the app? Thanks for any help you can provide...
0
8,255,841
11/24/2011 10:51:17
917,551
08/29/2011 09:43:47
1
0
cubic spline interpolation in R
I am trying an implementation of a cubic spline in R. I have already used the spline, smooth.spline and smooth.Pspline functions that are available in the R libraries but I am not that happy with the results so I want to convince myself about the consistency of the results by a "homemade" spline function. I have already computed the coefficients for the 3rd degree polynomials, but I am not sure how to plot the results..they seem random points. You can find the source code below. Any help would be appreciated. x = c(35,36,39,42,45,48) y = c(2.87671519825595, 4.04868309245341, 3.95202175000174, 3.87683188946186, 4.07739945984612, 2.16064840967985) n = length(x) #determine width of intervals for (i in 1:(n-1)){ h[i] = (x[i+1] - x[i]) } A = 0 B = 0 C = 0 D = 0 #determine the matrix influence coefficients for the natural spline for (i in 2:(n-1)){ j = i-1 D[j] = 2*(h[i-1] + h[i]) A[j] = h[i] B[j] = h[i-1] } #determine the constant matrix C for (i in 2:(n-1)){ j = i-1 C[j] = 6*((y[i+1] - y[i]) / h[i] - (y[i] - y[i-1]) / h[i-1]) } #maximum TDMA length ntdma = n - 2 #tridiagonal matrix algorithm #upper triangularization R = 0 for (i in 2:ntdma){ R = B[i]/D[i-1] D[i] = D[i] - R * A[i-1] C[i] = C[i] - R * C[i-1] } #set the last C C[ntdma] = C[ntdma] / D[ntdma] #back substitute for (i in (ntdma-1):1){ C[i] = (C[i] - A[i] * C[i+1]) / D[i] } #end of tdma #switch from C to S S = 0 for (i in 2:(n-1)){ j = i - 1 S[i] = C[j] } #end conditions S[1] <- 0 -> S[n] #Calculate cubic ai,bi,ci and di from S and h for (i in 1:(n-1)){ A[i] = (S[i+ 1] - S[i]) / (6 * h[i]) B[i] = S[i] / 2 C[i] = (y[i+1] - y[i]) / h[i] - (2 * h[i] * S[i] + h[i] * S[i + 1]) / 6 D[i] = y[i] } #control points xx = c(x[2],x[4]) #spline evaluation for (j in 1:length(xx)){ for (i in 1:n){ if (xx[j]<=x[i]){ break } yy[i] = A[i]*(xx[j] - x[i])^3 + B[i]*(xx[j] - x[i])^2 + C[i]*(xx[j] - x[i]) + D[i] } points(x,yy ,col="blue") } Thank you
r
plot
spline
cubic
null
11/24/2011 15:18:11
too localized
cubic spline interpolation in R === I am trying an implementation of a cubic spline in R. I have already used the spline, smooth.spline and smooth.Pspline functions that are available in the R libraries but I am not that happy with the results so I want to convince myself about the consistency of the results by a "homemade" spline function. I have already computed the coefficients for the 3rd degree polynomials, but I am not sure how to plot the results..they seem random points. You can find the source code below. Any help would be appreciated. x = c(35,36,39,42,45,48) y = c(2.87671519825595, 4.04868309245341, 3.95202175000174, 3.87683188946186, 4.07739945984612, 2.16064840967985) n = length(x) #determine width of intervals for (i in 1:(n-1)){ h[i] = (x[i+1] - x[i]) } A = 0 B = 0 C = 0 D = 0 #determine the matrix influence coefficients for the natural spline for (i in 2:(n-1)){ j = i-1 D[j] = 2*(h[i-1] + h[i]) A[j] = h[i] B[j] = h[i-1] } #determine the constant matrix C for (i in 2:(n-1)){ j = i-1 C[j] = 6*((y[i+1] - y[i]) / h[i] - (y[i] - y[i-1]) / h[i-1]) } #maximum TDMA length ntdma = n - 2 #tridiagonal matrix algorithm #upper triangularization R = 0 for (i in 2:ntdma){ R = B[i]/D[i-1] D[i] = D[i] - R * A[i-1] C[i] = C[i] - R * C[i-1] } #set the last C C[ntdma] = C[ntdma] / D[ntdma] #back substitute for (i in (ntdma-1):1){ C[i] = (C[i] - A[i] * C[i+1]) / D[i] } #end of tdma #switch from C to S S = 0 for (i in 2:(n-1)){ j = i - 1 S[i] = C[j] } #end conditions S[1] <- 0 -> S[n] #Calculate cubic ai,bi,ci and di from S and h for (i in 1:(n-1)){ A[i] = (S[i+ 1] - S[i]) / (6 * h[i]) B[i] = S[i] / 2 C[i] = (y[i+1] - y[i]) / h[i] - (2 * h[i] * S[i] + h[i] * S[i + 1]) / 6 D[i] = y[i] } #control points xx = c(x[2],x[4]) #spline evaluation for (j in 1:length(xx)){ for (i in 1:n){ if (xx[j]<=x[i]){ break } yy[i] = A[i]*(xx[j] - x[i])^3 + B[i]*(xx[j] - x[i])^2 + C[i]*(xx[j] - x[i]) + D[i] } points(x,yy ,col="blue") } Thank you
3
4,641,534
01/09/2011 20:19:36
556,613
12/29/2010 01:16:00
134
20
How to -accurately- measure size in pixels of text being drawn on a canvas by drawTextOnPath()
I'm using drawTextOnPath() to display some text on a Canvas and I need to know the dimensions of the text being drawn. I know this is not feasible for paths composed of multiple segments, curves, etc. but my path is a single segment which is perfectly horizontal. I am using Paint.getTextBounds() to get a Rect with the dimensions of the text I want to draw. I use this rect to draw a bounding box around the text when I draw it at an arbitrary location. Here's some simplified code that reflects what I am currently doing: // to keep this example simple, always at origin (0,0) public drawBoundedText(Canvas canvas, String text, Paint paint) { Rect textDims = new Rect(); paint.getTextBounds(text,0, text.length(), textDims); float hOffset = 0; float vOffset = paint.getFontMetrics().descent; // vertically centers text float startX = textDims.left; / 0 float startY = textDims.bottom; float endX = textDims.right; float endY = textDims.bottom; path.moveTo(startX, startY); path.lineTo(endX, endY); path.close(); // draw the text canvas.drawTextOnPath(text, path, 0, vOffset, paint); // draw bounding box canvas.drawRect(textDims, paint); } The results are -close- but not perfect. If I replace the second to last line with: canvas.drawText(text, startX, startY - vOffset, paint); Then it works perfectly. Usually there is a gap of 1-3 pixels on the right and bottom edges. The error seems to vary with font size as well. Any ideas? It's possible I'm doing everything right and the problem is with drawTextOnPath(); the text quality very visibly degrades when drawing along paths, even if the path is horizontal, likely because of the interpolation algorithm or whatever its using behind the scenes. I wouldnt be surprised to find out that the size jitter is also coming from there.
java
android
graphics
canvas
null
null
open
How to -accurately- measure size in pixels of text being drawn on a canvas by drawTextOnPath() === I'm using drawTextOnPath() to display some text on a Canvas and I need to know the dimensions of the text being drawn. I know this is not feasible for paths composed of multiple segments, curves, etc. but my path is a single segment which is perfectly horizontal. I am using Paint.getTextBounds() to get a Rect with the dimensions of the text I want to draw. I use this rect to draw a bounding box around the text when I draw it at an arbitrary location. Here's some simplified code that reflects what I am currently doing: // to keep this example simple, always at origin (0,0) public drawBoundedText(Canvas canvas, String text, Paint paint) { Rect textDims = new Rect(); paint.getTextBounds(text,0, text.length(), textDims); float hOffset = 0; float vOffset = paint.getFontMetrics().descent; // vertically centers text float startX = textDims.left; / 0 float startY = textDims.bottom; float endX = textDims.right; float endY = textDims.bottom; path.moveTo(startX, startY); path.lineTo(endX, endY); path.close(); // draw the text canvas.drawTextOnPath(text, path, 0, vOffset, paint); // draw bounding box canvas.drawRect(textDims, paint); } The results are -close- but not perfect. If I replace the second to last line with: canvas.drawText(text, startX, startY - vOffset, paint); Then it works perfectly. Usually there is a gap of 1-3 pixels on the right and bottom edges. The error seems to vary with font size as well. Any ideas? It's possible I'm doing everything right and the problem is with drawTextOnPath(); the text quality very visibly degrades when drawing along paths, even if the path is horizontal, likely because of the interpolation algorithm or whatever its using behind the scenes. I wouldnt be surprised to find out that the size jitter is also coming from there.
0
5,835,223
04/29/2011 17:22:33
355,448
06/01/2010 13:32:53
4
0
how to integrated paypal in my shopping cart
hi i have a basket having items added to it .now i have a button named Pay .i want to integrated paypal on clicking on this button.please provide me all detail how to do integrate paypal.please help
php
null
null
null
null
04/30/2011 11:46:36
not a real question
how to integrated paypal in my shopping cart === hi i have a basket having items added to it .now i have a button named Pay .i want to integrated paypal on clicking on this button.please provide me all detail how to do integrate paypal.please help
1
11,124,786
06/20/2012 17:18:19
1,228,914
02/23/2012 16:59:13
119
4
Bad practice to use 5 different method parameters?
I have two buttons that each can perform two different implementations (whether selected or not), so that's 4 possible implementations in total. After coding it all out, I noticed I had 20+ lines of code for each implementation and only 1 or 2 variables were different in each. I decided I want to clean this up and have each implementation call separate, smaller methods and pass the inconsistent variables as parameters. I figure this is a better practice b/c I'm reusing code. However, in one of my methods I have to pass 5 different arguments implement the method with correct conditions. Is having this many parameters in a method a bad practice?
objective-c
ios
null
null
null
06/22/2012 00:22:28
not constructive
Bad practice to use 5 different method parameters? === I have two buttons that each can perform two different implementations (whether selected or not), so that's 4 possible implementations in total. After coding it all out, I noticed I had 20+ lines of code for each implementation and only 1 or 2 variables were different in each. I decided I want to clean this up and have each implementation call separate, smaller methods and pass the inconsistent variables as parameters. I figure this is a better practice b/c I'm reusing code. However, in one of my methods I have to pass 5 different arguments implement the method with correct conditions. Is having this many parameters in a method a bad practice?
4
5,334,345
03/17/2011 02:47:00
327,415
04/28/2010 01:53:36
60
1
IOS Webview and video
I have a webview in an IOS app that I am loading with local data. The html page includes a link to stream a video. Clicking on the link displays the video fine, but when the video terminates, the web view page does not reappear, instead the QTime viewer is still showing with the Play arrow. How can I make sure the webview reappears?
ios
webview
video-streaming
null
null
null
open
IOS Webview and video === I have a webview in an IOS app that I am loading with local data. The html page includes a link to stream a video. Clicking on the link displays the video fine, but when the video terminates, the web view page does not reappear, instead the QTime viewer is still showing with the Play arrow. How can I make sure the webview reappears?
0
10,948,338
06/08/2012 11:53:03
1,417,897
05/25/2012 16:54:07
10
1
Javascript to display list of image names
I would like to create a piece of javascript that, when a button is clicked, scans through a page and returns a list of image names in a list. e.g. image1.png image2.jpg image3.png Any help would be much appreciated
javascript
null
null
null
null
06/08/2012 21:08:34
not a real question
Javascript to display list of image names === I would like to create a piece of javascript that, when a button is clicked, scans through a page and returns a list of image names in a list. e.g. image1.png image2.jpg image3.png Any help would be much appreciated
1
11,581,217
07/20/2012 14:17:57
1,509,552
07/08/2012 04:09:19
8
0
VB.NET How to use TimeSpan to add time to another TimeSpan
My first timespan is: `"00:01:03,160"` <Br> and my second timespan is: `"00:00:01,100"` <br> i want to do an addition or subtraction between **00:01:03,160** to **00:00:01,100** <br> 00:01:03,160 + 00:00:01,100 = 00:01:04,260 i think that the format is : hh\:mm\:ss\,fff <br>
vb.net
winforms
timespan
null
null
07/20/2012 20:31:23
not a real question
VB.NET How to use TimeSpan to add time to another TimeSpan === My first timespan is: `"00:01:03,160"` <Br> and my second timespan is: `"00:00:01,100"` <br> i want to do an addition or subtraction between **00:01:03,160** to **00:00:01,100** <br> 00:01:03,160 + 00:00:01,100 = 00:01:04,260 i think that the format is : hh\:mm\:ss\,fff <br>
1
11,060,893
06/16/2012 04:44:55
1,460,013
06/16/2012 01:21:44
6
0
not updating. why?
<input type="text" name="ticket_no" value="<?php $_POST['ticket_no']; } ?>" id="ticket_no_id" /> i think i got the value wrong? please correct me? mysql_query("UPDATE summary_item SET ticket_no='".$_POST['ticket_no']."' WHERE serial_no='{$_SESSION['STF_DELIVERY_ITEMS'][$i]}'"); i tried to copy it from if(isset($_GET['items'])) { mysql_query("UPDATE {$table} SET availability='OUT' WHERE serial_no='{$_SESSION['STF_DELIVERY_ITEMS'][$i]}'"); } if(isset($_GET['items'])){ if(!empty($_POST['client_name']) && !empty($_POST['ref_no']) && !empty($_POST['assigned_engr']) && !empty($_POST['purpose'])) { mysql_query("INSERT INTO `summary_item`(`date_out`, `client`, `reference_no`, `item`, `comcode`, `serial_no1`, `purpose`, `assigned_engineer`, `status`) VALUES ('".date("F d, Y")."','".$_POST['client_name']."','".$_POST['ref_no']."','".$row['classification']."','".$row['comcode']."','".$_SESSION['STF_DELIVERY_ITEMS'][$i]."','".$_POST['purpose']."','".$_POST['assigned_engr']."','PENDING')"); } } with its input type <td style="border-bottom:1px solid #000;"><strong><input type="text" name="client_name" id="client_name_id" style="width:100%;border:0px;font-weight:bold;font:arail;font-size:15px" value="<?php if(!empty($_POST['client_name'])) { echo $_POST['client_name']; } ?>" /></strong> but i can't make it work :|
mysql
update
null
null
null
06/16/2012 05:49:57
not a real question
not updating. why? === <input type="text" name="ticket_no" value="<?php $_POST['ticket_no']; } ?>" id="ticket_no_id" /> i think i got the value wrong? please correct me? mysql_query("UPDATE summary_item SET ticket_no='".$_POST['ticket_no']."' WHERE serial_no='{$_SESSION['STF_DELIVERY_ITEMS'][$i]}'"); i tried to copy it from if(isset($_GET['items'])) { mysql_query("UPDATE {$table} SET availability='OUT' WHERE serial_no='{$_SESSION['STF_DELIVERY_ITEMS'][$i]}'"); } if(isset($_GET['items'])){ if(!empty($_POST['client_name']) && !empty($_POST['ref_no']) && !empty($_POST['assigned_engr']) && !empty($_POST['purpose'])) { mysql_query("INSERT INTO `summary_item`(`date_out`, `client`, `reference_no`, `item`, `comcode`, `serial_no1`, `purpose`, `assigned_engineer`, `status`) VALUES ('".date("F d, Y")."','".$_POST['client_name']."','".$_POST['ref_no']."','".$row['classification']."','".$row['comcode']."','".$_SESSION['STF_DELIVERY_ITEMS'][$i]."','".$_POST['purpose']."','".$_POST['assigned_engr']."','PENDING')"); } } with its input type <td style="border-bottom:1px solid #000;"><strong><input type="text" name="client_name" id="client_name_id" style="width:100%;border:0px;font-weight:bold;font:arail;font-size:15px" value="<?php if(!empty($_POST['client_name'])) { echo $_POST['client_name']; } ?>" /></strong> but i can't make it work :|
1
3,137,350
06/29/2010 01:55:51
197,402
10/27/2009 14:47:05
102
7
What are some pieces of code that exemplify the power/functionality/style of their language of implementation?
I don't mean to say that any turing-complete programming language can be less powerful than another in terms of computation, but using "terseness" instead would not fufill the entire meaning of my question. Power in my mind is a combination of terseness and clarity.
language-agnostic
rosetta-stone
null
null
null
07/01/2010 01:10:40
not a real question
What are some pieces of code that exemplify the power/functionality/style of their language of implementation? === I don't mean to say that any turing-complete programming language can be less powerful than another in terms of computation, but using "terseness" instead would not fufill the entire meaning of my question. Power in my mind is a combination of terseness and clarity.
1
840,629
05/08/2009 16:15:47
55,747
01/16/2009 05:56:52
2,398
113
Reporting Services Report Timeout
We have a 2005 report that can be 2 to around 250 pages with the average being in the ballpark of 10. When the report was developed, our developer was told that 10 pages or so was the right number, and without knowing the business domain very well he decided reporting services was the correct approach. Now that the report has been deployed to PROD, we are having some complaints of the report timing out. Neither the developer or I on this are terribly surprised given the sheer size of the report that is being requested (250 pages). My question is what options do we have to use our current report that works 95% of the time and make it work for the remaining 5%? Are there configuration options anywhere to improve the rendering performance or anything like that? > The report is used for return > authorizations so the size of the > returns can very. Each authorization > page has 4 different return labels > with logos and barcodes.
reporting-services
reportingservices-2005
null
null
null
null
open
Reporting Services Report Timeout === We have a 2005 report that can be 2 to around 250 pages with the average being in the ballpark of 10. When the report was developed, our developer was told that 10 pages or so was the right number, and without knowing the business domain very well he decided reporting services was the correct approach. Now that the report has been deployed to PROD, we are having some complaints of the report timing out. Neither the developer or I on this are terribly surprised given the sheer size of the report that is being requested (250 pages). My question is what options do we have to use our current report that works 95% of the time and make it work for the remaining 5%? Are there configuration options anywhere to improve the rendering performance or anything like that? > The report is used for return > authorizations so the size of the > returns can very. Each authorization > page has 4 different return labels > with logos and barcodes.
0
1,432,236
09/16/2009 10:47:49
151,032
08/05/2009 13:03:04
8
1
magento - multiple tax rates
I've built a magento site for a Canadian company where each state has a Retail sales tax and a federal tax rate and these rates differ! So, I set up the rates, and the Tax is being calculated correctly, ie the sum of the two tax rates is being calculated correctly. however on selecting the breakdown of tax mode in the admin panel, it would appear that there is something wrong with my setup. Eg. Subtotal $129.99 GST/HST Quebec (5%) $ 16.25 Provincial Sales Tax Quebec (7.5%) Tax $ 16.25 Grand Total $158.23 16.25 is 12% of $129.99 so the tax figure is correct. However it should be displaying as follows: Subtotal $129.99 GST/HST Quebec (5%) $ 6.50 Provincial Sales Tax Quebec (7.5%) $ 9.75 Tax $ 16.25 Grand Total $158.23 Anyone come across this before? Have any suggestions on how to fix it? Many thanks, Fiona
magento
tax
rates
null
null
05/03/2012 13:17:48
off topic
magento - multiple tax rates === I've built a magento site for a Canadian company where each state has a Retail sales tax and a federal tax rate and these rates differ! So, I set up the rates, and the Tax is being calculated correctly, ie the sum of the two tax rates is being calculated correctly. however on selecting the breakdown of tax mode in the admin panel, it would appear that there is something wrong with my setup. Eg. Subtotal $129.99 GST/HST Quebec (5%) $ 16.25 Provincial Sales Tax Quebec (7.5%) Tax $ 16.25 Grand Total $158.23 16.25 is 12% of $129.99 so the tax figure is correct. However it should be displaying as follows: Subtotal $129.99 GST/HST Quebec (5%) $ 6.50 Provincial Sales Tax Quebec (7.5%) $ 9.75 Tax $ 16.25 Grand Total $158.23 Anyone come across this before? Have any suggestions on how to fix it? Many thanks, Fiona
2
10,728,249
05/23/2012 21:37:42
981,282
10/05/2011 21:52:38
129
4
Using preg_replace and preserving part of search
With preg_match, you can use `<name>` and it will add that to the output array. With preg_replace, I'd like to match a url, such as `"http://<url>\s"` and then have that url preserved in the replacement string, such as `"beforetheurl<url>aftertheurl"`
php
regex
null
null
null
null
open
Using preg_replace and preserving part of search === With preg_match, you can use `<name>` and it will add that to the output array. With preg_replace, I'd like to match a url, such as `"http://<url>\s"` and then have that url preserved in the replacement string, such as `"beforetheurl<url>aftertheurl"`
0
8,028,098
11/06/2011 15:32:45
1,030,776
11/05/2011 05:12:18
3
0
Looping Jquery Deffered (ajax) function?
I write a Javascript do...while loop on the deffered getFeed function. GetFeed function - return a url to caller if the object code is matched. The loop has to check the condition. Condition is - breaks the loop if the pass in url(to get the feed) is same with url returned by GetFeed function. I tried few methods but it crashed. Infinite looping. Maybe logical error. Ya, perhaps you noticed, I am totally new to programming. Give me some explanation with example would be appreciated. code=se254s23; var default_url ="first-url-obtain-from-user";//keep it as static url var pass_in_url=default_url; var obtained_url=""; var flag=1; do { getFeed(pass_in_url).done(function(newUrl) { obtained_url=newUrl; }); if(pass_in_url==obtained_url) { flag=0; } else { pass_in_url=obtained_url; } }while(flag==1); function getFeed(url) { dfd = $.Deferred(); $.ajax({ type: "POST", url: url, dataType: "jsonp", success: function(msg) { var aflag =0; $.each(msg.data, function(i, obj) { //if object's code match, get its url if(obj.code==code) { someUrl = obj.url; flag=1 } } // if no code matched, return pass in url if(flag=0) { someUrl=url; } dfd.resolve(someUrl); }); return dfd.promise(); }
javascript
jquery
jquery-ajax
jquery-deferred
null
11/07/2011 19:17:22
too localized
Looping Jquery Deffered (ajax) function? === I write a Javascript do...while loop on the deffered getFeed function. GetFeed function - return a url to caller if the object code is matched. The loop has to check the condition. Condition is - breaks the loop if the pass in url(to get the feed) is same with url returned by GetFeed function. I tried few methods but it crashed. Infinite looping. Maybe logical error. Ya, perhaps you noticed, I am totally new to programming. Give me some explanation with example would be appreciated. code=se254s23; var default_url ="first-url-obtain-from-user";//keep it as static url var pass_in_url=default_url; var obtained_url=""; var flag=1; do { getFeed(pass_in_url).done(function(newUrl) { obtained_url=newUrl; }); if(pass_in_url==obtained_url) { flag=0; } else { pass_in_url=obtained_url; } }while(flag==1); function getFeed(url) { dfd = $.Deferred(); $.ajax({ type: "POST", url: url, dataType: "jsonp", success: function(msg) { var aflag =0; $.each(msg.data, function(i, obj) { //if object's code match, get its url if(obj.code==code) { someUrl = obj.url; flag=1 } } // if no code matched, return pass in url if(flag=0) { someUrl=url; } dfd.resolve(someUrl); }); return dfd.promise(); }
3
4,019,794
10/26/2010 00:10:38
92,679
04/19/2009 05:23:14
369
17
why is my remote_form_tag with :action defined not posting the action?
This is what I've used with remote_form_tag: <% form_remote_tag(:url => {:controller => '/companies', :action => 'update'}, :update => 'tags') do %> <%= text_field :company, :tag_list %> <%= submit_tag 'Save' %> <% end %> This is in a Company.view, where Company is a model that is acts_as_taggable_on enabled. My expectation is that, via ajax, a post is made to companies/10/update But, instead, what is posted is: http://localhost:3000/companies/10 and the response is: No action responded to 10. Actions: create, destroy, edit, email_this_week, index, new, show, and update Help...?
ruby-on-rails
ajax
remote-forms
null
null
null
open
why is my remote_form_tag with :action defined not posting the action? === This is what I've used with remote_form_tag: <% form_remote_tag(:url => {:controller => '/companies', :action => 'update'}, :update => 'tags') do %> <%= text_field :company, :tag_list %> <%= submit_tag 'Save' %> <% end %> This is in a Company.view, where Company is a model that is acts_as_taggable_on enabled. My expectation is that, via ajax, a post is made to companies/10/update But, instead, what is posted is: http://localhost:3000/companies/10 and the response is: No action responded to 10. Actions: create, destroy, edit, email_this_week, index, new, show, and update Help...?
0
6,823,042
07/25/2011 22:16:28
862,409
07/25/2011 21:58:16
1
0
Java api Locale class, wrong description?
Follow this link http://download.oracle.com/javase/1,5.0/docs/api/java/util/Locale.html There is sentence: "*The Locale class provides a number of convenient constants that you can use to create Locale objects for commonly used locales. For example, the following creates a Locale object for the United States:* " How constants can create object? It gives you only reference.
java
api
locale
null
null
07/25/2011 22:31:15
not a real question
Java api Locale class, wrong description? === Follow this link http://download.oracle.com/javase/1,5.0/docs/api/java/util/Locale.html There is sentence: "*The Locale class provides a number of convenient constants that you can use to create Locale objects for commonly used locales. For example, the following creates a Locale object for the United States:* " How constants can create object? It gives you only reference.
1
11,272,124
06/30/2012 06:50:50
425,648
08/19/2010 19:13:53
696
50
Best way to handle hundreads of simultaneous update request in PHP-MySQL?
Hi I am receiving 100s of simultaneous row update request on a single table within 5-10 seconds, it causes problem, It is not actually updating the row and also not giving any error in `mysql_query($query)` response. Please suggest what can be the cause of this and how can I solve this? Table has something around 2Lac records in it. It might be one of the problem.
php
mysql
database
database-performance
database-update
06/30/2012 13:23:58
not a real question
Best way to handle hundreads of simultaneous update request in PHP-MySQL? === Hi I am receiving 100s of simultaneous row update request on a single table within 5-10 seconds, it causes problem, It is not actually updating the row and also not giving any error in `mysql_query($query)` response. Please suggest what can be the cause of this and how can I solve this? Table has something around 2Lac records in it. It might be one of the problem.
1
5,576,010
04/07/2011 04:33:49
696,066
04/07/2011 04:33:49
1
0
How to Lazy loading in DataGridView in C#
I want Retrieve big Data from sql server. I want it load row by row and displaying in to DataGridView. That like i execute Sql Script in Sql server management studio 2005. How i do that?!
c#
null
null
null
null
null
open
How to Lazy loading in DataGridView in C# === I want Retrieve big Data from sql server. I want it load row by row and displaying in to DataGridView. That like i execute Sql Script in Sql server management studio 2005. How i do that?!
0
4,523,390
12/24/2010 00:04:07
412,168
08/05/2010 16:12:58
51
1
API for Audio Matching in Android
I am working on android application.In my app i have to match some audio with server database. So,Anyone tell me what are API for Audio matching ?
android
audio
null
null
null
02/18/2011 02:16:24
not a real question
API for Audio Matching in Android === I am working on android application.In my app i have to match some audio with server database. So,Anyone tell me what are API for Audio matching ?
1
5,039,917
02/18/2011 10:02:09
385,264
07/07/2010 07:34:10
83
9
How to prevent Apache hangs when PHP APC cache completely fills up ?
When APC cache is full, it hangs Apache. Apache responds to requests, however waits forever for APC cache to free some resources, but this will never happen. I run every 10 minutes CRON job with my own small expunge script, which deletes expired entries from APC. Ok, I could add more memory to APC and/or I could run the expunge script more often. But that's not real solution, I am looking for some new way how to deal with issue.
php
apache
apache2
apc
null
null
open
How to prevent Apache hangs when PHP APC cache completely fills up ? === When APC cache is full, it hangs Apache. Apache responds to requests, however waits forever for APC cache to free some resources, but this will never happen. I run every 10 minutes CRON job with my own small expunge script, which deletes expired entries from APC. Ok, I could add more memory to APC and/or I could run the expunge script more often. But that's not real solution, I am looking for some new way how to deal with issue.
0
6,772,735
07/21/2011 07:36:16
698,574
04/08/2011 11:45:47
639
2
what's the rewrite rule meaning?
RewriteEngine on RewriteRule ^(.*)$ http://$1 [R=301,L] what's the meaning of this line ( RewriteRule ^(.*)$ http://$1 [R=301,L] ). thank you.
php
perl
apache
null
null
07/21/2011 08:32:25
off topic
what's the rewrite rule meaning? === RewriteEngine on RewriteRule ^(.*)$ http://$1 [R=301,L] what's the meaning of this line ( RewriteRule ^(.*)$ http://$1 [R=301,L] ). thank you.
2
6,625,214
07/08/2011 13:35:41
397,785
07/21/2010 10:03:03
103
2
search specific post in facebook using gaph api
I am trying to search for a specific post on my page which starts with specified text. I am able to search all public post by using https://grpah.facebook.com/search?q=specified text&type=post or getting all feeds of my page https://graph.facebook.com/[page-name]/feed?auth_token=[auth_token_received from facebook] but I am unable to search for posts that are on my page and have specified text. Is there a way to achieve this
facebook-graph-api
null
null
null
null
null
open
search specific post in facebook using gaph api === I am trying to search for a specific post on my page which starts with specified text. I am able to search all public post by using https://grpah.facebook.com/search?q=specified text&type=post or getting all feeds of my page https://graph.facebook.com/[page-name]/feed?auth_token=[auth_token_received from facebook] but I am unable to search for posts that are on my page and have specified text. Is there a way to achieve this
0
6,796,925
07/22/2011 22:50:47
289,935
03/09/2010 19:29:29
37
1
How do I reuse a previous migration's up or down methods
I had created my own User class and authentication from scratch but have recently decided to scrap it and start over using the Devise gem. So before I leverage the Devise migrations I need to create a migration to kill off my User table. "Easy", I thought, "I'll just use the down method of the migration that created my User table". But I can't for the life of me work out how to reference that from a new migration. Thoughts?
ruby-on-rails
migration
null
null
null
null
open
How do I reuse a previous migration's up or down methods === I had created my own User class and authentication from scratch but have recently decided to scrap it and start over using the Devise gem. So before I leverage the Devise migrations I need to create a migration to kill off my User table. "Easy", I thought, "I'll just use the down method of the migration that created my User table". But I can't for the life of me work out how to reference that from a new migration. Thoughts?
0
5,766,585
04/23/2011 20:04:17
722,070
04/23/2011 20:04:17
1
0
Network connections only work if device connected via cable
Ok, I tried for the last couple hours and I give up: I develop for a mobile device (Win CE on Unitech HT660) and have a weird thing occurring: I try to communicate with a service on my PC and I'm using TCPClient for it. This works great except for one big problem: Once I unplug the USB-Cable I use to copy the files from VS on program start TCPClient throws a SocketException that no socket connection could be made because the target machine actively refused it (not the case, Firewall is off, no third-party installed and the service is listening) And it gets weirder: If the cable is plugged in and I remove it after the program made the connection everything works perfectly fine, I can send and receive data without the cable, I can just not connect without the cable. Btw: It's the same story with MySQLConnection from the MySQL .NET Connector. It works with the cable, but if it is removed without an established connection no connection can be made. Has anyone ideas on that? Thanks in advance!
c#
mysql
compact-framework
tcp
windows-ce
null
open
Network connections only work if device connected via cable === Ok, I tried for the last couple hours and I give up: I develop for a mobile device (Win CE on Unitech HT660) and have a weird thing occurring: I try to communicate with a service on my PC and I'm using TCPClient for it. This works great except for one big problem: Once I unplug the USB-Cable I use to copy the files from VS on program start TCPClient throws a SocketException that no socket connection could be made because the target machine actively refused it (not the case, Firewall is off, no third-party installed and the service is listening) And it gets weirder: If the cable is plugged in and I remove it after the program made the connection everything works perfectly fine, I can send and receive data without the cable, I can just not connect without the cable. Btw: It's the same story with MySQLConnection from the MySQL .NET Connector. It works with the cable, but if it is removed without an established connection no connection can be made. Has anyone ideas on that? Thanks in advance!
0
5,799,835
04/27/2011 05:37:18
441,343
09/07/2010 10:34:49
74
2
hierarchyid sqlserver2008
I want to store the regional information of a customer, for this, i will create the following table 1. Country 2. State 3. District But using hierarchyid in SqlServer 2008, I think I can store the information in a single table called Region. Am I right?
sql-server
hierarchical-data
null
null
null
null
open
hierarchyid sqlserver2008 === I want to store the regional information of a customer, for this, i will create the following table 1. Country 2. State 3. District But using hierarchyid in SqlServer 2008, I think I can store the information in a single table called Region. Am I right?
0
5,645,563
04/13/2011 07:02:06
709,297
04/13/2011 04:59:06
1
0
Displaying Score card in Online examination system in asp.net c#
I am developing a project online examination system in asp.net(C#). I used a timer in it and previous and next buttons. In this system the user has to select a subject like c#,asp.net, and according to that he will get the questions. there are four options for answer. User has to select any one of them. i used radiobuttons for that. I placed 6 questions. But at the end of the text i couldn't get the total score. If your getting please answer....
asp.net
null
null
null
null
04/15/2011 16:00:56
not a real question
Displaying Score card in Online examination system in asp.net c# === I am developing a project online examination system in asp.net(C#). I used a timer in it and previous and next buttons. In this system the user has to select a subject like c#,asp.net, and according to that he will get the questions. there are four options for answer. User has to select any one of them. i used radiobuttons for that. I placed 6 questions. But at the end of the text i couldn't get the total score. If your getting please answer....
1
3,608,085
08/31/2010 10:22:05
434,922
08/30/2010 12:01:38
1
0
Neo4J installation problem
I am installing neo4j.py on ubuntu 10.04 and i got the following errors while executing: $ sudo python setup.py install Traceback (most recent call last): File "setup.py", line 146, in <module> main() File "setup.py", line 143, in main setup(**args) File "/usr/lib/python2.6/distutils/core.py", line 113, in setup _setup_distribution = dist = klass(attrs) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 221, in __init__ self.fetch_build_eggs(attrs.pop('setup_requires')) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 245, in fetch_build_eggs parse_requirements(requires), installer=self.fetch_build_egg File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 544, in resolve dist = best[req.key] = env.best_match(req, self, installer) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 786, in best_match return self.obtain(req, installer) # try and download/install File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 798, in obtain return installer(requirement) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 293, in fetch_build_egg return cmd.easy_install(req) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 582, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 612, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 802, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 1079, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 1068, in run_setup run_setup(setup_script, args) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 29, in run_setup lambda: execfile( File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 70, in run return func() File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 31, in <lambda> {'__file__':setup_script, '__name__':'__main__'} File "setup.py", line 172, in <module> File "/tmp/easy_install-p8ABhF/JCC-2.6/helpers/linux.py", line 64, in patch_setuptools NotImplementedError: Shared mode is disabled, setuptools patch.43.0.6c11 must be applied to enable it or the NO_SHARED environment variable must be set to turn off this error. sudo patch -d /usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg -Nup0 < /tmp/easy_install-p8ABhF/JCC-2.6/jcc/patches/patch.43.0.6c11 See /tmp/easy_install-p8ABhF/JCC-2.6/INSTALL for more information about shared mode. any clue on how to solve it? thx
neo4j
null
null
null
null
06/20/2012 12:40:09
off topic
Neo4J installation problem === I am installing neo4j.py on ubuntu 10.04 and i got the following errors while executing: $ sudo python setup.py install Traceback (most recent call last): File "setup.py", line 146, in <module> main() File "setup.py", line 143, in main setup(**args) File "/usr/lib/python2.6/distutils/core.py", line 113, in setup _setup_distribution = dist = klass(attrs) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 221, in __init__ self.fetch_build_eggs(attrs.pop('setup_requires')) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 245, in fetch_build_eggs parse_requirements(requires), installer=self.fetch_build_egg File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 544, in resolve dist = best[req.key] = env.best_match(req, self, installer) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 786, in best_match return self.obtain(req, installer) # try and download/install File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/pkg_resources.py", line 798, in obtain return installer(requirement) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/dist.py", line 293, in fetch_build_egg return cmd.easy_install(req) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 582, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 612, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 802, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 1079, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/command/easy_install.py", line 1068, in run_setup run_setup(setup_script, args) File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 29, in run_setup lambda: execfile( File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 70, in run return func() File "/usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg/setuptools/sandbox.py", line 31, in <lambda> {'__file__':setup_script, '__name__':'__main__'} File "setup.py", line 172, in <module> File "/tmp/easy_install-p8ABhF/JCC-2.6/helpers/linux.py", line 64, in patch_setuptools NotImplementedError: Shared mode is disabled, setuptools patch.43.0.6c11 must be applied to enable it or the NO_SHARED environment variable must be set to turn off this error. sudo patch -d /usr/local/lib/python2.6/dist-packages/distribute-0.6.14-py2.6.egg -Nup0 < /tmp/easy_install-p8ABhF/JCC-2.6/jcc/patches/patch.43.0.6c11 See /tmp/easy_install-p8ABhF/JCC-2.6/INSTALL for more information about shared mode. any clue on how to solve it? thx
2
10,738,383
05/24/2012 13:23:17
1,415,095
05/24/2012 12:54:23
1
0
converting vb6 proct
I have a very useful vb6 program that reads ms access tables and loads the data onto a sql server database in the correct format. The customer maintains his data using the access tables. The vb6 program allows him to then select the data categories he wants and loads the data onto a sql server database online. I haven't used vb.net yet. How useful is the vb6 to vb.net conversion process likely to be? I don't want to spend hours on an impossible task! Thanks
vb6-migration
null
null
null
null
05/29/2012 13:14:10
not a real question
converting vb6 proct === I have a very useful vb6 program that reads ms access tables and loads the data onto a sql server database in the correct format. The customer maintains his data using the access tables. The vb6 program allows him to then select the data categories he wants and loads the data onto a sql server database online. I haven't used vb.net yet. How useful is the vb6 to vb.net conversion process likely to be? I don't want to spend hours on an impossible task! Thanks
1
7,258,795
08/31/2011 14:49:42
610,144
02/09/2011 17:24:50
5
1
html table refresh using jquery/ajax on search
I have very big page, I will searching using first name, last name, now the page refreshes with user details along with the problem cases he has. The problem cases section is a simple html table and have from and to date search fields with Search button. On provided from and to dates and on click of Search button, I want to refresh the cases between those dates without refreshing the entire page. Now I am doing it with entire page refresh. Please help me how should I do with jQuery/ajax without using any external ajax tools. I am using Java/JSP. I have everything in backend which returns List of objects required. When I am using below code I get the entire html page as result in "data" variable. $.ajax({ type: "POST", url: "caseSearch", data:"FromDate=" + fromDate, dataType: "text/html;charset=utf-8", success: function(data) { alert(data); $("#caseResult").html(data); } });
jquery
ajax
jsp
table
null
null
open
html table refresh using jquery/ajax on search === I have very big page, I will searching using first name, last name, now the page refreshes with user details along with the problem cases he has. The problem cases section is a simple html table and have from and to date search fields with Search button. On provided from and to dates and on click of Search button, I want to refresh the cases between those dates without refreshing the entire page. Now I am doing it with entire page refresh. Please help me how should I do with jQuery/ajax without using any external ajax tools. I am using Java/JSP. I have everything in backend which returns List of objects required. When I am using below code I get the entire html page as result in "data" variable. $.ajax({ type: "POST", url: "caseSearch", data:"FromDate=" + fromDate, dataType: "text/html;charset=utf-8", success: function(data) { alert(data); $("#caseResult").html(data); } });
0
6,096,530
05/23/2011 11:27:21
488,505
09/29/2010 12:36:11
186
0
How to apply different Design pattern in project
I have worked on small project so far and never used design pattern as such. We have several design pattern like 1. Creational patterns 2. Structural patterns 3. Behavioral patterns When and where these Pattern comes in to the picture while we start Requirement analysis and design. 1. How to apply Design Pattern in a project. 2.I wanted to know whether all three can be used in a single project? 3.How can I determine particular thing/problem etc.. need to modeled using Creational Pattern or Structural patterns or Behavioral patterns.
c++
design-patterns
null
null
null
05/23/2011 12:29:49
off topic
How to apply different Design pattern in project === I have worked on small project so far and never used design pattern as such. We have several design pattern like 1. Creational patterns 2. Structural patterns 3. Behavioral patterns When and where these Pattern comes in to the picture while we start Requirement analysis and design. 1. How to apply Design Pattern in a project. 2.I wanted to know whether all three can be used in a single project? 3.How can I determine particular thing/problem etc.. need to modeled using Creational Pattern or Structural patterns or Behavioral patterns.
2
7,134,568
08/20/2011 20:42:16
765,409
05/23/2011 03:58:39
174
3
Inconsistency when I'm mapping lists into a dictionary using dict and zip - Python
I tried this example and it worked fine: http://stackoverflow.com/questions/209840/map-two-lists-into-a-dictionary-in-python/209854#209854 But if I replaced "keys" with this list: ['2', '3', '2', '3', '4', '2', '4', '2', '2', '3', '2', '3', '4'] and "values" with this list: [2, 3, 4, 5, 6, 4, 2, 1, 1, 2, 3, 4, 5] The dict class tried to make a dictionary of the "values" part alone! OUTPUT: {'3': 4, '2': 3, '4': 5} Try it yourselves, you should get the same answer. A why and an alternative to this would be great.
python
list
dictionary
null
null
null
open
Inconsistency when I'm mapping lists into a dictionary using dict and zip - Python === I tried this example and it worked fine: http://stackoverflow.com/questions/209840/map-two-lists-into-a-dictionary-in-python/209854#209854 But if I replaced "keys" with this list: ['2', '3', '2', '3', '4', '2', '4', '2', '2', '3', '2', '3', '4'] and "values" with this list: [2, 3, 4, 5, 6, 4, 2, 1, 1, 2, 3, 4, 5] The dict class tried to make a dictionary of the "values" part alone! OUTPUT: {'3': 4, '2': 3, '4': 5} Try it yourselves, you should get the same answer. A why and an alternative to this would be great.
0
10,954,692
06/08/2012 19:06:37
1,333,942
04/15/2012 00:09:09
1
0
wordpress: new page created on user signup
OK So what I am trying to do is this. When a new user signs up, they input their username/password in the reg form. After they sign up, in the dashboard of wp, a new page is creates for them as a child of another page (essentially a client page). This new page is created with the user's username as the title. How is this achievable. I know it has to be but im just not able to wrap my mind around it quite yet. Thanks for the help Z
php
wordpress
user
page
creation
06/09/2012 05:21:06
not a real question
wordpress: new page created on user signup === OK So what I am trying to do is this. When a new user signs up, they input their username/password in the reg form. After they sign up, in the dashboard of wp, a new page is creates for them as a child of another page (essentially a client page). This new page is created with the user's username as the title. How is this achievable. I know it has to be but im just not able to wrap my mind around it quite yet. Thanks for the help Z
1
6,088,141
05/22/2011 13:15:02
267,892
02/06/2010 21:09:20
1,114
66
MySQL doesn't respect UNIQUE and PRIMARY-keys
*To start with, I have to say that this is the first time I have ever tried to write SQL, which means I'm a n00b. Have some patience, please..* Now, I'm trying to create a table called "push" in my database like this: CREATE TABLE push (id int NOT NULL AUTO_INCREMENT, UDID varchar(40) NOT NULL, token varchar(64) NOT NULL, lastpost int DEFAULT '0', PRIMARY KEY(id), UNIQUE KEY(id, UDID, token)); That works, but not as expected. If I now try to insert some values here like this: INSERT INTO push (UDID, token, lastpost) VALUES ('123456789abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwqyz123456789', 211); INSERT INTO push (UDID, token, lastpost) VALUES ('123456789abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwqyz123456789', 211); That would, in my eyes, cause an error, because the UDID and token are equal, but it does not trigger any error at all, it just inserts the duplicate. I might have missed something here, but I can't find out what. How can I make this return the expected result? Thanks.
php
mysql
sql
duplicates
unique
null
open
MySQL doesn't respect UNIQUE and PRIMARY-keys === *To start with, I have to say that this is the first time I have ever tried to write SQL, which means I'm a n00b. Have some patience, please..* Now, I'm trying to create a table called "push" in my database like this: CREATE TABLE push (id int NOT NULL AUTO_INCREMENT, UDID varchar(40) NOT NULL, token varchar(64) NOT NULL, lastpost int DEFAULT '0', PRIMARY KEY(id), UNIQUE KEY(id, UDID, token)); That works, but not as expected. If I now try to insert some values here like this: INSERT INTO push (UDID, token, lastpost) VALUES ('123456789abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwqyz123456789', 211); INSERT INTO push (UDID, token, lastpost) VALUES ('123456789abcdefghijklmnopqrstuvwxyz', 'abcdefghijklmnopqrstuvwqyz123456789', 211); That would, in my eyes, cause an error, because the UDID and token are equal, but it does not trigger any error at all, it just inserts the duplicate. I might have missed something here, but I can't find out what. How can I make this return the expected result? Thanks.
0
7,913,270
10/27/2011 08:15:22
880,118
08/05/2011 07:55:59
16
3
IOException when opening JFileChooser
Ok this one is really weird. Every first time my application opens a JFileChooser it throws a IOException then some icons don't show properly. java.io.IOException at sun.awt.image.GifImageDecoder.readHeader(GifImageDecoder.java:265) at sun.awt.image.GifImageDecoder.produceImage(GifImageDecoder.java:102) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) Now when I dig into the error, it seems like on one icon when it tries to read the header, it retrieve only the first 10 bytes which is not enough. I've have checked the icons files and they all seem OK. I've tried to override the icon file with another one that loads properly before this error but same thing. Any ideas?
java
swing
null
null
null
null
open
IOException when opening JFileChooser === Ok this one is really weird. Every first time my application opens a JFileChooser it throws a IOException then some icons don't show properly. java.io.IOException at sun.awt.image.GifImageDecoder.readHeader(GifImageDecoder.java:265) at sun.awt.image.GifImageDecoder.produceImage(GifImageDecoder.java:102) at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246) at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172) at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136) Now when I dig into the error, it seems like on one icon when it tries to read the header, it retrieve only the first 10 bytes which is not enough. I've have checked the icons files and they all seem OK. I've tried to override the icon file with another one that loads properly before this error but same thing. Any ideas?
0
6,227,836
06/03/2011 13:41:51
208,348
11/11/2009 03:04:55
154
1
How to append data into the same file in IsolatedStorage for Windows Phone
This is the problem I wanted to solve:<br/> 1. Create a file, add data and Save it in isolatedStorage. 2. Open the file, add more data to this file. How do I append data into this file? Will the new data line up ahead of the old data? Some code will be appreciated. Thanks
windows-phone-7
null
null
null
null
null
open
How to append data into the same file in IsolatedStorage for Windows Phone === This is the problem I wanted to solve:<br/> 1. Create a file, add data and Save it in isolatedStorage. 2. Open the file, add more data to this file. How do I append data into this file? Will the new data line up ahead of the old data? Some code will be appreciated. Thanks
0
11,377,455
07/07/2012 18:09:01
1,472,277
06/21/2012 13:40:37
1
0
How to get the value in a text box using javascript?
**i loaded a textbox using jquery**. it's id is bid_id. but this doesn't invokes the keyup function of this textbox by specifying $(document).ready(function() { $("#bid_id").keyup(function() { please some one help me..
php
javascript
jquery
html
null
07/08/2012 13:16:27
not a real question
How to get the value in a text box using javascript? === **i loaded a textbox using jquery**. it's id is bid_id. but this doesn't invokes the keyup function of this textbox by specifying $(document).ready(function() { $("#bid_id").keyup(function() { please some one help me..
1
2,238,522
02/10/2010 16:34:52
268,850
02/08/2010 17:50:52
29
1
Significance of PermGen Spac
What is the significance of PermGen space in java.
permgen
null
null
null
null
null
open
Significance of PermGen Spac === What is the significance of PermGen space in java.
0
4,984,832
02/13/2011 15:00:09
58,394
01/23/2009 18:51:59
2,883
24
What is the output of "grails stats" for your largest Grails project?
`grails stats` gives various code statistics for a given Grails project. Typical output can look like something along the lines of: +----------------------+-------+-------+ | Name | Files | LOC | +----------------------+-------+-------+ | Controllers | 4 | 183 | | Domain Classes | 8 | 264 | | Jobs | 1 | 10 | | Services | 4 | 297 | | Tag Libraries | 2 | 63 | | Unit Tests | 17 | 204 | +----------------------+-------+-------+ | Totals | 36 | 1021 | +----------------------+-------+-------+ I'm curious about the typical division of code between the various artifacts in Grails projects (such as the ratio LOC(controllers) / LOC(services), etc.). <b>Please share the `grails stats` output of your largest Grails project to contribute your statistics to this question.</b>
grails
null
null
null
null
02/14/2011 15:07:47
off topic
What is the output of "grails stats" for your largest Grails project? === `grails stats` gives various code statistics for a given Grails project. Typical output can look like something along the lines of: +----------------------+-------+-------+ | Name | Files | LOC | +----------------------+-------+-------+ | Controllers | 4 | 183 | | Domain Classes | 8 | 264 | | Jobs | 1 | 10 | | Services | 4 | 297 | | Tag Libraries | 2 | 63 | | Unit Tests | 17 | 204 | +----------------------+-------+-------+ | Totals | 36 | 1021 | +----------------------+-------+-------+ I'm curious about the typical division of code between the various artifacts in Grails projects (such as the ratio LOC(controllers) / LOC(services), etc.). <b>Please share the `grails stats` output of your largest Grails project to contribute your statistics to this question.</b>
2
157,278
10/01/2008 12:04:32
23,855
09/30/2008 17:27:29
41
4
What are the best resources for preparing for a MCTS exam.
I am considering taking the MCTS exam (employer will pay) with the intention of gaining a core understanding of the .NET framework. Also, I plan to take the C# version. What are the best preparation resources. (I am not interested in brain dumps, as my goal is to learn, not just pass)
mcts
c#
certification
null
null
09/10/2011 20:00:45
off topic
What are the best resources for preparing for a MCTS exam. === I am considering taking the MCTS exam (employer will pay) with the intention of gaining a core understanding of the .NET framework. Also, I plan to take the C# version. What are the best preparation resources. (I am not interested in brain dumps, as my goal is to learn, not just pass)
2
4,753,064
01/20/2011 21:54:03
270,483
02/10/2010 17:25:04
306
10
Javascript ajax double request
I have a AJAX jQuery chat application, it works by asking for new messages, at the start it just asks for 20 most recent messages, then it gets the count of the latest message, so when it asks again, it knows what the last message ID was, and the server returns message since then. The issue is on slower connections, it takes longer then the rate it requests, resulting in getting more then one of the same message because there are more then one request running with the same old message ID. How would I make sure it only is running one request at a time?
javascript
jquery
html
ajax
null
null
open
Javascript ajax double request === I have a AJAX jQuery chat application, it works by asking for new messages, at the start it just asks for 20 most recent messages, then it gets the count of the latest message, so when it asks again, it knows what the last message ID was, and the server returns message since then. The issue is on slower connections, it takes longer then the rate it requests, resulting in getting more then one of the same message because there are more then one request running with the same old message ID. How would I make sure it only is running one request at a time?
0
6,016,956
05/16/2011 11:54:24
688,663
04/02/2011 06:11:43
7
2
Admob Integration in iPhone
Could any one helpme with how to add admob codes in Appdelegate file. Currently i have the following code in my appdelegate file. - (void)applicationDidFinishLaunching:(UIApplication *)application { [web_online loadHTMLString:@"<h1>Loading...</h1>" baseURL:nil]; current_word = [[NSString alloc] initWithString:@"keyword"]; current_url = [[NSString alloc] initWithString:@"http://www.google.com"]; #if 0 if ([[NSUserDefaults standardUserDefaults] boolForKey:@"auto_correction"] == NO) search_main.autocorrectionType = UITextAutocorrectionTypeYes; else search_main.autocorrectionType = UITextAutocorrectionTypeNo; #endif //search_main.keyboardAppearance = UIKeyboardAppearanceAlert; search_main.autocorrectionType = UITextAutocorrectionTypeNo; search_main.autocapitalizationType = UITextAutocapitalizationTypeNone; [self init_data]; [self init_sound]; [window addSubview:nav_main.view]; [window addSubview:view_start]; #ifdef DISABLE_ADMOB view_ad.hidden = YES; #endif // Override point for customization after application launch [window makeKeyAndVisible]; } My question is how to add the admob codes ie the code below bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; // Specify the ad's "unit identifier." This is your AdMob Publisher ID. bannerView_.adUnitID = @"67576511260"; // Let the runtime know which UIViewController to restore after taking // the user wherever the ad goes and add it to the view hierarchy. bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. [bannerView_ loadRequest:[GADRequest request]]; in the appdelegate file. Everything else i have done. All my code is done in appdelegate file . ie why this??
iphone
null
null
null
null
05/16/2011 19:21:02
not a real question
Admob Integration in iPhone === Could any one helpme with how to add admob codes in Appdelegate file. Currently i have the following code in my appdelegate file. - (void)applicationDidFinishLaunching:(UIApplication *)application { [web_online loadHTMLString:@"<h1>Loading...</h1>" baseURL:nil]; current_word = [[NSString alloc] initWithString:@"keyword"]; current_url = [[NSString alloc] initWithString:@"http://www.google.com"]; #if 0 if ([[NSUserDefaults standardUserDefaults] boolForKey:@"auto_correction"] == NO) search_main.autocorrectionType = UITextAutocorrectionTypeYes; else search_main.autocorrectionType = UITextAutocorrectionTypeNo; #endif //search_main.keyboardAppearance = UIKeyboardAppearanceAlert; search_main.autocorrectionType = UITextAutocorrectionTypeNo; search_main.autocapitalizationType = UITextAutocapitalizationTypeNone; [self init_data]; [self init_sound]; [window addSubview:nav_main.view]; [window addSubview:view_start]; #ifdef DISABLE_ADMOB view_ad.hidden = YES; #endif // Override point for customization after application launch [window makeKeyAndVisible]; } My question is how to add the admob codes ie the code below bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; // Specify the ad's "unit identifier." This is your AdMob Publisher ID. bannerView_.adUnitID = @"67576511260"; // Let the runtime know which UIViewController to restore after taking // the user wherever the ad goes and add it to the view hierarchy. bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. [bannerView_ loadRequest:[GADRequest request]]; in the appdelegate file. Everything else i have done. All my code is done in appdelegate file . ie why this??
1
7,048,888
08/13/2011 05:57:02
84,458
03/30/2009 05:51:22
2,325
30
std::vector<std::string> to char* array
I have a `std::vector<std::string>` that I need to use for a `C` function's argument that reads `char** foo`. I have [seen][1] [how][2] to convert a `std::string` to `char*`. As a newcomer to `C++`, I'm trying to piece together how to perform this conversion on each element of the vector and produce the `char*` array. I've seen several closely related SO questions, but most appear to illustrate ways to go the other direction and create `std::vector<std::string>`. Thanks. [1]: http://stackoverflow.com/questions/347949/convert-stdstring-to-const-char-or-char [2]: http://stackoverflow.com/questions/5620329/convert-stdstring-to-char-alternative
c++
c
stdvector
null
null
null
open
std::vector<std::string> to char* array === I have a `std::vector<std::string>` that I need to use for a `C` function's argument that reads `char** foo`. I have [seen][1] [how][2] to convert a `std::string` to `char*`. As a newcomer to `C++`, I'm trying to piece together how to perform this conversion on each element of the vector and produce the `char*` array. I've seen several closely related SO questions, but most appear to illustrate ways to go the other direction and create `std::vector<std::string>`. Thanks. [1]: http://stackoverflow.com/questions/347949/convert-stdstring-to-const-char-or-char [2]: http://stackoverflow.com/questions/5620329/convert-stdstring-to-char-alternative
0
4,773,145
01/23/2011 09:34:31
80,040
03/19/2009 14:13:39
514
56
Error when running unit test
I have this part of code in my indexController: public function init() { $this->_translate = $this->getInvokeArg('bootstrap')->getResource('translate'); } This works all fine and in PRD i don't get any errors But when i am running my unit tests it generates the following error: > Fatal error: Call to a member function > getResource() on a non-object in > K:\stage > 5\application\controllers\IndexController.php > on line 9 This is my testcode: class IndexControllerTest extends ControllerTestCase { public function testCanDisplayOurHomepage() { //Go to the main page of the webapplication $this->dispatch('/'); //check if we don't end up in an error controller $this->assertNotController('error'); $this->assertNotAction('error'); //Ok no error lets check if we are on the home page $this->assertModule('default'); $this->assertController('index'); $this->assertAction('index'); $this->assertResponseCode(200); } }
zend-framework
phpunit
null
null
null
null
open
Error when running unit test === I have this part of code in my indexController: public function init() { $this->_translate = $this->getInvokeArg('bootstrap')->getResource('translate'); } This works all fine and in PRD i don't get any errors But when i am running my unit tests it generates the following error: > Fatal error: Call to a member function > getResource() on a non-object in > K:\stage > 5\application\controllers\IndexController.php > on line 9 This is my testcode: class IndexControllerTest extends ControllerTestCase { public function testCanDisplayOurHomepage() { //Go to the main page of the webapplication $this->dispatch('/'); //check if we don't end up in an error controller $this->assertNotController('error'); $this->assertNotAction('error'); //Ok no error lets check if we are on the home page $this->assertModule('default'); $this->assertController('index'); $this->assertAction('index'); $this->assertResponseCode(200); } }
0
5,735,922
04/20/2011 19:59:48
717,823
04/20/2011 19:59:48
1
0
Windows service created to shut down computer is not working when computer is locked
I have created a windows service in vb. net to shut down the computer. Service works fine when computer is not locked (Cntrl + ALt + Delete). But some how it doesn't shut down when my computer is locked.
.net
null
null
null
null
null
open
Windows service created to shut down computer is not working when computer is locked === I have created a windows service in vb. net to shut down the computer. Service works fine when computer is not locked (Cntrl + ALt + Delete). But some how it doesn't shut down when my computer is locked.
0
4,078,782
11/02/2010 14:44:32
494,854
11/02/2010 14:34:12
1
0
knowledge sharing
i want to learn the best way of shwring knowledge in a workplace
python
null
null
null
null
11/02/2010 14:46:30
not a real question
knowledge sharing === i want to learn the best way of shwring knowledge in a workplace
1
4,884,413
02/03/2011 09:37:25
578,083
01/17/2011 05:22:12
36
1
Get datetime object .
Hi all i want a datetime object. In which I want to set time part by my own. Like i want DateTime object who will have todays system date and I want to set its time to 08:00:00.
c#
datetime
datetime-format
null
null
null
open
Get datetime object . === Hi all i want a datetime object. In which I want to set time part by my own. Like i want DateTime object who will have todays system date and I want to set its time to 08:00:00.
0
1,225,334
08/04/2009 01:07:43
81,717
03/23/2009 23:19:43
277
20
Flex: Converting a GUID to Base64
In Flex, I have a GUID that I receive as input in the following format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" as a string. How would I convert this to a string of Base64 encoded values? Please note that we have to account for leading zeroes in each section of the GUID, for example, "**00**91AFBC-8558-482A-9CF6-64F1745E7AC1"
flex
base64
null
null
null
null
open
Flex: Converting a GUID to Base64 === In Flex, I have a GUID that I receive as input in the following format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" as a string. How would I convert this to a string of Base64 encoded values? Please note that we have to account for leading zeroes in each section of the GUID, for example, "**00**91AFBC-8558-482A-9CF6-64F1745E7AC1"
0
8,621,941
12/24/2011 00:53:03
649,482
03/08/2011 08:23:16
310
1
Very simple private videos script?
I'm in the process of searching for a PHP/MySQL script for a site where the admin could upload videos and asign them to users. This is for a training site. **Solutions ruled out:** - [VIMP][1] - the free community version can't be used for commercial purposes and the cheapest version that can be is expensive (398 euros) - [TubePress][2] - I need a user/admin login panel on my site, not on youtube - [Kaltura][3] - not free unfortunately **Possible solutions:** - [PHPMotion][4] - this one seems really nice & it's free. If I don't find anything better/simpler I'll go with this. The only downside is that it has a lot of features I don't need but I can get used to that. Do you know of any other PHP/MySQL script? Or a Wordpress/Joomla/Drupal/other-CMS script? Preferably free. [1]: http://www.vimp.com/en/compare-versions.html [2]: http://tubepress.org/ [3]: http://corp.kaltura.com/ [4]: http://phpmotion.com
php
mysql
youtube
null
null
12/24/2011 01:32:28
off topic
Very simple private videos script? === I'm in the process of searching for a PHP/MySQL script for a site where the admin could upload videos and asign them to users. This is for a training site. **Solutions ruled out:** - [VIMP][1] - the free community version can't be used for commercial purposes and the cheapest version that can be is expensive (398 euros) - [TubePress][2] - I need a user/admin login panel on my site, not on youtube - [Kaltura][3] - not free unfortunately **Possible solutions:** - [PHPMotion][4] - this one seems really nice & it's free. If I don't find anything better/simpler I'll go with this. The only downside is that it has a lot of features I don't need but I can get used to that. Do you know of any other PHP/MySQL script? Or a Wordpress/Joomla/Drupal/other-CMS script? Preferably free. [1]: http://www.vimp.com/en/compare-versions.html [2]: http://tubepress.org/ [3]: http://corp.kaltura.com/ [4]: http://phpmotion.com
2
3,920,964
10/13/2010 05:17:34
280,924
02/25/2010 05:21:15
94
6
why is the output of this java code: "inside String argument method"
Why is the output of the following snippet: inside String argument method. Isn't null "Object" type ? class A{ void printVal(String obj){ System.out.println("inside String argument method"); } void printVal(Object obj){ System.out.println("inside Object argument method"); } public static void main(String[] args){ A a = new A(); a.printVal(null); } }
java
basics
null
null
null
null
open
why is the output of this java code: "inside String argument method" === Why is the output of the following snippet: inside String argument method. Isn't null "Object" type ? class A{ void printVal(String obj){ System.out.println("inside String argument method"); } void printVal(Object obj){ System.out.println("inside Object argument method"); } public static void main(String[] args){ A a = new A(); a.printVal(null); } }
0
6,424,360
06/21/2011 11:13:54
320,322
04/19/2010 12:30:50
115
6
How to use Grape with Oracle driver ?
In my groovy script, I have this code : @Grapes([ @Grab(group='com.oracle', module='ojdbc14', version='10.2.0.3.0') ]) When I run the script, I receive an error message : java.lang.RuntimeException: Error grabbing Grapes -- [download failed: com.oracle#ojdbc14;10.2.0.3.0!ojdbc14.jar] So, I download the jar file from oracle and I add it to my maven repository : mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=\path\to\ojdbc14.jar I try again and I receive the same error message I add a config file as describe on the [grape page][1] , with a ibiblio refering to my local repository, I try again and have also the same error. I tried with another group like jfreechart and it is working. So, why is it not working with ojdbc14.jar Thanks a lot [1]: http://groovy.codehaus.org/Grape
oracle
groovy
grab
grape
null
null
open
How to use Grape with Oracle driver ? === In my groovy script, I have this code : @Grapes([ @Grab(group='com.oracle', module='ojdbc14', version='10.2.0.3.0') ]) When I run the script, I receive an error message : java.lang.RuntimeException: Error grabbing Grapes -- [download failed: com.oracle#ojdbc14;10.2.0.3.0!ojdbc14.jar] So, I download the jar file from oracle and I add it to my maven repository : mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=\path\to\ojdbc14.jar I try again and I receive the same error message I add a config file as describe on the [grape page][1] , with a ibiblio refering to my local repository, I try again and have also the same error. I tried with another group like jfreechart and it is working. So, why is it not working with ojdbc14.jar Thanks a lot [1]: http://groovy.codehaus.org/Grape
0
11,531,469
07/17/2012 21:59:43
337,690
05/10/2010 21:08:25
1,592
31
PHP DateTime / DateInterval object difference returning strange results
I have the following [PHP datetime object][1] giving strange results: <?php $date = new DateTime("2013-01-01"); $date2 = new DateTime("2011-01-01"); $interval = $date2->diff($date); echo $interval->m; ?> - When using months (m), returns 0. Incorrect. - When I switch the interval to years (y) it returns 2 which is correct. - When I switch to days (d) it returns 0, incorrect. - When I switch to days using "days", it returns 731 which is correct I am not sure why certain intervals are working and others are not. Any ideas or is this expected? I am only interested in using the DateTime object so suggestions for strtotime or other older methods are not considered valid in this case. [1]: http://www.php.net/manual/en/class.dateinterval.php
php
datetime
date
null
null
null
open
PHP DateTime / DateInterval object difference returning strange results === I have the following [PHP datetime object][1] giving strange results: <?php $date = new DateTime("2013-01-01"); $date2 = new DateTime("2011-01-01"); $interval = $date2->diff($date); echo $interval->m; ?> - When using months (m), returns 0. Incorrect. - When I switch the interval to years (y) it returns 2 which is correct. - When I switch to days (d) it returns 0, incorrect. - When I switch to days using "days", it returns 731 which is correct I am not sure why certain intervals are working and others are not. Any ideas or is this expected? I am only interested in using the DateTime object so suggestions for strtotime or other older methods are not considered valid in this case. [1]: http://www.php.net/manual/en/class.dateinterval.php
0
1,114,860
07/11/2009 22:52:20
135,459
07/09/2009 06:24:39
34
4
What is the best C++ compiler?
Can a C++ compiler produce a not so good binary? You can think here of the output's robustness and performance. Is there such a thing as the "best" C++ compiler to use? If not, what are the strong points, and of course, the not-so-strong points, of the existing compilers (g++, Intel C++ Compiler, Visual C++).
c++
compiler
null
null
null
09/13/2011 12:33:24
not constructive
What is the best C++ compiler? === Can a C++ compiler produce a not so good binary? You can think here of the output's robustness and performance. Is there such a thing as the "best" C++ compiler to use? If not, what are the strong points, and of course, the not-so-strong points, of the existing compilers (g++, Intel C++ Compiler, Visual C++).
4
8,004,737
11/04/2011 04:00:35
275,728
02/18/2010 01:55:44
1
0
what is the best voice format on internet
I want my websites play voices after dom ready.I know mp3 works, but I want to load voice file via javascript. then, which format is the best on internet, should load by javascript? thanks
javascript
internet
voice
multimedia
null
11/04/2011 04:05:43
not constructive
what is the best voice format on internet === I want my websites play voices after dom ready.I know mp3 works, but I want to load voice file via javascript. then, which format is the best on internet, should load by javascript? thanks
4
10,182,719
04/16/2012 22:40:42
1,259,615
03/09/2012 15:28:26
13
0
Using .hide() instead of .remove()
The output should be like in this [demo](http://jsfiddle.net/SpB3m/3/). The problem is that I need to use .hide() instead of .remove(). Does anyone have any idea to solve it?
jquery
null
null
null
null
04/17/2012 12:45:24
not a real question
Using .hide() instead of .remove() === The output should be like in this [demo](http://jsfiddle.net/SpB3m/3/). The problem is that I need to use .hide() instead of .remove(). Does anyone have any idea to solve it?
1
5,617,271
04/11/2011 05:52:04
433,570
08/28/2010 07:11:43
350
7
tinyxpath create TinyXPath::xpath_processor with non-root element?
I have successfully used TinyXpath with root node as below const char* xpath ="/MyRoot/A/B"; TinyXpath::xpath_processor xp_proc(mRootElement, xpath); (this will find all B under all A of MyRoot) I wonder if I can pass non-root element to the constructor something like below const char* xpath = "./A/B"; TinyXpath::xpath_processor xp_proc(A_Element, xpath); (I want to find all B under specific A, when I have A_Element) Thank you
xml
tinyxpath
null
null
null
null
open
tinyxpath create TinyXPath::xpath_processor with non-root element? === I have successfully used TinyXpath with root node as below const char* xpath ="/MyRoot/A/B"; TinyXpath::xpath_processor xp_proc(mRootElement, xpath); (this will find all B under all A of MyRoot) I wonder if I can pass non-root element to the constructor something like below const char* xpath = "./A/B"; TinyXpath::xpath_processor xp_proc(A_Element, xpath); (I want to find all B under specific A, when I have A_Element) Thank you
0
6,251,760
06/06/2011 12:07:35
781,038
06/02/2011 11:34:21
1
0
Strange exception.
Hey guys we are trying to make a client-server racing game for our semester project but we have some strange error public void updatePosition(int id, ArrayList<Point2D.Float> positions){ if(id==1){ for (int i = 1; i < game.getS().getVehicles().size(); i++) { game.getS().getVehicles().get(i).updatePosition(positions.get(i)); } }else if(id==2){ game.getS().getVehicles().get(1).updatePosition(positions.get(0)); for (int i = 2; i < game.getS().getVehicles().size(); i++) { game.getS().getVehicles().get(i).updatePosition(positions.get(i)); } this is our code and the exception is in this exact row: game.getS().getVehicles().get(1).updatePosition(positions.get(0));
java
nullpointerexception
null
null
null
null
open
Strange exception. === Hey guys we are trying to make a client-server racing game for our semester project but we have some strange error public void updatePosition(int id, ArrayList<Point2D.Float> positions){ if(id==1){ for (int i = 1; i < game.getS().getVehicles().size(); i++) { game.getS().getVehicles().get(i).updatePosition(positions.get(i)); } }else if(id==2){ game.getS().getVehicles().get(1).updatePosition(positions.get(0)); for (int i = 2; i < game.getS().getVehicles().size(); i++) { game.getS().getVehicles().get(i).updatePosition(positions.get(i)); } this is our code and the exception is in this exact row: game.getS().getVehicles().get(1).updatePosition(positions.get(0));
0
10,271,665
04/22/2012 20:05:58
1,350,026
04/22/2012 20:01:48
1
0
jsp Exception error
i get an error "17 in the jsp file: /index.jsp Void methods cannot return a value" i think my exception code is wrong. i don't know how to return an empty string when the user doesn't enter any number . any suggestions <%@ page import="java.io.*"%><%@ page import="java.util.*"%><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> </head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <% String sum = (String) session.getAttribute("sum"); sum = "5"; session.setAttribute("sum",sum); int isum = Integer.parseInt(sum); try { isum=Integer.parseInt(request.getParameter("number")); } catch (NumberFormatException nfe) {return "";} if(request.getParameter("number")!=null && Integer.parseInt(request.getParameter("number"))==isum) { if(request.getParameter("submit") != null){ out.print("Hello");} } %> <body> <title>MAIN</title> <form action="index.jsp" method="post"> Enter 5 = <input type="text" name="number"> <input type="submit" value="continue" name="submit"> </form> </body> </html>
java
html
jsp
null
null
04/25/2012 11:54:31
too localized
jsp Exception error === i get an error "17 in the jsp file: /index.jsp Void methods cannot return a value" i think my exception code is wrong. i don't know how to return an empty string when the user doesn't enter any number . any suggestions <%@ page import="java.io.*"%><%@ page import="java.util.*"%><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> </head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <% String sum = (String) session.getAttribute("sum"); sum = "5"; session.setAttribute("sum",sum); int isum = Integer.parseInt(sum); try { isum=Integer.parseInt(request.getParameter("number")); } catch (NumberFormatException nfe) {return "";} if(request.getParameter("number")!=null && Integer.parseInt(request.getParameter("number"))==isum) { if(request.getParameter("submit") != null){ out.print("Hello");} } %> <body> <title>MAIN</title> <form action="index.jsp" method="post"> Enter 5 = <input type="text" name="number"> <input type="submit" value="continue" name="submit"> </form> </body> </html>
3
11,615,084
07/23/2012 14:56:30
803,954
06/17/2011 21:16:26
166
4
Rails: acts_as_api: Completed 406 Not Acceptable
I'm trying to use acts_as_api. I tried following their tutorial, but I got the titular error and nothing appeared on my screen when I went to the appropriate web page. Here's what I got: app/controllers/qtls_controller.rb def show_json show_id = URI.decode(params[:id]) show_id = show_id.gsub(/\s*$/,'') @qtls = Qtl.find_by_sql("select * from qtls where qtl_name like '%#{show_id}%' or qtl_symbol in (select qtl_symbol from obs_traits where qtl_symbol like '%#{show_id}%' or trait_name like '%#{show_id}%');") respond_to do |format| format.json { render_for_api :lis_json, :json => @qtls, :root => :qtls } end end app/models/qtl.rb class Qtl < ActiveRecord::Base self.primary_key = "qtl_name" acts_as_api api_accessible :lis_json do |t| t.add :qtl_name t.add :qtl_symbol t.add :qtl_symbol_id t.add :qtl_pub_name t.add :favorable_allele_source t.add :treatment t.add :lod t.add :marker_r2 t.add :total_r2 t.add :additivity t.add :map_collection t.add :entry_name t.add :lg t.add :left_end t.add :right_end t.add :nearest_marker t.add :species #t.add :trait_name t.add :comment end def species 'phavu' end #def trait_name # '' << ObsTrait.find_by_sql("select trait_name from obs_traits where entry_name = '#{entry_name}' and qtl_symbol = '#{qtl_symbol}'")[0].trait_name # end end
ruby-on-rails
null
null
null
null
null
open
Rails: acts_as_api: Completed 406 Not Acceptable === I'm trying to use acts_as_api. I tried following their tutorial, but I got the titular error and nothing appeared on my screen when I went to the appropriate web page. Here's what I got: app/controllers/qtls_controller.rb def show_json show_id = URI.decode(params[:id]) show_id = show_id.gsub(/\s*$/,'') @qtls = Qtl.find_by_sql("select * from qtls where qtl_name like '%#{show_id}%' or qtl_symbol in (select qtl_symbol from obs_traits where qtl_symbol like '%#{show_id}%' or trait_name like '%#{show_id}%');") respond_to do |format| format.json { render_for_api :lis_json, :json => @qtls, :root => :qtls } end end app/models/qtl.rb class Qtl < ActiveRecord::Base self.primary_key = "qtl_name" acts_as_api api_accessible :lis_json do |t| t.add :qtl_name t.add :qtl_symbol t.add :qtl_symbol_id t.add :qtl_pub_name t.add :favorable_allele_source t.add :treatment t.add :lod t.add :marker_r2 t.add :total_r2 t.add :additivity t.add :map_collection t.add :entry_name t.add :lg t.add :left_end t.add :right_end t.add :nearest_marker t.add :species #t.add :trait_name t.add :comment end def species 'phavu' end #def trait_name # '' << ObsTrait.find_by_sql("select trait_name from obs_traits where entry_name = '#{entry_name}' and qtl_symbol = '#{qtl_symbol}'")[0].trait_name # end end
0
10,837,025
05/31/2012 15:51:53
432,997
08/27/2010 14:11:47
866
63
Scrolling left/right to new pages
I am creating an application which displays several "pages" of content. Typically this is representative as tabs on a desktop based application. On android, I want to be able to flick between the tabs of information, using there finger anywhere on the screen. The content of these tabs will just be XML views, or programmatically created views. Looking at Applications on android, there are several applications that do this. Google Play, Gmail, Beautiful Widgets, BBC News, Contacts, Engadget. I've looked for several terms, mostly scrollable tabs but haven't found anything that is similar to the above applications. I'm looking at TabHost, TabWidget and ViewPaper at the moment, but not sure if these do what I'm looking for. Can anyone tell me which control can be used in android to get the functionality. Out of the apps listed I'm looking to have it styled more like the Google Play store, with the name of the tab at the top, and the names of the nearby tabs to the left and right if applicable.
java
android
gui
tabs
scrolling
null
open
Scrolling left/right to new pages === I am creating an application which displays several "pages" of content. Typically this is representative as tabs on a desktop based application. On android, I want to be able to flick between the tabs of information, using there finger anywhere on the screen. The content of these tabs will just be XML views, or programmatically created views. Looking at Applications on android, there are several applications that do this. Google Play, Gmail, Beautiful Widgets, BBC News, Contacts, Engadget. I've looked for several terms, mostly scrollable tabs but haven't found anything that is similar to the above applications. I'm looking at TabHost, TabWidget and ViewPaper at the moment, but not sure if these do what I'm looking for. Can anyone tell me which control can be used in android to get the functionality. Out of the apps listed I'm looking to have it styled more like the Google Play store, with the name of the tab at the top, and the names of the nearby tabs to the left and right if applicable.
0
5,916,723
05/06/2011 20:35:03
151,200
08/05/2009 16:50:28
1,927
100
Allowing anonymous access to default page
My ASP.NET Forms 4.0 site is running with forms authentication. By default unauthorized users are denied, and then I allow access to certain pages. I have a problem allowing access to the default url: http:/mysite.com. I have this entry in web.config that defines default page: <defaultDocument> <files> <clear/> <add value="default.aspx" /> </files> </defaultDocument> and I have this location override: <location path="default.aspx"> <system.web> <authorization> <allow users="?"/> </authorization> </system.web> </location> It works OK when I go to the full url: http://mysite.com/default.aspx, but redirects to the login page if I go to http://mysite.com Any ideas what am I doing wrong?
asp.net
forms-authentication
null
null
null
null
open
Allowing anonymous access to default page === My ASP.NET Forms 4.0 site is running with forms authentication. By default unauthorized users are denied, and then I allow access to certain pages. I have a problem allowing access to the default url: http:/mysite.com. I have this entry in web.config that defines default page: <defaultDocument> <files> <clear/> <add value="default.aspx" /> </files> </defaultDocument> and I have this location override: <location path="default.aspx"> <system.web> <authorization> <allow users="?"/> </authorization> </system.web> </location> It works OK when I go to the full url: http://mysite.com/default.aspx, but redirects to the login page if I go to http://mysite.com Any ideas what am I doing wrong?
0
2,749,258
05/01/2010 08:07:31
330,266
05/01/2010 07:54:16
1
0
Android : SQL Lite insertion or create table issue
Team, can anyone please help me to understand what could be the problem in the below snippet of code? It fails after insertion 2 and insertion 3 debug statements I have the contentValues in the Array list, I am iterating the arraylist and inserting the content values in to the database. Log.d("database","before insertion 1 "); liteDatabase = this.openOrCreateDatabase("Sales", MODE_PRIVATE, null); Log.d("database","before insertion 2 "); liteDatabase .execSQL("Create table activity ( ActivityId VARCHAR,Created VARCHAR,AMTaps_X VARCHAR,AMTemperature_X VARCHAR,AccountId VARCHAR,AccountLocation VARCHAR,AccountName VARCHAR,Classification VARCHAR,ActivityType VARCHAR,COTaps_X VARCHAR,COTemperature_X VARCHAR,Comment VARCHAR,ContactWorkPhone VARCHAR,CreatedByName VARCHAR,DSCycleNo_X VARCHAR,DSRouteNo_X VARCHAR,DSSequenceNo_X VARCHAR,Description VARCHAR,HETaps_X VARCHAR,HETemperature_X VARCHAR,Pro_Setup VARCHAR,LastUpdated VARCHAR,LastUpdatedBy VARCHAR,Licensee VARCHAR,MUTaps_X VARCHAR,MUTemperature_X VARCHAR,Objective VARCHAR,OwnerFirstName VARCHAR,OwnerLastName VARCHAR,PhoneNumber VARCHAR,Planned VARCHAR,PlannedCleanActualDt_X VARCHAR,PlannedCleanReason_X VARCHAR,PrimaryOwnedBy VARCHAR,Pro_Name VARCHAR,ServiceRepTerritory_X VARCHAR,ServiceRep_X VARCHAR,Status VARCHAR,Type VARCHAR,HEINDSTapAuditDate VARCHAR,HEINEmployeeType VARCHAR)"); Log.d("database","before insertion 3 "); int counter = 0; int size = arrayList.size(); for (counter = 0; counter < size; counter++) { ContentValues contentValues = (ContentValues) arrayList .get(counter); liteDatabase.insert("activity", "activityInfo", contentValues); Log.d("database", "Database insertion is done"); } }
android
null
null
null
null
12/20/2011 13:16:22
not a real question
Android : SQL Lite insertion or create table issue === Team, can anyone please help me to understand what could be the problem in the below snippet of code? It fails after insertion 2 and insertion 3 debug statements I have the contentValues in the Array list, I am iterating the arraylist and inserting the content values in to the database. Log.d("database","before insertion 1 "); liteDatabase = this.openOrCreateDatabase("Sales", MODE_PRIVATE, null); Log.d("database","before insertion 2 "); liteDatabase .execSQL("Create table activity ( ActivityId VARCHAR,Created VARCHAR,AMTaps_X VARCHAR,AMTemperature_X VARCHAR,AccountId VARCHAR,AccountLocation VARCHAR,AccountName VARCHAR,Classification VARCHAR,ActivityType VARCHAR,COTaps_X VARCHAR,COTemperature_X VARCHAR,Comment VARCHAR,ContactWorkPhone VARCHAR,CreatedByName VARCHAR,DSCycleNo_X VARCHAR,DSRouteNo_X VARCHAR,DSSequenceNo_X VARCHAR,Description VARCHAR,HETaps_X VARCHAR,HETemperature_X VARCHAR,Pro_Setup VARCHAR,LastUpdated VARCHAR,LastUpdatedBy VARCHAR,Licensee VARCHAR,MUTaps_X VARCHAR,MUTemperature_X VARCHAR,Objective VARCHAR,OwnerFirstName VARCHAR,OwnerLastName VARCHAR,PhoneNumber VARCHAR,Planned VARCHAR,PlannedCleanActualDt_X VARCHAR,PlannedCleanReason_X VARCHAR,PrimaryOwnedBy VARCHAR,Pro_Name VARCHAR,ServiceRepTerritory_X VARCHAR,ServiceRep_X VARCHAR,Status VARCHAR,Type VARCHAR,HEINDSTapAuditDate VARCHAR,HEINEmployeeType VARCHAR)"); Log.d("database","before insertion 3 "); int counter = 0; int size = arrayList.size(); for (counter = 0; counter < size; counter++) { ContentValues contentValues = (ContentValues) arrayList .get(counter); liteDatabase.insert("activity", "activityInfo", contentValues); Log.d("database", "Database insertion is done"); } }
1
10,685,861
05/21/2012 13:08:28
1,166,877
01/24/2012 11:33:50
34
1
Null pointer exception occurs when calling getText from EditText in OnClickListener
I have a custom dialog box. When i click "OK", I would like it to get the text from its EditText field. However, it throws a null pointer exception. Code: AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.dialog_delivered, (ViewGroup)findViewById(R.id.llDeliveredDialog)); builder.setMessage("Dialog message"); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { final EditText text = (EditText)findViewById(R.id.etGivenTo); String value = text.getText().toString(); } }); builder.setCancelable(false); builder.setView(layout); builder.show(); XML Layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/llDeliveredDialog" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <EditText android:id="@+id/etGivenTo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" > <requestFocus /> </EditText> </LinearLayout> Any help would be much appreciated.
android
android-widget
null
null
null
null
open
Null pointer exception occurs when calling getText from EditText in OnClickListener === I have a custom dialog box. When i click "OK", I would like it to get the text from its EditText field. However, it throws a null pointer exception. Code: AlertDialog.Builder builder = new AlertDialog.Builder(this); LayoutInflater inflater = (LayoutInflater) getApplicationContext().getSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.dialog_delivered, (ViewGroup)findViewById(R.id.llDeliveredDialog)); builder.setMessage("Dialog message"); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { final EditText text = (EditText)findViewById(R.id.etGivenTo); String value = text.getText().toString(); } }); builder.setCancelable(false); builder.setView(layout); builder.show(); XML Layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/llDeliveredDialog" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <EditText android:id="@+id/etGivenTo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" > <requestFocus /> </EditText> </LinearLayout> Any help would be much appreciated.
0
8,344,135
12/01/2011 15:47:59
823,369
06/30/2011 15:41:39
56
6
What is the best Database Access Technique for VB.Net 2010 Project
I am statrting a new ERP using VB.Net in Visual Studio 2010, I want to ask that what technique should i use for Data Access Layer 1. Normal Sql Queries Directly using System.Data.SqlClient 2. Strongly Typed DataSet 3. Linq To Sql Classes 4. Entity Framework
vb.net
visual-studio-2010
entity-framework
linq-to-sql
.net-4.0
12/01/2011 16:16:43
not constructive
What is the best Database Access Technique for VB.Net 2010 Project === I am statrting a new ERP using VB.Net in Visual Studio 2010, I want to ask that what technique should i use for Data Access Layer 1. Normal Sql Queries Directly using System.Data.SqlClient 2. Strongly Typed DataSet 3. Linq To Sql Classes 4. Entity Framework
4
6,980,240
08/08/2011 09:41:10
876,289
08/03/2011 09:23:39
10
0
Facting in SolNET
The sample application for SolrNET search is in MVC 2. I tried to convert it into MVC 3 application. The search is working perfectly, by connecting to my own solr instance. But the faceting is not getting displayed. private static readonly string[] AllFacetFields = new[] { "Dataaccess", "AccessMethod", "Datacreator", "Dataset", "Geographicalarea"}; And when the I sort according to the best match, price and random, I get the link like, http://localhost:2086/?sort=price But, what should I do, if I want to change the "price" to something else. I have been working on SolrNet only for the last few days and I'm stuck with the faceting.
asp.net-mvc-3
solr
solrnet
null
null
null
open
Facting in SolNET === The sample application for SolrNET search is in MVC 2. I tried to convert it into MVC 3 application. The search is working perfectly, by connecting to my own solr instance. But the faceting is not getting displayed. private static readonly string[] AllFacetFields = new[] { "Dataaccess", "AccessMethod", "Datacreator", "Dataset", "Geographicalarea"}; And when the I sort according to the best match, price and random, I get the link like, http://localhost:2086/?sort=price But, what should I do, if I want to change the "price" to something else. I have been working on SolrNet only for the last few days and I'm stuck with the faceting.
0
5,057,986
02/20/2011 15:34:22
465,558
10/04/2010 05:58:18
105
9
cant access my WCF service thru other machine in the same network
I wrote the most simple wcf service that have one method // return a+b int ICalc::add(int a, int b) When i try to access the service thru local machine - i get the result with no problem. But try to access from other machine i cant get the service. I try to define <security mode="None"/> from the client machine. I try to define web page 'default.htm' to see if i can access and see the web page ( to be more clear .. i can access and see the default.htm page. I try to access using the IP and using the machine name - but nothing ! nothing work. I define my service as WAS. Someone can help me here ?
wcf
null
null
null
null
null
open
cant access my WCF service thru other machine in the same network === I wrote the most simple wcf service that have one method // return a+b int ICalc::add(int a, int b) When i try to access the service thru local machine - i get the result with no problem. But try to access from other machine i cant get the service. I try to define <security mode="None"/> from the client machine. I try to define web page 'default.htm' to see if i can access and see the web page ( to be more clear .. i can access and see the default.htm page. I try to access using the IP and using the machine name - but nothing ! nothing work. I define my service as WAS. Someone can help me here ?
0
8,647,157
12/27/2011 17:00:15
694,170
04/06/2011 04:45:27
8
0
PCI compliance - which SAQ for ecommerce + POS?
Our business will be processing payments with 2 methods: 1. With a physical POS terminal that dials in for payments with a modem (separate from the internet). This is used for card not present customers that call in. 2. Through our ecommerce site which will be using Authorize.net's SIM solution (we don't transmit or store any cardholder data - the user is redirected to a payment form on authorize). I am trying to figure out which (or both?) SAQ's I will need to use. SAQ A and SAQ C look like the most likely candidates. The language that confuses me for SAQ C is: "Merchant has a payment application system and an Internet or public network connection on the same device and/or same local area network (LAN);" Since the POS terminal is on a separate dial-in line, does this mean I can use the really simple SAQ A form and be done with everything? Thanks!
pci
authorize
compliance
null
null
12/27/2011 23:37:07
off topic
PCI compliance - which SAQ for ecommerce + POS? === Our business will be processing payments with 2 methods: 1. With a physical POS terminal that dials in for payments with a modem (separate from the internet). This is used for card not present customers that call in. 2. Through our ecommerce site which will be using Authorize.net's SIM solution (we don't transmit or store any cardholder data - the user is redirected to a payment form on authorize). I am trying to figure out which (or both?) SAQ's I will need to use. SAQ A and SAQ C look like the most likely candidates. The language that confuses me for SAQ C is: "Merchant has a payment application system and an Internet or public network connection on the same device and/or same local area network (LAN);" Since the POS terminal is on a separate dial-in line, does this mean I can use the really simple SAQ A form and be done with everything? Thanks!
2
10,276,931
04/23/2012 08:03:28
88,112
04/07/2009 13:46:49
215
5
WPF Workshop advice and tips
I've been asked to hold a small workshop in work for a group of developers.. these developers have been working in Winforms for a while so should be able to pick it up pretty quickly! The first workshop I'm going to do will cover the very basics of WPF.. so far I've came up with the following topics - Controls (which do what and how to use them). - Styles - Triggers & Databinding - how to convert a winforms-esc view to WPF using MVVM So my question is this, If someone was trying to teach you WPF from the start (pretend you absolutely no knowledge) .. what are the things you would have liked to know and what would have made a big help to you? also, is there any advice you would like me to pass on to new and budding WPF developers :) ? Thanks.
c#
wpf
wpf-controls
null
null
04/23/2012 09:30:09
off topic
WPF Workshop advice and tips === I've been asked to hold a small workshop in work for a group of developers.. these developers have been working in Winforms for a while so should be able to pick it up pretty quickly! The first workshop I'm going to do will cover the very basics of WPF.. so far I've came up with the following topics - Controls (which do what and how to use them). - Styles - Triggers & Databinding - how to convert a winforms-esc view to WPF using MVVM So my question is this, If someone was trying to teach you WPF from the start (pretend you absolutely no knowledge) .. what are the things you would have liked to know and what would have made a big help to you? also, is there any advice you would like me to pass on to new and budding WPF developers :) ? Thanks.
2
5,398,873
03/22/2011 22:55:33
254,455
10/15/2008 00:17:24
320
22
Must RobotLegs be this complex?
Before I considered using RobotLegs I figured my Flex code needed to separate the view from the business logic. My initial solution was to use the following three parts: view.mxml <- this contains the Flex components to display something on screen ModelInterface.as <- this contains a set of functions that will need to be called on the data ModelImplementation.as <- this contains the implementation of the interface Using a set up like that I could do unit tests easily, separate my business logic from the view, and if I use call back functions instead of return statements, I can allow for asynchronous operations. Sure, I will still need custom events for some things, but this would be a rather straight forward and simple solution. RobotLegs on the other hand would require commands, a mediator, a model, a view, and custom events to do what I would otherwise do with only three source files. Is that really necessary? Am I missing the value of RobotLegs? Regardless, I have a fairly complex application that is about to become an order of magnitude more complex and I need to re-factor this into a MVC approach before it gets out of hand.
flex
actionscript-3
mvc
adobe
robotlegs
03/23/2011 14:21:53
not constructive
Must RobotLegs be this complex? === Before I considered using RobotLegs I figured my Flex code needed to separate the view from the business logic. My initial solution was to use the following three parts: view.mxml <- this contains the Flex components to display something on screen ModelInterface.as <- this contains a set of functions that will need to be called on the data ModelImplementation.as <- this contains the implementation of the interface Using a set up like that I could do unit tests easily, separate my business logic from the view, and if I use call back functions instead of return statements, I can allow for asynchronous operations. Sure, I will still need custom events for some things, but this would be a rather straight forward and simple solution. RobotLegs on the other hand would require commands, a mediator, a model, a view, and custom events to do what I would otherwise do with only three source files. Is that really necessary? Am I missing the value of RobotLegs? Regardless, I have a fairly complex application that is about to become an order of magnitude more complex and I need to re-factor this into a MVC approach before it gets out of hand.
4
4,394,210
12/09/2010 02:05:02
184,773
10/06/2009 06:16:54
2,269
36
What are some new and emerging programming languages
What are some new and exciting programming languages? I have already looked at ruby and python. Are there any other languages out there
programming-languages
null
null
null
null
12/09/2010 16:59:20
off topic
What are some new and emerging programming languages === What are some new and exciting programming languages? I have already looked at ruby and python. Are there any other languages out there
2
10,263,973
04/21/2012 23:35:15
926,665
09/03/2011 13:55:09
86
4
EF4.3 know if context has successfully inserted entity
I have the following method in a generic base class: public virtual void Insert(TEntity entity) { dbSet.Add(entity); } My service layer uses the `Insert` method to add new records. Now I would like to be able to return a bool, to make sure that it inserted properly. Something like the following: public virtual int Count { get { return dbSet.Count(); } } public virtual bool Insert(TEntity entity) { int count = this.Count; dbSet.Add(entity); return this.Count == count + 1; } Is there a more elegant way to this? Am I approaching it completely incorrectly? I could do something similar for the Delete method, but how would I check if an `Update` has been performed successfully?
asp.net-mvc-3
entity-framework
dbcontext
null
null
null
open
EF4.3 know if context has successfully inserted entity === I have the following method in a generic base class: public virtual void Insert(TEntity entity) { dbSet.Add(entity); } My service layer uses the `Insert` method to add new records. Now I would like to be able to return a bool, to make sure that it inserted properly. Something like the following: public virtual int Count { get { return dbSet.Count(); } } public virtual bool Insert(TEntity entity) { int count = this.Count; dbSet.Add(entity); return this.Count == count + 1; } Is there a more elegant way to this? Am I approaching it completely incorrectly? I could do something similar for the Delete method, but how would I check if an `Update` has been performed successfully?
0
7,404,852
09/13/2011 15:56:22
942,922
09/13/2011 15:56:22
1
0
Read + write the specific portion of ASCII file in Python
I want to read an ASCII file and write it in CSV format in a specific manner. The contents of file is [MAKE DATA:STUDENT1=AENIE:AGE14,STUDENT2=JOHN:AGE15,STUDENT3=KELLY:AGE14,STUDENT4=JACK:AGE16,STUDENT5=SNOW:AGE16;STUDENT6=MARIE:AGE15,STUDENT7=JENIEFER:AGE16;SET RECORD:STD1=GOOD,STD2=<NULL>,STD3=BAD,STD4=<NULL>,STD5=GOOD] ------------------------------------------------------------------------------------------- The specific manner in which I want to write is defined below, ------------------------------------------------------------------------------------------- 1. When "MAKE DATA:" and "SET RECORD:" appear then "DATA" and "RECORD" becomes the file name. 2. When "=" appear then the string which start after ":" and end before "=" in ASCII file becomes the name of header in the 1st column. In this case the header name of 1st column is STUDENT1, the header name of 2nd column is STUDENT2 and of 3rd, 4th and 5th column of file name "DATA" is STUDENT3, STUDENT4 and STUDENT5 respectively. 3. The value after "=" and before "," is the value of the header which lie just below the header name i.e. the column should be same but the row split. For the header "STUDENT1", its value is "AENIE:AGE14". 4. When ";" appear then next row starts and putting the data in the same manner mentioned above i.e when ";" appear the row splitting occur. Thank you in advance and waiting for a positive response
csv
read
ascii
write
python-2.5
09/14/2011 04:02:51
not a real question
Read + write the specific portion of ASCII file in Python === I want to read an ASCII file and write it in CSV format in a specific manner. The contents of file is [MAKE DATA:STUDENT1=AENIE:AGE14,STUDENT2=JOHN:AGE15,STUDENT3=KELLY:AGE14,STUDENT4=JACK:AGE16,STUDENT5=SNOW:AGE16;STUDENT6=MARIE:AGE15,STUDENT7=JENIEFER:AGE16;SET RECORD:STD1=GOOD,STD2=<NULL>,STD3=BAD,STD4=<NULL>,STD5=GOOD] ------------------------------------------------------------------------------------------- The specific manner in which I want to write is defined below, ------------------------------------------------------------------------------------------- 1. When "MAKE DATA:" and "SET RECORD:" appear then "DATA" and "RECORD" becomes the file name. 2. When "=" appear then the string which start after ":" and end before "=" in ASCII file becomes the name of header in the 1st column. In this case the header name of 1st column is STUDENT1, the header name of 2nd column is STUDENT2 and of 3rd, 4th and 5th column of file name "DATA" is STUDENT3, STUDENT4 and STUDENT5 respectively. 3. The value after "=" and before "," is the value of the header which lie just below the header name i.e. the column should be same but the row split. For the header "STUDENT1", its value is "AENIE:AGE14". 4. When ";" appear then next row starts and putting the data in the same manner mentioned above i.e when ";" appear the row splitting occur. Thank you in advance and waiting for a positive response
1
8,585,469
12/21/2011 05:31:21
1,109,173
12/21/2011 05:12:59
1
0
Google Chrome displays website different than Firefox and Explorer
I'm having a problem with Google Chrome displaying the title header different than Firefox 8 and Internet Explorer 9 on this website: benjapakee.atspace.com The website is valid html and css (W3C), no errors and no warnings. Any help to fix this problem would be very much appreciated.
html
css
null
null
null
12/21/2011 15:25:53
not a real question
Google Chrome displays website different than Firefox and Explorer === I'm having a problem with Google Chrome displaying the title header different than Firefox 8 and Internet Explorer 9 on this website: benjapakee.atspace.com The website is valid html and css (W3C), no errors and no warnings. Any help to fix this problem would be very much appreciated.
1
9,567,100
03/05/2012 13:02:42
817,963
06/27/2011 18:55:50
61
4
calling setTimeout without element ID in Javascript
I have the following code for a fade animation in Javascript: var ticks = 20; function fadein(tick,element){ if(element == null) return; element.style.opacity = tick/ticks; if(tick < ticks) { var s = "fadein(" + (tick+1) + "," + element + ")"; setTimeout(s, 500/ticks); } } The problem is this line: var s = "fadein(" + (tick+1) + "," + element + ")"; Element is turned into its string representation and causes an error on the next iteration. I know I could do this if all my elements had IDs by passing the eid, but I want to fade in a lot of different things (at different times) and don't want to have to name each one. Is there a way to do this in js?
javascript
settimeout
null
null
null
null
open
calling setTimeout without element ID in Javascript === I have the following code for a fade animation in Javascript: var ticks = 20; function fadein(tick,element){ if(element == null) return; element.style.opacity = tick/ticks; if(tick < ticks) { var s = "fadein(" + (tick+1) + "," + element + ")"; setTimeout(s, 500/ticks); } } The problem is this line: var s = "fadein(" + (tick+1) + "," + element + ")"; Element is turned into its string representation and causes an error on the next iteration. I know I could do this if all my elements had IDs by passing the eid, but I want to fade in a lot of different things (at different times) and don't want to have to name each one. Is there a way to do this in js?
0
11,307,885
07/03/2012 09:16:17
1,352,998
04/24/2012 06:37:39
1
0
how to create database for my app
I am new to Android, in office we are working on an app that stores the selection of user, user selects "yes" and "no" and some rating options through button available on screen Can you suggest me what would be the best way to create DB and store the selection done by user on each screen.
android
system.data.sqlite
null
null
null
07/03/2012 17:38:07
not a real question
how to create database for my app === I am new to Android, in office we are working on an app that stores the selection of user, user selects "yes" and "no" and some rating options through button available on screen Can you suggest me what would be the best way to create DB and store the selection done by user on each screen.
1
3,026,998
06/12/2010 00:18:35
326,480
04/27/2010 01:55:14
11,670
474
Annotation to make available generic type
Given an generic interface like interface DomainObjectDAO<T> { T newInstance(); add(T t); remove(T t); T findById(int id); // etc... } I'd like to create a subinterface that specifies the type parameter: interface CustomerDAO extends DomainObjectDAO<Customer> { // customer-specific queries - incidental. } The implementation needs to know the actual template parameter type, but of course type erasure means isn't available at runtime. Is there some annotation that I could include to declare the interface type? Something like @GenericParameter(Customer.class) interface CustomerDAO extends DomainObjectDAO<Customer> { } The implementation could then fetch this annotation from the interface and use it as a substitute for runtime generic type access. Some background: This interface is implemented using JDK dynamic proxies as outlined [here][1]. The non-generic version of this interface has been working well, but it would be nicer to use generics and not have to create a subinterface for each domain object type. The actual type is needed at runtime to implement the `newInstance` method, amongst others. [1]: http://jnb.ociweb.com/jnb/jnbNov2003.html
java
generics
annotations
null
null
null
open
Annotation to make available generic type === Given an generic interface like interface DomainObjectDAO<T> { T newInstance(); add(T t); remove(T t); T findById(int id); // etc... } I'd like to create a subinterface that specifies the type parameter: interface CustomerDAO extends DomainObjectDAO<Customer> { // customer-specific queries - incidental. } The implementation needs to know the actual template parameter type, but of course type erasure means isn't available at runtime. Is there some annotation that I could include to declare the interface type? Something like @GenericParameter(Customer.class) interface CustomerDAO extends DomainObjectDAO<Customer> { } The implementation could then fetch this annotation from the interface and use it as a substitute for runtime generic type access. Some background: This interface is implemented using JDK dynamic proxies as outlined [here][1]. The non-generic version of this interface has been working well, but it would be nicer to use generics and not have to create a subinterface for each domain object type. The actual type is needed at runtime to implement the `newInstance` method, amongst others. [1]: http://jnb.ociweb.com/jnb/jnbNov2003.html
0
9,584,315
03/06/2012 13:07:43
848,930
07/17/2011 18:11:47
76
1
how to bypass captcha using php or python
I want to pull some data form this site http://camprate.com/ using php(DOMXPath) or python(Scrapy). There is a captcha verification to access this site . is there any feasible way to bypass this checking using php or python ??
php
python
scrapy
null
null
03/06/2012 16:53:40
not constructive
how to bypass captcha using php or python === I want to pull some data form this site http://camprate.com/ using php(DOMXPath) or python(Scrapy). There is a captcha verification to access this site . is there any feasible way to bypass this checking using php or python ??
4
3,796,374
09/26/2010 02:30:35
149,080
08/01/2009 21:00:20
982
20
What did StackExchange use to build to popup like dialog when you click StackExchange in the Top Left?
On stackoverflow, when you click "StackExchange" in the top left, it opens a popup like dialog. Anyone know what they used to create that or what type of jQuery plugin makes such a UI?
jquery
null
null
null
null
null
open
What did StackExchange use to build to popup like dialog when you click StackExchange in the Top Left? === On stackoverflow, when you click "StackExchange" in the top left, it opens a popup like dialog. Anyone know what they used to create that or what type of jQuery plugin makes such a UI?
0