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
6,570,230
07/04/2011 10:29:43
827,940
07/04/2011 10:29:43
1
0
should we just forget about the properties in ECMAScript 5?
what is the whole point in using those "properties" that ECMAScript 5 provides? Ok let's not penalize ECMAScript 5 with the famous "old browser support" phrase. Even for modern browsers which support ECMAScript 5, as far as I know, if we simply replace those property getters with getXXX and setters with setXXX, the result (of creating and using those functions) are always faster in all browsers. And it's not just like 2 or 3 times faster.. it's pretty much more like a whole magnitude faster. And even into the future, it's well.. pretty unlikely that properties could indeed be faster than a simply get/set pair. So basically my question is: should we just forget about them?
javascript
html5
web
null
null
07/04/2011 12:51:27
not constructive
should we just forget about the properties in ECMAScript 5? === what is the whole point in using those "properties" that ECMAScript 5 provides? Ok let's not penalize ECMAScript 5 with the famous "old browser support" phrase. Even for modern browsers which support ECMAScript 5, as far as I know, if we simply replace those property getters with getXXX and setters with setXXX, the result (of creating and using those functions) are always faster in all browsers. And it's not just like 2 or 3 times faster.. it's pretty much more like a whole magnitude faster. And even into the future, it's well.. pretty unlikely that properties could indeed be faster than a simply get/set pair. So basically my question is: should we just forget about them?
4
3,733,358
09/17/2010 07:19:13
450,343
09/17/2010 07:19:13
1
0
Facebook Javascript API throws this error: "An error occurred with Mu Console. Please try again later" Any ideas?
I downloaded the official facebook Javascript SDK from http://github.com/facebook/connect-js and it seems that, for some reason, it outputs the above error. The strange thing is that it worked 2 days ago. Now I'm quite stuck. I tried with different API_KEYs and still got nothing. I'm running the examples inside my Apache Server. Do you have any ideas why this would show up?
javascript
facebook
facebook-connect
null
null
06/09/2012 15:15:53
too localized
Facebook Javascript API throws this error: "An error occurred with Mu Console. Please try again later" Any ideas? === I downloaded the official facebook Javascript SDK from http://github.com/facebook/connect-js and it seems that, for some reason, it outputs the above error. The strange thing is that it worked 2 days ago. Now I'm quite stuck. I tried with different API_KEYs and still got nothing. I'm running the examples inside my Apache Server. Do you have any ideas why this would show up?
3
10,781,280
05/28/2012 08:04:17
1,421,098
05/28/2012 06:41:41
1
0
how to play multiple audio file simultaneously on web application (html5) for ipad and iphone?
M trying to play background music and button music at same time but its not working on ipad and iphone devices, as well Do this devices support automatic audio play eg: onload() event ?
javascript
jquery
html5
null
null
05/29/2012 13:26:00
not a real question
how to play multiple audio file simultaneously on web application (html5) for ipad and iphone? === M trying to play background music and button music at same time but its not working on ipad and iphone devices, as well Do this devices support automatic audio play eg: onload() event ?
1
2,838,563
05/15/2010 01:38:04
293,009
03/13/2010 15:48:09
38
6
Exclude entry from glossary?
I'm using the glossaries package in LaTeX. I've got `\gls{foo}` in my document, but I don't want the entry for "foo" to appear in the glossary. How can I keep a working (i.e. expanding) `\gls{foo}` in the body of my document, but exclude the entry for "foo" from the glossary?
latex
glossaries
null
null
null
null
open
Exclude entry from glossary? === I'm using the glossaries package in LaTeX. I've got `\gls{foo}` in my document, but I don't want the entry for "foo" to appear in the glossary. How can I keep a working (i.e. expanding) `\gls{foo}` in the body of my document, but exclude the entry for "foo" from the glossary?
0
7,772,708
10/14/2011 19:37:27
965,383
09/26/2011 15:52:35
29
0
How to scroll UIView dynamically?
I'm doing a form in an iPhone application. I'm setting the next field on the return of the keyboard. Everything works fine but if the text field is hidden under the keyboard, it's not scrolling on top of the keyboard dynamically! How can I do this? **Here is my code** It basically set to the next tag (next fileld) -(BOOL)textFieldShouldReturn:(UITextField*)textField; { NSInteger nextTag = textField.tag + 1; // Try to find next responder UIResponder* nextResponder = [textField.superview viewWithTag:nextTag]; if (nextResponder) { // Found next responder, so set it. [nextResponder becomeFirstResponder]; } else { // Not found, so remove keyboard. [textField resignFirstResponder]; } return NO; // We do not want UITextField to insert line-breaks. }
objective-c
ios
null
null
null
null
open
How to scroll UIView dynamically? === I'm doing a form in an iPhone application. I'm setting the next field on the return of the keyboard. Everything works fine but if the text field is hidden under the keyboard, it's not scrolling on top of the keyboard dynamically! How can I do this? **Here is my code** It basically set to the next tag (next fileld) -(BOOL)textFieldShouldReturn:(UITextField*)textField; { NSInteger nextTag = textField.tag + 1; // Try to find next responder UIResponder* nextResponder = [textField.superview viewWithTag:nextTag]; if (nextResponder) { // Found next responder, so set it. [nextResponder becomeFirstResponder]; } else { // Not found, so remove keyboard. [textField resignFirstResponder]; } return NO; // We do not want UITextField to insert line-breaks. }
0
5,235,115
03/08/2011 16:13:36
531,507
12/05/2010 22:00:50
134
10
Windows 7 need an easy way to track file changes and restore to previous versions
I am looking for some way to roll back file changes. I have looked at versioning systems such as tortoiseCVS, but I can't seem to get it setup. If anyone can help me find a great solution to track and roll back file changes on win7 that would be great! Chris
windows
null
null
null
null
03/09/2011 08:44:25
not a real question
Windows 7 need an easy way to track file changes and restore to previous versions === I am looking for some way to roll back file changes. I have looked at versioning systems such as tortoiseCVS, but I can't seem to get it setup. If anyone can help me find a great solution to track and roll back file changes on win7 that would be great! Chris
1
10,134,741
04/13/2012 03:11:24
615,120
02/13/2011 14:38:11
30
0
Changing CSS dynamically according to its inner elements
Just look at my code http://jsfiddle.net/rkumarnirmal/GXAYa/6/ #box_bg is the outer gray box and #box is the inner black box. I used jquery accordion in the #box. What I need is #box_bg should dynamically enlarge or reduce its height according to the size of the inner #box. Could anyone help me? Thanks!
javascript
jquery
css
jquery-ui
css3
null
open
Changing CSS dynamically according to its inner elements === Just look at my code http://jsfiddle.net/rkumarnirmal/GXAYa/6/ #box_bg is the outer gray box and #box is the inner black box. I used jquery accordion in the #box. What I need is #box_bg should dynamically enlarge or reduce its height according to the size of the inner #box. Could anyone help me? Thanks!
0
6,061,305
05/19/2011 15:45:14
761,386
05/19/2011 15:45:14
1
0
Using R for Covariate Adjusted Logistic Regression
I would like to run a 'Covariable Adjusted Logistic Regression' test, and I would like to do this in R. So I am having some difficulties with this. I am uncertain if I am correct in my understanding of Covariable Adjusted Logistic Regression. I have to translate code from a software suite and I've been having a very hard finding articles to help me understand what it exactly is. This type of thing is commonly done in clinical trials but I am not a biostatitician and have been having trouble contextualizing what I am reading. Does anyone know if there is an R package out there that could help me with this? I can understand reading code much better than those clinical trial papers. The software suite code is unavailable to me, but I do have final values to compare against. It would be very helpful. I tried the R forum, but was told that I should take more statistics courses instead of trying to program... so not really useful advice.
r
null
null
null
null
05/19/2011 16:27:29
off topic
Using R for Covariate Adjusted Logistic Regression === I would like to run a 'Covariable Adjusted Logistic Regression' test, and I would like to do this in R. So I am having some difficulties with this. I am uncertain if I am correct in my understanding of Covariable Adjusted Logistic Regression. I have to translate code from a software suite and I've been having a very hard finding articles to help me understand what it exactly is. This type of thing is commonly done in clinical trials but I am not a biostatitician and have been having trouble contextualizing what I am reading. Does anyone know if there is an R package out there that could help me with this? I can understand reading code much better than those clinical trial papers. The software suite code is unavailable to me, but I do have final values to compare against. It would be very helpful. I tried the R forum, but was told that I should take more statistics courses instead of trying to program... so not really useful advice.
2
9,846,813
03/23/2012 21:40:11
1,236,005
02/27/2012 16:17:25
30
0
ASP.NET MVC3: Add element from list into a model's collection, from "Edit" view
I have a User model, which contains a collection of Devices. Users may have any number of Devices, but each Device may only have one User. I am making a page for editing Users. When the User's Devices collection needs to be edited, the view presents a table of Devices associated with the User, with Remove links next to each, and a table of Devices not currently associated with a User, with Add links. The view is typed to a viewmodel that contains both lists. This is all within a partial view, so that (ideally) it can update dynamically with Ajax. Unfortunately I am quite new to ASP.NET and MVC3, and to web development in general. How should I go about writing the view to implement this? Most of my assumptions about how to implement this are based on [this][1] tutorial. He's doing something similar, but he's just using @Html.EditorFor and adding whatever the user types in the text field into the collection, not selecting an existing object. Presumably I need to send the ID of the selected device back to the controller, so it can move the device between lists and return the updated partial view. But the view is typed to the viewmodel, and (unless I'm mistaken) I can't send arbitrary data back to the controller in a post; I can only send the viewmodel. So it would seem I need to put the selected device's ID into the viewmodel before posting it back, but if I do that then I'm violating the whole MVC pattern by manipulating data in the view. This is a pretty rudimentary problem so I'm sure there are plenty of solutions, but unfortunately I lack enough domain knowledge to even know how to look for one. [1]: http://geekswithblogs.net/blachniet/archive/2011/08/03/walkthrough-updating-partial-views-with-unobtrusive-ajax-in-mvc-3.aspx
asp.net
ajax
asp.net-mvc-3
partial-views
null
null
open
ASP.NET MVC3: Add element from list into a model's collection, from "Edit" view === I have a User model, which contains a collection of Devices. Users may have any number of Devices, but each Device may only have one User. I am making a page for editing Users. When the User's Devices collection needs to be edited, the view presents a table of Devices associated with the User, with Remove links next to each, and a table of Devices not currently associated with a User, with Add links. The view is typed to a viewmodel that contains both lists. This is all within a partial view, so that (ideally) it can update dynamically with Ajax. Unfortunately I am quite new to ASP.NET and MVC3, and to web development in general. How should I go about writing the view to implement this? Most of my assumptions about how to implement this are based on [this][1] tutorial. He's doing something similar, but he's just using @Html.EditorFor and adding whatever the user types in the text field into the collection, not selecting an existing object. Presumably I need to send the ID of the selected device back to the controller, so it can move the device between lists and return the updated partial view. But the view is typed to the viewmodel, and (unless I'm mistaken) I can't send arbitrary data back to the controller in a post; I can only send the viewmodel. So it would seem I need to put the selected device's ID into the viewmodel before posting it back, but if I do that then I'm violating the whole MVC pattern by manipulating data in the view. This is a pretty rudimentary problem so I'm sure there are plenty of solutions, but unfortunately I lack enough domain knowledge to even know how to look for one. [1]: http://geekswithblogs.net/blachniet/archive/2011/08/03/walkthrough-updating-partial-views-with-unobtrusive-ajax-in-mvc-3.aspx
0
2,635,340
04/14/2010 06:36:58
304,742
03/30/2010 02:23:27
1
0
Polling a running php cli script
I want to run a php script from the command line that is always running and constantly updating a variable. I then want any php script that is run in the meantime (probably but not necessarily from the web) to be able to read that variable at any time. Anyone know how I can do this? Thanks.
php
php-cli
null
null
null
null
open
Polling a running php cli script === I want to run a php script from the command line that is always running and constantly updating a variable. I then want any php script that is run in the meantime (probably but not necessarily from the web) to be able to read that variable at any time. Anyone know how I can do this? Thanks.
0
6,610,675
07/07/2011 12:35:38
447,156
09/14/2010 09:15:07
2,402
117
Cheating Husband Problem Solving with C# (Or any algorithm)
I read Stevey's Blog [Get that job at Google][1] for Google interview questions and i made a little search on the internet and i found a really good recursion question asked in Google interview. Q: Every man in a village of 100 married couples has cheated on his wife… Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens? Is there any answer to solved with C# or any algorithm for this question ? [1]: http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html
c#
algorithm
google
interview-questions
puzzle
07/07/2011 12:41:26
off topic
Cheating Husband Problem Solving with C# (Or any algorithm) === I read Stevey's Blog [Get that job at Google][1] for Google interview questions and i made a little search on the internet and i found a really good recursion question asked in Google interview. Q: Every man in a village of 100 married couples has cheated on his wife… Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens? Is there any answer to solved with C# or any algorithm for this question ? [1]: http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html
2
5,685,174
04/16/2011 07:38:30
12,421
09/16/2008 14:19:20
412
8
How do I retrieve incident work items from BMC Remedy ARS via the SOAP interface?
I'm using the Helpdesk_Query_Service method from the HPD_IncidentInterface web service in BMC Remedy ARS 7.5 to retrieve incident data. I can get the top-level incident data as expected, but I don't see any way to retrieve associated work items. The ITSM Integrations guide is extremely light on details. How do I get the work items out?
soap
remedy
null
null
null
null
open
How do I retrieve incident work items from BMC Remedy ARS via the SOAP interface? === I'm using the Helpdesk_Query_Service method from the HPD_IncidentInterface web service in BMC Remedy ARS 7.5 to retrieve incident data. I can get the top-level incident data as expected, but I don't see any way to retrieve associated work items. The ITSM Integrations guide is extremely light on details. How do I get the work items out?
0
10,032,531
04/05/2012 16:39:18
435,176
08/30/2010 16:50:08
154
3
SVN post-commit hook wont run after a commit
I have an SVN repo set up on my server and am having post-commit issues. I am using SmartSVN as my client on my iMac. I connect through ssh+svn from SmartSVN. I am able to successfully connect to the SVN and make changes to it. Although my post-commit script is not working after I commit from my SVN client. I created my post-commit shell script named post-commit.sh and put it in the hooks directory thinking this was all you had to do in order to get it working. Basically what the script does is SVN checkout to a temporary workspace and then it uploads the necessary files to my development subdomain on my server. I do this so that I can have a testing environment for all changes that users make for my web application. The file originally looked liked this. rm -rf /home/modionzc/tempworkspace/artistcondevspace/* cd /home/modionzc/tempworkspace/artistcondevspace svn checkout file:///home/modionzc/svnrepos/artistcondevrep rm -rf /home/modionzc/public_html/devsuper/application/* rm -rf /home/modionzc/public_html/devsuper/css/* rm -rf /home/modionzc/public_html/devsuper/js/* rm -rf /home/modionzc/public_html/devsuper/images/* cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/application/* /home/modionzc/public_html/devsuper/application/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/css/* /home/modionzc/public_html/devsuper/css/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/js/* /home/modionzc/public_html/devsuper/js/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/images/* /home/modionzc/public_html/devsuper/images/ cp /home/modionzc/artistconconfig/appconfigfiles/config.php /home/modionzc/public_html/devsuper/application/config/config.php cp /home/modionzc/artistconconfig/appconfigfiles/database.php /home/modionzc/public_html/devsuper/application/config/database.php cd /home/modionzc/public_html/devsuper chmod -R 755 * chmod 644 $(find *.* ! -type d) It runs perfectly normal when I run it manually from the command line and updates the necessary files. Now for some reason it is not being called whenever I commit from my SmartSVN. The changes are made through the repository and if I run the script manually I can see that the updates were actually made. I did some research and found out that it could be permission issues or that I'm not using absolute paths. I am using absolute paths throughout the script. The permissions to the file is set to 755. The only thing that I can think of is the actual SVN user doesn't have permission which are the users created in the conf file. I have looked through the SVN manual and over the internet for a fix without much success. One suggestion was to to make a log file to see any erros that are caused when the script is called. So now my post-commit script calls another file that has the commands above and outputs the command line returns to a file called svna.log. The post-commit.sh file looks like this now. cd /home/modionzc/hooktest/ /home/modionzc/hooktest/ac_post_commit.sh &> svna.log Where ac_post_commit.sh has the origional code above. Again if I call it manually all the responses go to the file as necessary, but if I commit my work from SmartSVN the log file is actually empty. FYI - for some reason my post-commit.sh has a * at the end of it and is listed as post-commit.sh* when I ls the files in the hooks directory. Please, any help with this would be greatly appreciated.
svn
shell
post-commit
null
null
null
open
SVN post-commit hook wont run after a commit === I have an SVN repo set up on my server and am having post-commit issues. I am using SmartSVN as my client on my iMac. I connect through ssh+svn from SmartSVN. I am able to successfully connect to the SVN and make changes to it. Although my post-commit script is not working after I commit from my SVN client. I created my post-commit shell script named post-commit.sh and put it in the hooks directory thinking this was all you had to do in order to get it working. Basically what the script does is SVN checkout to a temporary workspace and then it uploads the necessary files to my development subdomain on my server. I do this so that I can have a testing environment for all changes that users make for my web application. The file originally looked liked this. rm -rf /home/modionzc/tempworkspace/artistcondevspace/* cd /home/modionzc/tempworkspace/artistcondevspace svn checkout file:///home/modionzc/svnrepos/artistcondevrep rm -rf /home/modionzc/public_html/devsuper/application/* rm -rf /home/modionzc/public_html/devsuper/css/* rm -rf /home/modionzc/public_html/devsuper/js/* rm -rf /home/modionzc/public_html/devsuper/images/* cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/application/* /home/modionzc/public_html/devsuper/application/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/css/* /home/modionzc/public_html/devsuper/css/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/js/* /home/modionzc/public_html/devsuper/js/ cp -r /home/modionzc/tempworkspace/artistcondevspace/artistcondevrep/trunk/images/* /home/modionzc/public_html/devsuper/images/ cp /home/modionzc/artistconconfig/appconfigfiles/config.php /home/modionzc/public_html/devsuper/application/config/config.php cp /home/modionzc/artistconconfig/appconfigfiles/database.php /home/modionzc/public_html/devsuper/application/config/database.php cd /home/modionzc/public_html/devsuper chmod -R 755 * chmod 644 $(find *.* ! -type d) It runs perfectly normal when I run it manually from the command line and updates the necessary files. Now for some reason it is not being called whenever I commit from my SmartSVN. The changes are made through the repository and if I run the script manually I can see that the updates were actually made. I did some research and found out that it could be permission issues or that I'm not using absolute paths. I am using absolute paths throughout the script. The permissions to the file is set to 755. The only thing that I can think of is the actual SVN user doesn't have permission which are the users created in the conf file. I have looked through the SVN manual and over the internet for a fix without much success. One suggestion was to to make a log file to see any erros that are caused when the script is called. So now my post-commit script calls another file that has the commands above and outputs the command line returns to a file called svna.log. The post-commit.sh file looks like this now. cd /home/modionzc/hooktest/ /home/modionzc/hooktest/ac_post_commit.sh &> svna.log Where ac_post_commit.sh has the origional code above. Again if I call it manually all the responses go to the file as necessary, but if I commit my work from SmartSVN the log file is actually empty. FYI - for some reason my post-commit.sh has a * at the end of it and is listed as post-commit.sh* when I ls the files in the hooks directory. Please, any help with this would be greatly appreciated.
0
11,064,666
06/16/2012 15:16:34
1,460,784
06/16/2012 15:02:53
1
0
iphone app saving state - nsmutableindexset and nsuintegers?
I'm newer to Xcode development and am trying to save state for my app which tracks multiple index sets, integers and strings. I've tried different code and haven't been able to get it to work saving to a plist. What is the best approach for saving the following data types, NSMUTABLEINDEXSETS and NSUINTEGERS? Any direction would be great, Thanks.
ios
cocoa-touch
savestate
null
null
06/20/2012 12:15:29
not constructive
iphone app saving state - nsmutableindexset and nsuintegers? === I'm newer to Xcode development and am trying to save state for my app which tracks multiple index sets, integers and strings. I've tried different code and haven't been able to get it to work saving to a plist. What is the best approach for saving the following data types, NSMUTABLEINDEXSETS and NSUINTEGERS? Any direction would be great, Thanks.
4
1,657,974
11/01/2009 18:52:41
200,546
11/01/2009 17:29:58
1
0
How to get the text value of an object?
How do I get the text value of an object in order to display it in a table? Other posts say objects are not NSStrings and you need to ask the object for its text. But how? The error is this: > *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[Names isEqualToString:]: unrecognized selector sent to instance 0xf51b60' for this code in Objective-C: NSString *cellValue = [namesArray objectAtIndex:indexPath.row]; cell.textLabel.text = cellValue; return cell; My apologies to all you advanced programers, I'm new at this and could not find the answer in the NSObject documentation either. Thanks.
objective-c
object
text
null
null
null
open
How to get the text value of an object? === How do I get the text value of an object in order to display it in a table? Other posts say objects are not NSStrings and you need to ask the object for its text. But how? The error is this: > *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[Names isEqualToString:]: unrecognized selector sent to instance 0xf51b60' for this code in Objective-C: NSString *cellValue = [namesArray objectAtIndex:indexPath.row]; cell.textLabel.text = cellValue; return cell; My apologies to all you advanced programers, I'm new at this and could not find the answer in the NSObject documentation either. Thanks.
0
9,502,789
02/29/2012 16:22:23
1,141,555
01/10/2012 18:35:26
21
1
mysql Like issue
i think i found a bug in opencart so in the featured module there is an autocomplete box which suggests products but it seems to skip a whole bunch. After examining the code it looks like it all boils down to this database query SELECT * FROM calcproduct p LEFT JOIN calcproduct_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '1' AND LCASE(pd.name) LIKE 'ti %' GROUP BY p.product_id ORDER BY pd.name ASC LIMIT 0,20 When i run the query manually for example i have two products TI 83 Brand New and TI 83 Like New it only finds one of them and it's doing this for other products as well. Anyone have any clude why , it has to be the like part of the query i took out the group by and order by and even the first where clause. I tried changing the column from utf_8 to latin_1 Im out of ideas please help
mysql
null
null
null
null
07/26/2012 16:09:06
not a real question
mysql Like issue === i think i found a bug in opencart so in the featured module there is an autocomplete box which suggests products but it seems to skip a whole bunch. After examining the code it looks like it all boils down to this database query SELECT * FROM calcproduct p LEFT JOIN calcproduct_description pd ON (p.product_id = pd.product_id) WHERE pd.language_id = '1' AND LCASE(pd.name) LIKE 'ti %' GROUP BY p.product_id ORDER BY pd.name ASC LIMIT 0,20 When i run the query manually for example i have two products TI 83 Brand New and TI 83 Like New it only finds one of them and it's doing this for other products as well. Anyone have any clude why , it has to be the like part of the query i took out the group by and order by and even the first where clause. I tried changing the column from utf_8 to latin_1 Im out of ideas please help
1
9,744,470
03/16/2012 21:01:48
901,229
08/18/2011 18:59:38
1
0
How do i store tweets with a specific hashtag in my database?
I want to monitor and store all tweets with a hashtag '#myDDD' into my MySQL database. I want to store the username of the guy who tweeted, the content of the tweet and the timestamp. I have a table with 'username', 'tweet' and 'time'. Ideally I wouldn't want to get retweets.
php
mysql
twitter
null
null
03/17/2012 23:47:48
not a real question
How do i store tweets with a specific hashtag in my database? === I want to monitor and store all tweets with a hashtag '#myDDD' into my MySQL database. I want to store the username of the guy who tweeted, the content of the tweet and the timestamp. I have a table with 'username', 'tweet' and 'time'. Ideally I wouldn't want to get retweets.
1
10,034,222
04/05/2012 18:47:18
1,316,050
04/05/2012 18:40:21
1
0
missing ) after argument list on line 1
<script type="text/javascript">$('#multipleResults').show(); $('#multipleResultsOut').html('<table><tr><td colspan="2"><?php echo $lang['search.limited']; ?></td></tr><?php while ($bQr = mysql_fetch_assoc($botquery22)) { echo ('<tr><td style="width: 40px;"><div style="width: 40px; height: 40px; overflow: hidden; background-position: center; background-repeat: no-repeat; background-image: url(\'%www%/images/badges/'.$bQr['name'].'\');"></div></td><td><a href="#" onclick="getBadge(\'%www%/\', \''.$bQr['name'].'\'); return false;">'.$bQr['badgename'].'</a><br />'.$bQr['desc'].'</td></tr>'); } ?><?php echo $end; ?>;</script><?php echo $lang['search.x.results']; ?> **And I've rolled the code again, but still the same error.**
list
arguments
null
null
null
04/06/2012 00:20:34
too localized
missing ) after argument list on line 1 === <script type="text/javascript">$('#multipleResults').show(); $('#multipleResultsOut').html('<table><tr><td colspan="2"><?php echo $lang['search.limited']; ?></td></tr><?php while ($bQr = mysql_fetch_assoc($botquery22)) { echo ('<tr><td style="width: 40px;"><div style="width: 40px; height: 40px; overflow: hidden; background-position: center; background-repeat: no-repeat; background-image: url(\'%www%/images/badges/'.$bQr['name'].'\');"></div></td><td><a href="#" onclick="getBadge(\'%www%/\', \''.$bQr['name'].'\'); return false;">'.$bQr['badgename'].'</a><br />'.$bQr['desc'].'</td></tr>'); } ?><?php echo $end; ?>;</script><?php echo $lang['search.x.results']; ?> **And I've rolled the code again, but still the same error.**
3
7,265,004
09/01/2011 00:30:31
237,681
12/23/2009 15:31:25
2,013
26
PHP MVC books||tutorials 2011
Are there any new (or old, if it still good in your opinion) and good books||tutorials about building PHP MVC framework or giving advices on Design patterns using PHP MVC or something like that? I am willing to create my own PHP framework (I'm very excited about that), but firstly I want to read books which are written by professionals, so I wouldn't make essential mistakes building that. Thank you.
php
oop
mvc
frameworks
null
09/28/2011 11:28:52
not constructive
PHP MVC books||tutorials 2011 === Are there any new (or old, if it still good in your opinion) and good books||tutorials about building PHP MVC framework or giving advices on Design patterns using PHP MVC or something like that? I am willing to create my own PHP framework (I'm very excited about that), but firstly I want to read books which are written by professionals, so I wouldn't make essential mistakes building that. Thank you.
4
11,463,311
07/13/2012 02:25:03
1,505,663
07/06/2012 03:30:25
4
0
Python Function variable: local and global
I am struggling with local and global variables. I was doing this: def SomeFunc(Input): if Input == 1: Input = "True" elif Input == 0: Input = "False" RawInput=int(raw_input("Input 1 or 0: ")) SomeFunc(RawInput) print str(RawInput) and it showed this: >>> def SomeFunc(Input): if Input ==1: Input = "True" elif Input ==0: Input = "False" >>> RawInput = int(raw_input("Input 1 or 0: ")) Input 1 or 0: 1 >>> SomeFunc(RawInput) >>> print str(RawInput) 1 What should I do so that the input will convert to str in the function?
python
function
global-variables
python-2.7
local-variables
null
open
Python Function variable: local and global === I am struggling with local and global variables. I was doing this: def SomeFunc(Input): if Input == 1: Input = "True" elif Input == 0: Input = "False" RawInput=int(raw_input("Input 1 or 0: ")) SomeFunc(RawInput) print str(RawInput) and it showed this: >>> def SomeFunc(Input): if Input ==1: Input = "True" elif Input ==0: Input = "False" >>> RawInput = int(raw_input("Input 1 or 0: ")) Input 1 or 0: 1 >>> SomeFunc(RawInput) >>> print str(RawInput) 1 What should I do so that the input will convert to str in the function?
0
2,274,001
02/16/2010 15:37:33
213,689
11/18/2009 11:34:47
102
6
How to restrict a user to access only specific folders
I have an Ubuntu server installed and I need to give access to my client's sites hosted on my server. There are currently 2 sites, which means 2 folders. I was able to create a user with the command: adduser user However, I cannot find a way how to restrict this user to view only specific folders. If you tell me at least how to restrict a user to only one folder on your server that would be great! I googled a bit and I found something about chroot. If I understood correctly, this will literally create a new root for the user which ultimately means restricting certain folders. However, I am no linux expert and didn't manage to use it. Many thanks in advance
linux
chroot
ssh
null
null
02/16/2010 15:52:40
off topic
How to restrict a user to access only specific folders === I have an Ubuntu server installed and I need to give access to my client's sites hosted on my server. There are currently 2 sites, which means 2 folders. I was able to create a user with the command: adduser user However, I cannot find a way how to restrict this user to view only specific folders. If you tell me at least how to restrict a user to only one folder on your server that would be great! I googled a bit and I found something about chroot. If I understood correctly, this will literally create a new root for the user which ultimately means restricting certain folders. However, I am no linux expert and didn't manage to use it. Many thanks in advance
2
7,493,426
09/21/2011 00:48:46
344,298
05/18/2010 17:21:30
801
16
Tools for developing Apps for Android
I am currently researching tools used to develop applications on the android os, I would like to explore the different type of tools out there before I decide to pick one as my main tool. So far I have explored the following Android SDK, App Inventor, Basic4Android, Mono. I was wondering if there are any other tools that I could explore? Thank-you for your help!
android
null
null
null
null
06/06/2012 14:13:46
not constructive
Tools for developing Apps for Android === I am currently researching tools used to develop applications on the android os, I would like to explore the different type of tools out there before I decide to pick one as my main tool. So far I have explored the following Android SDK, App Inventor, Basic4Android, Mono. I was wondering if there are any other tools that I could explore? Thank-you for your help!
4
4,860,165
02/01/2011 07:54:37
593,837
01/28/2011 12:45:35
1
0
how to use (String [] [] args) in java
how to use (String [] [] args) in java and write program of 2d array.
java
null
null
null
null
02/01/2011 08:07:16
not a real question
how to use (String [] [] args) in java === how to use (String [] [] args) in java and write program of 2d array.
1
8,404,449
12/06/2011 17:55:46
175,346
09/18/2009 05:17:12
19
0
display russian characters in excel
I am facing the problem to display the Russian characters in Excel. Actually, we are using HSSFWorkbook to generate the excel by creating cell,rows.... can you please help to reslove the issue. Thanks in advance.
java
excel
null
null
null
12/08/2011 03:55:58
not a real question
display russian characters in excel === I am facing the problem to display the Russian characters in Excel. Actually, we are using HSSFWorkbook to generate the excel by creating cell,rows.... can you please help to reslove the issue. Thanks in advance.
1
4,075,392
11/02/2010 06:25:20
179,736
09/27/2009 11:27:55
4,350
39
How can I show the Unique Cosntraints in MYSQL?
show uniques???
mysql
database
query
unique
constraints
05/03/2012 12:31:55
not a real question
How can I show the Unique Cosntraints in MYSQL? === show uniques???
1
4,147,651
11/10/2010 18:17:30
225,815
12/06/2009 15:30:09
3
0
Python or Ruby?
I've done courses on C++, C# and SQL, read SICP, so I have some beginners knowledge about programming. Now I am looking to focus on one language that I could use to develop general applications include web, mostly as a hobby. I seem to hear good things about Ruby and Python and they seem to be reasonably easy to learn and use. If I had to choose only one of the two, which one should I focus on? Why? Thanks!
python
ruby
null
null
null
11/10/2010 18:22:28
not constructive
Python or Ruby? === I've done courses on C++, C# and SQL, read SICP, so I have some beginners knowledge about programming. Now I am looking to focus on one language that I could use to develop general applications include web, mostly as a hobby. I seem to hear good things about Ruby and Python and they seem to be reasonably easy to learn and use. If I had to choose only one of the two, which one should I focus on? Why? Thanks!
4
5,950,231
05/10/2011 12:46:54
194,476
10/22/2009 10:43:12
823
77
SilkTest books for beginner
I would like to know good books for beginners of Silk Test software. I googled for it and searched amazon website, but couldn't find any book dedicated to silk test. Please suggest some names !
books
silktest
null
null
null
09/27/2011 14:02:28
not constructive
SilkTest books for beginner === I would like to know good books for beginners of Silk Test software. I googled for it and searched amazon website, but couldn't find any book dedicated to silk test. Please suggest some names !
4
8,417,042
12/07/2011 14:35:59
1,085,829
12/07/2011 14:30:52
1
0
VB functions and C#
How to access VB functions using C#? I am trying to create an interface for a sensor, whose files are given in VB format. How can i access themm and consequently make changes in the same?
c#
function
vb
null
null
12/07/2011 22:24:04
not a real question
VB functions and C# === How to access VB functions using C#? I am trying to create an interface for a sensor, whose files are given in VB format. How can i access themm and consequently make changes in the same?
1
6,605,261
07/07/2011 02:41:58
139,150
07/16/2009 03:00:08
1,292
56
using TCP or UPP
I can upload a file and analyse. > splunk > Search > Add more data > from > files and directories But how do I use TCP and / or UDP? Assuming I have hosted splunk on 10.10.10.100, I want to access the logs on 10.10.10.99 and the location is "/var/log/somefile.log" Currently I am copying the file from 99 to 100 and then analysing. Is there a better way to dynamically link to the source ?
splunk
null
null
null
null
07/09/2011 06:25:15
off topic
using TCP or UPP === I can upload a file and analyse. > splunk > Search > Add more data > from > files and directories But how do I use TCP and / or UDP? Assuming I have hosted splunk on 10.10.10.100, I want to access the logs on 10.10.10.99 and the location is "/var/log/somefile.log" Currently I am copying the file from 99 to 100 and then analysing. Is there a better way to dynamically link to the source ?
2
9,198,876
02/08/2012 18:00:25
141,172
07/20/2009 04:36:50
21,208
805
Does Enumerable.Cast<T> Copy Objects?
I have an object hierarchy public class MyBase {} public class MyDerived : MyBase {} and have List<MyBase> myList; that is actually filled with instances of `MyDerived` In order to access that list as a `List<MyDerived>`, I'm doing the following: > myList.Cast<MyDerived>().ToList() I read the MSDN docs on [Enumerable.Cast<T>][1], but it's not clear to me whether the Cast<T> and ToList operations make a new *copy* of the objects in memory, or simply allow the compiler to *access* the existing objects as if they were a `List<MyDerived>`. [1]: http://msdn.microsoft.com/en-us/library/Bb341406%28v=vs.100%29.aspx
c#
casting
null
null
null
null
open
Does Enumerable.Cast<T> Copy Objects? === I have an object hierarchy public class MyBase {} public class MyDerived : MyBase {} and have List<MyBase> myList; that is actually filled with instances of `MyDerived` In order to access that list as a `List<MyDerived>`, I'm doing the following: > myList.Cast<MyDerived>().ToList() I read the MSDN docs on [Enumerable.Cast<T>][1], but it's not clear to me whether the Cast<T> and ToList operations make a new *copy* of the objects in memory, or simply allow the compiler to *access* the existing objects as if they were a `List<MyDerived>`. [1]: http://msdn.microsoft.com/en-us/library/Bb341406%28v=vs.100%29.aspx
0
1,277,118
08/14/2009 10:21:26
155,725
08/13/2009 11:05:07
27
4
Good IDE for Struts
MyEclipse may be a good ide for struts. But which is the best ide freely available for struts
struts
null
null
null
null
09/01/2011 13:30:02
not constructive
Good IDE for Struts === MyEclipse may be a good ide for struts. But which is the best ide freely available for struts
4
2,430,543
03/12/2010 04:40:32
129,195
06/26/2009 04:27:31
3,432
314
aps.net-mvc 2.0
Does anyone know if this has been released yet? I went to asp.net and the Windows PI installs MVC 2 and it doesn't mention anything about RC's but then Scott Guthrie doesn't mention anything on his blog either.
asp.net-mvc-2
asp.net-mvc
null
null
null
01/19/2012 04:12:49
too localized
aps.net-mvc 2.0 === Does anyone know if this has been released yet? I went to asp.net and the Windows PI installs MVC 2 and it doesn't mention anything about RC's but then Scott Guthrie doesn't mention anything on his blog either.
3
3,797,766
09/26/2010 12:27:52
7,893
09/15/2008 14:38:54
1,023
34
What is the best way to past contents of an ordered list on html form submission?
In the past I have always used a hidden field, an on the submit button onClick event I stuff the list contents into a hidden form field using custom code, and parse it out on the server-side using custom code. This has always felt like a hack and I was wondering if there is a more modern approach. I'd like to find the most generic approach, but if tooling matters, I'm using JQuery on the client, and Ruby/Sinatra on the server.
jquery
html
forms
dom
sinatra
null
open
What is the best way to past contents of an ordered list on html form submission? === In the past I have always used a hidden field, an on the submit button onClick event I stuff the list contents into a hidden form field using custom code, and parse it out on the server-side using custom code. This has always felt like a hack and I was wondering if there is a more modern approach. I'd like to find the most generic approach, but if tooling matters, I'm using JQuery on the client, and Ruby/Sinatra on the server.
0
7,112,003
08/18/2011 18:07:35
648,138
03/07/2011 12:27:30
1,574
40
what is the reason i get this error?
From the following code i am get the error saying : tester.java:15: constructor Thread in class Thread cannot be applied to given types new Thread(r).start(); ^ required: no arguments found: Runnable 1 error **Code** import java.lang.Thread.*; class tester { int i = 0; private void startThread() { Runnable r = new Runnable() { @Override public void run() { callFunction(); } }; new Thread(r).start(); } private void callFunction() { while( i <= 50 ) { System.out.println( i ); i++; } } public static void main( String args[] ) { System.out.println("before first call"); new tester().startThread(); System.out.println("after the fnctn call"); } } Why do i get the above error ?
java
multithreading
null
null
null
08/19/2011 13:04:22
not a real question
what is the reason i get this error? === From the following code i am get the error saying : tester.java:15: constructor Thread in class Thread cannot be applied to given types new Thread(r).start(); ^ required: no arguments found: Runnable 1 error **Code** import java.lang.Thread.*; class tester { int i = 0; private void startThread() { Runnable r = new Runnable() { @Override public void run() { callFunction(); } }; new Thread(r).start(); } private void callFunction() { while( i <= 50 ) { System.out.println( i ); i++; } } public static void main( String args[] ) { System.out.println("before first call"); new tester().startThread(); System.out.println("after the fnctn call"); } } Why do i get the above error ?
1
5,732,817
04/20/2011 15:27:39
665,977
03/18/2011 11:55:01
5
0
Add a transparent overlay to all LI not in focus
I have list of products within an LI what I need to do is when I hover over a product I need all other LI (Products) to get a slight overlay to them, the product that is hovered over is more prominant. Any help would be greatly appreciated.
jquery
overlay
null
null
null
null
open
Add a transparent overlay to all LI not in focus === I have list of products within an LI what I need to do is when I hover over a product I need all other LI (Products) to get a slight overlay to them, the product that is hovered over is more prominant. Any help would be greatly appreciated.
0
7,388,703
09/12/2011 13:31:37
865,597
07/27/2011 14:17:24
1
0
Expiration Dates
One of our editors did "something" that set an expiration date on all of the items in a folder and its subfolders. I'd love to know how it occured so we can avoid it in the future. (There are hundreds of items that need to have the expiration date cleared). ***So, my question is*** do any of you know what causes that? Also, is there a way to clear the expiration dates in bulk? Thanks
plone
null
null
null
null
09/12/2011 15:26:58
off topic
Expiration Dates === One of our editors did "something" that set an expiration date on all of the items in a folder and its subfolders. I'd love to know how it occured so we can avoid it in the future. (There are hundreds of items that need to have the expiration date cleared). ***So, my question is*** do any of you know what causes that? Also, is there a way to clear the expiration dates in bulk? Thanks
2
4,764,199
01/21/2011 21:54:54
585,027
01/21/2011 20:33:52
1
0
Updated question from a beginner
Would any be willing to take a look at my project and help me out? Anyone with some knowledge of C# will not have any problem with this or take more than a few mintues to figure out. I just can't seem to grasp what my school project is trying to accomplish. Would anyone be willing to take a little time to help me out, where I could explain my project in depth. I have everything built, I just need to code the events for my form. My teacher is a dud and is no help. For my project, I needed to create an airplane class and position class for a windows form application. I'll show my classes in a sec, but I want to explain what I'm not getting. I believe that I have everything built, including the form with all the required controls. I dont know how or what to code inside the events. These are the requirement for my form, which I have built with all the required events. Again I just don't know what to code inside the events once activated and then display the calculations **Add a new form called “frmAirplane” to the project. Provide textbox input fields for each of the attributes in the Airplane and Position classes. Ensure that each input is appropriately validated and the program shall only store valid inputs. Ensure that each textbox has a label describing the purpose of the input field (called a label, field pair). Add command buttons that correspond to each of the operations in the Airplane class, and include event handlers that invoke the associated method. The event handler for each operation should display the position information before the action is taken, then display the information after the action is taken. Add a command button that allows the user to add an additional airplane, and for each airplane added, add a label on the form that displays how many airplane objects are created. Add a command button that will clear all input fields. Add a command button that will exit the application.** HERE ARE THE CLASSES: AIRPLANE FIRST, POSITION SECOND class Airplane { private int X_Coordinate; private int Y_Coordinate; private double speed; private int direction; //constant max speed of plane const int MAX_SPEED = 50; public Airplane() { //increment the numberCreated each time an Airplane object is created int numberCreated; } //gets airplane name private string airPlaneName; public string AirplaneName { get { return airPlaneName; } set { airPlaneName = value; } } //gets airplane position private string airPlanePosition; public string AirPlanePosition { get { return airPlanePosition; } set { airPlanePosition = value; } } private int numberCreated; public int NumberCreated { get { return numberCreated; } set { numberCreated = value; } } public void move(int direction) { double radians = direction * Math.PI / 180; //change the x location by the x vector of the speed X_Coordinate += (int)(speed * Math.Cos(radians)); //change the y location by the y vectior of the speed Y_Coordinate -= (int)(speed * Math.Sin(radians)); } public void TurnRight() { if (direction > 0) direction = direction - 1; //or direction -=1; else direction = 359; //reset direct to fit within 0-359 degrees } public void TurnLeft() { //turn left relative to the airplane if (direction < 359) direction = direction + 1; //or direct +=1; else direction = 0;//reset diection to fit within 0-359 degrees } public void Accelerate() { //increase the speed of the airplane if (speed < MAX_SPEED) speed = speed + 1; //or speed +=1; } public void Decelerate() { //decrease the speed of the airplane if (speed > 0) speed = speed - 1; //or speed -=1; } public int GetNumberOfAirplanesCreated() { //return the total number of airplanes created using the class as the blueprint return numberCreated; } ------------------------------------------------------------------- class Position { public Position() { string airplanePosition; } private int x_coordinate; public int X_coordinate { get { return x_coordinate; } set { x_coordinate = value; } } private int y_coordinate; public int Y_coordinate { get { return y_coordinate; } set { y_coordinate = value; } } private double speed; public double Speed { get { return speed; } set { speed = value; } } private int direction; public int Direction { get { return direction; } set { direction = value; } } public string displayAirplanePosition() { return ""; }
c#
visual-studio-2008
null
null
null
01/21/2011 22:20:28
not a real question
Updated question from a beginner === Would any be willing to take a look at my project and help me out? Anyone with some knowledge of C# will not have any problem with this or take more than a few mintues to figure out. I just can't seem to grasp what my school project is trying to accomplish. Would anyone be willing to take a little time to help me out, where I could explain my project in depth. I have everything built, I just need to code the events for my form. My teacher is a dud and is no help. For my project, I needed to create an airplane class and position class for a windows form application. I'll show my classes in a sec, but I want to explain what I'm not getting. I believe that I have everything built, including the form with all the required controls. I dont know how or what to code inside the events. These are the requirement for my form, which I have built with all the required events. Again I just don't know what to code inside the events once activated and then display the calculations **Add a new form called “frmAirplane” to the project. Provide textbox input fields for each of the attributes in the Airplane and Position classes. Ensure that each input is appropriately validated and the program shall only store valid inputs. Ensure that each textbox has a label describing the purpose of the input field (called a label, field pair). Add command buttons that correspond to each of the operations in the Airplane class, and include event handlers that invoke the associated method. The event handler for each operation should display the position information before the action is taken, then display the information after the action is taken. Add a command button that allows the user to add an additional airplane, and for each airplane added, add a label on the form that displays how many airplane objects are created. Add a command button that will clear all input fields. Add a command button that will exit the application.** HERE ARE THE CLASSES: AIRPLANE FIRST, POSITION SECOND class Airplane { private int X_Coordinate; private int Y_Coordinate; private double speed; private int direction; //constant max speed of plane const int MAX_SPEED = 50; public Airplane() { //increment the numberCreated each time an Airplane object is created int numberCreated; } //gets airplane name private string airPlaneName; public string AirplaneName { get { return airPlaneName; } set { airPlaneName = value; } } //gets airplane position private string airPlanePosition; public string AirPlanePosition { get { return airPlanePosition; } set { airPlanePosition = value; } } private int numberCreated; public int NumberCreated { get { return numberCreated; } set { numberCreated = value; } } public void move(int direction) { double radians = direction * Math.PI / 180; //change the x location by the x vector of the speed X_Coordinate += (int)(speed * Math.Cos(radians)); //change the y location by the y vectior of the speed Y_Coordinate -= (int)(speed * Math.Sin(radians)); } public void TurnRight() { if (direction > 0) direction = direction - 1; //or direction -=1; else direction = 359; //reset direct to fit within 0-359 degrees } public void TurnLeft() { //turn left relative to the airplane if (direction < 359) direction = direction + 1; //or direct +=1; else direction = 0;//reset diection to fit within 0-359 degrees } public void Accelerate() { //increase the speed of the airplane if (speed < MAX_SPEED) speed = speed + 1; //or speed +=1; } public void Decelerate() { //decrease the speed of the airplane if (speed > 0) speed = speed - 1; //or speed -=1; } public int GetNumberOfAirplanesCreated() { //return the total number of airplanes created using the class as the blueprint return numberCreated; } ------------------------------------------------------------------- class Position { public Position() { string airplanePosition; } private int x_coordinate; public int X_coordinate { get { return x_coordinate; } set { x_coordinate = value; } } private int y_coordinate; public int Y_coordinate { get { return y_coordinate; } set { y_coordinate = value; } } private double speed; public double Speed { get { return speed; } set { speed = value; } } private int direction; public int Direction { get { return direction; } set { direction = value; } } public string displayAirplanePosition() { return ""; }
1
10,490,599
05/07/2012 23:39:49
1,062,305
11/23/2011 16:15:26
12
0
Jquery / imagemap combination not working properly
I'm using a combination of Jquery and html imagemap to have a banner with rollovers over different areas. The basic function of it works fine, but I've been having issues with making it more advanced. This is the jsfiddle http://jsfiddle.net/2fav4/ What's happening, is the hover works fine, the new image appears and all that. When the user clicks on the image, it stays up (like it's supposed to), the problem is that the clicked state never goes away. I want the user to be able to dismiss the image by clicking it a second time.
javascript
jquery
html
imagemap
jsfiddle
null
open
Jquery / imagemap combination not working properly === I'm using a combination of Jquery and html imagemap to have a banner with rollovers over different areas. The basic function of it works fine, but I've been having issues with making it more advanced. This is the jsfiddle http://jsfiddle.net/2fav4/ What's happening, is the hover works fine, the new image appears and all that. When the user clicks on the image, it stays up (like it's supposed to), the problem is that the clicked state never goes away. I want the user to be able to dismiss the image by clicking it a second time.
0
8,218,911
11/21/2011 21:40:02
1,047,086
11/15/2011 07:55:31
3
0
Update to MySQL
I`m stuck again with this script, i am now trying to update an existing client in table "wdclient" but no update goes though to the database. Trying to insert "products" and "description". Here is my code: $id=$_GET['id']; $clientId=$_GET['clientId']; include ('msql_connect.php'); include ('msql_open.php'); include ('header.php'); $base1 = '<option value="'; $base2 = '">'; $base3 = '</option>'; if(isset($_POST['submit'])) { mysql_query("UPDATE wdclient (cdetail, cproducts) WHERE clid = '$clientId' VALUES ('$_POST[detail]', '$_POST[products]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category1]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category2]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category3]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category4]','$_POST[clid]')"); } ?> <div class="tagline"> <h1>Finish your Registration!</h1> <span><em>Complete your Registration!</em></span> <div class="clear"></div> </div> <div class="wrapper"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform" class="big_form" > <div id="section1"> <?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { } ?> <table width="1000" border="0"> <tr> <th width="185" scope="col">&nbsp;</th> <th colspan="2" scope="col"><h2 >Choose up to 4 Categories:</h2></th> <th width="30" scope="col">&nbsp;</th> </tr> <tr> <td>&nbsp;</td> <td width="308"><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category1" id="category1" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td width="459"><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category2" id="category2" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category3" id="category3" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category4" id="category4" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td colspan="2"><br/> <h2>Company Information:</h2></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><label for="description"><b style="color:#C00">* </b>Company Description:</label> <textarea name="detail" id="detail" cols="40" rows="8"></textarea></td> <td><label for="description"><b style="color:#C00">* </b>Products: (eg, shoes, bedding, tableware)</label> <textarea name="products" id="products" cols="40" rows="8"></textarea></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td colspan="2"><br/> <h2>Upload Images:</h2><br/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="hidden" name="clid" id="clid" value="<?php echo $clientId ;?>"></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="Complete Registration" name="submit" class="button form" /></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </div> </form> <div class="clear"></div> </div> </div> <?php include ('msql_close.php'); ?> <?php include('footer.php'); ?> Any assistance will be appreciated. Thanks
php
null
null
null
null
null
open
Update to MySQL === I`m stuck again with this script, i am now trying to update an existing client in table "wdclient" but no update goes though to the database. Trying to insert "products" and "description". Here is my code: $id=$_GET['id']; $clientId=$_GET['clientId']; include ('msql_connect.php'); include ('msql_open.php'); include ('header.php'); $base1 = '<option value="'; $base2 = '">'; $base3 = '</option>'; if(isset($_POST['submit'])) { mysql_query("UPDATE wdclient (cdetail, cproducts) WHERE clid = '$clientId' VALUES ('$_POST[detail]', '$_POST[products]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category1]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category2]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category3]','$_POST[clid]')"); mysql_query("INSERT INTO wdccat (caid, clid) VALUES ('$_POST[category4]','$_POST[clid]')"); } ?> <div class="tagline"> <h1>Finish your Registration!</h1> <span><em>Complete your Registration!</em></span> <div class="clear"></div> </div> <div class="wrapper"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform" class="big_form" > <div id="section1"> <?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { } ?> <table width="1000" border="0"> <tr> <th width="185" scope="col">&nbsp;</th> <th colspan="2" scope="col"><h2 >Choose up to 4 Categories:</h2></th> <th width="30" scope="col">&nbsp;</th> </tr> <tr> <td>&nbsp;</td> <td width="308"><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category1" id="category1" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td width="459"><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category2" id="category2" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category3" id="category3" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td><label for="text"><b style="color:#C00">*</b> Select Category:</label><select name="category4" id="category4" value="" class="required"><?php $SQL = "SELECT * FROM wdcat ORDER BY `ccname` ASC"; $result = mysql_query($SQL); while ($db_field = mysql_fetch_assoc($result)) { echo $base1; print $db_field['ccid']; echo $base2; print $db_field['ccname']; echo $base3; };?></select></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td colspan="2"><br/> <h2>Company Information:</h2></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><label for="description"><b style="color:#C00">* </b>Company Description:</label> <textarea name="detail" id="detail" cols="40" rows="8"></textarea></td> <td><label for="description"><b style="color:#C00">* </b>Products: (eg, shoes, bedding, tableware)</label> <textarea name="products" id="products" cols="40" rows="8"></textarea></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td colspan="2"><br/> <h2>Upload Images:</h2><br/></td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="hidden" name="clid" id="clid" value="<?php echo $clientId ;?>"></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="Complete Registration" name="submit" class="button form" /></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> </div> </form> <div class="clear"></div> </div> </div> <?php include ('msql_close.php'); ?> <?php include('footer.php'); ?> Any assistance will be appreciated. Thanks
0
4,520,071
12/23/2010 15:27:04
538,032
12/10/2010 15:47:56
11
3
Find firstname, lastname, address, email, etc.. in non-semantic texts
I search some kind of sources or method to analyze non-semantic texts. To find firstname, lastname, phone, address, etc.. Dalou
c++
python
qt
text
semantic
12/24/2010 02:06:33
not a real question
Find firstname, lastname, address, email, etc.. in non-semantic texts === I search some kind of sources or method to analyze non-semantic texts. To find firstname, lastname, phone, address, etc.. Dalou
1
7,950,067
10/31/2011 04:42:24
977,687
10/04/2011 02:01:58
84
3
Site with 1M pageviews/day with RubyOnRails... Unicorn or Passenger?
I have a site developed using RubOnRails framework... I'll format my server and which is better? Unicorn or Passenger?
ruby-on-rails
ruby
linux
scalability
null
11/14/2011 11:52:37
not constructive
Site with 1M pageviews/day with RubyOnRails... Unicorn or Passenger? === I have a site developed using RubOnRails framework... I'll format my server and which is better? Unicorn or Passenger?
4
9,062,485
01/30/2012 10:32:16
1,177,803
01/30/2012 10:09:11
1
0
Is this a right Strategy implementation
I have tried to implement the Head First Duck problem with Startegy. I am trying to implement the Decoy Duck, which intially don't have the facility to Quack or Fly is implemented by calling a a default constructor( I know this duck don't have the ability to Fly or Quack). All other Ducks are intitialized by calling the overriden consturctor. In the book a duck with no Fly is implemented with a class FlyNoFly which implements the IFly interface. For my solution, i am not using this class. Instead, i am checking in the base duck class the Fly propery whether a valid instance is passed for it or not (by if(Fly != null) . if the Fly has a valid reference, then only i am invloking the fly method on that. Else i am throwing a default message. I want to know whether my implementation is violating any design principle / Whether this is a valid implementation. Thanks TutuMon public abstract class Duck { public IFlyable Fly { get; set; } public IQuackable Quack { get; set; } public void PerformQuack() { //Is this checking valid as per OO? if (Quack != null) Quack.Quack(); else Console.WriteLine("Quack Operation Not supported"); } public void PerformFly() { //Is this checking valid as per OO? if (Fly != null) Fly.Fly(); else Console.WriteLine("Fly Operation not supported"); } public abstract void Swim(); } public class MallardDuck : Duck { public MallardDuck() { } public MallardDuck(IFlyable fly, IQuackable quack) { Fly = fly; Quack = quack; } public override void Swim() { Console.WriteLine("Mallard Duck is Swimming"); } } //No Fly and Quack behaviour by default public class DecoyDuck : Duck { public DecoyDuck() { } public DecoyDuck(IFlyable fly, IQuackable quack) { Fly = fly; Quack = quack; } public override void Swim() { Console.WriteLine("DecoyDuck Duck is Swimming"); } } public interface IFlyable { void Fly(); } public class FlyWithWings : IFlyable { public void Fly() { Console.WriteLine("You are flying with wings"); } } public class RocketFly : IFlyable { public void Fly() { Console.WriteLine("Rocket Powered Fly"); } } public interface IQuackable { void Quack(); } public class RealQUack :IQuackable { public void Quack() { Console.WriteLine("This is Real Quack"); } } public class PowerQuack : IQuackable { public void Quack() { Console.WriteLine("Powerful Quacking "); } } public class Program { public static void Main(string[] args) { Duck mallard = new MallardDuck {Fly=new FlyWithWings(),Quack=new RealQUack()} mallard.PerformQuack(); mallard.PerformFly(); // He can't Quack or Fly by default // So i am calling the default constructor. Duck decoy = new DecoyDuck(); decoy.PerformQuack(); decoy.PerformFly(); // Adding behaviours on the fly decoy.Fly = new RocketFly(); decoy.Quack = new PowerQuack(); decoy.PerformQuack(); decoy.PerformFly(); Console.Read(); } }
strategy
null
null
null
null
05/04/2012 13:27:17
off topic
Is this a right Strategy implementation === I have tried to implement the Head First Duck problem with Startegy. I am trying to implement the Decoy Duck, which intially don't have the facility to Quack or Fly is implemented by calling a a default constructor( I know this duck don't have the ability to Fly or Quack). All other Ducks are intitialized by calling the overriden consturctor. In the book a duck with no Fly is implemented with a class FlyNoFly which implements the IFly interface. For my solution, i am not using this class. Instead, i am checking in the base duck class the Fly propery whether a valid instance is passed for it or not (by if(Fly != null) . if the Fly has a valid reference, then only i am invloking the fly method on that. Else i am throwing a default message. I want to know whether my implementation is violating any design principle / Whether this is a valid implementation. Thanks TutuMon public abstract class Duck { public IFlyable Fly { get; set; } public IQuackable Quack { get; set; } public void PerformQuack() { //Is this checking valid as per OO? if (Quack != null) Quack.Quack(); else Console.WriteLine("Quack Operation Not supported"); } public void PerformFly() { //Is this checking valid as per OO? if (Fly != null) Fly.Fly(); else Console.WriteLine("Fly Operation not supported"); } public abstract void Swim(); } public class MallardDuck : Duck { public MallardDuck() { } public MallardDuck(IFlyable fly, IQuackable quack) { Fly = fly; Quack = quack; } public override void Swim() { Console.WriteLine("Mallard Duck is Swimming"); } } //No Fly and Quack behaviour by default public class DecoyDuck : Duck { public DecoyDuck() { } public DecoyDuck(IFlyable fly, IQuackable quack) { Fly = fly; Quack = quack; } public override void Swim() { Console.WriteLine("DecoyDuck Duck is Swimming"); } } public interface IFlyable { void Fly(); } public class FlyWithWings : IFlyable { public void Fly() { Console.WriteLine("You are flying with wings"); } } public class RocketFly : IFlyable { public void Fly() { Console.WriteLine("Rocket Powered Fly"); } } public interface IQuackable { void Quack(); } public class RealQUack :IQuackable { public void Quack() { Console.WriteLine("This is Real Quack"); } } public class PowerQuack : IQuackable { public void Quack() { Console.WriteLine("Powerful Quacking "); } } public class Program { public static void Main(string[] args) { Duck mallard = new MallardDuck {Fly=new FlyWithWings(),Quack=new RealQUack()} mallard.PerformQuack(); mallard.PerformFly(); // He can't Quack or Fly by default // So i am calling the default constructor. Duck decoy = new DecoyDuck(); decoy.PerformQuack(); decoy.PerformFly(); // Adding behaviours on the fly decoy.Fly = new RocketFly(); decoy.Quack = new PowerQuack(); decoy.PerformQuack(); decoy.PerformFly(); Console.Read(); } }
2
8,560,680
12/19/2011 11:32:40
1,105,775
12/19/2011 11:25:35
1
0
Can the Iphone screen can function as a weight?
I wonder if there is an option to use the iphone screen (via app ofcourse) as a weight? Thank's Ziv
iphone
null
null
null
null
12/20/2011 00:27:22
not a real question
Can the Iphone screen can function as a weight? === I wonder if there is an option to use the iphone screen (via app ofcourse) as a weight? Thank's Ziv
1
2,947,527
06/01/2010 05:53:12
57,428
01/21/2009 08:23:46
32,256
960
What traits can hint a teenager he should pursue software development career?
We're gonna have a day when employees' kids will visit our company office. The idea is that they will come see "how parents work", "how cool stuff is done", have fun, etc. Kids will be up to 17 years old. Now I suppose some of the teenagers already think of what they wanna do when they finally grow up and will ask questions like "how can I tell I should get a degree in software engineering and not in logistics/finances/whatever?" So I think we better be prepared and ready to answer those questions so that those who really fit don't waste time but use their potential to the full. What traits that already emerge in teenage years indicate that a person could become a very good software developer?
career-development
personal-growth
null
null
null
06/02/2010 11:39:30
off topic
What traits can hint a teenager he should pursue software development career? === We're gonna have a day when employees' kids will visit our company office. The idea is that they will come see "how parents work", "how cool stuff is done", have fun, etc. Kids will be up to 17 years old. Now I suppose some of the teenagers already think of what they wanna do when they finally grow up and will ask questions like "how can I tell I should get a degree in software engineering and not in logistics/finances/whatever?" So I think we better be prepared and ready to answer those questions so that those who really fit don't waste time but use their potential to the full. What traits that already emerge in teenage years indicate that a person could become a very good software developer?
2
2,607,515
04/09/2010 12:53:06
245,549
01/07/2010 13:20:49
1,354
3
How do I check if output stream of a socket is closed?
I have this code: public void post(String message) { output.close(); final String mess = message; (new Thread() { public void run() { while (true) { try { output.println(mess); System.out.println("The following message was successfully sent:"); System.out.println(mess); break; } catch (NullPointerException e) { try {Thread.sleep(1000);} catch (InterruptedException ie) {} } } } }).start(); } As you can see I close the socket in the very beginning of the code and then `try` to use it to send some information to another computer. The program writes me "The following message was successfully sent". It means that the NullPointerException was not thrown. **So, does Java throw no exception if it tries to use a closed output stream of a socket? Is there a way to check if a socket is closed or opened?**
java
networking
sockets
outputstream
close
null
open
How do I check if output stream of a socket is closed? === I have this code: public void post(String message) { output.close(); final String mess = message; (new Thread() { public void run() { while (true) { try { output.println(mess); System.out.println("The following message was successfully sent:"); System.out.println(mess); break; } catch (NullPointerException e) { try {Thread.sleep(1000);} catch (InterruptedException ie) {} } } } }).start(); } As you can see I close the socket in the very beginning of the code and then `try` to use it to send some information to another computer. The program writes me "The following message was successfully sent". It means that the NullPointerException was not thrown. **So, does Java throw no exception if it tries to use a closed output stream of a socket? Is there a way to check if a socket is closed or opened?**
0
7,826,459
10/19/2011 18:47:18
771,537
05/26/2011 14:56:52
20
3
VMware VIC losing connection after a couple hours
I am using the "VMWare Infrastructure Client" to manage several esxi 3.5 servers. I am losing connection to one of them and when I try to reconnect I get the errors "VMware Infrastructure Client could not establish the initial connection with server 'XXX'. Details: A connection failure occured" The esxi server replies to pings, I can log on to the console and ping the gateway as well as an IP on the internet. The Guest Os's are still running and I can RDP to them. I just lost management control/connection of the esxi server. Short of restarting the server (which doesn't fix the issue), what can I do to fix this?
vmware
virtualhost
esxi
vmware-tools
null
10/19/2011 19:54:28
off topic
VMware VIC losing connection after a couple hours === I am using the "VMWare Infrastructure Client" to manage several esxi 3.5 servers. I am losing connection to one of them and when I try to reconnect I get the errors "VMware Infrastructure Client could not establish the initial connection with server 'XXX'. Details: A connection failure occured" The esxi server replies to pings, I can log on to the console and ping the gateway as well as an IP on the internet. The Guest Os's are still running and I can RDP to them. I just lost management control/connection of the esxi server. Short of restarting the server (which doesn't fix the issue), what can I do to fix this?
2
1,903,571
12/14/2009 21:18:10
231,635
12/14/2009 21:18:10
1
0
Powerbuilder WebApp Access on my website
I'm running PB11.5. I just upoaded my webapp to my website. Cannot seem to run it from website, but I can run it from my PC. I'm using a MS Access DB.
powerbuilder
web-applications
deployment
null
null
null
open
Powerbuilder WebApp Access on my website === I'm running PB11.5. I just upoaded my webapp to my website. Cannot seem to run it from website, but I can run it from my PC. I'm using a MS Access DB.
0
6,956,864
08/05/2011 13:14:21
351,901
05/27/2010 11:47:11
312
17
Rails global Encoding configuration?
I'm working on a Rails project that has strings with spanish characters: `ñ, á, é, í, ó, ú, etc`. I have to use the "coding" comment (`# coding: utf-8`) at the top of every single file that has these characters to avoid errors when running the application. How could I set this option globally instead of typing this comment in each file? I guess it should go in the initializers or environment files.
ruby-on-rails-3
encoding
utf-8
initialization
null
null
open
Rails global Encoding configuration? === I'm working on a Rails project that has strings with spanish characters: `ñ, á, é, í, ó, ú, etc`. I have to use the "coding" comment (`# coding: utf-8`) at the top of every single file that has these characters to avoid errors when running the application. How could I set this option globally instead of typing this comment in each file? I guess it should go in the initializers or environment files.
0
9,300,031
02/15/2012 19:35:27
9,099
09/15/2008 17:43:43
422
2
PHP5 - good screencasts (without frameworks)
Do you happen to know any good screencasts for modern PHP5 for example: a blog / todo application that shows how to build PHP -> DB application (WITHOUT frameworks)
php
oop
screencasts
null
null
02/15/2012 19:38:31
not constructive
PHP5 - good screencasts (without frameworks) === Do you happen to know any good screencasts for modern PHP5 for example: a blog / todo application that shows how to build PHP -> DB application (WITHOUT frameworks)
4
5,714,184
04/19/2011 09:20:45
686,800
04/01/2011 01:37:24
20
0
Using System.Reflection
What are the best examples in using System.Reflection? I'm working on this in-house CMS that uses reflection to get on page object instance properties for manipulation.
c#
asp.net
system.reflection
null
null
04/19/2011 09:42:03
not a real question
Using System.Reflection === What are the best examples in using System.Reflection? I'm working on this in-house CMS that uses reflection to get on page object instance properties for manipulation.
1
8,571,402
12/20/2011 06:00:22
1,066,679
11/26/2011 07:37:16
3
0
How to change url in PHP?
Is there any methods other than **header** and **link** to change the browser url in php ?
php
browser
null
null
null
12/21/2011 02:24:16
not a real question
How to change url in PHP? === Is there any methods other than **header** and **link** to change the browser url in php ?
1
6,613,317
07/07/2011 15:44:52
469,935
10/08/2010 06:55:16
18,591
601
Read a file compile-time in C#
I am writing some unit tests in which I need a fake xml file. I can create that file and require it to be deployed with the unit tests, but experience shows that at my office it's a lot of headache. So I decided that the file will be created by UT's. StreamWriter sw = new StreamWriter(testFileName); sw.Write(contents); sw.Close(); Now the problem is the contents string. It is virtually a long xml, something like this: string contents = @"<?xml version="1.0" encoding="windows-1251"?> <blah> ~100 lines here </blah> "; I don't want this to be in the same file as the rest of the code. I want the string to be generated compile-time from a file. In C++, I'd do this string contents = " #include "test.xml" "; Is it possible somehow in C#?
c#
compilation
null
null
null
null
open
Read a file compile-time in C# === I am writing some unit tests in which I need a fake xml file. I can create that file and require it to be deployed with the unit tests, but experience shows that at my office it's a lot of headache. So I decided that the file will be created by UT's. StreamWriter sw = new StreamWriter(testFileName); sw.Write(contents); sw.Close(); Now the problem is the contents string. It is virtually a long xml, something like this: string contents = @"<?xml version="1.0" encoding="windows-1251"?> <blah> ~100 lines here </blah> "; I don't want this to be in the same file as the rest of the code. I want the string to be generated compile-time from a file. In C++, I'd do this string contents = " #include "test.xml" "; Is it possible somehow in C#?
0
9,861,991
03/25/2012 16:45:42
548,551
11/03/2010 10:02:48
34
0
How to delete multiple files and directories in UNIX
I have very little knowledge about unix. My task is to write a shell script to delete multiple files and directories. All files and directories have different location. So can i use this logic of creating an array and storing all the paths in that.Then looping around the array and use rm command with each element of array. I dont have unix system to practice commands, hence i was not able to test it. Is this the correct way? or what else could be done Thanks a lot.
shell
unix
null
null
null
03/25/2012 17:06:49
not a real question
How to delete multiple files and directories in UNIX === I have very little knowledge about unix. My task is to write a shell script to delete multiple files and directories. All files and directories have different location. So can i use this logic of creating an array and storing all the paths in that.Then looping around the array and use rm command with each element of array. I dont have unix system to practice commands, hence i was not able to test it. Is this the correct way? or what else could be done Thanks a lot.
1
9,742,985
03/16/2012 18:56:37
882,428
08/07/2011 04:51:56
47
1
Fixing vs Hiding Errors in PHP
Depending on which error reporting I set, my web app either works or displays a ton of errors. I was under the impression I didn't need to initiate variables in PHP but setting the second error reporting seems to require it. What is going here? Should I go through and initiate all my variables? error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL | E_STRICT);
php
error-message
null
null
null
03/17/2012 23:58:04
not constructive
Fixing vs Hiding Errors in PHP === Depending on which error reporting I set, my web app either works or displays a ton of errors. I was under the impression I didn't need to initiate variables in PHP but setting the second error reporting seems to require it. What is going here? Should I go through and initiate all my variables? error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL | E_STRICT);
4
7,379,314
09/11/2011 15:39:29
939,302
09/11/2011 15:39:29
1
0
Want to learn Java and to start Android development
I recently got interested in Android applications development. I have no experience with Java, so i need some book that will teach me the basic things that i need to know before i switch to Android dev. I currently work with PHP for few years so i got some understanding of Object Oriented Programming. Can you recommend me something?
java
android
null
null
null
09/12/2011 08:37:03
not constructive
Want to learn Java and to start Android development === I recently got interested in Android applications development. I have no experience with Java, so i need some book that will teach me the basic things that i need to know before i switch to Android dev. I currently work with PHP for few years so i got some understanding of Object Oriented Programming. Can you recommend me something?
4
10,565,413
05/12/2012 16:21:43
1,376,341
05/05/2012 05:38:31
1
0
Is it necessary to add support for IE8 in Web design
I'm designing a website template, and my design breaks when viewed on IE8. So, I want to ask that - Is it necessary to add support for IE8?
internet-explorer
null
null
null
null
05/13/2012 04:15:31
not constructive
Is it necessary to add support for IE8 in Web design === I'm designing a website template, and my design breaks when viewed on IE8. So, I want to ask that - Is it necessary to add support for IE8?
4
1,007,879
06/17/2009 15:41:21
88,032
04/07/2009 10:27:55
15
5
Iframe with jquery
Is it possible to change iframe scrolling attribute with jquery ? I need to change iframe css as well. When the root document load completed i'm changing the src attribute of iframe and then i'm attaching to iframe load event with jquery this part work with successfully. After that i'm trying to change some attributes of same iframe with jquery but that isn't work. Iframes attributes can't change and Jquery isn't give any error. Thanks for your help.
jquery
jquery-ui
iframe
html
null
null
open
Iframe with jquery === Is it possible to change iframe scrolling attribute with jquery ? I need to change iframe css as well. When the root document load completed i'm changing the src attribute of iframe and then i'm attaching to iframe load event with jquery this part work with successfully. After that i'm trying to change some attributes of same iframe with jquery but that isn't work. Iframes attributes can't change and Jquery isn't give any error. Thanks for your help.
0
7,638,831
10/03/2011 18:03:54
427,292
08/21/2010 20:54:18
675
11
Fade Between Two UIImageView Images?
Rather than creating two UIImageViews, it seems logical to simply just change the image of one view. If I do that, is there anyway of having a fade/cross dissolve between the two images rather than an instant switch? Thanks.
iphone
objective-c
ipad
animation
uiimageview
null
open
Fade Between Two UIImageView Images? === Rather than creating two UIImageViews, it seems logical to simply just change the image of one view. If I do that, is there anyway of having a fade/cross dissolve between the two images rather than an instant switch? Thanks.
0
7,429,632
09/15/2011 10:51:31
946,589
09/15/2011 10:43:22
1
0
Using Javascript frameworks instead of JSF
I'm a Java EE programmer which, until know has used JSF 1/2 for building the front-end of Web applications. There's a lot of talking about Javascript frameworks like jQuery or Dojo which could be a valid replacement for the front-end layer. Granted that there is no obvious framework or technology which can prove the best in every kind of scenario, I'd like to hear your opinion which are the scenarios when "light" javascript framework are a better choice then JSF. Thanks in advance Mylos
javascript
jquery
jsf
dojo
null
09/15/2011 21:53:42
not constructive
Using Javascript frameworks instead of JSF === I'm a Java EE programmer which, until know has used JSF 1/2 for building the front-end of Web applications. There's a lot of talking about Javascript frameworks like jQuery or Dojo which could be a valid replacement for the front-end layer. Granted that there is no obvious framework or technology which can prove the best in every kind of scenario, I'd like to hear your opinion which are the scenarios when "light" javascript framework are a better choice then JSF. Thanks in advance Mylos
4
5,659,234
04/14/2011 06:06:49
481,455
10/20/2010 09:01:21
139
15
UIPanGestureRecognizer is working for only uiview not for uiimageview
hi all can any one give me the exact reason why the UIPanGestureRecognizer in not working for UIImageView and working for UIView i didnt find any blog.Below is my code(working now) UIView *endImage=[[UIView alloc]init]; endImage.backgroundColor=[[UIColor yellowColor] colorWithAlphaComponent:0.3f]; UIPanGestureRecognizer *panOnEndImage = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanOnLine:)]; panOnEndImage.delegate=self; [endImage addGestureRecognizer:panOnEndImage]; [anotherUIView addSubview:endImage]; [panOnEndImage release]; if i am changing endimage as a UIIMageView object then that panning is not working...Thanks in advance your suggestion is more important.
iphone
objective-c
ipad
null
null
null
open
UIPanGestureRecognizer is working for only uiview not for uiimageview === hi all can any one give me the exact reason why the UIPanGestureRecognizer in not working for UIImageView and working for UIView i didnt find any blog.Below is my code(working now) UIView *endImage=[[UIView alloc]init]; endImage.backgroundColor=[[UIColor yellowColor] colorWithAlphaComponent:0.3f]; UIPanGestureRecognizer *panOnEndImage = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanOnLine:)]; panOnEndImage.delegate=self; [endImage addGestureRecognizer:panOnEndImage]; [anotherUIView addSubview:endImage]; [panOnEndImage release]; if i am changing endimage as a UIIMageView object then that panning is not working...Thanks in advance your suggestion is more important.
0
11,119,354
06/20/2012 12:15:35
486,845
10/25/2010 19:41:19
1,046
52
Application doesn't register with Growl
I am trying to implement Growl into my Mac application. When running the application in debug mode, everything works perfectly and I am able to register the application with Growl and show notifications. When archiving and distributing the application, it does not register with Growl. Does anyone know why this is? When building for archiving I would get the following warning: > warning: skipping copy phase strip, binary is code signed. Then I set **Strip Debug Symbols During Copy** to **No** for both debug and release. This removed the warning. I don't know if this has anything to do with the application not registering with Growl when distributed.
osx
cocoa
growl
null
null
null
open
Application doesn't register with Growl === I am trying to implement Growl into my Mac application. When running the application in debug mode, everything works perfectly and I am able to register the application with Growl and show notifications. When archiving and distributing the application, it does not register with Growl. Does anyone know why this is? When building for archiving I would get the following warning: > warning: skipping copy phase strip, binary is code signed. Then I set **Strip Debug Symbols During Copy** to **No** for both debug and release. This removed the warning. I don't know if this has anything to do with the application not registering with Growl when distributed.
0
11,662,941
07/26/2012 05:30:01
1,357,684
04/26/2012 03:35:28
12
0
Wordpress URL rewrite with custom $_GET variable
I'm looking for a way to rewrite a URL similar to wordpress where: http://www.example.com/?p=5 becomes http://www.example.com/some-page-with-that-title I'd like http://www.example.com/events/?event_id=23 to become http://www.example.com/events/some-event-title I've discovered the wordpress rewrite api and have successfully gotten the following to rewrite the url using and events template page. add_action( 'init', 'events_permalinks' ); function events_permalinks() { add_rewrite_rule( 'events/([^/]+)/?', 'index.php?pagename=events&event_name=$matches[1]', 'top' ); } add_filter( 'query_vars', 'events_query_vars' ); function events_query_vars( $query_vars ) { $query_vars[] = 'event_name'; return $query_vars; } And get the variable with get_query_var( 'event_name' ) I know I need to look up the event_id in the non-wordpress events table to get the name but I'm not sure where to put the query so I can swap it into the url. Hopefully I haven't confused things. :)
php
wordpress
null
null
null
null
open
Wordpress URL rewrite with custom $_GET variable === I'm looking for a way to rewrite a URL similar to wordpress where: http://www.example.com/?p=5 becomes http://www.example.com/some-page-with-that-title I'd like http://www.example.com/events/?event_id=23 to become http://www.example.com/events/some-event-title I've discovered the wordpress rewrite api and have successfully gotten the following to rewrite the url using and events template page. add_action( 'init', 'events_permalinks' ); function events_permalinks() { add_rewrite_rule( 'events/([^/]+)/?', 'index.php?pagename=events&event_name=$matches[1]', 'top' ); } add_filter( 'query_vars', 'events_query_vars' ); function events_query_vars( $query_vars ) { $query_vars[] = 'event_name'; return $query_vars; } And get the variable with get_query_var( 'event_name' ) I know I need to look up the event_id in the non-wordpress events table to get the name but I'm not sure where to put the query so I can swap it into the url. Hopefully I haven't confused things. :)
0
2,438,644
03/13/2010 14:22:37
292,970
03/13/2010 14:22:37
1
0
spring framework why is better
what is better spring framework or ejb
java-ee
null
null
null
null
03/13/2010 14:46:23
not constructive
spring framework why is better === what is better spring framework or ejb
4
9,637,415
03/09/2012 16:19:48
157,804
08/17/2009 14:49:31
1,062
72
How do I create and store a thumbnail image of a camera photo in iPad?
I want to take photos and upload to a server database. Later, they will be viewed by another iPad or web based application. I would like to store thumbnails in the DB so I can have weak linking to the larger image. Is is sufficient to use a scaling transformation? Will that compress information such that the store is minimized? How do I copy the scaled image into another (thumbnail) image object?
ios
image
thumbnail
photo
null
null
open
How do I create and store a thumbnail image of a camera photo in iPad? === I want to take photos and upload to a server database. Later, they will be viewed by another iPad or web based application. I would like to store thumbnails in the DB so I can have weak linking to the larger image. Is is sufficient to use a scaling transformation? Will that compress information such that the store is minimized? How do I copy the scaled image into another (thumbnail) image object?
0
9,691,446
03/13/2012 20:19:37
1,267,425
03/13/2012 20:13:43
1
0
JNA, Structures and Arrays
I'm trying to create a array of my class (that extends JNA's Structure) to pass it for a DLL function. I have the values readed from a database to a ArrayList, and now I need to put them into a array. First, I tried to use the toArray() method of ArrayList, but it return me the following exception when I call the native function: java.lang.IllegalArgumentException: Structure array elements must use contiguous memory (bad backing address at Structure array index 1) If I simply set a new array with the same size as the ArrayList, when I will set the 'fields' of the struct in my class, it returns me a NullPointerException. Someone can help me to solve this?
java
arrays
struct
jna
null
null
open
JNA, Structures and Arrays === I'm trying to create a array of my class (that extends JNA's Structure) to pass it for a DLL function. I have the values readed from a database to a ArrayList, and now I need to put them into a array. First, I tried to use the toArray() method of ArrayList, but it return me the following exception when I call the native function: java.lang.IllegalArgumentException: Structure array elements must use contiguous memory (bad backing address at Structure array index 1) If I simply set a new array with the same size as the ArrayList, when I will set the 'fields' of the struct in my class, it returns me a NullPointerException. Someone can help me to solve this?
0
7,149,402
08/22/2011 14:59:48
906,131
08/22/2011 14:59:48
1
0
Export SQL Server Querry to an Excel sheet
I have a query (ex:- select * from emp). I want to export the result of this query to an excel sheet automaticly and the file name also should be dynamic (Ex:- emp_1,Emp_2,....). Kindly help me... Thanks in Advance Venkat
sql
server
null
null
null
08/22/2011 15:11:11
not a real question
Export SQL Server Querry to an Excel sheet === I have a query (ex:- select * from emp). I want to export the result of this query to an excel sheet automaticly and the file name also should be dynamic (Ex:- emp_1,Emp_2,....). Kindly help me... Thanks in Advance Venkat
1
906,423
05/25/2009 11:41:30
99,395
05/01/2009 15:02:55
457
21
JQuery add class on current item
I have this method that changes an larger image source on click. I need to add a 'current' class on the selected. I have no problem adding this class,but I need it to remove the class on the other, previous, selected item. This is the code I'm using at the moment: $(document).ready(function() { $("ul.timgs li a").click(function(e) { e.preventDefault(); var path = $(this).attr("href"); $("div.tour-image img").attr({"src": path}); }); }); Thanks :-)
jquery
javascript
null
null
null
null
open
JQuery add class on current item === I have this method that changes an larger image source on click. I need to add a 'current' class on the selected. I have no problem adding this class,but I need it to remove the class on the other, previous, selected item. This is the code I'm using at the moment: $(document).ready(function() { $("ul.timgs li a").click(function(e) { e.preventDefault(); var path = $(this).attr("href"); $("div.tour-image img").attr({"src": path}); }); }); Thanks :-)
0
3,950,915
10/16/2010 21:38:58
415,088
08/09/2010 12:51:04
58
0
"initializer element is not constant" when declaring an array
This is how I declare my array : NSArray *atouts = [[NSArray alloc] arrayWithObjects:@"1",@"2",nil]; but I'm getting : *Initializer element is not constant* What would be the best way to declare a static array then ?
iphone
objective-c
null
null
null
null
open
"initializer element is not constant" when declaring an array === This is how I declare my array : NSArray *atouts = [[NSArray alloc] arrayWithObjects:@"1",@"2",nil]; but I'm getting : *Initializer element is not constant* What would be the best way to declare a static array then ?
0
7,249,447
08/30/2011 20:33:22
819,725
06/28/2011 18:03:49
40
0
Populate sign-up form field with an uneditable/undeletable sentence
One field in our website's sign-up form is occasionally left blank yet we need it to include one sentence that for legal reasons must not be editable. This is then later used as part of the user's profile and will sit in the same place if they added content to that field too during the initial sign-up. How can we populate this single field with an uneditable/undeletable sentence, yet allow text to be added above it if the user chooses to? Currently the field in question looks like this: <textarea name="description" id="eBann" rows="2" maxlength="1500" cols="20" onKeyUp="toCount('eBann','sBann','{CHAR} characters left',1500);"><?php echo $description;?></textarea>
php
table
textfield
auto-populate
null
null
open
Populate sign-up form field with an uneditable/undeletable sentence === One field in our website's sign-up form is occasionally left blank yet we need it to include one sentence that for legal reasons must not be editable. This is then later used as part of the user's profile and will sit in the same place if they added content to that field too during the initial sign-up. How can we populate this single field with an uneditable/undeletable sentence, yet allow text to be added above it if the user chooses to? Currently the field in question looks like this: <textarea name="description" id="eBann" rows="2" maxlength="1500" cols="20" onKeyUp="toCount('eBann','sBann','{CHAR} characters left',1500);"><?php echo $description;?></textarea>
0
1,376,657
09/04/2009 00:23:36
6,236
09/13/2008 05:27:27
625
30
How to debug OpenGL ES crashes?
OpenGL ES 1.1 likes to crash my iPhone program if anything goes slightly wrong. Usually it happens somewhere inside glDrawArrays, with several glDestroyContext calls on stack. Usually I'm bisecting the problem by inserting { GLint iErr = glGetError(); if (iErr != GL_NO_ERROR) { NSLog(@"GL error: %d (0x%x)", iErr, iErr); } } all over the place. However sometimes it is not enough. Are there any other ways to get useful diagnostics on the crash reasons?
iphone
opengl-es
crash
debugging
null
null
open
How to debug OpenGL ES crashes? === OpenGL ES 1.1 likes to crash my iPhone program if anything goes slightly wrong. Usually it happens somewhere inside glDrawArrays, with several glDestroyContext calls on stack. Usually I'm bisecting the problem by inserting { GLint iErr = glGetError(); if (iErr != GL_NO_ERROR) { NSLog(@"GL error: %d (0x%x)", iErr, iErr); } } all over the place. However sometimes it is not enough. Are there any other ways to get useful diagnostics on the crash reasons?
0
6,366,779
06/16/2011 03:26:55
450,407
09/17/2010 08:45:13
11
0
What is the best graph drawing package for web pages out there?
My main concern is not so much flexibility ( of course, that's given like zooming in, etc. ) but the memory leakage. I need something that I can leave on for days and with an every second update - it still needs to go strong. Flot, JQplot, etc. are all on my radar.
javascript
jquery
html
graph
canvas
06/16/2011 03:59:40
not constructive
What is the best graph drawing package for web pages out there? === My main concern is not so much flexibility ( of course, that's given like zooming in, etc. ) but the memory leakage. I need something that I can leave on for days and with an every second update - it still needs to go strong. Flot, JQplot, etc. are all on my radar.
4
9,712,514
03/15/2012 00:45:09
1,270,438
03/15/2012 00:39:46
1
0
Alternative for the = sign
i was asked to implement a c++ code to perform the assignment x=y without the = sign and without functions. I have used the memcpy: int main(int argc, char *argv[]) { int x(5),y(3); memcpy(&x,&y,sizeof(y)); printf("%d",x); getchar(); return 0; } any other generic solutions? Thanks
c++
equals
null
null
null
03/16/2012 00:22:59
too localized
Alternative for the = sign === i was asked to implement a c++ code to perform the assignment x=y without the = sign and without functions. I have used the memcpy: int main(int argc, char *argv[]) { int x(5),y(3); memcpy(&x,&y,sizeof(y)); printf("%d",x); getchar(); return 0; } any other generic solutions? Thanks
3
7,899,471
10/26/2011 06:46:28
930,339
09/06/2011 09:27:24
6
0
Sniffing IGMP messages on the local network
I'm trying to sniff all IGMP messages on the local network (for crazy reasons not to be discussed ;-)). I have some questions related to this, as I'm not really an IGMP/routing expert. Is it even possible? I know I can read IGMP from a raw socket, and I know you can use Wireshark to monitor the IGMP messages that reach your local computer, but what puzzles me is this: I use a program on another computer (seperated from the one running Wireshark by a switch) which will join a multicast address - BUT - it's not always that I even see the Membership report/JOIN in Wireshark. Now does anyone know if it's guaranteed that _every_ IGMP join is spread out on the entire local network? Sometimes I see the join in Wireshark, sometimes I don't. Assuming all IGMP join messages are always sent to every station on the network, shouldn't it be possible to monitor which stations are members of which multicast groups doing something like this (posix socket c++ code): int rawSock = ::socket(AF_INET, SOCK_RAW, IPPROTO_IGMP); uint8_t buf[10*1024]; while(true) { ssize_t rval = ::recv(rawSock, buf, sizeof(buf), 0); iphdr *iph = (iphdr*)buf; printf("Received %d bytes - protocol %d\n", rval, iph->protocol); /*do whatever needed to the IGMP message*/ } Hope someone knows their IGMP stuff :-)
sockets
routing
ip
multicast
igmp
null
open
Sniffing IGMP messages on the local network === I'm trying to sniff all IGMP messages on the local network (for crazy reasons not to be discussed ;-)). I have some questions related to this, as I'm not really an IGMP/routing expert. Is it even possible? I know I can read IGMP from a raw socket, and I know you can use Wireshark to monitor the IGMP messages that reach your local computer, but what puzzles me is this: I use a program on another computer (seperated from the one running Wireshark by a switch) which will join a multicast address - BUT - it's not always that I even see the Membership report/JOIN in Wireshark. Now does anyone know if it's guaranteed that _every_ IGMP join is spread out on the entire local network? Sometimes I see the join in Wireshark, sometimes I don't. Assuming all IGMP join messages are always sent to every station on the network, shouldn't it be possible to monitor which stations are members of which multicast groups doing something like this (posix socket c++ code): int rawSock = ::socket(AF_INET, SOCK_RAW, IPPROTO_IGMP); uint8_t buf[10*1024]; while(true) { ssize_t rval = ::recv(rawSock, buf, sizeof(buf), 0); iphdr *iph = (iphdr*)buf; printf("Received %d bytes - protocol %d\n", rval, iph->protocol); /*do whatever needed to the IGMP message*/ } Hope someone knows their IGMP stuff :-)
0
6,762,219
07/20/2011 12:52:35
741,496
05/06/2011 09:42:53
48
9
What is the sense of Flex Modules
As far as my understanding goes Modules kann be used to split an Application into different parts. A big advantage seems to be to be able to load Module after Application Start, to get a better Startup performance. I personally would like Modules to make me able to have an own Code Sandbox for the Module Code. So neither the Main App Code nor the Module Code should influence each other. But for examples CSS Styles from modules influence the Main Application an visa vers. My Question: 1. What can I use Modules for beside Runtimeloading ? 2. Are there options to run code in an own sandbox ? For Example via Loading swf assets ?
flex
actionscript-3
flash-builder
null
null
07/21/2011 14:49:58
not a real question
What is the sense of Flex Modules === As far as my understanding goes Modules kann be used to split an Application into different parts. A big advantage seems to be to be able to load Module after Application Start, to get a better Startup performance. I personally would like Modules to make me able to have an own Code Sandbox for the Module Code. So neither the Main App Code nor the Module Code should influence each other. But for examples CSS Styles from modules influence the Main Application an visa vers. My Question: 1. What can I use Modules for beside Runtimeloading ? 2. Are there options to run code in an own sandbox ? For Example via Loading swf assets ?
1
8,110,536
11/13/2011 08:40:11
1,043,986
11/13/2011 08:35:28
1
0
How to manage an asp.net website in host server from my home?
there is a way to do this like svn or somthing? The deployment is not necessary from visual studio because I uploaded all the files from ftp to the server.
asp.net
deployment
null
null
null
06/07/2012 23:25:35
not a real question
How to manage an asp.net website in host server from my home? === there is a way to do this like svn or somthing? The deployment is not necessary from visual studio because I uploaded all the files from ftp to the server.
1
5,076,906
02/22/2011 10:25:31
410,636
02/17/2010 10:17:46
7,066
479
Column does not exist in the IN clause, but SQL runs
I have a query that uses the `IN` clause. Here's a simplified version: SELECT * FROM table A JOIN table B ON A.ID = B.ID WHERE B.AnotherColumn IN (SELECT Column FROM tableC WHERE ID = 1) `tableC` doesn't have a `Column` column, but the query executes just fine with no error message. Can anyone explain why?
sql
sql-server-2008
null
null
null
null
open
Column does not exist in the IN clause, but SQL runs === I have a query that uses the `IN` clause. Here's a simplified version: SELECT * FROM table A JOIN table B ON A.ID = B.ID WHERE B.AnotherColumn IN (SELECT Column FROM tableC WHERE ID = 1) `tableC` doesn't have a `Column` column, but the query executes just fine with no error message. Can anyone explain why?
0
5,977,444
05/12/2011 11:45:09
11,635
09/16/2008 09:41:29
10,902
469
Preventing MSBuild from building a project in a .sln without using Solution Configurations
I want to inhibit the building of certain projects within a solution from building (within a TeamCity Build Configuration in order to optimize the speed of my Commit Build feedback if you must know). I'm aware of the Solution Configurations mechanism but don't want to have to force lots of `.sln` files to end up with every permutation of things I want to be able to switch off. I have Convention based rule where I want to say "If I'm doing the Commit Build, I dont want to do the final installer packaging". (And I don't want to break it out into a separate solution). I'd prefer not to use a solution involving find and replace in the `.sln` file or in a `.proj` file created via `[MsBuildEmitSolution][1]`. I'm aware of questions here which cover the [out of the box solution][2] and [this slightly related question][3]. I see MSBuild `/v:diag` is saying: 2>Target "Build" in file "Z.sln.metaproj" from project "Z.sln" (entry point): Using "MSBuild" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "MSBuild" Global Properties: BuildingSolutionFile=true CurrentSolutionConfigurationContents=<SolutionConfiguration> <ProjectConfiguration Project="{C83D035D-169B-4023-9BEE-1790C9FE22AB}" AbsolutePath="X.csproj" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> <ProjectConfiguration Project="{15E7887D-F1DB-4D85-8454-E4EF5CBDE6D5}" AbsolutePath="Y.csproj" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> </SolutionConfiguration> So the question is: *Is there a **neat** way of me getting to do an XPath replace or similar to have the effect of changing `BuildProjectInSolution="`**`True`**`"` to `BuildProjectInSolution="`**`False`**`"`* Failing that, is there a relatively simple edit I can do within a `.ccproj` (An Azure 1.4 Package) or a `.csproj` (a general project) file to cause the effects (including triggering of dependent projects) of the project being enabled to be nullified? [1]: http://blogs.infosupport.com/blogs/raimondb/archive/2006/05/22/msbuildemit.aspx [2]: http://stackoverflow.com/questions/1627483/skip-a-project-while-building-a-solution-using-msbuild-3-5 [3]: http://stackoverflow.com/questions/5057830/under-vs10-msbuild-exe-how-can-a-specific-project-within-a-solution-sln-be-ignore
msbuild
teamcity
sln
azure-packaging
skipping
null
open
Preventing MSBuild from building a project in a .sln without using Solution Configurations === I want to inhibit the building of certain projects within a solution from building (within a TeamCity Build Configuration in order to optimize the speed of my Commit Build feedback if you must know). I'm aware of the Solution Configurations mechanism but don't want to have to force lots of `.sln` files to end up with every permutation of things I want to be able to switch off. I have Convention based rule where I want to say "If I'm doing the Commit Build, I dont want to do the final installer packaging". (And I don't want to break it out into a separate solution). I'd prefer not to use a solution involving find and replace in the `.sln` file or in a `.proj` file created via `[MsBuildEmitSolution][1]`. I'm aware of questions here which cover the [out of the box solution][2] and [this slightly related question][3]. I see MSBuild `/v:diag` is saying: 2>Target "Build" in file "Z.sln.metaproj" from project "Z.sln" (entry point): Using "MSBuild" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "MSBuild" Global Properties: BuildingSolutionFile=true CurrentSolutionConfigurationContents=<SolutionConfiguration> <ProjectConfiguration Project="{C83D035D-169B-4023-9BEE-1790C9FE22AB}" AbsolutePath="X.csproj" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> <ProjectConfiguration Project="{15E7887D-F1DB-4D85-8454-E4EF5CBDE6D5}" AbsolutePath="Y.csproj" BuildProjectInSolution="True">Debug|AnyCPU</ProjectConfiguration> </SolutionConfiguration> So the question is: *Is there a **neat** way of me getting to do an XPath replace or similar to have the effect of changing `BuildProjectInSolution="`**`True`**`"` to `BuildProjectInSolution="`**`False`**`"`* Failing that, is there a relatively simple edit I can do within a `.ccproj` (An Azure 1.4 Package) or a `.csproj` (a general project) file to cause the effects (including triggering of dependent projects) of the project being enabled to be nullified? [1]: http://blogs.infosupport.com/blogs/raimondb/archive/2006/05/22/msbuildemit.aspx [2]: http://stackoverflow.com/questions/1627483/skip-a-project-while-building-a-solution-using-msbuild-3-5 [3]: http://stackoverflow.com/questions/5057830/under-vs10-msbuild-exe-how-can-a-specific-project-within-a-solution-sln-be-ignore
0
11,242,798
06/28/2012 10:36:17
886,906
08/09/2011 23:14:53
663
1
Play Audio HTML5 function works with path to http, not to the file in the root
Solution found. No additional solution is needed. Thank you. My js script is to play the audio file when the page loads. <script type="text/javascript"> var wavfile = new Audio("http://www.mysite.com/sound10.wav"); wavfile.play(); </script> The project is on the localhost on my laptop. It works and plays that sound and works fine. The only thing I want is to play the file from the localhost. For that purpose I have the same file `sound10.wav` in my wwwroot folder where the project is, but I have no luck to insert a proper path to that file. var wavfile = new Audio("???"); &nbsp; var wavfile = new Audio("sound10.wav"); doesn't work. Thank you.
javascript
html5
audio
path
playback
06/28/2012 14:10:33
too localized
Play Audio HTML5 function works with path to http, not to the file in the root === Solution found. No additional solution is needed. Thank you. My js script is to play the audio file when the page loads. <script type="text/javascript"> var wavfile = new Audio("http://www.mysite.com/sound10.wav"); wavfile.play(); </script> The project is on the localhost on my laptop. It works and plays that sound and works fine. The only thing I want is to play the file from the localhost. For that purpose I have the same file `sound10.wav` in my wwwroot folder where the project is, but I have no luck to insert a proper path to that file. var wavfile = new Audio("???"); &nbsp; var wavfile = new Audio("sound10.wav"); doesn't work. Thank you.
3
5,596,847
04/08/2011 14:49:26
558,243
12/30/2010 12:03:40
594
51
ibatis database name with special characters
I have to generate an html report regarding a few databases. I am using ibatis on the server side. One of the tables has a 'degree' sign as a part of its name. The issue is, when I print this name in html file, the degree signs converts to ? , which is not what I want. Is there a way , that I can get the database name with special characters and show it in the same way. Thanks -- Neeraj
html
tomcat
ibatis
null
null
null
open
ibatis database name with special characters === I have to generate an html report regarding a few databases. I am using ibatis on the server side. One of the tables has a 'degree' sign as a part of its name. The issue is, when I print this name in html file, the degree signs converts to ? , which is not what I want. Is there a way , that I can get the database name with special characters and show it in the same way. Thanks -- Neeraj
0
9,693,058
03/13/2012 22:16:39
667,464
03/19/2011 16:32:18
13
1
JQuery Accordion and Validation conflict
I have a form with sections broken into accordions. I'm using JQuery Accordion to do that, and I'm also using the JQuery Validation plug-in on the same form. There is no submit button. There's an anchor link that, on click, starts the validation and then if the form is valid, runs some additional code. (Saving the data to a db and in some cases redirecting.) My problem is that the the validator is only working on the currently expanded accordion fold. If everything is valid in the current accordion fold, the form will test as valid even if another fold has invalid elements. Unfortunately, this project is too convoluted to provide much/complete code. It's an extensive and complex PHP/NuSoap API project. I've also had two devs flake on me with this, so there's probably lots of code that's irrelevant, and two different devs' worth of info architecture. I'm stuck muddling through the final stretch with my limited knowledge of Jquery/Json/NuSOAP. I know limited code means I may not get an answer that works. However, I would really appreciate any suggestions that I can experiment with. Here are some bits... It's a long form, so here is an abbreviated version of the HTML: <p class="sidebarheader">Basic Information</p> <p class="fineprint required">*Required field&nbsp;&nbsp;|&nbsp;&nbsp;Write dates as mm/dd/yyyy</p> <form method="post" action="" class="profileform" rel="basic" id="profile-basic"> <div id="errormsg" class="cf"><ul></ul></div> <div id="accordion"> <h3>Name*</h3> <div> <div class="twocol"> <label for="firstName">First Name:*</label> <input type="text" id="firstName" name="firstName" class="required" /> <label for="lastName">Last Name:*</label> <input type="text" id="lastName" name="lastName" class="required" /> </div> <div class="twocol"> <label for="namePrefix" class="widerlabel">Name Prefix (Ms., Mr., etc.):</label> <input type="text" id="namePrefix" name="namePrefix" /> <label for="nameSuffix" class="widerlabel">Name Suffix (Jr., Esq., etc.):</label> <input type="text" id="nameSuffix" name="nameSuffix" /> </div> </div><!-- name --> <h3>Contact Information*</h3> <div> <div class="twocol"> <label for="phone">Phone:*</label> <input type="text" id="phone" name="phone" class="required" /> <label for="workPhone">Work Phone:</label> <input type="text" id="workPhone" name="workPhone" /> <label for="mobile">Mobile:</label> <input type="text" id="mobile" name="mobile" /> </div> <div class="twocol"> <label for="address1_1">Address:*</label> <input type="text" id="address1_1" name="address1_1" class="required" /> <label for="address2_1" class="widelabel">Address (line2):</label> <input type="text" id="address2_1" name="address2_1" /> <label for="city_1">City:*</label> <input type="text" id="city_1" name="city_1" class="required" /> <label for="state_1">State:*</label> <input type="text" id="state_1" name="state_1" class="required" /> <label for="zip_1">Zip:*</label> <input type="text" id="zip_1" name="zip_1" class="required" /> <label for="country_1">Country:*</label> <select id="country_1" name="country_1"> </select> </div> </div> <!-- contact --> <h3>Additional Information*</h3> <div> <div class="twocol"> <label for="dateAvailable" class="widelabel">Date Available:*</label> <input type="text" id="dateAvailable" name="dateAvailable" placeholder="mm/dd/yyyy" class="required" /> </div> <div class="twocol"> <label for="persComments" class="ownline">Comments:*</label> <textarea id="persComments" name="persComments" class="required" /></textarea> </div> </div><!-- add'l info --> </div> <!-- accordion --> <input type="hidden" id="formid" name="formid" value="basic" /> </section> <div class="buttons"><a href="" class="save">Save</a> | <a href="/profile-work" class="next">Save and Go to Work History</a> | <a href="/profile-complete" class="finish">Save and Submit</a></div> </form> Next is some relevant code from the init.js. Some notes about it: 1) In it you may notice some scattered remnants of the PHP-based validation the first dev started, but never finished. I have taken most of it out, but in some places I just didn't want to risk breaking something and left it in. 2) There is some additional functionality added to the accordions. The form is a job application, and there are scripts that will add or delete additional folds if the user wants to add another job to their work history, or delete one. (Work history is on another page - not the one I just posted the HTML for. But you may see bits in the scripts below that make you wonder, so I'm giving the explanation.) 3) I'm getting a last line syntax error with the bit I've pasted below. That's just because I took a lot out and probably lost a brace along the way. In the full version, I get no errors. 4) I'm not sure how relevant the code above the Validator Defaults comment is. It's probably worth looking at line 228 through the end first. That's halfway down (you'll see the Validator Defaults comment) 5) Here's a list of all the scripts being invoked on this page. I don't know if they are all being used. <script src="<?php bloginfo('template_directory'); ?>/js/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/init.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.address-1.5.min.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/fileuploader/fileuploader.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.widget.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.iframe-transport.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.fileupload.js"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> (The site uses WordPress, but the code for all of this is standalone, it's just called into WP using ShortcodeExec.) OK, so here's the js. Please excuse any craptastic code. I am undoubtedly swimming in the deep end. var is_authenticated; var authinfo; var currenturl = window.location.href; var accordionLastActive = 0; var accordionLength = 0; var accordionNextActive = 0; var accordionvars = { autoHeight: false, change: function(event, ui) { accordionLastActive = ui.options['active']; save_profile_form(); } } $(document).ready(function () { $.get( '/wp-content/themes/customtheme/inc/app/session.php', function(data) { if(data.user_id) { is_authenticated = true; authinfo = data; //Change this after my account has been added. if(currenturl.indexOf('/log-in/') >= 0 || currenturl.indexOf('/register/') >= 0) window.location = '/profile/'; if(currenturl.indexOf('/profile') >= 0 || currenturl.indexOf('/my-account/')>=0) { if(currenturl.slice(23) == '/profile/') createUploader(); else $('#file-uploader').empty(); //The slickest way would be to add all of this information to both the complete and my-account if(currenturl.indexOf('complete') >= 0 || currenturl.indexOf('/my-account/') >=0) { $('.loadinggif').hide(); if (!data.bh_jobid) { $('.submitprofile').hide(); } var incompletefields = 0; for(var i in data.profile) { for(var j in data.profile[i]) { if($.isArray(data.profile[i][j]) && j!='multi') { var implodearray; if(j == 'categoryID' || j == 'secondaryCategories') { var catpopulate = j; $.get( '/wp-content/themes/customtheme/inc/app/categories.php?catid='+data.profile[i][j].join(','), function(cdata) { var catarray = new Array(); for(var c in cdata) catarray[c] = cdata[c]['category']; $('#'+catpopulate).text(catarray.join(', ')); }, 'json' ); } else { $('#'+j).text(data.profile[i][j].join(', ')); } } else if(j == 'multi') { if(data.profile[i][j].length > 0) { for(k=0;k<data.profile[i][j].length;k++) { if(k > 0) addProfileTab(i,k); for(var l in data.profile[i][j][k]) { //console.log("#"+l+"_"+k); $("#"+l+"_"+k).text(data.profile[i][j][k][l]); } } } } else { if(j == 'categoryID' || j == 'secondaryCategories') { var catpopulates = j; $.get( '/wp-content/themes/customtheme/inc/app/categories.php?catid='+data.profile[i][j], function(cdata) { for(var c in cdata) { $('#'+catpopulates).text(cdata[c]['category']); } }, 'json' ); } else if(j == 'country_1') { var crpopulates = j; $.get( '/wp-content/themes/customtheme/inc/app/countries.php?countryid='+data.profile[i][j], function(crdata) { for(var cr in crdata) { $('#'+crpopulates).text(crdata[cr]['name']); } }, 'json' ); } else if(j == 'country_2') { if(data.profile[i][j]) { var cr2populates = j; $.get( '/wp-content/themes/customtheme/inc/app/countries.php?countryid='+data.profile[i][j], function(cr2data) { for(var cr2 in cr2data) { $('#'+cr2populates).text(cr2data[cr2]['name']); } }, 'json' ); } } else { $('#'+j).text(data.profile[i][j]); } } } } // removed old validation 3-12-12 ksc } else { var formid = $("form.profileform").attr('rel'); for(var i in data.profile[formid]) { if(i == 'multi') { if(data.profile[formid][i].length > 0) { for(j=0;j<data.profile[formid][i].length;j++) { if(j > 0) { //move the delete button to another part of the app. addDeleteButton(); addAccordionTab(j); } for(var k in data.profile[formid][i][j]) $(":input#"+k+"_"+j).val(data.profile[formid][i][j][k]) } } } else { $(":input#"+i).val(data.profile[formid][i]); } } if(currenturl.indexOf('/profile/') >= 0) { $.get( '/wp-content/themes/customtheme/inc/app/countries.php', function(crdata) { for(var cr in crdata) $('#country_1, #country_2').append('<option value="' + crdata[cr]['countryID'] + '">' + crdata[cr]['name'] + '</option>'); $(":input#country_1").val(data.profile[formid]['country_1']); $(":input#country_2").val(data.profile[formid]['country_2']); }, 'json' ); $.get( '/wp-content/themes/customtheme/inc/app/categories.php', function(cdata) { for(var c in cdata) $('#categoryID, #secondaryCategories').append('<option value="' + cdata[c]['catid'] + '">' + cdata[c]['category'] + '</option>'); $(":input#categoryID").val(data.profile[formid]['categoryID']); $(":input#secondaryCategories").val(data.profile[formid]['secondaryCategories']); }, 'json' ); } } } $("#accordion").accordion(accordionvars); } else { if(currenturl.indexOf('/profile') >= 0) window.location = '/log-in/'; $(".loadinggif").hide(); } }, 'json' ); $(".addanother").click(function(){ save_profile_form(); addAccordionTab(); $("#accordion").accordion('destroy').accordion(accordionvars).accordion('activate',accordionLength); $("#accordion").children("div:last").find("input:first").focus(); //Change this to scrollTo return false; }); /* VALIDATOR DEFAULTS */ $.validator.setDefaults({ debug: true, errorElement: "li", // Something has to be defined here, or JQuery overwrites existing label classes with the error class instead of appending. errorContainer: '#errormsg', errorLabelContainer: '#errormsg ul', onfocusout: false, highlight: function (element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); $(element.form).find("label[for=" + element.id + "]") .addClass(errorClass); }, unhighlight: function (element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); $(element.form).find("label[for=" + element.id + "]") .removeClass(errorClass); }, invalidHandler: function (form, validator) { // This may not be working. $('html,body').animate( {scrollTop: (360)} ); }, submitHandler: function (form) { // I don't think this is working either. $(form).hide(); $('<p class="successmsg">Your changes have been recorded. Thank you.</p>') .insertBefore(form); $('html,body').animate( {scrollTop: (360)} ); } }); var validator = $("#profile-basic").validate({ rules: { address_1: "required", city_1: "required", country_1: "required", dateAvailable: { required: true, date: true }, email: { required: true, email: true }, firstName: "required", lastName: "required", persComments: "required", phone: "required", state_1: "required", zip_1: "required", select:{ // what's this? required: function (element) { if( $("#select").val() ==''){ return false; }else{ return true; } } } }, messages: { address1_1: "Please enter your address.", city_1: "Please enter your city.", country_1: "Please enter your country.", dateAvailable: { required: "Please enter the date you are available.", date: "The date you are available is not formatted as a date (mm/dd/yyy)." }, email: { required: "Please enter your email address.", email: "Enter a valid email address, for example [email protected]." }, firstName: "Please enter your first name.", lastName: "Please enter your last name.", persComments: "Please enter some comments about yourself.", phone: "Please enter your phone number.", state_1: "Please enter your state.", zip_1: "Please enter your zip code." } }); // $("#profile-basic").valid(); // huh, wow. this line causes the whole page to validate (not just one accordion) on load $(".save").click(function() { validator.form(); if ($("#profile-basic").valid()){ // console.log($('.profileform').serialize()); // is this just for debugging? save_profile_form('','Your data has been saved','Failed to save. Try again'); } return false; }); $('.profileform .next').click(function() { validator.form(); if ($("#profile-basic").valid()){ save_profile_form($(this).attr('href')); } return false; }); $('.profileform .finish').click(function() { validator.form(); if ($("#profile-basic").valid()){ save_profile_form($(this).attr('href')); } return false; }); function save_profile_form(goto_page,success_message,error_message){ if($('.profileform').length > 0) { $.post( 'inc/update_profile.php', $('.profileform').serialize(), function(data, textStatus) { var text = JSON.stringify(data, null, '\t'); if(data.status == 401) { alert('Your changes have not been saved because your session has expired. To save your changes, please log in again'); window.location = '/log-in/'; } else { if(goto_page) window.location = goto_page; if(success_message && data.status == 200) alert(success_message); if(error_message && data.status != 200) alert(error_message); } }, 'json' ); } else if(goto_page) { //window.location = goto_page; } } function addProfileTab(i,k){ var newTab = $("#"+i+" .duplicatable").clone(false).removeClass('duplicatable').addClass('duplicated').find('span').each(function(){ var newId = this.id.replace("_0","_"+k); this.id = newId; }).end(); $(newTab).appendTo("#"+i); } function addAccordionTab(newpos){ accordionLength = $("h3").length; accordionNextActive = $(".duplicated").length + 2; var newTab = $(".duplicatable").clone(false).removeClass('duplicatable').addClass('duplicated').find(':input').each(function(){ newpos = newpos ? newpos : (accordionNextActive - 1); var newId = this.id.replace("_0","_"+newpos); var newName = this.name.replace("[0]","["+(newpos)+"]"); $(this).prev().attr('for',newId); this.id = newId; this.name = newName; $(this).val(''); }).end(); var newTitle = $(".duplicatable").attr('rel') + " #" + accordionNextActive; $("#entries").val(accordionNextActive); $("#accordion").append('<h3>'+newTitle+ '</h3>'); $(newTab).appendTo("#accordion"); //Check and see if the add delete button exists. If it does, then add another button to the end of it. if ($('.removeanother').length ==0) { addDeleteButton(); } } function removeAccordionTab() { var active = $('#accordion').accordion('option', 'active'); var accordionItemTitle = $("#accordion").find('h3:last'); //Just get the both and remove them both. var accordionItemDiv = $("#accordion").find('div:last'); accordionItemTitle.remove(); accordionItemDiv.remove(); if ($('h3').length > 0) { $('.removeanother').remove(); } } function addDeleteButton() { //Find the add another button var accordianTitle = $(".duplicatable").attr('rel'); $('.addanother').after('<a href = "" class = "removeanother">Remove '+ accordianTitle +'</a>'); //add the click function. $(".removeanother").click(function(){ removeAccordionTab(); save_profile_form(); $("#accordion").accordion('destroy').accordion(accordionvars).accordion('activate',accordionLength); $("#accordion").children("div:last").find("input:first").focus(); //Change this to scrollTo return false; }); } Mucho, mucho gracias. I can't believe I've made it this far to run into this last wall! (Yes, really, it will be the last. Really.) Thanks, Kim
jquery-plugins
jquery-accordion
jquery-validation-plugin
null
null
03/14/2012 02:00:18
not a real question
JQuery Accordion and Validation conflict === I have a form with sections broken into accordions. I'm using JQuery Accordion to do that, and I'm also using the JQuery Validation plug-in on the same form. There is no submit button. There's an anchor link that, on click, starts the validation and then if the form is valid, runs some additional code. (Saving the data to a db and in some cases redirecting.) My problem is that the the validator is only working on the currently expanded accordion fold. If everything is valid in the current accordion fold, the form will test as valid even if another fold has invalid elements. Unfortunately, this project is too convoluted to provide much/complete code. It's an extensive and complex PHP/NuSoap API project. I've also had two devs flake on me with this, so there's probably lots of code that's irrelevant, and two different devs' worth of info architecture. I'm stuck muddling through the final stretch with my limited knowledge of Jquery/Json/NuSOAP. I know limited code means I may not get an answer that works. However, I would really appreciate any suggestions that I can experiment with. Here are some bits... It's a long form, so here is an abbreviated version of the HTML: <p class="sidebarheader">Basic Information</p> <p class="fineprint required">*Required field&nbsp;&nbsp;|&nbsp;&nbsp;Write dates as mm/dd/yyyy</p> <form method="post" action="" class="profileform" rel="basic" id="profile-basic"> <div id="errormsg" class="cf"><ul></ul></div> <div id="accordion"> <h3>Name*</h3> <div> <div class="twocol"> <label for="firstName">First Name:*</label> <input type="text" id="firstName" name="firstName" class="required" /> <label for="lastName">Last Name:*</label> <input type="text" id="lastName" name="lastName" class="required" /> </div> <div class="twocol"> <label for="namePrefix" class="widerlabel">Name Prefix (Ms., Mr., etc.):</label> <input type="text" id="namePrefix" name="namePrefix" /> <label for="nameSuffix" class="widerlabel">Name Suffix (Jr., Esq., etc.):</label> <input type="text" id="nameSuffix" name="nameSuffix" /> </div> </div><!-- name --> <h3>Contact Information*</h3> <div> <div class="twocol"> <label for="phone">Phone:*</label> <input type="text" id="phone" name="phone" class="required" /> <label for="workPhone">Work Phone:</label> <input type="text" id="workPhone" name="workPhone" /> <label for="mobile">Mobile:</label> <input type="text" id="mobile" name="mobile" /> </div> <div class="twocol"> <label for="address1_1">Address:*</label> <input type="text" id="address1_1" name="address1_1" class="required" /> <label for="address2_1" class="widelabel">Address (line2):</label> <input type="text" id="address2_1" name="address2_1" /> <label for="city_1">City:*</label> <input type="text" id="city_1" name="city_1" class="required" /> <label for="state_1">State:*</label> <input type="text" id="state_1" name="state_1" class="required" /> <label for="zip_1">Zip:*</label> <input type="text" id="zip_1" name="zip_1" class="required" /> <label for="country_1">Country:*</label> <select id="country_1" name="country_1"> </select> </div> </div> <!-- contact --> <h3>Additional Information*</h3> <div> <div class="twocol"> <label for="dateAvailable" class="widelabel">Date Available:*</label> <input type="text" id="dateAvailable" name="dateAvailable" placeholder="mm/dd/yyyy" class="required" /> </div> <div class="twocol"> <label for="persComments" class="ownline">Comments:*</label> <textarea id="persComments" name="persComments" class="required" /></textarea> </div> </div><!-- add'l info --> </div> <!-- accordion --> <input type="hidden" id="formid" name="formid" value="basic" /> </section> <div class="buttons"><a href="" class="save">Save</a> | <a href="/profile-work" class="next">Save and Go to Work History</a> | <a href="/profile-complete" class="finish">Save and Submit</a></div> </form> Next is some relevant code from the init.js. Some notes about it: 1) In it you may notice some scattered remnants of the PHP-based validation the first dev started, but never finished. I have taken most of it out, but in some places I just didn't want to risk breaking something and left it in. 2) There is some additional functionality added to the accordions. The form is a job application, and there are scripts that will add or delete additional folds if the user wants to add another job to their work history, or delete one. (Work history is on another page - not the one I just posted the HTML for. But you may see bits in the scripts below that make you wonder, so I'm giving the explanation.) 3) I'm getting a last line syntax error with the bit I've pasted below. That's just because I took a lot out and probably lost a brace along the way. In the full version, I get no errors. 4) I'm not sure how relevant the code above the Validator Defaults comment is. It's probably worth looking at line 228 through the end first. That's halfway down (you'll see the Validator Defaults comment) 5) Here's a list of all the scripts being invoked on this page. I don't know if they are all being used. <script src="<?php bloginfo('template_directory'); ?>/js/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/init.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.address-1.5.min.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/fileuploader/fileuploader.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.widget.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.iframe-transport.js"></script> <script src="<?php bloginfo('template_directory'); ?>/js/jquery.fileupload.js"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> (The site uses WordPress, but the code for all of this is standalone, it's just called into WP using ShortcodeExec.) OK, so here's the js. Please excuse any craptastic code. I am undoubtedly swimming in the deep end. var is_authenticated; var authinfo; var currenturl = window.location.href; var accordionLastActive = 0; var accordionLength = 0; var accordionNextActive = 0; var accordionvars = { autoHeight: false, change: function(event, ui) { accordionLastActive = ui.options['active']; save_profile_form(); } } $(document).ready(function () { $.get( '/wp-content/themes/customtheme/inc/app/session.php', function(data) { if(data.user_id) { is_authenticated = true; authinfo = data; //Change this after my account has been added. if(currenturl.indexOf('/log-in/') >= 0 || currenturl.indexOf('/register/') >= 0) window.location = '/profile/'; if(currenturl.indexOf('/profile') >= 0 || currenturl.indexOf('/my-account/')>=0) { if(currenturl.slice(23) == '/profile/') createUploader(); else $('#file-uploader').empty(); //The slickest way would be to add all of this information to both the complete and my-account if(currenturl.indexOf('complete') >= 0 || currenturl.indexOf('/my-account/') >=0) { $('.loadinggif').hide(); if (!data.bh_jobid) { $('.submitprofile').hide(); } var incompletefields = 0; for(var i in data.profile) { for(var j in data.profile[i]) { if($.isArray(data.profile[i][j]) && j!='multi') { var implodearray; if(j == 'categoryID' || j == 'secondaryCategories') { var catpopulate = j; $.get( '/wp-content/themes/customtheme/inc/app/categories.php?catid='+data.profile[i][j].join(','), function(cdata) { var catarray = new Array(); for(var c in cdata) catarray[c] = cdata[c]['category']; $('#'+catpopulate).text(catarray.join(', ')); }, 'json' ); } else { $('#'+j).text(data.profile[i][j].join(', ')); } } else if(j == 'multi') { if(data.profile[i][j].length > 0) { for(k=0;k<data.profile[i][j].length;k++) { if(k > 0) addProfileTab(i,k); for(var l in data.profile[i][j][k]) { //console.log("#"+l+"_"+k); $("#"+l+"_"+k).text(data.profile[i][j][k][l]); } } } } else { if(j == 'categoryID' || j == 'secondaryCategories') { var catpopulates = j; $.get( '/wp-content/themes/customtheme/inc/app/categories.php?catid='+data.profile[i][j], function(cdata) { for(var c in cdata) { $('#'+catpopulates).text(cdata[c]['category']); } }, 'json' ); } else if(j == 'country_1') { var crpopulates = j; $.get( '/wp-content/themes/customtheme/inc/app/countries.php?countryid='+data.profile[i][j], function(crdata) { for(var cr in crdata) { $('#'+crpopulates).text(crdata[cr]['name']); } }, 'json' ); } else if(j == 'country_2') { if(data.profile[i][j]) { var cr2populates = j; $.get( '/wp-content/themes/customtheme/inc/app/countries.php?countryid='+data.profile[i][j], function(cr2data) { for(var cr2 in cr2data) { $('#'+cr2populates).text(cr2data[cr2]['name']); } }, 'json' ); } } else { $('#'+j).text(data.profile[i][j]); } } } } // removed old validation 3-12-12 ksc } else { var formid = $("form.profileform").attr('rel'); for(var i in data.profile[formid]) { if(i == 'multi') { if(data.profile[formid][i].length > 0) { for(j=0;j<data.profile[formid][i].length;j++) { if(j > 0) { //move the delete button to another part of the app. addDeleteButton(); addAccordionTab(j); } for(var k in data.profile[formid][i][j]) $(":input#"+k+"_"+j).val(data.profile[formid][i][j][k]) } } } else { $(":input#"+i).val(data.profile[formid][i]); } } if(currenturl.indexOf('/profile/') >= 0) { $.get( '/wp-content/themes/customtheme/inc/app/countries.php', function(crdata) { for(var cr in crdata) $('#country_1, #country_2').append('<option value="' + crdata[cr]['countryID'] + '">' + crdata[cr]['name'] + '</option>'); $(":input#country_1").val(data.profile[formid]['country_1']); $(":input#country_2").val(data.profile[formid]['country_2']); }, 'json' ); $.get( '/wp-content/themes/customtheme/inc/app/categories.php', function(cdata) { for(var c in cdata) $('#categoryID, #secondaryCategories').append('<option value="' + cdata[c]['catid'] + '">' + cdata[c]['category'] + '</option>'); $(":input#categoryID").val(data.profile[formid]['categoryID']); $(":input#secondaryCategories").val(data.profile[formid]['secondaryCategories']); }, 'json' ); } } } $("#accordion").accordion(accordionvars); } else { if(currenturl.indexOf('/profile') >= 0) window.location = '/log-in/'; $(".loadinggif").hide(); } }, 'json' ); $(".addanother").click(function(){ save_profile_form(); addAccordionTab(); $("#accordion").accordion('destroy').accordion(accordionvars).accordion('activate',accordionLength); $("#accordion").children("div:last").find("input:first").focus(); //Change this to scrollTo return false; }); /* VALIDATOR DEFAULTS */ $.validator.setDefaults({ debug: true, errorElement: "li", // Something has to be defined here, or JQuery overwrites existing label classes with the error class instead of appending. errorContainer: '#errormsg', errorLabelContainer: '#errormsg ul', onfocusout: false, highlight: function (element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); $(element.form).find("label[for=" + element.id + "]") .addClass(errorClass); }, unhighlight: function (element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); $(element.form).find("label[for=" + element.id + "]") .removeClass(errorClass); }, invalidHandler: function (form, validator) { // This may not be working. $('html,body').animate( {scrollTop: (360)} ); }, submitHandler: function (form) { // I don't think this is working either. $(form).hide(); $('<p class="successmsg">Your changes have been recorded. Thank you.</p>') .insertBefore(form); $('html,body').animate( {scrollTop: (360)} ); } }); var validator = $("#profile-basic").validate({ rules: { address_1: "required", city_1: "required", country_1: "required", dateAvailable: { required: true, date: true }, email: { required: true, email: true }, firstName: "required", lastName: "required", persComments: "required", phone: "required", state_1: "required", zip_1: "required", select:{ // what's this? required: function (element) { if( $("#select").val() ==''){ return false; }else{ return true; } } } }, messages: { address1_1: "Please enter your address.", city_1: "Please enter your city.", country_1: "Please enter your country.", dateAvailable: { required: "Please enter the date you are available.", date: "The date you are available is not formatted as a date (mm/dd/yyy)." }, email: { required: "Please enter your email address.", email: "Enter a valid email address, for example [email protected]." }, firstName: "Please enter your first name.", lastName: "Please enter your last name.", persComments: "Please enter some comments about yourself.", phone: "Please enter your phone number.", state_1: "Please enter your state.", zip_1: "Please enter your zip code." } }); // $("#profile-basic").valid(); // huh, wow. this line causes the whole page to validate (not just one accordion) on load $(".save").click(function() { validator.form(); if ($("#profile-basic").valid()){ // console.log($('.profileform').serialize()); // is this just for debugging? save_profile_form('','Your data has been saved','Failed to save. Try again'); } return false; }); $('.profileform .next').click(function() { validator.form(); if ($("#profile-basic").valid()){ save_profile_form($(this).attr('href')); } return false; }); $('.profileform .finish').click(function() { validator.form(); if ($("#profile-basic").valid()){ save_profile_form($(this).attr('href')); } return false; }); function save_profile_form(goto_page,success_message,error_message){ if($('.profileform').length > 0) { $.post( 'inc/update_profile.php', $('.profileform').serialize(), function(data, textStatus) { var text = JSON.stringify(data, null, '\t'); if(data.status == 401) { alert('Your changes have not been saved because your session has expired. To save your changes, please log in again'); window.location = '/log-in/'; } else { if(goto_page) window.location = goto_page; if(success_message && data.status == 200) alert(success_message); if(error_message && data.status != 200) alert(error_message); } }, 'json' ); } else if(goto_page) { //window.location = goto_page; } } function addProfileTab(i,k){ var newTab = $("#"+i+" .duplicatable").clone(false).removeClass('duplicatable').addClass('duplicated').find('span').each(function(){ var newId = this.id.replace("_0","_"+k); this.id = newId; }).end(); $(newTab).appendTo("#"+i); } function addAccordionTab(newpos){ accordionLength = $("h3").length; accordionNextActive = $(".duplicated").length + 2; var newTab = $(".duplicatable").clone(false).removeClass('duplicatable').addClass('duplicated').find(':input').each(function(){ newpos = newpos ? newpos : (accordionNextActive - 1); var newId = this.id.replace("_0","_"+newpos); var newName = this.name.replace("[0]","["+(newpos)+"]"); $(this).prev().attr('for',newId); this.id = newId; this.name = newName; $(this).val(''); }).end(); var newTitle = $(".duplicatable").attr('rel') + " #" + accordionNextActive; $("#entries").val(accordionNextActive); $("#accordion").append('<h3>'+newTitle+ '</h3>'); $(newTab).appendTo("#accordion"); //Check and see if the add delete button exists. If it does, then add another button to the end of it. if ($('.removeanother').length ==0) { addDeleteButton(); } } function removeAccordionTab() { var active = $('#accordion').accordion('option', 'active'); var accordionItemTitle = $("#accordion").find('h3:last'); //Just get the both and remove them both. var accordionItemDiv = $("#accordion").find('div:last'); accordionItemTitle.remove(); accordionItemDiv.remove(); if ($('h3').length > 0) { $('.removeanother').remove(); } } function addDeleteButton() { //Find the add another button var accordianTitle = $(".duplicatable").attr('rel'); $('.addanother').after('<a href = "" class = "removeanother">Remove '+ accordianTitle +'</a>'); //add the click function. $(".removeanother").click(function(){ removeAccordionTab(); save_profile_form(); $("#accordion").accordion('destroy').accordion(accordionvars).accordion('activate',accordionLength); $("#accordion").children("div:last").find("input:first").focus(); //Change this to scrollTo return false; }); } Mucho, mucho gracias. I can't believe I've made it this far to run into this last wall! (Yes, really, it will be the last. Really.) Thanks, Kim
1
4,359,152
12/05/2010 14:02:56
457,065
09/24/2010 08:57:48
63
0
could anyone tell me about reverse linklist with diagram?
Diagram and program code in c is necessary.
c
null
null
null
null
12/05/2010 14:19:01
not a real question
could anyone tell me about reverse linklist with diagram? === Diagram and program code in c is necessary.
1
10,742,769
05/24/2012 17:52:46
1,415,718
05/24/2012 17:47:42
1
0
How to make a facebook application like this
I have to make an application like [this][1] [1]: http://www.facebook.com/extremesilver.ekszer/app_209220649157564 Please point me in the good direction, because I'm getting lost here. My app will show a question, and if you like the page, the answer will appear and also ask you if you want to post it on your news feed. How can I do this? Thanks in advance!
facebook
null
null
null
null
null
open
How to make a facebook application like this === I have to make an application like [this][1] [1]: http://www.facebook.com/extremesilver.ekszer/app_209220649157564 Please point me in the good direction, because I'm getting lost here. My app will show a question, and if you like the page, the answer will appear and also ask you if you want to post it on your news feed. How can I do this? Thanks in advance!
0
8,999,427
01/25/2012 08:00:56
1,073,328
11/30/2011 12:22:22
13
0
good shopping cart plugin for joomla 1.7
I am creating a online dvd shop site. I am using joomla 1.7 and I have found two plugins virtueMart and HikaShop. If any of you have used this two plugin before please suggest a easy one to use as I am running out of time.
joomla1.7
null
null
null
null
01/26/2012 14:05:08
not constructive
good shopping cart plugin for joomla 1.7 === I am creating a online dvd shop site. I am using joomla 1.7 and I have found two plugins virtueMart and HikaShop. If any of you have used this two plugin before please suggest a easy one to use as I am running out of time.
4
1,524,609
10/06/2009 09:47:05
180,343
09/28/2009 12:58:44
15
4
Boo vs C# vs Python?
I was (yes, was) a Python (and before VB6) lover until tried to create GUI applications. It is very (very) difficult to create a GUI, and making exe's (A hello world app was 2 mb :D LOL). Then, I jumped to VB.NET, but collections looked hard,strange and foolish to me (:D). Then, jumped to C#, but don't really know C# well now. I ordered a good (Turkish) C# book. Nowadays, I met Boo. It is a bit more Python syntax, .NET, compiled and compiles in C# lang. I liked it, even more C# :). But didn't find a book for Boo. And I really don't know, is learning Boo better than C# or learning c# better than Boo. I just want to some Python like data types. Those were: {key1:value1, key2:value2} -> dictionary (some like HashTable); [Value1,Value2,Value3] -> List (can be edited/changed), (Value1,Value2,Value3) -> Tuple (can't be edited/changed). I use dictionaries more than list and tuples. I want to be knowledged, which is better? :)
c#
boo
python
versus
programming-languages
10/07/2009 17:17:12
not a real question
Boo vs C# vs Python? === I was (yes, was) a Python (and before VB6) lover until tried to create GUI applications. It is very (very) difficult to create a GUI, and making exe's (A hello world app was 2 mb :D LOL). Then, I jumped to VB.NET, but collections looked hard,strange and foolish to me (:D). Then, jumped to C#, but don't really know C# well now. I ordered a good (Turkish) C# book. Nowadays, I met Boo. It is a bit more Python syntax, .NET, compiled and compiles in C# lang. I liked it, even more C# :). But didn't find a book for Boo. And I really don't know, is learning Boo better than C# or learning c# better than Boo. I just want to some Python like data types. Those were: {key1:value1, key2:value2} -> dictionary (some like HashTable); [Value1,Value2,Value3] -> List (can be edited/changed), (Value1,Value2,Value3) -> Tuple (can't be edited/changed). I use dictionaries more than list and tuples. I want to be knowledged, which is better? :)
1
9,844,880
03/23/2012 18:49:52
1,160,530
01/20/2012 11:35:31
1
0
Address an ordered list the RESTful way
I doubt what's the best way to address an ordered list in a RESTful API. Imagine the following example: Let's create a chart list of LPs, where you want to add new LPs, delete those which aren't in the TOP10 yet, and change their positions. How would you implement those methods in a RESTful JSON-API? I thought of the following way: - **GET /** to return the ordered chart list like `[{ "name": "1st-place LP", "link": "/uid123" }, { "name": "2nd-place LP", "link": "/uid987" }, ...]` - **GET /{uid}** to return a LP by its unique ID, returning sth. like `{"name": "1st-place LP", "ranking": 1 }` - **GET /ranking/{position}** to access e.g. the current first-ranked LP, returning a `303 See Other` with a Location-header like `Location: /uid123` - **POST /** with request body `{ "name": "my first LP title" }` to create a new LP without specifying its current chart position Now it's the question how we could change the current chart positions? One could simply **PUT /{uid}** to update the `ranking` attribute, but I think a **PUT /ranking/{position}** would be more natural. On the other hand it doesn't make sense to PUT against an URI which will return a `303 See Other` when using GET. What do you think would be the best way to address such a chart list? I don't like the solution of changing simply the `ranking` attribute in the LP-datasets as this could end in senseless states like two LPs with the same ranking and so on.
rest
null
null
null
null
null
open
Address an ordered list the RESTful way === I doubt what's the best way to address an ordered list in a RESTful API. Imagine the following example: Let's create a chart list of LPs, where you want to add new LPs, delete those which aren't in the TOP10 yet, and change their positions. How would you implement those methods in a RESTful JSON-API? I thought of the following way: - **GET /** to return the ordered chart list like `[{ "name": "1st-place LP", "link": "/uid123" }, { "name": "2nd-place LP", "link": "/uid987" }, ...]` - **GET /{uid}** to return a LP by its unique ID, returning sth. like `{"name": "1st-place LP", "ranking": 1 }` - **GET /ranking/{position}** to access e.g. the current first-ranked LP, returning a `303 See Other` with a Location-header like `Location: /uid123` - **POST /** with request body `{ "name": "my first LP title" }` to create a new LP without specifying its current chart position Now it's the question how we could change the current chart positions? One could simply **PUT /{uid}** to update the `ranking` attribute, but I think a **PUT /ranking/{position}** would be more natural. On the other hand it doesn't make sense to PUT against an URI which will return a `303 See Other` when using GET. What do you think would be the best way to address such a chart list? I don't like the solution of changing simply the `ranking` attribute in the LP-datasets as this could end in senseless states like two LPs with the same ranking and so on.
0
6,905,554
08/01/2011 23:14:04
873,606
08/01/2011 23:14:04
1
0
Help implementing quick sort
This is what I have and it doesn't work. Can't figure out why... The problem is probably in the quick_sort function. #include <stdio.h> #include <stdlib.h> void quick_sort(int * a, int l, int r); void swap(int * a, int i, int j); int main(void) { #define N 10 int a[N], i; for (i = 0; i < N; ++i) { a[i] = rand(); printf("%d\n", a[i]); } quick_sort(a, 0, N - 1); for (i = 0; i < N; ++i) printf("%d\n", a[i]); return 0; #undef N } void quick_sort(int * a, int l, int r) { int i, j; if (l < r) { swap(a, rand() % (r - l + 1), r); i = l; for (j = l; j < r; ++j) if (a[j] < a[r]) { swap(a, i, j); ++i; } swap(a, i, r); quick_sort(a, l, i - 1); quick_sort(a, i + 1, r); } } void swap(int * a, int i, int j) { int k; k = a[i]; a[i] = a[j]; a[j] = k; }
c
sorting
quicksort
null
null
08/02/2011 02:57:21
too localized
Help implementing quick sort === This is what I have and it doesn't work. Can't figure out why... The problem is probably in the quick_sort function. #include <stdio.h> #include <stdlib.h> void quick_sort(int * a, int l, int r); void swap(int * a, int i, int j); int main(void) { #define N 10 int a[N], i; for (i = 0; i < N; ++i) { a[i] = rand(); printf("%d\n", a[i]); } quick_sort(a, 0, N - 1); for (i = 0; i < N; ++i) printf("%d\n", a[i]); return 0; #undef N } void quick_sort(int * a, int l, int r) { int i, j; if (l < r) { swap(a, rand() % (r - l + 1), r); i = l; for (j = l; j < r; ++j) if (a[j] < a[r]) { swap(a, i, j); ++i; } swap(a, i, r); quick_sort(a, l, i - 1); quick_sort(a, i + 1, r); } } void swap(int * a, int i, int j) { int k; k = a[i]; a[i] = a[j]; a[j] = k; }
3
443,543
01/14/2009 16:07:09
28,772
10/16/2008 23:23:28
140
6
Quick and dirty solution for communication between processes in different machines
I have two processes written in java in two machines within my network that should pass simple chunks of data to each other. <br><br><br> <b> I'm looking for a quick and dirty way (without resorting to writing files and polling for changes on network share files) </b>
java
process
communication
windows
quick-and-dirty
05/01/2012 11:56:07
not a real question
Quick and dirty solution for communication between processes in different machines === I have two processes written in java in two machines within my network that should pass simple chunks of data to each other. <br><br><br> <b> I'm looking for a quick and dirty way (without resorting to writing files and polling for changes on network share files) </b>
1
9,966,734
04/01/2012 17:50:12
1,146,399
01/12/2012 20:38:58
8
0
Multiplayer billiards game physics simulation
I’m building an online multiplayer billiards game and I’m struggling to think of the best approach to multiplayer physics simulation. I have thought of a three possible scenarios, each having its own advantages and disadvantages and I would like to hear some opinion of those that either have implemented something similar already or have experience in multiplayer online games. **1st Scenario:** Physics simulation on the clients: The player in turn to take a shot sends the angle of the shot and power to the server, and the sever updates all clients with these values so they can simulate the shot independently. *Advantages:* 1. Low server overheat *Disadvantages:* 1. Problems with synchronization. Clients must simulate the exact simulation regardless of their frame rate. (Possible to solve with some clever algorithm like one described [here](http://gafferongames.com/game-physics/fix-your-timestep/)) 2. Cheating. Players can cheat by tweaking the physics engine. (Possible to determine when making a comparison at the end of the shot with other players ball positions. If only two players are at the table (i.e. not spectaculars) then who the cheater is?) **2nd Scenario:** Physics simulation on one (i.e. “master”) client (e.g. who ever takes the shot) and then broadcast each physics step to everyone else. *Advantages:* 1. No problems with synchronization. *Disadvantages:* 1. Server overheat. Each time step the “master” client will be sending the coordinates of all balls to the server, and the server will have to broadcast them to everyone else in the room. 2. Cheating by the “master” player is still possible. **3rd Scenario:** The physics will be simulated on the server. *Advantage:* 1. No possibility to cheat as the simulation is run independent of clients. 2. No synchronization issues, one simulation means everyone will see the same result (event if not at the same time because of network lag) *Disadvantages:* 1. Huge server overload. Not only the server will have to calculate physics 30/60 times every second for every table (there might be 100 tables at the same time) but also will have to broadcast all the coordinates to everyone in the rooms.
networking
game-physics
null
null
null
04/01/2012 22:12:09
not constructive
Multiplayer billiards game physics simulation === I’m building an online multiplayer billiards game and I’m struggling to think of the best approach to multiplayer physics simulation. I have thought of a three possible scenarios, each having its own advantages and disadvantages and I would like to hear some opinion of those that either have implemented something similar already or have experience in multiplayer online games. **1st Scenario:** Physics simulation on the clients: The player in turn to take a shot sends the angle of the shot and power to the server, and the sever updates all clients with these values so they can simulate the shot independently. *Advantages:* 1. Low server overheat *Disadvantages:* 1. Problems with synchronization. Clients must simulate the exact simulation regardless of their frame rate. (Possible to solve with some clever algorithm like one described [here](http://gafferongames.com/game-physics/fix-your-timestep/)) 2. Cheating. Players can cheat by tweaking the physics engine. (Possible to determine when making a comparison at the end of the shot with other players ball positions. If only two players are at the table (i.e. not spectaculars) then who the cheater is?) **2nd Scenario:** Physics simulation on one (i.e. “master”) client (e.g. who ever takes the shot) and then broadcast each physics step to everyone else. *Advantages:* 1. No problems with synchronization. *Disadvantages:* 1. Server overheat. Each time step the “master” client will be sending the coordinates of all balls to the server, and the server will have to broadcast them to everyone else in the room. 2. Cheating by the “master” player is still possible. **3rd Scenario:** The physics will be simulated on the server. *Advantage:* 1. No possibility to cheat as the simulation is run independent of clients. 2. No synchronization issues, one simulation means everyone will see the same result (event if not at the same time because of network lag) *Disadvantages:* 1. Huge server overload. Not only the server will have to calculate physics 30/60 times every second for every table (there might be 100 tables at the same time) but also will have to broadcast all the coordinates to everyone in the rooms.
4
10,982,725
06/11/2012 15:03:51
1,381,202
05/08/2012 05:01:54
3
0
configuring database access in java web applications
I am beginner with web applications. In a web application i have added two types of users- 1. user will decide which database to use and will change the database other use as needed 2. The other users accessing database. How can i achieve this... I have tried storing the values in properties file and reading them but i cannot find a way to get outputstream to the properties file. Also i think We cannot create a file in the web application server(i tried this on tomcat)... Is there any way to change the database access at runtime?
java
tomcat
web
null
null
06/11/2012 23:52:01
not a real question
configuring database access in java web applications === I am beginner with web applications. In a web application i have added two types of users- 1. user will decide which database to use and will change the database other use as needed 2. The other users accessing database. How can i achieve this... I have tried storing the values in properties file and reading them but i cannot find a way to get outputstream to the properties file. Also i think We cannot create a file in the web application server(i tried this on tomcat)... Is there any way to change the database access at runtime?
1
7,288,650
09/02/2011 19:58:59
408,173
08/01/2010 22:58:57
115
5
PHP $_SESSION turning from Array to Object
My problem is simple to state : my $_SESSION is, after running a really small piece of code, turning from an Array to an Object (and changing values too!) Just have a look at it, turning from : [_SESSION] => Array ( [user] => Array ( [id] => 2 ) ) to : [_SESSION] => Array ( [user] => stdClass Object ( [id] => 1 ) ) And the script executing in between is a simple PDO query, using `$_SESSION['user']['id']` as a parameter to bind. Mighty gold help me!
php
arrays
object
session-variables
null
09/13/2011 03:00:47
too localized
PHP $_SESSION turning from Array to Object === My problem is simple to state : my $_SESSION is, after running a really small piece of code, turning from an Array to an Object (and changing values too!) Just have a look at it, turning from : [_SESSION] => Array ( [user] => Array ( [id] => 2 ) ) to : [_SESSION] => Array ( [user] => stdClass Object ( [id] => 1 ) ) And the script executing in between is a simple PDO query, using `$_SESSION['user']['id']` as a parameter to bind. Mighty gold help me!
3
4,428,096
12/13/2010 10:56:53
481,835
10/20/2010 14:23:53
13
2
countdown timer implementation in UILabel?
I am Implementing a countdown timer in my app. In the functionality, I need to display the remaining time before Jan 1st 2011. In months, days, hours and minutes format. Can any one please help. Thanks in advance.
iphone
objective-c
null
null
null
null
open
countdown timer implementation in UILabel? === I am Implementing a countdown timer in my app. In the functionality, I need to display the remaining time before Jan 1st 2011. In months, days, hours and minutes format. Can any one please help. Thanks in advance.
0
9,381,318
02/21/2012 16:34:03
1,223,834
02/21/2012 16:24:07
1
0
C programming doesn't give output for graphics programs
i use DOSBOX to run c programs in windows 7 . in this i can run non graphics program .it'll give the appropriate output . but the problem comes in graphics programs . when i run any graphics program , it'll show 4 errors "unable to open include file" n all ... i solved this problem by giving proper include n library directories . but when i run the program by pressing ctrl+f9 , the program will automatically terminate . and it will terminate dos as well . pls help me to solve this problem .
c
null
null
null
null
02/21/2012 16:44:16
not a real question
C programming doesn't give output for graphics programs === i use DOSBOX to run c programs in windows 7 . in this i can run non graphics program .it'll give the appropriate output . but the problem comes in graphics programs . when i run any graphics program , it'll show 4 errors "unable to open include file" n all ... i solved this problem by giving proper include n library directories . but when i run the program by pressing ctrl+f9 , the program will automatically terminate . and it will terminate dos as well . pls help me to solve this problem .
1
4,759,451
01/21/2011 13:42:07
81,863
03/24/2009 07:42:58
5
1
Run if statement in loop only once
Just curious if its possible. Consider follwing code: boolean firstRow = true; while{row = result.next()) { if(firstRow) { firstRow = false; //do some setup } //do stuff } Its pseudo-code and question is general not about some specific programming language. My question: is it possible to write code that behaves exactly same but without using additional variable (in this case "firstRow"). In FOR loop its possible to check counter variable value but lets leave FOR loops out of this question.
loops
null
null
null
null
null
open
Run if statement in loop only once === Just curious if its possible. Consider follwing code: boolean firstRow = true; while{row = result.next()) { if(firstRow) { firstRow = false; //do some setup } //do stuff } Its pseudo-code and question is general not about some specific programming language. My question: is it possible to write code that behaves exactly same but without using additional variable (in this case "firstRow"). In FOR loop its possible to check counter variable value but lets leave FOR loops out of this question.
0
10,401,478
05/01/2012 17:15:48
410,856
08/04/2010 13:52:26
789
47
Hello World phonegap app crashing
Alright, I am trying to just get the demo working on their website, but when I try to install it and run on my phone, I get this exception in Eclipse: `05-01 13:10:49.637: E/AndroidRuntime(19669): java.lang.SecurityException: ConnectivityService: Neither user 10128 nor current process has android.permission.ACCESS_NETWORK_STATE.` I thought maybe it was because it was on WiFi, but it persisted after I disabled that as well. Does anyone know what is causing this? I am literally doing the bare minimum. This is my HTML: <!DOCTYPE HTML> <html> <head> <title>PhoneGap</title> <script type="text/javascript" charset="utf-8" src="cordova-1.7.0rc1.js"></script> </head> <body> <h1>Hello World</h1> </body> </html>
javascript
html
css
phonegap
null
05/03/2012 19:53:47
too localized
Hello World phonegap app crashing === Alright, I am trying to just get the demo working on their website, but when I try to install it and run on my phone, I get this exception in Eclipse: `05-01 13:10:49.637: E/AndroidRuntime(19669): java.lang.SecurityException: ConnectivityService: Neither user 10128 nor current process has android.permission.ACCESS_NETWORK_STATE.` I thought maybe it was because it was on WiFi, but it persisted after I disabled that as well. Does anyone know what is causing this? I am literally doing the bare minimum. This is my HTML: <!DOCTYPE HTML> <html> <head> <title>PhoneGap</title> <script type="text/javascript" charset="utf-8" src="cordova-1.7.0rc1.js"></script> </head> <body> <h1>Hello World</h1> </body> </html>
3
5,239,822
03/08/2011 23:54:19
650,679
03/08/2011 23:53:44
1
0
how to create java Applets
i'm learning at uni java but i dont know how to make an applets very good... i will Appreciate if some one will send me a link to learn for example i want to make on the panel drawwing of triangle how can i do that... my goal is to control very good on make applets... this is my big problem.
java
null
null
null
null
01/11/2012 01:34:10
not a real question
how to create java Applets === i'm learning at uni java but i dont know how to make an applets very good... i will Appreciate if some one will send me a link to learn for example i want to make on the panel drawwing of triangle how can i do that... my goal is to control very good on make applets... this is my big problem.
1
6,261,920
06/07/2011 07:30:06
787,008
06/07/2011 07:30:06
1
0
Opinions about WaveMaker?
I'm starting to work on a very simple SAAS application. First I must choose a development environment, because until now I've never developen for the web, only client-server desktop applications, written in Delphi or Java. Some days ago I discovered WaveMaker. Anyone here used it? What's your opinion about this RAD? It's a good idea to use WaveMaker, or better stay with a "classic framework", like PHP Symfony or CodeIgniter? Thank you for your opinions.
java
saas
null
null
null
06/07/2011 10:38:09
not constructive
Opinions about WaveMaker? === I'm starting to work on a very simple SAAS application. First I must choose a development environment, because until now I've never developen for the web, only client-server desktop applications, written in Delphi or Java. Some days ago I discovered WaveMaker. Anyone here used it? What's your opinion about this RAD? It's a good idea to use WaveMaker, or better stay with a "classic framework", like PHP Symfony or CodeIgniter? Thank you for your opinions.
4
7,642,229
10/04/2011 00:46:23
474,026
10/13/2010 03:29:07
16
2
how to create multiple toggle buttons in android
Here is my problem. I am using a tutorial for toggle buttons found at Toni Silvestri's website. To get to my point i have modified the code to present alert messages when the buttons are turned on and off. It works fine as a single unit. The problem is I want to use this code for several other toggle buttons with the same function but i want each button to present different alert when pressed. I used the same code in different classes and nothing works except for the executing class defined in the manifest. I included the other files in the manifest but nothing works..not even the other buttons that are not toggle related.The layout ends up with only one working button. The initializing class disables all other buttons for some reason but the code is the same. Or maybe its the alert messages.. not sure here is the code i am using package com.silvestri; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageButton; public class ToggleButton extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.good); recycleButton = (ImageButton) findViewById(R.id.recyclen); targetButton = (ImageButton) findViewById(R.id.targetn); recycleButton.setOnClickListener(recycleClicked); targetButton.setOnClickListener(targetClicked); } public Boolean isRecycle = true; public ImageButton recycleButton; public ImageButton targetButton; public OnClickListener recycleClicked = new OnClickListener() { @Override public void onClick(View v) { if(isRecycle){ } else { isRecycle = true; // toggle to recycle on - target off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); AlertDialog.Builder alert; alert = new AlertDialog.Builder(ToggleButton.this); alert.setTitle("message to display here"); alert.setPositiveButton("Yes",new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog,int whichButton){ if(isRecycle){ } else { isRecycle = true; // toggle to recycle on - target off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); } }}); alert.setNegativeButton("Not yet",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int whichButton) { if(!isRecycle){ } else { isRecycle = false; // toggle to target on - recycle off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); } }}); alert.show();} } } ; public OnClickListener targetClicked = new OnClickListener() { @Override public void onClick(View v) { if(!isRecycle){ } else { isRecycle = false; // toggle to target on - recycle off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); AlertDialog.Builder alert; alert = new AlertDialog.Builder(ToggleButton.this); alert.setTitle("message to display here"); alert.setNegativeButton("Ok",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int whichButton) { dialog.cancel(); } }); alert.show();} ;} };} the original tutorial can be found here [Toggle button tutorial][1] [1]: http://tonysilvestri.com/blog/2010/10/09/android-toggle-button/ can someone help..thanks in advance
android
button
toggle
manifest
alerts
12/15/2011 19:09:59
too localized
how to create multiple toggle buttons in android === Here is my problem. I am using a tutorial for toggle buttons found at Toni Silvestri's website. To get to my point i have modified the code to present alert messages when the buttons are turned on and off. It works fine as a single unit. The problem is I want to use this code for several other toggle buttons with the same function but i want each button to present different alert when pressed. I used the same code in different classes and nothing works except for the executing class defined in the manifest. I included the other files in the manifest but nothing works..not even the other buttons that are not toggle related.The layout ends up with only one working button. The initializing class disables all other buttons for some reason but the code is the same. Or maybe its the alert messages.. not sure here is the code i am using package com.silvestri; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageButton; public class ToggleButton extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.good); recycleButton = (ImageButton) findViewById(R.id.recyclen); targetButton = (ImageButton) findViewById(R.id.targetn); recycleButton.setOnClickListener(recycleClicked); targetButton.setOnClickListener(targetClicked); } public Boolean isRecycle = true; public ImageButton recycleButton; public ImageButton targetButton; public OnClickListener recycleClicked = new OnClickListener() { @Override public void onClick(View v) { if(isRecycle){ } else { isRecycle = true; // toggle to recycle on - target off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); AlertDialog.Builder alert; alert = new AlertDialog.Builder(ToggleButton.this); alert.setTitle("message to display here"); alert.setPositiveButton("Yes",new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog,int whichButton){ if(isRecycle){ } else { isRecycle = true; // toggle to recycle on - target off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); } }}); alert.setNegativeButton("Not yet",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int whichButton) { if(!isRecycle){ } else { isRecycle = false; // toggle to target on - recycle off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); } }}); alert.show();} } } ; public OnClickListener targetClicked = new OnClickListener() { @Override public void onClick(View v) { if(!isRecycle){ } else { isRecycle = false; // toggle to target on - recycle off recycleButton.setImageResource(R.drawable.active); targetButton.setImageResource(R.drawable.activeicon); AlertDialog.Builder alert; alert = new AlertDialog.Builder(ToggleButton.this); alert.setTitle("message to display here"); alert.setNegativeButton("Ok",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog,int whichButton) { dialog.cancel(); } }); alert.show();} ;} };} the original tutorial can be found here [Toggle button tutorial][1] [1]: http://tonysilvestri.com/blog/2010/10/09/android-toggle-button/ can someone help..thanks in advance
3
9,278,346
02/14/2012 14:10:53
1,185,139
02/02/2012 12:45:23
1
0
Publish Access database based application using VB2010
i want to publish access database based application using visual basic.. the thing is i do not want my database to be appeared in the installation folder so that user/client wont have access to it... It is for window application.. TQ
winforms
visual-studio-2010
ms-access
deployment
null
02/16/2012 16:34:11
not a real question
Publish Access database based application using VB2010 === i want to publish access database based application using visual basic.. the thing is i do not want my database to be appeared in the installation folder so that user/client wont have access to it... It is for window application.. TQ
1
10,223,918
04/19/2012 08:01:29
1,340,343
04/18/2012 04:44:03
1
0
is it possible to get a dict of Lists in python?
I want to add lists into a dictionary variable in python. is it possible to get a dict of Lists in python ?
python
null
null
null
null
04/19/2012 08:10:38
not a real question
is it possible to get a dict of Lists in python? === I want to add lists into a dictionary variable in python. is it possible to get a dict of Lists in python ?
1
8,679,938
12/30/2011 13:28:07
238,729
12/26/2009 02:27:45
55
1
where is the best encryption and decryption algorithm for encrypting cookies?
i want a encryption and decryption algorithm using c#, to encrypt the cookie value in wap site,so i hope encrypted value as short as possible. i find des, TripleDES, Rijndael, Blowfish, AES. but they are not what I want, not short-encrypted value.
c#
algorithm
cookies
encryption
null
12/30/2011 13:39:54
not a real question
where is the best encryption and decryption algorithm for encrypting cookies? === i want a encryption and decryption algorithm using c#, to encrypt the cookie value in wap site,so i hope encrypted value as short as possible. i find des, TripleDES, Rijndael, Blowfish, AES. but they are not what I want, not short-encrypted value.
1