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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,630,686 | 05/17/2012 06:08:43 | 30,868 | 10/23/2008 16:19:25 | 526 | 4 | Maintaining different repositories under a master project repository | We are into a project that involves many opensource libraries and their code.
Our application uses all these libraries code to build an X application.
The problem comes when individual libraries get updated and we have to support these updated
librayies,which leads to a lot of manual copying of latest code and merging of changes that we made on the previous versions of the updated libraries.
We have our own version control in place (perforce) but its repo is there just to version our changes along with all the code of opensource libraries that we use.
Is there a way in which the individual libraries can be updated through there own version control systems(they might be using there own versioning systems of their choice git,svn,etc..) by perforce .. i mean we give a command to sync on perforce and it does the individual syncing on individual libs using their respective versioning tool?
If perforce cant do this is there another tool than can do this? which one is the preferred tool for such a use case?
Thanks. | git | version-control | perforce | null | null | null | open | Maintaining different repositories under a master project repository
===
We are into a project that involves many opensource libraries and their code.
Our application uses all these libraries code to build an X application.
The problem comes when individual libraries get updated and we have to support these updated
librayies,which leads to a lot of manual copying of latest code and merging of changes that we made on the previous versions of the updated libraries.
We have our own version control in place (perforce) but its repo is there just to version our changes along with all the code of opensource libraries that we use.
Is there a way in which the individual libraries can be updated through there own version control systems(they might be using there own versioning systems of their choice git,svn,etc..) by perforce .. i mean we give a command to sync on perforce and it does the individual syncing on individual libs using their respective versioning tool?
If perforce cant do this is there another tool than can do this? which one is the preferred tool for such a use case?
Thanks. | 0 |
1,089,123 | 07/06/2009 20:43:19 | 62,151 | 02/03/2009 21:58:29 | 266 | 16 | C# - setting a property by reflection with a string value | I'd like to set a property of an object through reflection, with a value of type string.
So, for instance, suppose I have a Ship class, with a property of Latitude, which is a double.
Here's what I'd like to do:
Ship ship = new Ship();
string value = "5.5";
PropertyInfo propertyInfo = ship.GetType().GetProperty("Latitude");
propertyInfo.SetValue(ship, value, null);
As is, this throws an Argument exception (Object of type 'System.String' cannot be converted to type 'System.Double').
How can I convert value to the proper type, based on propertyInfo? | c# | reflection | propertyinfo | setvalue | typeconversion | null | open | C# - setting a property by reflection with a string value
===
I'd like to set a property of an object through reflection, with a value of type string.
So, for instance, suppose I have a Ship class, with a property of Latitude, which is a double.
Here's what I'd like to do:
Ship ship = new Ship();
string value = "5.5";
PropertyInfo propertyInfo = ship.GetType().GetProperty("Latitude");
propertyInfo.SetValue(ship, value, null);
As is, this throws an Argument exception (Object of type 'System.String' cannot be converted to type 'System.Double').
How can I convert value to the proper type, based on propertyInfo? | 0 |
10,345,742 | 04/27/2012 06:23:30 | 1,113,027 | 12/23/2011 07:57:28 | 16 | 0 | does mysql 5.5 supports NOSQL? | I m developing a application which requires to handle a heavy data.I am planing to use mysql 5.5. i have heard about NOSQL and mysql 5.5 also supports NOSQL.Does any one has idea that till how extend mysql 5.5 support NOSQL and how can i use NOSQL with it .
I am totally novice in NOSQL technologies and would appreciate any advice . | php | mysql | nosql | relational-database | null | 04/28/2012 05:27:19 | off topic | does mysql 5.5 supports NOSQL?
===
I m developing a application which requires to handle a heavy data.I am planing to use mysql 5.5. i have heard about NOSQL and mysql 5.5 also supports NOSQL.Does any one has idea that till how extend mysql 5.5 support NOSQL and how can i use NOSQL with it .
I am totally novice in NOSQL technologies and would appreciate any advice . | 2 |
4,990,828 | 02/14/2011 10:01:26 | 207,831 | 11/10/2009 14:20:25 | 190 | 3 | How do I get who broke the last build in TFS 2010 | Is there a way to query who broke the last build in TFS 2010.
I know that it is possible to subscribe to the build failed event but I would like to query the TFS to get the last build and the state of the build and if it broke, who broke it.
/Jimmy | tfs | tfs2010 | tfsbuild | null | null | null | open | How do I get who broke the last build in TFS 2010
===
Is there a way to query who broke the last build in TFS 2010.
I know that it is possible to subscribe to the build failed event but I would like to query the TFS to get the last build and the state of the build and if it broke, who broke it.
/Jimmy | 0 |
6,921,516 | 08/03/2011 04:09:46 | 450,712 | 02/09/2010 18:21:35 | 32 | 2 | Web Server sercurity from intrusion (used only for web services) | I am using a Virtual Private Server for accessing Web-Services used only on the Mobile devices,
there are many entries in the access and error log, even there is nothing on the web server.
I am little worried about server security.
Things I have done..
1. Installed Fail2Ban
2. rkhunter
3. using SSH login
I am using Server with LAMP configuration.
What other security I should use to protect against attacks ?
| php | mysql | linux | web-services | apache | 08/03/2011 05:46:15 | off topic | Web Server sercurity from intrusion (used only for web services)
===
I am using a Virtual Private Server for accessing Web-Services used only on the Mobile devices,
there are many entries in the access and error log, even there is nothing on the web server.
I am little worried about server security.
Things I have done..
1. Installed Fail2Ban
2. rkhunter
3. using SSH login
I am using Server with LAMP configuration.
What other security I should use to protect against attacks ?
| 2 |
7,337,495 | 09/07/2011 16:40:51 | 239,879 | 12/29/2009 00:03:06 | 692 | 10 | Can I run a .coffee file directly from node.js? | I'm doing some tutorials and I'm writing everything in CoffeeScript. I then have to compile to JS then execute in node.js. Is there any way to do it directly? | node.js | coffeescript | null | null | null | null | open | Can I run a .coffee file directly from node.js?
===
I'm doing some tutorials and I'm writing everything in CoffeeScript. I then have to compile to JS then execute in node.js. Is there any way to do it directly? | 0 |
9,824,061 | 03/22/2012 14:14:58 | 1,286,151 | 03/22/2012 14:13:07 | 1 | 0 | Java Projects With Junit Test cases | I am looking for Java Projects with Junit Test cases so let me know any open source java projects available containing the test suites. | java | junit | null | null | null | 05/16/2012 17:09:00 | not constructive | Java Projects With Junit Test cases
===
I am looking for Java Projects with Junit Test cases so let me know any open source java projects available containing the test suites. | 4 |
4,237,049 | 11/21/2010 08:34:29 | 513,018 | 11/19/2010 03:13:54 | 17 | 0 | Regular expression for date. | I have a date format like: YYYY-MM-DD, as we all know that the months only contains numbers like 01,02,03,04,05,06,07,08,09,10,11,12. How can I actually write a regular expression that allows me to only get the correct months as well as dates. I could only do something like this...
var date = /[0-9]{4}\-[0-9]{2}\-[0-9]{2}/;
function checkDate(Date)
{
if (date.test(Date))
{
alert("Valid Date");
}
else
{
alert("Invalid Date");
}
}
Thus, if the date is for example, 2008-24-43. It will still return me valid date.
Thanks. | javascript | regex | null | null | null | null | open | Regular expression for date.
===
I have a date format like: YYYY-MM-DD, as we all know that the months only contains numbers like 01,02,03,04,05,06,07,08,09,10,11,12. How can I actually write a regular expression that allows me to only get the correct months as well as dates. I could only do something like this...
var date = /[0-9]{4}\-[0-9]{2}\-[0-9]{2}/;
function checkDate(Date)
{
if (date.test(Date))
{
alert("Valid Date");
}
else
{
alert("Invalid Date");
}
}
Thus, if the date is for example, 2008-24-43. It will still return me valid date.
Thanks. | 0 |
4,977,090 | 02/12/2011 08:14:14 | 614,070 | 02/12/2011 08:14:14 | 1 | 0 | Find the highest n second highest numbers in an array within a single iteration | Find the highest n second highest numbers in an array within a single iteration
for example
a[]={0,100,5,2,3,200}
Ouput: {200,100}
| c++ | turbo | null | null | null | 02/12/2011 08:36:26 | not a real question | Find the highest n second highest numbers in an array within a single iteration
===
Find the highest n second highest numbers in an array within a single iteration
for example
a[]={0,100,5,2,3,200}
Ouput: {200,100}
| 1 |
7,358,716 | 09/09/2011 08:01:25 | 897,889 | 08/17/2011 03:30:02 | 118 | 20 | ie conditional comments need explaination | The following code is for reliable cross-browser IE version detection
<!--[if lt IE 7 ]><body class="ie_6"><![endif]-->
<!--[if IE 7 ]><body class="ie_7"><![endif]-->
<!--[if IE 8 ]><body class="ie_8"><![endif]-->
<!--[if IE 9 ]><body class="ie_9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body>
<!--<![endif]-->
What i don't understand is, why it's working.Why the normal `<body>` didn't overwrite the `<body class="ie_9">` since it is just a normal tag, should be recongnized by all the browsers.
What's the magic about
<!-->
<body>
<!-- | html | internet-explorer | null | null | null | null | open | ie conditional comments need explaination
===
The following code is for reliable cross-browser IE version detection
<!--[if lt IE 7 ]><body class="ie_6"><![endif]-->
<!--[if IE 7 ]><body class="ie_7"><![endif]-->
<!--[if IE 8 ]><body class="ie_8"><![endif]-->
<!--[if IE 9 ]><body class="ie_9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<body>
<!--<![endif]-->
What i don't understand is, why it's working.Why the normal `<body>` didn't overwrite the `<body class="ie_9">` since it is just a normal tag, should be recongnized by all the browsers.
What's the magic about
<!-->
<body>
<!-- | 0 |
8,047,533 | 11/08/2011 08:09:34 | 163,373 | 08/26/2009 09:37:33 | 505 | 0 | Focus on text area after tab in prototype javascript library | I am trying to make a text area tab-aware and as a part of it I have written the following javascript. I am using prototype js library,
document.observe("dom:loaded", function (){
$('tabawaretextarea').observe('keydown',function(e) {
if(e.keyCode === 9) { // tab was pressed
$('tabawaretextarea').value = $F('tabawaretextarea')+"\t";
return false;
}
})
});
As expected, the tabs are getting appended at the end. However, my text area loses the focuse and the HTML element next to the text area is getting focused. I believe the return false should do the magic but it does not.
Any suggestions? | javascript | javascript-events | prototype | focus | prototypejs | null | open | Focus on text area after tab in prototype javascript library
===
I am trying to make a text area tab-aware and as a part of it I have written the following javascript. I am using prototype js library,
document.observe("dom:loaded", function (){
$('tabawaretextarea').observe('keydown',function(e) {
if(e.keyCode === 9) { // tab was pressed
$('tabawaretextarea').value = $F('tabawaretextarea')+"\t";
return false;
}
})
});
As expected, the tabs are getting appended at the end. However, my text area loses the focuse and the HTML element next to the text area is getting focused. I believe the return false should do the magic but it does not.
Any suggestions? | 0 |
1,548,782 | 10/10/2009 18:57:02 | 187,737 | 10/10/2009 18:06:20 | 1 | 0 | Retrieving JSON Object Literal from HttpServletRequest | I am writing code that needs to extract an object literal posted to a servlet. I have studied the API for the HttpServletRequest object, but it is not clear to me how to get the JSON object out of the request since it is not posted from a form element on a web page.
Any insight is appreciated.
Thanks. | json | servlets | post | null | null | null | open | Retrieving JSON Object Literal from HttpServletRequest
===
I am writing code that needs to extract an object literal posted to a servlet. I have studied the API for the HttpServletRequest object, but it is not clear to me how to get the JSON object out of the request since it is not posted from a form element on a web page.
Any insight is appreciated.
Thanks. | 0 |
8,099,521 | 11/11/2011 20:25:38 | 1,042,156 | 11/11/2011 17:26:37 | 1 | 0 | Creating An If Statement for a Program | I code for a program I am writing in java. I am learning Java and would appreciate any assistance. I need to do a check to see if a section of my air plane seats are full and I cannot figure out the most efficient way to make the check. Here's my code.
import java.util.Scanner;
public class Resv2
{
public static void main( String[] args )
{
boolean[] seats = new boolean[10];
boolean availseats = true;
boolean seatstatus = false;
int answer = 0;
//int i = 0;
//int k = 0;
boolean makeresv = true;
boolean found = false;
boolean fclassfull = false;
boolean economyclassfull = false;
int section;
int seatnum;
while(makeresv == true)
{
System.out.println("\nWelcome to the Airline Reservation System\n\nPress 1 for a First Class seat and\n\nPress 2 for an Economy Class seat");
Scanner input = new Scanner(System.in);
section = input.nextInt();
System.out.println("You selected "+ section) ;
System.out.println(seats[0]) ;
System.out.println(seats[1]) ;
System.out.println(seats[2]) ;
System.out.println(seats[3]) ;
System.out.println(seats[4]) ;
System.out.println(seats[5]) ;
System.out.println(seats[6]) ;
System.out.println(seats[7]) ;
System.out.println(seats[8]) ;
System.out.println(seats[9]) ;
System.out.println("This is the value of makeresv "+ makeresv) ;
//System.out.println("This is the value of availseats "+ availseats) ;
if(section ==1 && fclassfull == false )//start of reservation system menu for Economy class
{
for(int index=0;index<=5;index++)// looping to check for available seats
{
if(seats[index] == false && found == false )//&& found == false)// making the seat reservation
{
System.out.println("Do the things for section one");
System.out.println("This is flcass before setting it"+ index + seats[index]);
seats[index]=true;
seatnum = index + 1;
System.out.println(index+"\t"+seats[index]);
System.out.println("This is flcass after setting it"+index+"\t"+seats[index]);
System.out.println("Your seat# "+seatnum);
found = true;
}
}
}
System.out.println("Else statement for if seats");
if(section == 2)//start of resveration system meun for Economy class
{
for(int index=5;index<=9;index++)// looping to check for avaliable seats
{
if(seats[index] == false && found == false)// making the seat reservation
{
System.out.println("Do the things for section one");
System.out.println("This is flcass before setting it"+index+seats[index]);
seats[index]=true;
seatnum = index + 1;
System.out.println(index+"\t"+seats[index]);
System.out.println("This is flcass after setting it"+index+"\t"+seats[index]);
System.out.println("Your seat# "+seatnum);
found = true;
}// end of if array class index
}//end of for statement looping through the array for empty economy class seats
}
found = false;//end of the while loop, set found to false to bring you back to the main menu
//fclassfull = true;
}
}
}
| java | if-statement | null | null | null | 11/12/2011 03:46:40 | too localized | Creating An If Statement for a Program
===
I code for a program I am writing in java. I am learning Java and would appreciate any assistance. I need to do a check to see if a section of my air plane seats are full and I cannot figure out the most efficient way to make the check. Here's my code.
import java.util.Scanner;
public class Resv2
{
public static void main( String[] args )
{
boolean[] seats = new boolean[10];
boolean availseats = true;
boolean seatstatus = false;
int answer = 0;
//int i = 0;
//int k = 0;
boolean makeresv = true;
boolean found = false;
boolean fclassfull = false;
boolean economyclassfull = false;
int section;
int seatnum;
while(makeresv == true)
{
System.out.println("\nWelcome to the Airline Reservation System\n\nPress 1 for a First Class seat and\n\nPress 2 for an Economy Class seat");
Scanner input = new Scanner(System.in);
section = input.nextInt();
System.out.println("You selected "+ section) ;
System.out.println(seats[0]) ;
System.out.println(seats[1]) ;
System.out.println(seats[2]) ;
System.out.println(seats[3]) ;
System.out.println(seats[4]) ;
System.out.println(seats[5]) ;
System.out.println(seats[6]) ;
System.out.println(seats[7]) ;
System.out.println(seats[8]) ;
System.out.println(seats[9]) ;
System.out.println("This is the value of makeresv "+ makeresv) ;
//System.out.println("This is the value of availseats "+ availseats) ;
if(section ==1 && fclassfull == false )//start of reservation system menu for Economy class
{
for(int index=0;index<=5;index++)// looping to check for available seats
{
if(seats[index] == false && found == false )//&& found == false)// making the seat reservation
{
System.out.println("Do the things for section one");
System.out.println("This is flcass before setting it"+ index + seats[index]);
seats[index]=true;
seatnum = index + 1;
System.out.println(index+"\t"+seats[index]);
System.out.println("This is flcass after setting it"+index+"\t"+seats[index]);
System.out.println("Your seat# "+seatnum);
found = true;
}
}
}
System.out.println("Else statement for if seats");
if(section == 2)//start of resveration system meun for Economy class
{
for(int index=5;index<=9;index++)// looping to check for avaliable seats
{
if(seats[index] == false && found == false)// making the seat reservation
{
System.out.println("Do the things for section one");
System.out.println("This is flcass before setting it"+index+seats[index]);
seats[index]=true;
seatnum = index + 1;
System.out.println(index+"\t"+seats[index]);
System.out.println("This is flcass after setting it"+index+"\t"+seats[index]);
System.out.println("Your seat# "+seatnum);
found = true;
}// end of if array class index
}//end of for statement looping through the array for empty economy class seats
}
found = false;//end of the while loop, set found to false to bring you back to the main menu
//fclassfull = true;
}
}
}
| 3 |
9,738,310 | 03/16/2012 13:39:20 | 530,153 | 12/04/2010 04:08:27 | 1,585 | 8 | Exception on deploying myfaces app on tomcat | I am trying to deploy my JSF (myfaces) application on tomcat server but as soon as I deploy I get the following exception messages in the logs :
16 Mar, 2012 6:53:33 PM org.apache.catalina.util.LifecycleBase start
INFO: The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Px10Application]] after start() had already been called. The second call will be ignored.
16 Mar, 2012 6:53:35 PM org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage loadLibraries
SEVERE: Error Loading library: /WEB-INF/facelets/jsfcomps.taglib.xml
java.io.FileNotFoundException: /WEB-INF/facelets/jsfcomps.taglib.xml
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.loadLibraries(FaceletViewDeclarationLanguage.java:2458)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createCompiler(FaceletViewDeclarationLanguage.java:2099)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.initialize(FaceletViewDeclarationLanguage.java:2386)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.<init>(FaceletViewDeclarationLanguage.java:346)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageStrategy.<init>(FaceletViewDeclarationLanguageStrategy.java:52)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.initialize(ViewDeclarationLanguageFactoryImpl.java:106)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:79)
at org.apache.myfaces.application.ViewHandlerImpl.getViewDeclarationLanguage(ViewHandlerImpl.java:179)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.checkResourceExists(DefaultViewHandlerSupport.java:546)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.handleSuffixMapping(DefaultViewHandlerSupport.java:466)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.calculateViewId(DefaultViewHandlerSupport.java:94)
at org.apache.myfaces.application.ViewHandlerImpl.deriveLogicalViewId(ViewHandlerImpl.java:118)
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:157)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
What does this mean & how do I recitfy this?
Previously I was working with Mojarra implementation on glassfish server for this project. | jsf | tomcat | myfaces | null | null | null | open | Exception on deploying myfaces app on tomcat
===
I am trying to deploy my JSF (myfaces) application on tomcat server but as soon as I deploy I get the following exception messages in the logs :
16 Mar, 2012 6:53:33 PM org.apache.catalina.util.LifecycleBase start
INFO: The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Px10Application]] after start() had already been called. The second call will be ignored.
16 Mar, 2012 6:53:35 PM org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage loadLibraries
SEVERE: Error Loading library: /WEB-INF/facelets/jsfcomps.taglib.xml
java.io.FileNotFoundException: /WEB-INF/facelets/jsfcomps.taglib.xml
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.loadLibraries(FaceletViewDeclarationLanguage.java:2458)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.createCompiler(FaceletViewDeclarationLanguage.java:2099)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.initialize(FaceletViewDeclarationLanguage.java:2386)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.<init>(FaceletViewDeclarationLanguage.java:346)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguageStrategy.<init>(FaceletViewDeclarationLanguageStrategy.java:52)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.initialize(ViewDeclarationLanguageFactoryImpl.java:106)
at org.apache.myfaces.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:79)
at org.apache.myfaces.application.ViewHandlerImpl.getViewDeclarationLanguage(ViewHandlerImpl.java:179)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.checkResourceExists(DefaultViewHandlerSupport.java:546)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.handleSuffixMapping(DefaultViewHandlerSupport.java:466)
at org.apache.myfaces.shared.application.DefaultViewHandlerSupport.calculateViewId(DefaultViewHandlerSupport.java:94)
at org.apache.myfaces.application.ViewHandlerImpl.deriveLogicalViewId(ViewHandlerImpl.java:118)
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:157)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
What does this mean & how do I recitfy this?
Previously I was working with Mojarra implementation on glassfish server for this project. | 0 |
11,478,572 | 07/13/2012 21:22:30 | 1,524,664 | 07/13/2012 21:12:33 | 1 | 0 | Structure within structure | can anybody please help me with the following code.The program runs correctly.These are my question
1)why is dot operator working in c?
2)why am i able to access stack structure(i.e s1) twice when i allocated only once memory.How did it become an array?
3)Anybody please explain how is memory getting allocated here.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
typedef struct
{
struct mynode
{
int val;
struct mynode *next;
}node;
}stack;
int main()
{
stack *s1;
s1=(stack*)malloc(sizeof(stack));
s1[0].node.val=10;
s1[1].node.val=20;
printf("%d",s1[1].node.val);
getch();
return 0;
}
| c | null | null | null | null | 07/18/2012 02:33:45 | too localized | Structure within structure
===
can anybody please help me with the following code.The program runs correctly.These are my question
1)why is dot operator working in c?
2)why am i able to access stack structure(i.e s1) twice when i allocated only once memory.How did it become an array?
3)Anybody please explain how is memory getting allocated here.
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
typedef struct
{
struct mynode
{
int val;
struct mynode *next;
}node;
}stack;
int main()
{
stack *s1;
s1=(stack*)malloc(sizeof(stack));
s1[0].node.val=10;
s1[1].node.val=20;
printf("%d",s1[1].node.val);
getch();
return 0;
}
| 3 |
3,852,493 | 10/04/2010 02:30:47 | 198,212 | 10/28/2009 15:37:51 | 418 | 25 | Is drupal well suited for a Real Estate web site? | this is a simple question. I have to develop a Real Estate website and i'm trying some alternatives.
Have you ever try to develop a Real Estate on Drupal? Have you any concrete thought about how could it be done?
Thanks!!!! | php | mysql | drupal | real-estate | null | 08/07/2011 12:02:38 | not a real question | Is drupal well suited for a Real Estate web site?
===
this is a simple question. I have to develop a Real Estate website and i'm trying some alternatives.
Have you ever try to develop a Real Estate on Drupal? Have you any concrete thought about how could it be done?
Thanks!!!! | 1 |
9,207,145 | 02/09/2012 07:50:33 | 500,088 | 11/07/2010 20:37:17 | 1 | 3 | Learning Front end technologies (Javascript, HTML5 etc) | I'm a hardcore object oriented (mainly Java) developer with over 7 years of experience. It's fun doing back-end Java work right now, but I strongly believe in being a generalist, so I'm finally trying to learn the HTML5/CSS3/JavaScript future of the Web. However, I find JavaScript's weak typing and dynamic nature difficult to adapt to because I'm so used to strongly-typed, compiled languages with lots of compile-time error-checking and help from the IDE. Does anyone out there who has made this transition have any tips in terms of the best tools and libraries to use to make JavaScript more palatable to us old-school developers? | java | javascript | css | html5 | frontend | 02/09/2012 07:59:56 | off topic | Learning Front end technologies (Javascript, HTML5 etc)
===
I'm a hardcore object oriented (mainly Java) developer with over 7 years of experience. It's fun doing back-end Java work right now, but I strongly believe in being a generalist, so I'm finally trying to learn the HTML5/CSS3/JavaScript future of the Web. However, I find JavaScript's weak typing and dynamic nature difficult to adapt to because I'm so used to strongly-typed, compiled languages with lots of compile-time error-checking and help from the IDE. Does anyone out there who has made this transition have any tips in terms of the best tools and libraries to use to make JavaScript more palatable to us old-school developers? | 2 |
1,303,402 | 08/20/2009 00:47:23 | 15,154 | 09/17/2008 06:38:47 | 3,825 | 167 | Guessing an unbounded integer | If I say to you:
"I am thinking of a number between 0 and n, and I will tell you if your guess is high or low", then you will immediately reach for binary search.
What if I remove the upper bound? i.e. I am thinking of a positive integer, and you need to guess it.
One possible method would be for you to guess 2, 4, 8, ..., until you guess 2**k for some k and I say "lower". Then you can apply binary search.
Is there a quicker method? | algorithm | language-agnostic | null | null | null | null | open | Guessing an unbounded integer
===
If I say to you:
"I am thinking of a number between 0 and n, and I will tell you if your guess is high or low", then you will immediately reach for binary search.
What if I remove the upper bound? i.e. I am thinking of a positive integer, and you need to guess it.
One possible method would be for you to guess 2, 4, 8, ..., until you guess 2**k for some k and I say "lower". Then you can apply binary search.
Is there a quicker method? | 0 |
8,998,725 | 01/25/2012 06:27:43 | 1,168,583 | 01/25/2012 06:17:40 | 1 | 0 | training of neural network | i want to train the neural network with more then one input parameters and with one target parameter, i am not able train the network can any one help me out for solving this problem. I have struct in between of my project, please help me out.
input [1 0 1; 1 1 1 ]
te | java | null | null | null | null | 01/25/2012 18:04:38 | not a real question | training of neural network
===
i want to train the neural network with more then one input parameters and with one target parameter, i am not able train the network can any one help me out for solving this problem. I have struct in between of my project, please help me out.
input [1 0 1; 1 1 1 ]
te | 1 |
3,408,604 | 08/04/2010 18:30:30 | 341,184 | 05/14/2010 11:28:12 | 201 | 5 | Software Design problems and solutions | I am searching for Software design problems and solutions. Or something like, design a subsystem to open an Image and save to user defined format. Different people give different solutions. I would like to if you have any links which actually talk about problems and one of the good solution with Class diagrams.
Thanks in advance
Harsha | design | null | null | null | null | 08/05/2010 04:41:42 | not a real question | Software Design problems and solutions
===
I am searching for Software design problems and solutions. Or something like, design a subsystem to open an Image and save to user defined format. Different people give different solutions. I would like to if you have any links which actually talk about problems and one of the good solution with Class diagrams.
Thanks in advance
Harsha | 1 |
10,888,524 | 06/04/2012 21:18:43 | 1,435,585 | 06/04/2012 16:29:00 | 1 | 0 | C programming language, multlinked list | So far I know how to construct a simply linked list and a doubly linked list. I need to construct a multilinked list, I mean where a node can be connected to more than two different pointers and vice versa | c | null | null | null | null | 06/04/2012 23:02:53 | not a real question | C programming language, multlinked list
===
So far I know how to construct a simply linked list and a doubly linked list. I need to construct a multilinked list, I mean where a node can be connected to more than two different pointers and vice versa | 1 |
6,490,113 | 06/27/2011 08:05:55 | 597,872 | 02/01/2011 04:41:59 | 1 | 0 | Comparison between iOS and android framework | I need some information or link or any regarding the comparison and between iOS and android framework. I want to convert any iOS application to android application.
Thanx in advance | android | ios | null | null | null | 06/27/2011 12:48:27 | not a real question | Comparison between iOS and android framework
===
I need some information or link or any regarding the comparison and between iOS and android framework. I want to convert any iOS application to android application.
Thanx in advance | 1 |
6,963,093 | 08/05/2011 22:04:39 | 848,262 | 07/17/2011 00:33:58 | 6 | 0 | How to run a screen in Ubuntu 10.04 LTS so that it's not visible for one user | As the title says I am looking for a command to run a screen that is not only visible for one initializing user. | linux | multiple | user | screen | null | 08/05/2011 22:50:22 | off topic | How to run a screen in Ubuntu 10.04 LTS so that it's not visible for one user
===
As the title says I am looking for a command to run a screen that is not only visible for one initializing user. | 2 |
8,871,869 | 01/15/2012 17:43:15 | 1,139,593 | 01/09/2012 20:50:15 | 5 | 0 | Jquery autocomplete select name and display id | I am using the autocomplete jquery plugin in my form. In this when I search the name , autocomplete display the list of the names onselection the names to list it display the name in the input field. I want onselection when I select the name it display the id of the name in input field.Please let me know How can I do it or any jquery plugin ?
Thanks | jquery | jquery-ui | jquery-ajax | jquery-plugins | jquery-selectors | 01/16/2012 05:34:14 | not a real question | Jquery autocomplete select name and display id
===
I am using the autocomplete jquery plugin in my form. In this when I search the name , autocomplete display the list of the names onselection the names to list it display the name in the input field. I want onselection when I select the name it display the id of the name in input field.Please let me know How can I do it or any jquery plugin ?
Thanks | 1 |
503,157 | 02/02/2009 13:13:09 | 31,169 | 10/24/2008 13:24:57 | 18 | 1 | Eclipse error: This project needs to migrate WTP metadata | We started a Web Project in Eclipse 3.2 a ways back and we've since upgraded to Eclipse 3.4 but now the Project has the error:
"This project needs to migrate WTP metadata"
We've tried right-clicking and doing the "quick-fix" which is in fact to Migrate WTP Metadata. Unfortunately nothing happens and the error remains.
We can delete that error from the Problems and everything works as it should, however, every time we re-import the project from source control, the error re-appears. Any ideas on how to permanently get rid of this error or how to ACTUALLY migrate WTP metadata? | eclipse | java | eclipse-wtp | null | null | null | open | Eclipse error: This project needs to migrate WTP metadata
===
We started a Web Project in Eclipse 3.2 a ways back and we've since upgraded to Eclipse 3.4 but now the Project has the error:
"This project needs to migrate WTP metadata"
We've tried right-clicking and doing the "quick-fix" which is in fact to Migrate WTP Metadata. Unfortunately nothing happens and the error remains.
We can delete that error from the Problems and everything works as it should, however, every time we re-import the project from source control, the error re-appears. Any ideas on how to permanently get rid of this error or how to ACTUALLY migrate WTP metadata? | 0 |
9,375,532 | 02/21/2012 10:02:29 | 441,168 | 09/07/2010 06:50:26 | 22 | 2 | When does EntityManager's flush() Method return? | I'm using the EntityManager to persist data into my database.
public void save(X x){
entityManager.persist(x);
entityManager.flush();
triggerDataChange();
}
After flushing the data I call the triggerDataChange() Method to send a message to an external component which depends on the newly written data.
Question: Can I rely on the flush method returning <b>after</b> the data has been written to database successfully?
Thanks for your help. | java | jpa | ejb | entitymanager | null | null | open | When does EntityManager's flush() Method return?
===
I'm using the EntityManager to persist data into my database.
public void save(X x){
entityManager.persist(x);
entityManager.flush();
triggerDataChange();
}
After flushing the data I call the triggerDataChange() Method to send a message to an external component which depends on the newly written data.
Question: Can I rely on the flush method returning <b>after</b> the data has been written to database successfully?
Thanks for your help. | 0 |
9,089,079 | 02/01/2012 00:23:10 | 1,181,625 | 02/01/2012 00:01:48 | 1 | 0 | Web app ports for Exchange/AD | I am developing a JBoss web app that'll be authenticating via LDAP on Active Directory and will serve as a client for MS exchange web server (through EWS api it will send e-mails). Do I have to open specific ports on the application server for communcation with exchange and AD (apart from 8080 port on which JBoss is running).
Currently everything is working ok, and I didn't have any problems now since my connection to these systems don't go through firewall in my development environment. App is to be deployed on the "closed" environment. Which port should be opened on the application server machine in order to achieve communication towards AD and MS exchange, if there should any? | java | jboss | exchange | ews | null | 02/02/2012 14:26:40 | off topic | Web app ports for Exchange/AD
===
I am developing a JBoss web app that'll be authenticating via LDAP on Active Directory and will serve as a client for MS exchange web server (through EWS api it will send e-mails). Do I have to open specific ports on the application server for communcation with exchange and AD (apart from 8080 port on which JBoss is running).
Currently everything is working ok, and I didn't have any problems now since my connection to these systems don't go through firewall in my development environment. App is to be deployed on the "closed" environment. Which port should be opened on the application server machine in order to achieve communication towards AD and MS exchange, if there should any? | 2 |
8,485,782 | 12/13/2011 07:39:57 | 896,012 | 08/16/2011 05:10:09 | 1,302 | 96 | What is the philosophy behind using Objective-C in iOS? Why not C++? | Having involved in C++ projects for more than ten years, it is really a big question for me that why Objective-C has been used as the base programming language on iOS. Taking a look at Objective-C spec, it seems that it is more dynamic than C++ in binding variables to their types, as a result it is not more efficient than C++. Can someone tell me what the philosophy behind using this language is? | c++ | objective-c | c | ios | null | 12/13/2011 08:09:49 | off topic | What is the philosophy behind using Objective-C in iOS? Why not C++?
===
Having involved in C++ projects for more than ten years, it is really a big question for me that why Objective-C has been used as the base programming language on iOS. Taking a look at Objective-C spec, it seems that it is more dynamic than C++ in binding variables to their types, as a result it is not more efficient than C++. Can someone tell me what the philosophy behind using this language is? | 2 |
11,193,543 | 06/25/2012 16:43:32 | 1,055,037 | 11/19/2011 06:53:10 | 1 | 0 | Sharepoint Changes content types when uploading files to same library |
I have a library in which there are two content types: say "documents" and "drawings."
For the past year, there were only files with the type "documents" in the the library but recently I have wanted to add drawings to it. When I uploaded a bunch of these drawings (~350 items) and set the default content type as "drawings," some of the files of which previously had the type "documents" switched content types to the "drawings."
Just the type changed, the files are the same etc.
When I added some more drawings, I noticed the same thing: mroe documents changed their content type.
Has anyone else run into this issue?
Thanks in advance
| sharepoint | sharepoint2010 | content-type | null | null | 06/25/2012 18:40:44 | off topic | Sharepoint Changes content types when uploading files to same library
===
I have a library in which there are two content types: say "documents" and "drawings."
For the past year, there were only files with the type "documents" in the the library but recently I have wanted to add drawings to it. When I uploaded a bunch of these drawings (~350 items) and set the default content type as "drawings," some of the files of which previously had the type "documents" switched content types to the "drawings."
Just the type changed, the files are the same etc.
When I added some more drawings, I noticed the same thing: mroe documents changed their content type.
Has anyone else run into this issue?
Thanks in advance
| 2 |
11,447,884 | 07/12/2012 08:31:02 | 1,499,490 | 07/03/2012 17:11:48 | 6 | 0 | query about ListActivity of android | what is the difference between Spinner and ListView.in case of ListView can i use ArrayAdapter without ListAdapter,if not,why?is Activity and ListActivity same?thank you. | android | null | null | null | null | 07/12/2012 12:11:41 | not a real question | query about ListActivity of android
===
what is the difference between Spinner and ListView.in case of ListView can i use ArrayAdapter without ListAdapter,if not,why?is Activity and ListActivity same?thank you. | 1 |
10,027,243 | 04/05/2012 10:53:42 | 451,878 | 09/19/2010 11:30:24 | 26 | 2 | Not sending mails (phpmailer), on windows, with attachements | I would like ton send, simply, a mail with attachements (with a form), on windows.
I'm testing on localhost. All is allright, but phpmailer don't add the attachements, and the mail sending is blank...
Here my code :
require_once('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsMail();
$mail->SetFrom('contact@blabla.fr', 'H');
$mail->AddReplyTo("contact@blabla.fr",'H');
$mail->AddAddress('contact@blabla.fr', "H");
if (isset($_FILES) && count($_FILES)>0) {
foreach ($_FILES as $form) {
if ($form['error']==0) {
//$source = str_replace('\\','\\\\',$form["tmp_name"]);
$source = $form["tmp_name"];
$name = $form["name"];
if (!$mail->AddAttachment($source,$name)) {
echo "ERREUR D'ATTACHEMENT !! : "; var_dump($mail->ErrorInfo);
}
}
}
}
$mail->CharSet = 'utf-8';
$subject = "...";
$message = ' ...' ;
$mail->Subject = $subject;
$mail->MsgHTML($message);
if($mail->Send()) {
$back = array('response'=>1, 'data'=>'1');
} else {
$errors = $mail->ErrorInfo;
$back = array('response'=>0, 'errors'=>$errors, 'data'=>0);
}
I've no error durong the process to add the attachement... bt the mail is blank, with no file attached :(
Thanx,
Fabrice | php | windows | localhost | sendmail | phpmailer | null | open | Not sending mails (phpmailer), on windows, with attachements
===
I would like ton send, simply, a mail with attachements (with a form), on windows.
I'm testing on localhost. All is allright, but phpmailer don't add the attachements, and the mail sending is blank...
Here my code :
require_once('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsMail();
$mail->SetFrom('contact@blabla.fr', 'H');
$mail->AddReplyTo("contact@blabla.fr",'H');
$mail->AddAddress('contact@blabla.fr', "H");
if (isset($_FILES) && count($_FILES)>0) {
foreach ($_FILES as $form) {
if ($form['error']==0) {
//$source = str_replace('\\','\\\\',$form["tmp_name"]);
$source = $form["tmp_name"];
$name = $form["name"];
if (!$mail->AddAttachment($source,$name)) {
echo "ERREUR D'ATTACHEMENT !! : "; var_dump($mail->ErrorInfo);
}
}
}
}
$mail->CharSet = 'utf-8';
$subject = "...";
$message = ' ...' ;
$mail->Subject = $subject;
$mail->MsgHTML($message);
if($mail->Send()) {
$back = array('response'=>1, 'data'=>'1');
} else {
$errors = $mail->ErrorInfo;
$back = array('response'=>0, 'errors'=>$errors, 'data'=>0);
}
I've no error durong the process to add the attachement... bt the mail is blank, with no file attached :(
Thanx,
Fabrice | 0 |
46,820 | 09/05/2008 20:22:19 | 4,829 | 09/05/2008 19:58:59 | 11 | 1 | What is the best .WTV conversion tool? | .WTV is the new DVR-MR format for recorded TV-shows in the Vista Media Center with TV Pack 2008 installed. Since there is a bug in that TV Pack, not allowing to see the current playback posision within the MSAS COM State integration service, the only way to 'fix' the commercial skipping addin, is to convert the .WTV file into a .DVR-MR, and/or cutting out the commercial at that stage.
Does anyone know of a free command-line utility that can be used for that? | command-line | mediacenter | null | null | null | 11/27/2011 16:02:34 | off topic | What is the best .WTV conversion tool?
===
.WTV is the new DVR-MR format for recorded TV-shows in the Vista Media Center with TV Pack 2008 installed. Since there is a bug in that TV Pack, not allowing to see the current playback posision within the MSAS COM State integration service, the only way to 'fix' the commercial skipping addin, is to convert the .WTV file into a .DVR-MR, and/or cutting out the commercial at that stage.
Does anyone know of a free command-line utility that can be used for that? | 2 |
4,563,810 | 12/30/2010 15:24:56 | 71,406 | 02/26/2009 14:57:18 | 143 | 3 | SQL Server Cursor To Include the Value in Select | I have a SELECT statement returning a set of rows.
From each row, I need to get a value of one column and pass it to a Stored Procedure to get a value that I would need to supply for the set of rows itself.
For example:
DECLARE @col1 int
DECLARE @col2 int
DECLARE @col3 varchar(20)
DECLARE myCursor CURSOR FOR
SELECT col1, col2, col3
FROM table1
WHERE....
OPEN myCursor
FETCH NEXT FROM myCursor
INTO @col1, @col2
WHILE @@FETH_STATUS = 0
BEGIN
SET @col3 = EXEC proc_GetCol3_Value @col1, @col2
FETCH NEXT FROM myCursor
INTO @col1, @col2
END
CLOSE myCursor
DEALLOCATE myCursor
Now, based from that, I want to return the rows as retrieved by the original cursor, plus the value retrieved from the Stored procedure executed to be column 3's value.
Say, the rows returned by the SQL cursor is:
col1 col2 col3
1 5000
2 5000
3 2500
4 2000
And what I need is that all columns have been supplied after running the cursor and the Stored Proc and the result set should be:
col1 col2 col3
1 5000 APPROVED
2 5000 REJECTED
3 2500 CANCELLED
4 2000 APPROVED
Any ideas welcome. Thanks.
P.S. I know that a lot would advice to simply using a JOIN statement but since the stored procedure to be executed is quite complex, making a join with the cursor SQL statement would be too complicated.
| sql | cursors | null | null | null | null | open | SQL Server Cursor To Include the Value in Select
===
I have a SELECT statement returning a set of rows.
From each row, I need to get a value of one column and pass it to a Stored Procedure to get a value that I would need to supply for the set of rows itself.
For example:
DECLARE @col1 int
DECLARE @col2 int
DECLARE @col3 varchar(20)
DECLARE myCursor CURSOR FOR
SELECT col1, col2, col3
FROM table1
WHERE....
OPEN myCursor
FETCH NEXT FROM myCursor
INTO @col1, @col2
WHILE @@FETH_STATUS = 0
BEGIN
SET @col3 = EXEC proc_GetCol3_Value @col1, @col2
FETCH NEXT FROM myCursor
INTO @col1, @col2
END
CLOSE myCursor
DEALLOCATE myCursor
Now, based from that, I want to return the rows as retrieved by the original cursor, plus the value retrieved from the Stored procedure executed to be column 3's value.
Say, the rows returned by the SQL cursor is:
col1 col2 col3
1 5000
2 5000
3 2500
4 2000
And what I need is that all columns have been supplied after running the cursor and the Stored Proc and the result set should be:
col1 col2 col3
1 5000 APPROVED
2 5000 REJECTED
3 2500 CANCELLED
4 2000 APPROVED
Any ideas welcome. Thanks.
P.S. I know that a lot would advice to simply using a JOIN statement but since the stored procedure to be executed is quite complex, making a join with the cursor SQL statement would be too complicated.
| 0 |
3,388,781 | 08/02/2010 14:38:19 | 253,924 | 01/19/2010 10:56:30 | 76 | 3 | scheduling task in iphone | I am developing an iphone app, there's a section in it where user can declare his task and its occurence in time.
I.e. recursive task. The task will only show an alert box and nothing else when its due time.
Its a kind of reminder, rather than a real task scheduler.
What's the best way or technology to achieve that with objective-c, particularly on iphone.
I was also thinking, if not too time consuming to implement, about some kind of integration with iphone calendar. Would it be nice to have the app create its own calendar.
thanks | iphone | objective-c | task | null | null | null | open | scheduling task in iphone
===
I am developing an iphone app, there's a section in it where user can declare his task and its occurence in time.
I.e. recursive task. The task will only show an alert box and nothing else when its due time.
Its a kind of reminder, rather than a real task scheduler.
What's the best way or technology to achieve that with objective-c, particularly on iphone.
I was also thinking, if not too time consuming to implement, about some kind of integration with iphone calendar. Would it be nice to have the app create its own calendar.
thanks | 0 |
10,669,555 | 05/19/2012 23:16:15 | 310,291 | 03/02/2010 15:22:39 | 4,023 | 21 | EBJ Performance optimisation between different containers | EJB is slower than pure well optimized JDBC but here http://www.javaperformancetuning.com/news/qotm047.shtml it is said
> " the simple JDBC/EJB comparison assumes that your JDBC is as
> efficient as the EJB generated JDBC. That is by no means certain, as
> the container vendors can have specialist developers who are expert in
> producing optimal SQL."
How do I know the logics of optimization between JBoss, Glassfish, TomEE ? How do I know that it is actually suited to my particular application as generic optimisation is kind of premature optimization : can I check the code generated somehow ? And can I override that optimization if necessary if yes how ? | java | java-ee | jboss | glassfish | ejb | 05/22/2012 14:19:30 | not a real question | EBJ Performance optimisation between different containers
===
EJB is slower than pure well optimized JDBC but here http://www.javaperformancetuning.com/news/qotm047.shtml it is said
> " the simple JDBC/EJB comparison assumes that your JDBC is as
> efficient as the EJB generated JDBC. That is by no means certain, as
> the container vendors can have specialist developers who are expert in
> producing optimal SQL."
How do I know the logics of optimization between JBoss, Glassfish, TomEE ? How do I know that it is actually suited to my particular application as generic optimisation is kind of premature optimization : can I check the code generated somehow ? And can I override that optimization if necessary if yes how ? | 1 |
10,640,265 | 05/17/2012 17:10:25 | 155,992 | 08/13/2009 17:59:38 | 129 | 0 | TSQL query for Week Comparison | I have a table that has a TASK_START_DATE and TASK_FINISH_DATE Columns of type datetime
I need help with a query that returns all Tasks when the Task: (date = just the date - I think I can do a conversion to the date from datetime on SQL 2008R2, it works fine)
<br/>
<br/>- is within 2 weeks previous of the current date or two weeks after the current date.
Similarly I also need the records whose TaskEnd values are within 2 weeks previous or two weeks before
I've been trying things like which would get tasks where the start date is within the two previous weeks, but I have to do the same for TASK_FINISH_DATE and I think my and's and or's are all jumbled up, any help is appreciated.
Convert(Date, TASK_START_DATE) <= Convert(Date, DateAdd(ww, -2, GetDate()))
Short version:
How do I correctly write a query that combines all records with the TASK_START_DATE and TASK_END_DATE within two weeks in the future or past, i.e.
Select Task_ID, TASK_NAME, TASK_START_DATE, TASK_END_DATE
where
??? | sql-server | query | tsql | null | null | null | open | TSQL query for Week Comparison
===
I have a table that has a TASK_START_DATE and TASK_FINISH_DATE Columns of type datetime
I need help with a query that returns all Tasks when the Task: (date = just the date - I think I can do a conversion to the date from datetime on SQL 2008R2, it works fine)
<br/>
<br/>- is within 2 weeks previous of the current date or two weeks after the current date.
Similarly I also need the records whose TaskEnd values are within 2 weeks previous or two weeks before
I've been trying things like which would get tasks where the start date is within the two previous weeks, but I have to do the same for TASK_FINISH_DATE and I think my and's and or's are all jumbled up, any help is appreciated.
Convert(Date, TASK_START_DATE) <= Convert(Date, DateAdd(ww, -2, GetDate()))
Short version:
How do I correctly write a query that combines all records with the TASK_START_DATE and TASK_END_DATE within two weeks in the future or past, i.e.
Select Task_ID, TASK_NAME, TASK_START_DATE, TASK_END_DATE
where
??? | 0 |
3,603,168 | 08/30/2010 18:32:36 | 429,558 | 08/24/2010 13:09:38 | 16 | 0 | HTTPService & MySQL & PHP | I can't seem to post needed information to my database, here's what I've got:
<mx:HTTPService id="someService" url="http://name.domain/postPHP.php" method="POST">
<s:request xmlns="">
<name>{name.text}</name>
<score>{score.text}</score>
</s:request>
</mx:HTTPService>
And of course a button to send();
Php as follows:
echo "<?xml version=\"1.0\" ?>\n;
$connections = ...;
mysql_select_db("...");
$name = $_POST['name'];
$score = $_POST['score'];
$query = "INSERT INTO hs (name, score) VALUES ('$name', '$score')";
mysql_query($query);
So what is wrong? Why ain't it adding the information to my database?
Thanks, Yan | php | mysql | flex | post | httpservice | null | open | HTTPService & MySQL & PHP
===
I can't seem to post needed information to my database, here's what I've got:
<mx:HTTPService id="someService" url="http://name.domain/postPHP.php" method="POST">
<s:request xmlns="">
<name>{name.text}</name>
<score>{score.text}</score>
</s:request>
</mx:HTTPService>
And of course a button to send();
Php as follows:
echo "<?xml version=\"1.0\" ?>\n;
$connections = ...;
mysql_select_db("...");
$name = $_POST['name'];
$score = $_POST['score'];
$query = "INSERT INTO hs (name, score) VALUES ('$name', '$score')";
mysql_query($query);
So what is wrong? Why ain't it adding the information to my database?
Thanks, Yan | 0 |
1,211,521 | 07/31/2009 09:20:16 | 191,083 | 02/11/2009 21:04:26 | 447 | 29 | What are good books on computer networks? | What are some good books on computer networks that cover complicated subjects in simple and understandable manner?
Stackoverflow has many "questions on books" but never has anything about computer networks.<br/>
Most of them are either programming in ____ language or how to do software engineering properly and efficiently<br/>
I'm creating this wiki to see what are some highly recommended computer networks books that everyone should read now that the trend is shifting to the web, which requires at least basic knowledge on computer networks.
So far, I have found:
- [Computer Networks by Andrew S. Tanenbaum][1]
- [Computer Networking: A Top-Down Approach by Kurose and Ross][2]
[1]: http://www.amazon.com/Computer-Networks-4th-Andrew-Tanenbaum/dp/0130661023/ref=sr_1_1?ie=UTF8&s=books&qid=1249031817&sr=8-1
[2]: http://www.amazon.com/Computer-Networking-Top-Down-Approach-5th/dp/0136079679/ref=sr_1_3?ie=UTF8&s=books&qid=1249031914&sr=8-3 | networking | books | null | null | null | 04/14/2012 19:37:18 | not constructive | What are good books on computer networks?
===
What are some good books on computer networks that cover complicated subjects in simple and understandable manner?
Stackoverflow has many "questions on books" but never has anything about computer networks.<br/>
Most of them are either programming in ____ language or how to do software engineering properly and efficiently<br/>
I'm creating this wiki to see what are some highly recommended computer networks books that everyone should read now that the trend is shifting to the web, which requires at least basic knowledge on computer networks.
So far, I have found:
- [Computer Networks by Andrew S. Tanenbaum][1]
- [Computer Networking: A Top-Down Approach by Kurose and Ross][2]
[1]: http://www.amazon.com/Computer-Networks-4th-Andrew-Tanenbaum/dp/0130661023/ref=sr_1_1?ie=UTF8&s=books&qid=1249031817&sr=8-1
[2]: http://www.amazon.com/Computer-Networking-Top-Down-Approach-5th/dp/0136079679/ref=sr_1_3?ie=UTF8&s=books&qid=1249031914&sr=8-3 | 4 |
10,997,122 | 06/12/2012 12:56:21 | 763,285 | 05/20/2011 19:10:38 | 16 | 0 | Unknown command 'zremrangebyrank' | On my local machine, redis works perfectly when I command
zremrangebyrank city 0 -1
But when I try to do it on the dev server i receive:
Unknown command 'zremrangebyrank'
Any idea why?
| redis | null | null | null | null | null | open | Unknown command 'zremrangebyrank'
===
On my local machine, redis works perfectly when I command
zremrangebyrank city 0 -1
But when I try to do it on the dev server i receive:
Unknown command 'zremrangebyrank'
Any idea why?
| 0 |
8,635,120 | 12/26/2011 11:03:16 | 1,116,194 | 12/26/2011 10:40:04 | 1 | 0 | How to customize Bugzilla fields | We have one product e.g. Product1 and two groups (Group1 , Group2) having access rights as below on this product.
Group1 : Shown/Shown, ENTRY, editcomponents, canconfirm, editbugs
Group2: Shown/Shown, canconfirm, editbugs
1) Now we want certain Status values should be set only via specific Groups.
Eg.Only Group1 can set bug Status as RESOLVED where as Group2 can not
and only Group2 can set bug Status as CLOSED where as Group1 can not.
2) We want fields such as Product, Component, Importance etc. should be non-editable on show_bug.cgi page(i.e. once the bug is entered) for both the Groups.
So that none of the group can modify Product, Component, Importance etc. fields once the bug is entered.
| bugzilla | null | null | null | null | 12/26/2011 23:18:27 | off topic | How to customize Bugzilla fields
===
We have one product e.g. Product1 and two groups (Group1 , Group2) having access rights as below on this product.
Group1 : Shown/Shown, ENTRY, editcomponents, canconfirm, editbugs
Group2: Shown/Shown, canconfirm, editbugs
1) Now we want certain Status values should be set only via specific Groups.
Eg.Only Group1 can set bug Status as RESOLVED where as Group2 can not
and only Group2 can set bug Status as CLOSED where as Group1 can not.
2) We want fields such as Product, Component, Importance etc. should be non-editable on show_bug.cgi page(i.e. once the bug is entered) for both the Groups.
So that none of the group can modify Product, Component, Importance etc. fields once the bug is entered.
| 2 |
5,563,983 | 04/06/2011 09:11:31 | 361,151 | 11/17/2009 12:35:43 | 156 | 14 | Office Addin software update options | Our team has created VSTO addin in VS 2010. We are now exploring options for updating the add-in once installed on the end user system.
We are currently distributing the application using an installer. Within the office app the user gets some visual clue regarding the availability of a new version of add-in. I am exploring ways on how to actually update the add-in install directory.
One option is to alert user from the application (Word, Excel) regarding the availability of new add-in including its download location. The user then downloads a new setup file manually and updates.
What are the other mechanism that we can explorer.
Thanks,
Chandermani
| installation | vsto | setup | office | auto-update | null | open | Office Addin software update options
===
Our team has created VSTO addin in VS 2010. We are now exploring options for updating the add-in once installed on the end user system.
We are currently distributing the application using an installer. Within the office app the user gets some visual clue regarding the availability of a new version of add-in. I am exploring ways on how to actually update the add-in install directory.
One option is to alert user from the application (Word, Excel) regarding the availability of new add-in including its download location. The user then downloads a new setup file manually and updates.
What are the other mechanism that we can explorer.
Thanks,
Chandermani
| 0 |
10,337,822 | 04/26/2012 16:47:33 | 451,038 | 09/17/2010 20:44:22 | 68 | 3 | How do you create a type-safe array or collection with varying types of individual elements? | I'm implementing a method in C# that takes a single argument of type `object`, e.g. `SomeMethod(object argument)`. I need to pass a collection of multiple objects of varying type to this method. I can't change the method signature because of interface restrictions.
I was thinking of sending an object array, `object[] myArray = new object[2]`, but I want to strongly type each element of the array if possible. For example, I have two objects, one of type `Foo` and the other of `Bar`. I want to guarantee that `myArray[0]` is `Foo` and `myArray[1]` is `Bar`.
How would I do this? Would another collection type or creating a special class make more sense?
| c# | arrays | generics | null | null | null | open | How do you create a type-safe array or collection with varying types of individual elements?
===
I'm implementing a method in C# that takes a single argument of type `object`, e.g. `SomeMethod(object argument)`. I need to pass a collection of multiple objects of varying type to this method. I can't change the method signature because of interface restrictions.
I was thinking of sending an object array, `object[] myArray = new object[2]`, but I want to strongly type each element of the array if possible. For example, I have two objects, one of type `Foo` and the other of `Bar`. I want to guarantee that `myArray[0]` is `Foo` and `myArray[1]` is `Bar`.
How would I do this? Would another collection type or creating a special class make more sense?
| 0 |
4,270,294 | 11/24/2010 18:34:45 | 519,240 | 11/24/2010 18:34:45 | 1 | 0 | how to force google to re-index a page | A website i've made have been recently hacked and Google indexed that hacked homepage and now display unrelevant text on search result.
Hack have been resolve but search result still the same.
His there a way to force Google to re-index my homepage?
Thanks in advanced. | google | seo | null | null | null | 12/04/2011 16:13:46 | off topic | how to force google to re-index a page
===
A website i've made have been recently hacked and Google indexed that hacked homepage and now display unrelevant text on search result.
Hack have been resolve but search result still the same.
His there a way to force Google to re-index my homepage?
Thanks in advanced. | 2 |
7,463,557 | 09/18/2011 18:38:21 | 877,490 | 08/03/2011 21:19:57 | 13 | 0 | How to extract specific text from a webpage? | I'm trying to extract a specific text from a webpage?
This is the part of the webpage which contains the specific text:
<div class="module">
<div class="body">
<dl class="per_info">
<dt>F.Name:</dt>
<dd><a class="nm" href="http://">a Variable Name1</a></dd>
<dt>L.Name:</dt>
<dd><a class="nm" href="http://">a Variable Name2</a></dd>
</dl>
</div>
</div>
How to extract the content of Variable Name1 and Variable Name2?
Is there any html parser could do this extraction? | java | text | extract | webpage | null | null | open | How to extract specific text from a webpage?
===
I'm trying to extract a specific text from a webpage?
This is the part of the webpage which contains the specific text:
<div class="module">
<div class="body">
<dl class="per_info">
<dt>F.Name:</dt>
<dd><a class="nm" href="http://">a Variable Name1</a></dd>
<dt>L.Name:</dt>
<dd><a class="nm" href="http://">a Variable Name2</a></dd>
</dl>
</div>
</div>
How to extract the content of Variable Name1 and Variable Name2?
Is there any html parser could do this extraction? | 0 |
6,672,681 | 07/13/2011 00:03:47 | 784,044 | 06/04/2011 15:19:03 | 1 | 0 | I am new to C and I am trying to learn to use structs, my unix app won't run and says EXC_BAD_ACCES. HElP!!! | Here's the code:
#include <stdio.h>
int main (int argc, const char * argv[]) {
int num;
struct contact;
struct contact {
double foneNumber;
char firstName;
char lastName;
};
typedef struct contact cntct;
cntct bob;
bob.foneNumber = 15555555555;
bob.firstName = "bob";
bob.lastName = "builder";
cntct fudge;
fudge.foneNumber = 15444444444;
fudge.firstName = "fudge";
fudge.lastName = "cornelius";
cntct Siddhartha;
Siddhartha.foneNumber = 15333333333;
Siddhartha.firstName = "Siddhartha";
Siddhartha.lastName = "Gautama";
while (1) {
printf("Would you like to see contact 1, 2, or 3 (0 to quit)?");
scanf("%d", &num);
switch (num)
{
case 1:
printf("Phone Number: %lg", bob.foneNumber);
printf("\nFirst Name: %s", bob.firstName);
printf("\nLast Name: %s", bob.lastName);
break;
case 2:
printf("Phone Number: %lg", fudge.foneNumber);
printf("\nFirst Name: %s", fudge.firstName);
printf("\nLast Name: %s", fudge.lastName);
break;
case 3:
printf("Phone Number: %lg", Siddhartha.foneNumber);
printf("\nFirst Name: %s", Siddhartha.firstName);
printf("\nLast Name: %s", Siddhartha.lastName);
break;
case 0:
return 0;
break;
default:
printf("huh?");
return 0;
}
}
}
| c | xcode | struct | typedef | exc-bad-access | 07/13/2011 00:07:06 | not a real question | I am new to C and I am trying to learn to use structs, my unix app won't run and says EXC_BAD_ACCES. HElP!!!
===
Here's the code:
#include <stdio.h>
int main (int argc, const char * argv[]) {
int num;
struct contact;
struct contact {
double foneNumber;
char firstName;
char lastName;
};
typedef struct contact cntct;
cntct bob;
bob.foneNumber = 15555555555;
bob.firstName = "bob";
bob.lastName = "builder";
cntct fudge;
fudge.foneNumber = 15444444444;
fudge.firstName = "fudge";
fudge.lastName = "cornelius";
cntct Siddhartha;
Siddhartha.foneNumber = 15333333333;
Siddhartha.firstName = "Siddhartha";
Siddhartha.lastName = "Gautama";
while (1) {
printf("Would you like to see contact 1, 2, or 3 (0 to quit)?");
scanf("%d", &num);
switch (num)
{
case 1:
printf("Phone Number: %lg", bob.foneNumber);
printf("\nFirst Name: %s", bob.firstName);
printf("\nLast Name: %s", bob.lastName);
break;
case 2:
printf("Phone Number: %lg", fudge.foneNumber);
printf("\nFirst Name: %s", fudge.firstName);
printf("\nLast Name: %s", fudge.lastName);
break;
case 3:
printf("Phone Number: %lg", Siddhartha.foneNumber);
printf("\nFirst Name: %s", Siddhartha.firstName);
printf("\nLast Name: %s", Siddhartha.lastName);
break;
case 0:
return 0;
break;
default:
printf("huh?");
return 0;
}
}
}
| 1 |
10,062,954 | 04/08/2012 12:56:07 | 962,891 | 09/24/2011 18:10:11 | 912 | 2 | ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() | I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing a **bitwise AND** instead of a **logical AND**.
I changed the code from:
r = mlab.csv2rec(datafile, delimiter=',', names=COL_HEADERS)
mask = ((r["dt"] >= startdate) & (r["dt"] <= enddate))
selected = r[mask]
TO:
r = mlab.csv2rec(datafile, delimiter=',', names=COL_HEADERS)
mask = ((r["dt"] >= startdate) and (r["dt"] <= enddate))
selected = r[mask]
To my surprise, I got the rather cryptic error message:
> ValueError: The truth value of an array with more than one element is
> ambiguous. Use a.any() or a.all()
Why was a similar error not emitted when I use a bitwise operation - and how do I fix this?
| python | matplotlib | null | null | null | null | open | ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
===
I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing a **bitwise AND** instead of a **logical AND**.
I changed the code from:
r = mlab.csv2rec(datafile, delimiter=',', names=COL_HEADERS)
mask = ((r["dt"] >= startdate) & (r["dt"] <= enddate))
selected = r[mask]
TO:
r = mlab.csv2rec(datafile, delimiter=',', names=COL_HEADERS)
mask = ((r["dt"] >= startdate) and (r["dt"] <= enddate))
selected = r[mask]
To my surprise, I got the rather cryptic error message:
> ValueError: The truth value of an array with more than one element is
> ambiguous. Use a.any() or a.all()
Why was a similar error not emitted when I use a bitwise operation - and how do I fix this?
| 0 |
2,313,855 | 02/22/2010 20:18:01 | 95,236 | 04/23/2009 23:12:53 | 23 | 1 | Is this the best way to do this? | I have a navigation bar that has two dropdowns (as nested ul's). I'm trying to toggle the subnavs when its parent is clicked. Or hide one subnav when the other parent is clicked. Here's the markup:
<div id="nav-bar">
<a href="#">A link</a> |
<ul>
<li id="feedback">
<a href="javascript:void(0);">Feedback</a>
<ul class="subnav">
<li><a href="#">Give us feedback</a></li>
</ul>
</li>
</ul> |
<a href="#">Another link</a> |
<ul>
<li id="location">
<a href="javascript:void(0);">Pick your location</a>
<ul class="subnav">
<li><a href="#">Los Angeles</a></li>
<li><a href="#">New York</a></li>
</ul>
</li>
</ul>
</div>
And the code:
//hide the subnavs and give them a little down arrow
$('ul.subnav').hide().parent().append('<small>▼</small>');
// show its subnav when clicked
$('#nav-bar ul li').click(function() {
var subnav = $(this).children('ul.subnav');
// hide the other's subnav if it's visible
if ($(this).attr('id') == 'location') {
subnav.toggle();
$('li#feedback').children('ul.subnav').hide();
} else {
subnav.toggle();
$('li#location').children('ul.subnav').hide();
}
});
Still a novice to JS and jQuery, I'd like to know if there's a less verbose way to accomplish what I'm trying to do above.
Edit: A better question is, is there a way to do this without having to explicitly give the li's an id? | jquery | newbie | javascript | null | null | 04/18/2012 13:48:58 | not constructive | Is this the best way to do this?
===
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying to toggle the subnavs when its parent is clicked. Or hide one subnav when the other parent is clicked. Here's the markup:
<div id="nav-bar">
<a href="#">A link</a> |
<ul>
<li id="feedback">
<a href="javascript:void(0);">Feedback</a>
<ul class="subnav">
<li><a href="#">Give us feedback</a></li>
</ul>
</li>
</ul> |
<a href="#">Another link</a> |
<ul>
<li id="location">
<a href="javascript:void(0);">Pick your location</a>
<ul class="subnav">
<li><a href="#">Los Angeles</a></li>
<li><a href="#">New York</a></li>
</ul>
</li>
</ul>
</div>
And the code:
//hide the subnavs and give them a little down arrow
$('ul.subnav').hide().parent().append('<small>▼</small>');
// show its subnav when clicked
$('#nav-bar ul li').click(function() {
var subnav = $(this).children('ul.subnav');
// hide the other's subnav if it's visible
if ($(this).attr('id') == 'location') {
subnav.toggle();
$('li#feedback').children('ul.subnav').hide();
} else {
subnav.toggle();
$('li#location').children('ul.subnav').hide();
}
});
Still a novice to JS and jQuery, I'd like to know if there's a less verbose way to accomplish what I'm trying to do above.
Edit: A better question is, is there a way to do this without having to explicitly give the li's an id? | 4 |
4,295,055 | 11/28/2010 02:44:22 | 357,034 | 06/03/2010 01:47:26 | 409 | 3 | ajax call problem | I am having problems returning the HTML from this ajax call. It works fine in FF but gives me an "null" in IE for the `alert(result.html());`
Here is the code. Any ideas? Thanks!!!
EDIT: Also the errors variable is also null in IE as well.
function update_price(){
$.ajax({url:$("form[name='MainForm']").attr('action'),
data:$("form[name='MainForm']").serialize()+'&btnupdateprice.x=0&btnupdateprice.y=0',
type:'POST',
cache:false,
success:function(response){
var errors=$(response).find("#listOfErrorsSpan");
var result=$(response).find(".colors_productprice:eq(0)");
alert(result.html());
$(".colors_productprice:eq(0)").replaceWith('<font class="colors_productprice">'+result.html()+'</font>');
$('#listOfErrorsSpan').replaceWith('<span id="listOfErrorsSpan">'+errors.html()+'</span>');
}
});
}
$(function(){$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").each(function(){
$(this).change(function(){update_price();
});
});
$("a[href^='javascript:change_option']").each(function(){
$(this).click(function(){
var result_href=$(this).attr('href').match(/\'(.*?)\'/)[1];
var result_val=$(this).attr('href').match(/\,(.*?)\)/)[1];
change_option(result_href,result_val);
update_price();
return false;
});
});
}); | javascript | jquery | ajax | null | null | null | open | ajax call problem
===
I am having problems returning the HTML from this ajax call. It works fine in FF but gives me an "null" in IE for the `alert(result.html());`
Here is the code. Any ideas? Thanks!!!
EDIT: Also the errors variable is also null in IE as well.
function update_price(){
$.ajax({url:$("form[name='MainForm']").attr('action'),
data:$("form[name='MainForm']").serialize()+'&btnupdateprice.x=0&btnupdateprice.y=0',
type:'POST',
cache:false,
success:function(response){
var errors=$(response).find("#listOfErrorsSpan");
var result=$(response).find(".colors_productprice:eq(0)");
alert(result.html());
$(".colors_productprice:eq(0)").replaceWith('<font class="colors_productprice">'+result.html()+'</font>');
$('#listOfErrorsSpan').replaceWith('<span id="listOfErrorsSpan">'+errors.html()+'</span>');
}
});
}
$(function(){$("select[name^='SELECT___'],input[name^='SELECT___'][type='radio']").each(function(){
$(this).change(function(){update_price();
});
});
$("a[href^='javascript:change_option']").each(function(){
$(this).click(function(){
var result_href=$(this).attr('href').match(/\'(.*?)\'/)[1];
var result_val=$(this).attr('href').match(/\,(.*?)\)/)[1];
change_option(result_href,result_val);
update_price();
return false;
});
});
}); | 0 |
9,152,848 | 02/05/2012 20:45:36 | 870,925 | 07/30/2011 18:02:45 | 146 | 5 | Is communication over teamviewer secure?i | i want to ask a question that when we commnicate through teamviewe and shares our video,is this secure?Do this video save on any centralized server?is this pure peer to peer?help will be appreciated.. | php | video | udp | skype | null | 02/05/2012 23:44:46 | off topic | Is communication over teamviewer secure?i
===
i want to ask a question that when we commnicate through teamviewe and shares our video,is this secure?Do this video save on any centralized server?is this pure peer to peer?help will be appreciated.. | 2 |
1,050,806 | 06/26/2009 19:26:51 | 129,609 | 06/26/2009 19:26:50 | 1 | 0 | How do I add CRRedist2008_x86.msi to Visual Studio Deployment Project? |
I need to add CRRedist2008_x86.msi to my deployment project as it is a requirement for my app. However, I want it to run automatically. I don't want it to be just added as a file and then the user has to click on it for it to run after my app installs. Can someone guide my on how to do this? It seems like it should be very easy but for some reason I am missing something.
| visual-studio | deployment | windows | installer | null | null | open | How do I add CRRedist2008_x86.msi to Visual Studio Deployment Project?
===
I need to add CRRedist2008_x86.msi to my deployment project as it is a requirement for my app. However, I want it to run automatically. I don't want it to be just added as a file and then the user has to click on it for it to run after my app installs. Can someone guide my on how to do this? It seems like it should be very easy but for some reason I am missing something.
| 0 |
9,979,360 | 04/02/2012 15:40:02 | 1,296,173 | 03/27/2012 17:04:49 | 1 | 0 | How to calculate the area of an SVG path c# | If anyone can help with calculating the area of an SVG path I would be very grateful.
I have a function to get the total length which works really well.
I've seen a javascript method that converts the path in to a polygon:
http://phrogz.net/SVG/convert_path_to_polygon.xhtml
Converting this to c# would be a good route as I have a function that gets the area of a polygon to a sufficient accuracy.
Regards | c# | svg | null | null | null | 04/25/2012 11:52:55 | not a real question | How to calculate the area of an SVG path c#
===
If anyone can help with calculating the area of an SVG path I would be very grateful.
I have a function to get the total length which works really well.
I've seen a javascript method that converts the path in to a polygon:
http://phrogz.net/SVG/convert_path_to_polygon.xhtml
Converting this to c# would be a good route as I have a function that gets the area of a polygon to a sufficient accuracy.
Regards | 1 |
1,027,908 | 06/22/2009 15:41:27 | 120,622 | 06/10/2009 15:33:21 | 83 | 3 | rake db:test:load not working | i am working on a project that requires Rails 1.2.6. I am setting up my first test environment, but i get a "rake aborted! Don't know how to build task 'db:test:load'"
when i try "rake db:test:load." is this command only for Rails 2.x? do i need to use a deprecated command? | rake | unit-testing | ruby-on-rails | null | null | null | open | rake db:test:load not working
===
i am working on a project that requires Rails 1.2.6. I am setting up my first test environment, but i get a "rake aborted! Don't know how to build task 'db:test:load'"
when i try "rake db:test:load." is this command only for Rails 2.x? do i need to use a deprecated command? | 0 |
4,360,068 | 12/05/2010 17:16:13 | 243,274 | 01/04/2010 15:21:48 | 343 | 14 | Mixing C Structs and Objective-C Properties | I have defined an object with a CGPoint ivar and associated property as follows...
@interface Sprite : NSObject {
CGRect boundingBox;
}
@property(assign) CGRect boundingBox;
When I use an instance of the Sprite class and try and update the boundingBox struct as follows...
self.boundingBox.origin.x = minX;
I receive a compile time error stating...
> Lvalue required as left operand of
> assignment
Am I correct in saying that self.boundingBox will return a C struct, which isn't actually the struct held by the Sprite object but rather a copy of it? Therefore when the assignment of a new value for x fails because the struct is only a temporary copy?
If this is the case will the following code work correctly (and is it the correct way to achieve what I want)?
CGRect newBoundingBox = self.boundingBox;
newBoundingBox.origin.x = self.boundingBox.origin.x;
self.boundingBox = newBoundingBox; | objective-c | null | null | null | null | null | open | Mixing C Structs and Objective-C Properties
===
I have defined an object with a CGPoint ivar and associated property as follows...
@interface Sprite : NSObject {
CGRect boundingBox;
}
@property(assign) CGRect boundingBox;
When I use an instance of the Sprite class and try and update the boundingBox struct as follows...
self.boundingBox.origin.x = minX;
I receive a compile time error stating...
> Lvalue required as left operand of
> assignment
Am I correct in saying that self.boundingBox will return a C struct, which isn't actually the struct held by the Sprite object but rather a copy of it? Therefore when the assignment of a new value for x fails because the struct is only a temporary copy?
If this is the case will the following code work correctly (and is it the correct way to achieve what I want)?
CGRect newBoundingBox = self.boundingBox;
newBoundingBox.origin.x = self.boundingBox.origin.x;
self.boundingBox = newBoundingBox; | 0 |
7,522,385 | 09/22/2011 22:50:37 | 142,191 | 07/21/2009 17:45:02 | 2,902 | 255 | push replaces the old value in the array | Maybe its because I have been working all day and I can't see the problem. But in the following code the alert only shows the last added value and doesn't push the value in the array. :(
var currentSelectedGroups = [];
$(this).find('li a').bind('click', function (event) {
var criteria = $(this).text();
input.attr('value', criteria);
currentSelectedGroups.push($(this).attr('class'));
dropdownContent.toggle('fast');
event.preventDefault();
alert(currentSelectedGroups);
});
1. There are no JavaScript errors.
2. Content and this script get loaded via ajax
| javascript | arrays | push | null | null | null | open | push replaces the old value in the array
===
Maybe its because I have been working all day and I can't see the problem. But in the following code the alert only shows the last added value and doesn't push the value in the array. :(
var currentSelectedGroups = [];
$(this).find('li a').bind('click', function (event) {
var criteria = $(this).text();
input.attr('value', criteria);
currentSelectedGroups.push($(this).attr('class'));
dropdownContent.toggle('fast');
event.preventDefault();
alert(currentSelectedGroups);
});
1. There are no JavaScript errors.
2. Content and this script get loaded via ajax
| 0 |
9,500,186 | 02/29/2012 13:40:27 | 625,678 | 02/20/2011 21:43:57 | 102 | 2 | Cant accses to .cs files proprties | i got a problem with my site with my app_code files and a lot of question ive read people say you need to change the proprties of the .cs files to Build Action.
by right clicking the .cs files and press proprties.
but...
when i right clicking the files i cant see any option called proprties so i press F4 and it open a proprties window and i just click on the .cs file and still cant see any option i can change somthing to Build Action.
any idea why i cant see this options? | c# | asp.net | visual-studio | visual-studio-2010 | null | null | open | Cant accses to .cs files proprties
===
i got a problem with my site with my app_code files and a lot of question ive read people say you need to change the proprties of the .cs files to Build Action.
by right clicking the .cs files and press proprties.
but...
when i right clicking the files i cant see any option called proprties so i press F4 and it open a proprties window and i just click on the .cs file and still cant see any option i can change somthing to Build Action.
any idea why i cant see this options? | 0 |
5,681,294 | 04/15/2011 19:15:12 | 710,418 | 04/15/2011 19:08:57 | 1 | 0 | I am trying to write a networking software -firewall in server, proxy? | I have question about network programming. My first question was probably about the platform, because the speed and the user friendliness is important. I decided to do it in VC++, not in .net (C#), as I want to use the firewall mechanism, though should find the common way between old windows and after vista, as I was studying about it. Honestly, I have a book titled "Network Programming for Microsoft Windows Second Edition" and another book that is about Active Directory and not an important issue here. I need to use it, too. I don't know how much that book can related to and help my software writing.
My software needs to do the Bandwidth allocation job, it needs to do some packet processing and needs to control the internet usage of all clients in the server that receive internet from server, DHCP maybe or maybe through IP address, I don't know, maybe it is good or needed to write a proxy, as for filtering, too. In fact, I need guidance for writing this software, forgot to say that proxy brings a question about connectionless UDP in my mind, if that's the same way I thought: through sockets make a simple bridge.
Thanks! | c++ | null | null | null | null | 04/15/2011 22:28:57 | not a real question | I am trying to write a networking software -firewall in server, proxy?
===
I have question about network programming. My first question was probably about the platform, because the speed and the user friendliness is important. I decided to do it in VC++, not in .net (C#), as I want to use the firewall mechanism, though should find the common way between old windows and after vista, as I was studying about it. Honestly, I have a book titled "Network Programming for Microsoft Windows Second Edition" and another book that is about Active Directory and not an important issue here. I need to use it, too. I don't know how much that book can related to and help my software writing.
My software needs to do the Bandwidth allocation job, it needs to do some packet processing and needs to control the internet usage of all clients in the server that receive internet from server, DHCP maybe or maybe through IP address, I don't know, maybe it is good or needed to write a proxy, as for filtering, too. In fact, I need guidance for writing this software, forgot to say that proxy brings a question about connectionless UDP in my mind, if that's the same way I thought: through sockets make a simple bridge.
Thanks! | 1 |
8,226,933 | 11/22/2011 12:36:38 | 801,423 | 06/16/2011 12:17:09 | 57 | 0 | I want my customers to fill in there address and this address to show on my google maps. How do i approach this? | I'm building a website where i want to create the option that when registerd customers login for the first time they have to fill in there address, this address then gets put in my google maps along side the others. So when visitors see my maps they can see al my customers geographically and click on them. I'm building my site with PHP& mysql. | php | javascript | google-maps | web-applications | null | 11/22/2011 18:45:37 | not a real question | I want my customers to fill in there address and this address to show on my google maps. How do i approach this?
===
I'm building a website where i want to create the option that when registerd customers login for the first time they have to fill in there address, this address then gets put in my google maps along side the others. So when visitors see my maps they can see al my customers geographically and click on them. I'm building my site with PHP& mysql. | 1 |
10,993,420 | 06/12/2012 09:00:50 | 385,883 | 06/07/2010 10:06:34 | 93 | 2 | Is there an opensource .NET CMS that can manage banners | <br>
I am rather new to the .net world and quite stuck. I am looking for a cms system to handle banners on an existing site. I don't want the cms to overtake the site, meaning I don't need a cms with an integrated banner system, I need a cms-like system that can handle banner content and just that. It's should provide a possibility for content review, content promotion, it should have an available metadata model, should allow internationalization. Any help is appreciated.
<p>I was looking at <i>umbraco</i>, but it wasn't a good fit for the site I am working on. Perhaps a good banner system, that does have a cms like capabilities.
Thanks,<br>
Peter | .net | asp.net-mvc | open-source | content-management-system | null | 06/12/2012 15:04:26 | not constructive | Is there an opensource .NET CMS that can manage banners
===
<br>
I am rather new to the .net world and quite stuck. I am looking for a cms system to handle banners on an existing site. I don't want the cms to overtake the site, meaning I don't need a cms with an integrated banner system, I need a cms-like system that can handle banner content and just that. It's should provide a possibility for content review, content promotion, it should have an available metadata model, should allow internationalization. Any help is appreciated.
<p>I was looking at <i>umbraco</i>, but it wasn't a good fit for the site I am working on. Perhaps a good banner system, that does have a cms like capabilities.
Thanks,<br>
Peter | 4 |
10,331,413 | 04/26/2012 10:14:30 | 778,942 | 12/06/2010 09:44:01 | 523 | 19 | parsing regional string language | I am working on the exel parsing using python.
till now I have worked with english language but when I encounter the regional languages, I am getting the error.
example :
IR05 měsíční (monthly)
It gives me the error as
UnicodeEncodeError: 'ascii' codec can't encode character u'\u011b' in position 6: ordinal not in range(128)
how I can parse it and I can again write in same language in output files?
| python | encoding | null | null | null | null | open | parsing regional string language
===
I am working on the exel parsing using python.
till now I have worked with english language but when I encounter the regional languages, I am getting the error.
example :
IR05 měsíční (monthly)
It gives me the error as
UnicodeEncodeError: 'ascii' codec can't encode character u'\u011b' in position 6: ordinal not in range(128)
how I can parse it and I can again write in same language in output files?
| 0 |
9,963,299 | 04/01/2012 09:24:37 | 886,060 | 08/09/2011 13:44:36 | 4 | 0 | maximum number of threads running in a pc | How can I determine the maximum number of threads running in my pc or different pc in my current network? does it depend on only hardware or something else..plz give me some reference link and suggestion
thanks in advance .. | multithreading | hardware-acceleration | null | null | null | 04/01/2012 20:03:49 | not a real question | maximum number of threads running in a pc
===
How can I determine the maximum number of threads running in my pc or different pc in my current network? does it depend on only hardware or something else..plz give me some reference link and suggestion
thanks in advance .. | 1 |
10,383,561 | 04/30/2012 12:16:37 | 1,297,506 | 03/28/2012 07:52:41 | 1 | 0 | PostFix / DoveCot with Debian 6 - Using Windows Live Mail | I am completely new using Debian 6, and yesterday I configured everything to setup emails and now I am able to send and receive emails, I am using RoundCube to do everything, but today I decided to use the Windows Live Mail but I don't know where I can find my Outgoing Mail(SMTP) and Incoming Mail (IMAP) information.
I only can receive emails but when I send any email the Windows Live Email give me a error:
"**The message could not be sent. The setting for your outgoing email [SMTP] server might need to be configured. To find the server settings for 'testemail@hotmail.com', please contact your email service provider.
Subject 'Teste'
Server Error: 554
Server Response: 554 5.7.1 <testemail@hotmail.com>: Relay access denied
Server: 'mail.sideforce.co.uk'
Windows Live Mail Error ID: 0x800CCC79
Protocol: SMTP
Port: 25
Secure(SSL): Yes**"
I dont know how to do because to login on roundcube I only need the Server: mail.server.com and User: something@server.com and password
Anyone can help me please? A command to find the information to setup on Windowns Live Mail or Outlook.
| linux | debian | postfix | dovecot | null | 05/01/2012 13:54:56 | off topic | PostFix / DoveCot with Debian 6 - Using Windows Live Mail
===
I am completely new using Debian 6, and yesterday I configured everything to setup emails and now I am able to send and receive emails, I am using RoundCube to do everything, but today I decided to use the Windows Live Mail but I don't know where I can find my Outgoing Mail(SMTP) and Incoming Mail (IMAP) information.
I only can receive emails but when I send any email the Windows Live Email give me a error:
"**The message could not be sent. The setting for your outgoing email [SMTP] server might need to be configured. To find the server settings for 'testemail@hotmail.com', please contact your email service provider.
Subject 'Teste'
Server Error: 554
Server Response: 554 5.7.1 <testemail@hotmail.com>: Relay access denied
Server: 'mail.sideforce.co.uk'
Windows Live Mail Error ID: 0x800CCC79
Protocol: SMTP
Port: 25
Secure(SSL): Yes**"
I dont know how to do because to login on roundcube I only need the Server: mail.server.com and User: something@server.com and password
Anyone can help me please? A command to find the information to setup on Windowns Live Mail or Outlook.
| 2 |
6,811,472 | 07/25/2011 03:15:02 | 284,932 | 03/03/2010 02:26:55 | 160 | 7 | Have a way to simulate diamond problem with Java | Have a way to simulate diamond problem with Java ? With interfaces ?
Thanks,
Celso | java | multiple-inheritance | diamond-problem | null | null | 07/25/2011 03:19:42 | not a real question | Have a way to simulate diamond problem with Java
===
Have a way to simulate diamond problem with Java ? With interfaces ?
Thanks,
Celso | 1 |
2,571,173 | 04/03/2010 11:57:41 | 308,277 | 04/03/2010 11:57:41 | 1 | 0 | Color sampler, like firebug, but for image text | I use firebug to check colors on webpages, but sometimes the color is from an image. Is there a firefox plugin like firebug that can act as a color sampler this way? | firebug | css | html | null | null | null | open | Color sampler, like firebug, but for image text
===
I use firebug to check colors on webpages, but sometimes the color is from an image. Is there a firefox plugin like firebug that can act as a color sampler this way? | 0 |
3,858,908 | 10/04/2010 20:35:18 | 89,234 | 04/09/2009 20:11:16 | 8 | 0 | Convert a 4 char string into int32 | Is there a fast way to convert 4 chars into a 32bit int? I know i can loop through it like :
string key = "ABCD";
int val = 0;
for (int i = 0; i < 4; i++)
{
int b = (int)key[i] * (int)Math.Pow(256, i);
val += b;
}
// val = 1145258561
I would like something lower level, I know the chars are stored as bytes. I don't mind if its unsafe code because I am basically trying to write a 4 char string to an integer pointer location.
| c# | null | null | null | null | null | open | Convert a 4 char string into int32
===
Is there a fast way to convert 4 chars into a 32bit int? I know i can loop through it like :
string key = "ABCD";
int val = 0;
for (int i = 0; i < 4; i++)
{
int b = (int)key[i] * (int)Math.Pow(256, i);
val += b;
}
// val = 1145258561
I would like something lower level, I know the chars are stored as bytes. I don't mind if its unsafe code because I am basically trying to write a 4 char string to an integer pointer location.
| 0 |
4,059,543 | 10/30/2010 16:20:42 | 171,742 | 09/10/2009 22:17:54 | 1,373 | 70 | MVC Abstract Base Controller Override parameter type for modelbinding | For simplicity's sake, lets say I have the following Abstract Base Controller Class:
public abstract class RESTController : Controller
{
public abstract JsonResult List();
public abstract JsonResult Get(Guid id);
public abstract JsonResult Create(object obj);
public abstract JsonResult Update(object obj);
public abstract JsonResult Delete(Guid Id);
}
For the Create & Update methods, I not only want to override the Method, but also the type of the parameter.
Typically I would use generics like so:
public abstract JsonResult Create<T>(T obj);
However this is an MVC action, and there is no way to specify type parameters.
What are my options? If I leave it as `(object obj)` will the MVC model binder work correctly?
var model = obj as MyViewModel;
This isn't very clean in any case. Any help would be appreciated.
| c# | asp.net-mvc | design | modelbinding | oop | null | open | MVC Abstract Base Controller Override parameter type for modelbinding
===
For simplicity's sake, lets say I have the following Abstract Base Controller Class:
public abstract class RESTController : Controller
{
public abstract JsonResult List();
public abstract JsonResult Get(Guid id);
public abstract JsonResult Create(object obj);
public abstract JsonResult Update(object obj);
public abstract JsonResult Delete(Guid Id);
}
For the Create & Update methods, I not only want to override the Method, but also the type of the parameter.
Typically I would use generics like so:
public abstract JsonResult Create<T>(T obj);
However this is an MVC action, and there is no way to specify type parameters.
What are my options? If I leave it as `(object obj)` will the MVC model binder work correctly?
var model = obj as MyViewModel;
This isn't very clean in any case. Any help would be appreciated.
| 0 |
7,198,197 | 08/25/2011 23:01:38 | 100,747 | 05/04/2009 08:49:24 | 724 | 15 | Check if array is empty or null | I would like to know how to check if an array is empty or null in jQuery. I tried `array.length === 0` but it didn't work. It did not throw any error either.
This is the code:
var album_text= new Array();
$("input[name='album_text[]']").each(function(){
if( $(this).val() ) {
album_text.push($(this).val());
}
});
if (album_text.length === 0) {
$('#error_message').html("Error");
}
else {
//send data
}
| jquery | arrays | null | null | null | null | open | Check if array is empty or null
===
I would like to know how to check if an array is empty or null in jQuery. I tried `array.length === 0` but it didn't work. It did not throw any error either.
This is the code:
var album_text= new Array();
$("input[name='album_text[]']").each(function(){
if( $(this).val() ) {
album_text.push($(this).val());
}
});
if (album_text.length === 0) {
$('#error_message').html("Error");
}
else {
//send data
}
| 0 |
9,838,104 | 03/23/2012 11:02:52 | 1,288,087 | 03/23/2012 10:51:53 | 1 | 0 | creating a code editor with visual studio 2010 using C# | I am trying to make a code editor winforms application for features like syntax highlighting,and many more code editing features using visual studio 2010.I used **scintillaNet** with my visual studio ultimate version with net 4.0 framework for my winform application. but after adding the tool in my toolbox the scintilla.net shows many errors and dragging it onto my form becomes impossible..plz help.
I have also tried **actipro Syantx editor**,its pretty good but the evaluation version comes for 15 days and its not free or open source like scintilla.net..
i also tried **editor.net** from Qwhale,it is very good but could not create a new parser for **vhdl** language as none of the text editors have vhdl as one of their sample languages.it supported around 20 language parsers but none for VHDL.
plzz help with other alternatives or solns for these..!!!
| c# | visual-studio-2010 | editor | syntaxhighlighter | null | 03/23/2012 13:07:39 | not a real question | creating a code editor with visual studio 2010 using C#
===
I am trying to make a code editor winforms application for features like syntax highlighting,and many more code editing features using visual studio 2010.I used **scintillaNet** with my visual studio ultimate version with net 4.0 framework for my winform application. but after adding the tool in my toolbox the scintilla.net shows many errors and dragging it onto my form becomes impossible..plz help.
I have also tried **actipro Syantx editor**,its pretty good but the evaluation version comes for 15 days and its not free or open source like scintilla.net..
i also tried **editor.net** from Qwhale,it is very good but could not create a new parser for **vhdl** language as none of the text editors have vhdl as one of their sample languages.it supported around 20 language parsers but none for VHDL.
plzz help with other alternatives or solns for these..!!!
| 1 |
10,894,688 | 06/05/2012 09:20:58 | 399,145 | 07/22/2010 13:40:20 | 916 | 5 | How to execute .sql file using powershell? | I am having .sql file. I am trying to pass connection string details through powershell script
and invoke the .sql file.
I was searching and come up with some cmdlet related to Invoke-sqlcmd.
While i was trying to find the module which is corresponding to SQL , i did not find any one in my machine.
Should i install any thing in my machine (the machine already has ssms 2008 R2) to get the modules?
or is there any easy way to execute .sql files using powershell? | sql | powershell | powershell-module | null | null | null | open | How to execute .sql file using powershell?
===
I am having .sql file. I am trying to pass connection string details through powershell script
and invoke the .sql file.
I was searching and come up with some cmdlet related to Invoke-sqlcmd.
While i was trying to find the module which is corresponding to SQL , i did not find any one in my machine.
Should i install any thing in my machine (the machine already has ssms 2008 R2) to get the modules?
or is there any easy way to execute .sql files using powershell? | 0 |
10,759,188 | 05/25/2012 17:55:19 | 1,417,678 | 05/25/2012 14:53:08 | 1 | 0 | JSON string is treated as a literal string in loop | I suspect this is an easy problem, but I am a bit new to js and can't find the solution. Thanks in advance. Basically, when I pass a JSON string to a function and then attempt to iterate through the passed variable, it treats it like a literal string rather than an array.
With this function:
function build_codes_long(codes) {
var codes_long_text = "";
for(var i =0;i < codes.length-1;i++) {
var code = codes[i];
codes_long_text += "<p>" + code['id'] + " = " + code['del'] + "</p>";
}
return codes_long_text;
}
When I pass a JSON string to it like:
[{"id":"1","del":"0","clip":"1"},{"id":"2","del":"0","clip":"1"}]
It evaluates each character in the string, rather than each item in the array. So it loops 65 times instead of 2, returning something like:
undefined = undefined
I understand the problem with the returned values; it's the treating the array like a literal string I don't understand. Thanks!
| json | null | null | null | null | null | open | JSON string is treated as a literal string in loop
===
I suspect this is an easy problem, but I am a bit new to js and can't find the solution. Thanks in advance. Basically, when I pass a JSON string to a function and then attempt to iterate through the passed variable, it treats it like a literal string rather than an array.
With this function:
function build_codes_long(codes) {
var codes_long_text = "";
for(var i =0;i < codes.length-1;i++) {
var code = codes[i];
codes_long_text += "<p>" + code['id'] + " = " + code['del'] + "</p>";
}
return codes_long_text;
}
When I pass a JSON string to it like:
[{"id":"1","del":"0","clip":"1"},{"id":"2","del":"0","clip":"1"}]
It evaluates each character in the string, rather than each item in the array. So it loops 65 times instead of 2, returning something like:
undefined = undefined
I understand the problem with the returned values; it's the treating the array like a literal string I don't understand. Thanks!
| 0 |
8,460,247 | 12/10/2011 22:02:06 | 554,660 | 12/27/2010 04:57:17 | 1 | 0 | $.when not waiting for ajax return | I have this code
$('#mySelect').change(function() {
$.get(
"test.php",
function(data) { alert('test1'); },
);
});
I need to fire the event change of #mySelect, and wait for the answer of the ajax to perform a other task. But when I try
$.when($('#mySelect').change()).done(function() { alert('test2'); });
It only wait for the change is finish, and the ajax sended, not received.
So I have the alert 'test2' before 'test1'
How can I make $.when wait for everything inside the even to be finish?
| javascript | jquery | null | null | null | null | open | $.when not waiting for ajax return
===
I have this code
$('#mySelect').change(function() {
$.get(
"test.php",
function(data) { alert('test1'); },
);
});
I need to fire the event change of #mySelect, and wait for the answer of the ajax to perform a other task. But when I try
$.when($('#mySelect').change()).done(function() { alert('test2'); });
It only wait for the change is finish, and the ajax sended, not received.
So I have the alert 'test2' before 'test1'
How can I make $.when wait for everything inside the even to be finish?
| 0 |
4,995,092 | 02/14/2011 17:18:22 | 420,878 | 08/15/2010 09:22:18 | 10 | 1 | code not compiling | #include<stdio.h>
#include<math.h>
void insert(int *,int);
int main(int argc, char argv[])
{
int tree[1000];
memset(tree,'\0',1000);
int i=1;
while (!argv[i])
{
insert(tree,atoi(argv[i]));
}
int depth=0;
printf("Enter depth");
scanf("%d",&depth);
int x=pow(2,depth);
int y=2x-1;
int count=0;
for(;x<=y;x++)
{
if((tree[x]!=NULL) && (tree[2x+1]==NULL) && (tree[2x]==NULL))
{
count++;
}
}
printf("Number of leaf nodes is %d", count);
}
void insert(int *tree,int gmail)
{
int i=1;
if(tree[i]==NULL)
{
tree[i]=gmail;
}
else
{
if(gmail>tree[i])
{
insert(tree[2i+1],gmail);
}
else
insert(tree[2i],gmail);
}
}
| c | data-structures | data | null | null | 04/08/2011 02:08:02 | not a real question | code not compiling
===
#include<stdio.h>
#include<math.h>
void insert(int *,int);
int main(int argc, char argv[])
{
int tree[1000];
memset(tree,'\0',1000);
int i=1;
while (!argv[i])
{
insert(tree,atoi(argv[i]));
}
int depth=0;
printf("Enter depth");
scanf("%d",&depth);
int x=pow(2,depth);
int y=2x-1;
int count=0;
for(;x<=y;x++)
{
if((tree[x]!=NULL) && (tree[2x+1]==NULL) && (tree[2x]==NULL))
{
count++;
}
}
printf("Number of leaf nodes is %d", count);
}
void insert(int *tree,int gmail)
{
int i=1;
if(tree[i]==NULL)
{
tree[i]=gmail;
}
else
{
if(gmail>tree[i])
{
insert(tree[2i+1],gmail);
}
else
insert(tree[2i],gmail);
}
}
| 1 |
4,451,812 | 12/15/2010 15:43:08 | 292,431 | 03/12/2010 15:07:15 | 207 | 20 | Javascript Search | I would like to add a search on name of people on my website.
The list of friends is already displayed on the page.
I love the way Facebook is doing this where you start typing a name and Facebook only displays your friends that match the query.
http://cl.ly/2t2V0v2Q103X2G1V080R
and
http://cl.ly/0R1j0B2n1s3y413i0a34
Any ideas on implementing this ? | javascript | facebook | search | null | null | null | open | Javascript Search
===
I would like to add a search on name of people on my website.
The list of friends is already displayed on the page.
I love the way Facebook is doing this where you start typing a name and Facebook only displays your friends that match the query.
http://cl.ly/2t2V0v2Q103X2G1V080R
and
http://cl.ly/0R1j0B2n1s3y413i0a34
Any ideas on implementing this ? | 0 |
11,009,834 | 06/13/2012 07:09:51 | 39,068 | 11/19/2008 19:18:37 | 3,133 | 101 | Powershell: Args/params not being populated | I have a PowerShell script:
param (
[Parameter(Mandatory=$true)][string]$input,
[Parameter(Mandatory=$true)][string]$table
)
Write-Host "Args:" $Args.Length
Get-Content $input |
% { [Regex]::Replace($_, ",(?!NULL)([^,]*[^\d,]+[^,]*)", ",'`$1'") } |
% { [Regex]::Replace($_, ".+", "INSERT INTO $table VALUES (`$1)") }
The `Write-Host part` is for debugging.
I run it as `.\csvtosql.ps1 mycsv.csv dbo.MyTable` (from powershell shell), and get
Args: 0
Get-Content : Cannot bind argument to parameter 'Path' because it is an empty s
tring.
At C:\temp\csvtosql.ps1:7 char:12
+ Get-Content <<<< $input |
+ CategoryInfo : InvalidData: (:) [Get-Content], ParameterBinding
ValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAl
lowed,Microsoft.PowerShell.Commands.GetContentCommand
I get exactly the same error with any parameters that I pass, also the same error if I try to use named parameters.
What can cause parameters not to be passed in?
**UPDATE**: PowerShell ISE asks me for these parameters using GUI prompts, then gives me the same error about them not being passed in. | powershell | null | null | null | null | null | open | Powershell: Args/params not being populated
===
I have a PowerShell script:
param (
[Parameter(Mandatory=$true)][string]$input,
[Parameter(Mandatory=$true)][string]$table
)
Write-Host "Args:" $Args.Length
Get-Content $input |
% { [Regex]::Replace($_, ",(?!NULL)([^,]*[^\d,]+[^,]*)", ",'`$1'") } |
% { [Regex]::Replace($_, ".+", "INSERT INTO $table VALUES (`$1)") }
The `Write-Host part` is for debugging.
I run it as `.\csvtosql.ps1 mycsv.csv dbo.MyTable` (from powershell shell), and get
Args: 0
Get-Content : Cannot bind argument to parameter 'Path' because it is an empty s
tring.
At C:\temp\csvtosql.ps1:7 char:12
+ Get-Content <<<< $input |
+ CategoryInfo : InvalidData: (:) [Get-Content], ParameterBinding
ValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAl
lowed,Microsoft.PowerShell.Commands.GetContentCommand
I get exactly the same error with any parameters that I pass, also the same error if I try to use named parameters.
What can cause parameters not to be passed in?
**UPDATE**: PowerShell ISE asks me for these parameters using GUI prompts, then gives me the same error about them not being passed in. | 0 |
10,020,764 | 04/04/2012 23:36:39 | 677,725 | 03/26/2011 04:13:46 | 20 | 1 | What Could Cause time.sleep() to be Horrifically Inaccurate? | I have a program that takes measurements in a user-specified interval. In order to keep it on the desired interval in spite of scheduling shenanigans, I keep track of when the program started and the time when each interval should end so that I can sleep for however long the program needs to reach the next interval.
This system works totally fine with my laptop running Vista and another computer running XP, but when I copy/paste the program on a third computer running XP it sleeps for anywhere from 20-40 seconds when given a 10 second interval! This is especially strange since I've set it so that if it's missed an interval it should attempt to take another measurement immediately, but I'm not seeing anything to indicate that that is happening. I've reinstalled python 2.7.2 but the program still has the exact same problem.
I've checked all the processes and services on the problem computer and there's nothing out of the ordinary and nothing using up any system resources. Is there any reason why time.sleep would sleep for so long?
Here's the code segment in question. In my program it was running independently in three threads. cycles is an int counter initialized to zero, self.delay is a float holding the user-specified delay, in this case 10.0 seconds.
cycles += 1
currentTime = time.clock()
wakeUp = startTime + cycles * self.delay
if currentTime > wakeUp: #we overslept
continue
else:
#not guaranteed to sleep for the exact specified amount of time
time.sleep(float(wakeUp - currentTime))
finalTime = time.clock()
print "sleep(" + str(wakeUp - currentTime) + ") lasted " + str(finalTime - currentTime) +" seconds"
And here's the output it gave (again, this is from three threads running the same code at once):
sleep(9.79808763972) lasted 2.23244022605 seconds
sleep(9.85392503634) lasted 2.28918191569 seconds
sleep(9.85480072929) lasted 2.28966006466 seconds
sleep(17.4051347451) lasted 3.53031012481 secondssleep(17.460965924) lasted 3.57
352359781 seconds
sleep(17.4618652549) lasted 3.57801161345 seconds
sleep(23.7643461506) lasted 3.95732551752 seconds
sleep(23.6929753521) lasted 3.89900929026 seconds
sleep(23.7410070723) lasted 3.95309855646 seconds
sleep(29.6151041176) lasted 4.11169123853 seconds
sleep(29.7488017693) lasted 4.24533422385 seconds
sleep(29.6727458824) lasted 4.163745103 seconds
| python | time | sleep | null | null | null | open | What Could Cause time.sleep() to be Horrifically Inaccurate?
===
I have a program that takes measurements in a user-specified interval. In order to keep it on the desired interval in spite of scheduling shenanigans, I keep track of when the program started and the time when each interval should end so that I can sleep for however long the program needs to reach the next interval.
This system works totally fine with my laptop running Vista and another computer running XP, but when I copy/paste the program on a third computer running XP it sleeps for anywhere from 20-40 seconds when given a 10 second interval! This is especially strange since I've set it so that if it's missed an interval it should attempt to take another measurement immediately, but I'm not seeing anything to indicate that that is happening. I've reinstalled python 2.7.2 but the program still has the exact same problem.
I've checked all the processes and services on the problem computer and there's nothing out of the ordinary and nothing using up any system resources. Is there any reason why time.sleep would sleep for so long?
Here's the code segment in question. In my program it was running independently in three threads. cycles is an int counter initialized to zero, self.delay is a float holding the user-specified delay, in this case 10.0 seconds.
cycles += 1
currentTime = time.clock()
wakeUp = startTime + cycles * self.delay
if currentTime > wakeUp: #we overslept
continue
else:
#not guaranteed to sleep for the exact specified amount of time
time.sleep(float(wakeUp - currentTime))
finalTime = time.clock()
print "sleep(" + str(wakeUp - currentTime) + ") lasted " + str(finalTime - currentTime) +" seconds"
And here's the output it gave (again, this is from three threads running the same code at once):
sleep(9.79808763972) lasted 2.23244022605 seconds
sleep(9.85392503634) lasted 2.28918191569 seconds
sleep(9.85480072929) lasted 2.28966006466 seconds
sleep(17.4051347451) lasted 3.53031012481 secondssleep(17.460965924) lasted 3.57
352359781 seconds
sleep(17.4618652549) lasted 3.57801161345 seconds
sleep(23.7643461506) lasted 3.95732551752 seconds
sleep(23.6929753521) lasted 3.89900929026 seconds
sleep(23.7410070723) lasted 3.95309855646 seconds
sleep(29.6151041176) lasted 4.11169123853 seconds
sleep(29.7488017693) lasted 4.24533422385 seconds
sleep(29.6727458824) lasted 4.163745103 seconds
| 0 |
4,198,260 | 11/16/2010 19:45:36 | 254,009 | 01/19/2010 13:10:41 | 8 | 1 | WPF Changing Controls within a data template? | so now that I can access controls hidden within nested datatemplates, it seems that I cannot change their values. For instance I have the code (granted to me graciously by a Stack overflow member)
<Grid Name="mainGrid">
<Grid.Resources>
<DataTemplate x:Key="frontTemplate" >
<StackPanel x:Name="noWork">
<Image Source="Images/1.png" Stretch="Fill" Width="72" Height="96" x:Name="FrontFace" HorizontalAlignment="Left" VerticalAlignment="Top"></Image>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="flipItemTemplate">
<Grid Width="200" Height="200">
<Border x:Name="frontHost" Background="Transparent">
<ContentPresenter Name="contentPresenter" Content="{Binding}" ContentTemplate="{StaticResource frontTemplate}" />
</Border>
</Grid>
</DataTemplate>
</Grid.Resources>
</Grid>
And although I can get TO the image in that second template (frontFace) I can't get the source to change. I can get a new bitmap, and load it without error, but the image does not change. If I put an image control in the XAML outside of the datatemplate and load it with my bitmap code there, it works fine. This leads me to believe that the template can't redraw itself after its been applied... BUT I can't get access to its internal elements until its been applied... so how in the heck do I dynamically set up elements in a template before its been applied?
| c# | wpf | null | null | null | null | open | WPF Changing Controls within a data template?
===
so now that I can access controls hidden within nested datatemplates, it seems that I cannot change their values. For instance I have the code (granted to me graciously by a Stack overflow member)
<Grid Name="mainGrid">
<Grid.Resources>
<DataTemplate x:Key="frontTemplate" >
<StackPanel x:Name="noWork">
<Image Source="Images/1.png" Stretch="Fill" Width="72" Height="96" x:Name="FrontFace" HorizontalAlignment="Left" VerticalAlignment="Top"></Image>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="flipItemTemplate">
<Grid Width="200" Height="200">
<Border x:Name="frontHost" Background="Transparent">
<ContentPresenter Name="contentPresenter" Content="{Binding}" ContentTemplate="{StaticResource frontTemplate}" />
</Border>
</Grid>
</DataTemplate>
</Grid.Resources>
</Grid>
And although I can get TO the image in that second template (frontFace) I can't get the source to change. I can get a new bitmap, and load it without error, but the image does not change. If I put an image control in the XAML outside of the datatemplate and load it with my bitmap code there, it works fine. This leads me to believe that the template can't redraw itself after its been applied... BUT I can't get access to its internal elements until its been applied... so how in the heck do I dynamically set up elements in a template before its been applied?
| 0 |
7,425,139 | 09/15/2011 02:14:38 | 712,981 | 04/18/2011 07:38:40 | 38 | 2 | Can a Visual Studio 2010 license be used for Visual Studio 2008? | Ive tried contacting Microsoft about this licensing inquiry but after been kept waiting in the phone queues for hours on end I thought I'd throw this one out to the community to see if anyone knows the answer.
Ive recently purchased Visual Studio 2010 Professional. Am I legally allowed to use Visual Studio 2008 using the license key for Visual Studio 2010? | visual-studio | visual-studio-2010 | licensing | license-key | null | 09/15/2011 02:33:06 | off topic | Can a Visual Studio 2010 license be used for Visual Studio 2008?
===
Ive tried contacting Microsoft about this licensing inquiry but after been kept waiting in the phone queues for hours on end I thought I'd throw this one out to the community to see if anyone knows the answer.
Ive recently purchased Visual Studio 2010 Professional. Am I legally allowed to use Visual Studio 2008 using the license key for Visual Studio 2010? | 2 |
1,716,287 | 11/11/2009 16:20:50 | 108,390 | 05/17/2009 12:57:22 | 15 | 4 | How to access a xml node with attributes and namespace using selectsinglenode() | I have this document where i want to get to the value in `"x_server_response/retrieve_resources_by_category_response/source_full_info/record/ datafield[@tag='520']/subfield[@code='a']"`
But i just can't! Why?
i suspect that this has something to do with the namespace daclaration at the *record* node. But i can not figure out how to do it.
my code looks like this:
XmlNodeList xmlResources = r.ResponseXmlDocument.SelectNodes("x_server_response/retrieve_resources_by_category_response/source_full_info);
foreach (XmlNode xmlResource in xmlResources)
{
string information = xmlResource.SelectSingleNode("record/datafield[@tag='520']/subfield[@code='a']").InnerText;
And the xml goes like this:
<x_server_response> metalib_version="4.00 (20)>
<source_full_info>
<record xmlns="http://www.loc.gov/MARC21/slim/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim
http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<controlfield tag="001">CKB02166</controlfield>
<datafield tag="520" ind1=" " ind2=" ">
<subfield code="a">Providing access to thousands of online journals from leading
scholarly, academic and business publishers, the Ingenta Select service provides fast and
reliable access from a global network of servers to users' desktops around the world.
## ##Ingenta Select provides access to more than 5,000 electronic
publications from over 190 publisher clients and bring together an extensive range of services
for the librarian and end-user alike</subfield>
</datafield> </record>
</source_full_info>
<session_id new_session="N">3B7F9EQE259KNK1YUK462VCCG4455T4BUPUC5B9LVQS9XD16U6</session_id>
<x_server_response>
| c# | xpath | null | null | null | null | open | How to access a xml node with attributes and namespace using selectsinglenode()
===
I have this document where i want to get to the value in `"x_server_response/retrieve_resources_by_category_response/source_full_info/record/ datafield[@tag='520']/subfield[@code='a']"`
But i just can't! Why?
i suspect that this has something to do with the namespace daclaration at the *record* node. But i can not figure out how to do it.
my code looks like this:
XmlNodeList xmlResources = r.ResponseXmlDocument.SelectNodes("x_server_response/retrieve_resources_by_category_response/source_full_info);
foreach (XmlNode xmlResource in xmlResources)
{
string information = xmlResource.SelectSingleNode("record/datafield[@tag='520']/subfield[@code='a']").InnerText;
And the xml goes like this:
<x_server_response> metalib_version="4.00 (20)>
<source_full_info>
<record xmlns="http://www.loc.gov/MARC21/slim/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slim
http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<controlfield tag="001">CKB02166</controlfield>
<datafield tag="520" ind1=" " ind2=" ">
<subfield code="a">Providing access to thousands of online journals from leading
scholarly, academic and business publishers, the Ingenta Select service provides fast and
reliable access from a global network of servers to users' desktops around the world.
## ##Ingenta Select provides access to more than 5,000 electronic
publications from over 190 publisher clients and bring together an extensive range of services
for the librarian and end-user alike</subfield>
</datafield> </record>
</source_full_info>
<session_id new_session="N">3B7F9EQE259KNK1YUK462VCCG4455T4BUPUC5B9LVQS9XD16U6</session_id>
<x_server_response>
| 0 |
7,710,083 | 10/10/2011 08:15:12 | 139,150 | 07/16/2009 03:00:08 | 1,506 | 57 | Installing samhain | I have installed the samhain software. But I can not start it in daemon mode.
/usr/local/sbin/samhain -t check -D
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*.[0-9].gz>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*.[0-9].log>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*/*.[0-9].gz>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*/*.[0-9][0-9].gz>
How exactly the software is going to help me to protect the data? | security | null | null | null | null | 10/10/2011 11:18:00 | off topic | Installing samhain
===
I have installed the samhain software. But I can not start it in daemon mode.
/usr/local/sbin/samhain -t check -D
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*.[0-9].gz>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*.[0-9].log>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*/*.[0-9].gz>
ERROR : [2011-10-10T13:41:07+0530] msg=<No matches found>, interface=<glob>, path=</var/log/*/*.[0-9][0-9].gz>
How exactly the software is going to help me to protect the data? | 2 |
5,269 | 08/07/2008 20:30:00 | 357 | 08/05/2008 01:29:23 | 253 | 13 | C# logic order | In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?
Example:
DataTable myDt = new DataTable();
if (myDt != null && myDt.Rows.Count > 0)
{
//do some stuff with myDt
}
Which statement does the runtime evaluate first -
myDt != null
or:
myDt.Rows.Count > 0
? | c# | logic | language-agnostic | null | null | null | open | C# logic order
===
In C#, (and feel free to answer for other languages), what order does the runtime evaluate a logic statement?
Example:
DataTable myDt = new DataTable();
if (myDt != null && myDt.Rows.Count > 0)
{
//do some stuff with myDt
}
Which statement does the runtime evaluate first -
myDt != null
or:
myDt.Rows.Count > 0
? | 0 |
10,927,107 | 06/07/2012 07:00:21 | 1,439,449 | 06/06/2012 10:05:03 | 1 | 0 | ios sentest case | I'm Facing these erroros.
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_AuthNetUnitTests in AuthNetUnitTests.o
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_AuthNetUnitTests in AuthNetUnitTests.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| ios | null | null | null | null | 06/08/2012 23:02:44 | not a real question | ios sentest case
===
I'm Facing these erroros.
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_AuthNetUnitTests in AuthNetUnitTests.o
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_AuthNetUnitTests in AuthNetUnitTests.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| 1 |
7,414,266 | 09/14/2011 09:44:58 | 453,682 | 06/07/2010 11:03:38 | 11 | 5 | What 'new' languages are you interested in? | The September SuperMondays event will cover 'new' languages. We are looking for suggestions on languages that you may be interested in....also please suggest a speaker (either yourself or somebody else). | programming-languages | null | null | null | null | 09/14/2011 09:46:32 | off topic | What 'new' languages are you interested in?
===
The September SuperMondays event will cover 'new' languages. We are looking for suggestions on languages that you may be interested in....also please suggest a speaker (either yourself or somebody else). | 2 |
9,158,114 | 02/06/2012 09:35:18 | 1,191,934 | 02/06/2012 09:24:53 | 1 | 0 | Any reasons why 64 bit process would be twice as slow? | So I have two versions of the same program, one configured as for 64 bit and the other as 32. I am running it on a macpro with 2xquad core intel and 14 GB RAM.
After running a trial, I realised that the 64 bit version took twice as long as its 32 bit counterpart.
Notes
- my OSx is a bit old, 10.5.8, which i understand isnt the best place to be running 64 bit processes, but still it shouldnt take longer?!
- also I ran them at the same time, and each of them only used 1 processor. not sure if that makes a dif.
-my reason for wanting to run it in 64 is that when I tried the real, very large job i kept getting memory allocation errors, which i still for the life of me cant figure out
Does this make sense to anyone?
sorry if something sounds incorrect, im a biologist, go easy on me! | memory-management | cpu | 32bit-64bit | null | null | 02/27/2012 03:34:25 | not constructive | Any reasons why 64 bit process would be twice as slow?
===
So I have two versions of the same program, one configured as for 64 bit and the other as 32. I am running it on a macpro with 2xquad core intel and 14 GB RAM.
After running a trial, I realised that the 64 bit version took twice as long as its 32 bit counterpart.
Notes
- my OSx is a bit old, 10.5.8, which i understand isnt the best place to be running 64 bit processes, but still it shouldnt take longer?!
- also I ran them at the same time, and each of them only used 1 processor. not sure if that makes a dif.
-my reason for wanting to run it in 64 is that when I tried the real, very large job i kept getting memory allocation errors, which i still for the life of me cant figure out
Does this make sense to anyone?
sorry if something sounds incorrect, im a biologist, go easy on me! | 4 |
8,223,279 | 11/22/2011 07:18:37 | 650,640 | 03/08/2011 23:21:34 | 149 | 3 | Do I need to do some special setting for Virtual Legacy Wire in Linux kernel? | In my x86 main board, I connect some special interrupt sources (including NMI) to the south bridge chip. In the datasheet of the chip, it says that these interrupts are sent to CPU via virtual legacy wire (VLW). I don't know VLW well, and I don't know whether it is transparent for software developers.
Currently I can't capture the interrupts in Linux kernel. So my question is that do I need to do some special settings for VLW in kernel? In my previous hardware and code, I used IOAPIC to handle the similar interrupts and it worked well. | linux-kernel | intel | linux-device-driver | interrupt | interrupt-handling | null | open | Do I need to do some special setting for Virtual Legacy Wire in Linux kernel?
===
In my x86 main board, I connect some special interrupt sources (including NMI) to the south bridge chip. In the datasheet of the chip, it says that these interrupts are sent to CPU via virtual legacy wire (VLW). I don't know VLW well, and I don't know whether it is transparent for software developers.
Currently I can't capture the interrupts in Linux kernel. So my question is that do I need to do some special settings for VLW in kernel? In my previous hardware and code, I used IOAPIC to handle the similar interrupts and it worked well. | 0 |
2,981,124 | 06/05/2010 16:26:48 | 267,838 | 02/06/2010 18:50:44 | 96 | 2 | How to make will_paginate work with liquid | I managed to make a little hack to make will_paginate work with liquid:
http://gist.github.com/426737
I wonder if this is safe? Ideas? | ruby-on-rails | rails | will-paginate | liquid | null | null | open | How to make will_paginate work with liquid
===
I managed to make a little hack to make will_paginate work with liquid:
http://gist.github.com/426737
I wonder if this is safe? Ideas? | 0 |
10,204,265 | 04/18/2012 06:49:01 | 1,109,419 | 12/21/2011 08:25:59 | 74 | 15 | Why and when should use web-services in Mobile application? | Could you give me the answer clearly for this question: why and when should use web-services in Mobile application? Thanks.
| web-services | null | null | null | null | 04/19/2012 13:15:42 | not constructive | Why and when should use web-services in Mobile application?
===
Could you give me the answer clearly for this question: why and when should use web-services in Mobile application? Thanks.
| 4 |
8,103,107 | 11/12/2011 07:03:54 | 605,996 | 02/07/2011 06:06:31 | 638 | 65 | iCloud Server Space Limitation for iOS Application | This is general question,
Is there any limitation for application to store data on iCloud Server (Not exceed max Limit of 5 GB in general).
| ios | icloud | null | null | null | 11/12/2011 14:55:16 | off topic | iCloud Server Space Limitation for iOS Application
===
This is general question,
Is there any limitation for application to store data on iCloud Server (Not exceed max Limit of 5 GB in general).
| 2 |
8,024,738 | 11/06/2011 02:02:47 | 40,322 | 11/24/2008 16:54:48 | 7,571 | 266 | An Attempt to solve LOH Fragmentation Problems (StringBuilder + RegEx) | I was having some serious LOH Fragmentation problems with processing large strings and especially running RegEx matches on them.
Looked around a lot but couldn't find a solution, here is my attempt solve this problem in a fairly generic way but with some obvious limitations. Since I haven't seen this advice anywhere and everyone is whining about LOH Fragmentation I wanted to share the code to confirm that my design and assumptions are correct.
**Theory:**
1. Create a shared massive StringBuilder (this is to store the big strings that read from we read from streams) - `new StringBuilder(ChunkSize * 5);`
2. Create a massive String (has to be bigger than max. accepted size), should be initialized with empty space. - new string(' ', ChunkSize * 10);
3. Pin string object to memory so GC will not mess with it. `GCHandle.Alloc(pinnedText, GCHandleType.Pinned)`. Even though LOH objects are normally pinned this seems to improve the performance. Maybe because of `unsafe` code
4. Read stream into shared StringBuilder and then unsafe copy it to pinnedText by using indexers
5. Pass the pinnedText to RegEx
With this implementation the code below works just like there is no LOH allocation. If I switch to `new string(' ')` allocations instead of using a static `StringBuilder` or use `StringBuilder.ToString()` code can allocate **300% less memory** before crashing with `outofmemory exception`
I also confirmed the results with a memory profiler, that there is no LOH fragmentation in this implementation. I still don't understand why RegEx doesn't cause any unexpected problems. I also tested with different and expensive RegEx patterns and results are same, no fragmentation.
**Code:**
http://pastebin.com/ZuuBUXk3
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
namespace LOH_RegEx
{
internal class Program
{
private static List<string> storage = new List<string>();
private const int ChunkSize = 100000;
private static StringBuilder _sb = new StringBuilder(ChunkSize * 5);
private static void Main(string[] args)
{
var pinnedText = new string(' ', ChunkSize * 10);
var sourceCodePin = GCHandle.Alloc(pinnedText, GCHandleType.Pinned);
var rgx = new Regex("A", RegexOptions.CultureInvariant | RegexOptions.Compiled);
try
{
for (var i = 0; i < 30000; i++)
{
//Simulate that we read data from stream to SB
UpdateSB(i);
CopyInto(pinnedText);
var rgxMatch = rgx.Match(pinnedText);
if (!rgxMatch.Success)
{
Console.WriteLine("RegEx failed!");
Console.ReadLine();
}
//Extra buffer to fragment LoH
storage.Add(new string('z', 50000));
if ((i%100) == 0)
{
Console.Write(i + ",");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.WriteLine("OOM Crash!");
Console.ReadLine();
}
}
private static unsafe void CopyInto(string text)
{
fixed (char* pChar = text)
{
int i;
for (i = 0; i < _sb.Length; i++)
{
pChar[i] = _sb[i];
}
pChar[i + 1] = '\0';
}
}
private static void UpdateSB(int extraSize)
{
_sb.Remove(0,_sb.Length);
var rnd = new Random();
for (var i = 0; i < ChunkSize + extraSize; i++)
{
_sb.Append((char)rnd.Next(60, 80));
}
}
}
} | c# | .net | performance | memory | large-object-heap | 11/06/2011 15:25:38 | not a real question | An Attempt to solve LOH Fragmentation Problems (StringBuilder + RegEx)
===
I was having some serious LOH Fragmentation problems with processing large strings and especially running RegEx matches on them.
Looked around a lot but couldn't find a solution, here is my attempt solve this problem in a fairly generic way but with some obvious limitations. Since I haven't seen this advice anywhere and everyone is whining about LOH Fragmentation I wanted to share the code to confirm that my design and assumptions are correct.
**Theory:**
1. Create a shared massive StringBuilder (this is to store the big strings that read from we read from streams) - `new StringBuilder(ChunkSize * 5);`
2. Create a massive String (has to be bigger than max. accepted size), should be initialized with empty space. - new string(' ', ChunkSize * 10);
3. Pin string object to memory so GC will not mess with it. `GCHandle.Alloc(pinnedText, GCHandleType.Pinned)`. Even though LOH objects are normally pinned this seems to improve the performance. Maybe because of `unsafe` code
4. Read stream into shared StringBuilder and then unsafe copy it to pinnedText by using indexers
5. Pass the pinnedText to RegEx
With this implementation the code below works just like there is no LOH allocation. If I switch to `new string(' ')` allocations instead of using a static `StringBuilder` or use `StringBuilder.ToString()` code can allocate **300% less memory** before crashing with `outofmemory exception`
I also confirmed the results with a memory profiler, that there is no LOH fragmentation in this implementation. I still don't understand why RegEx doesn't cause any unexpected problems. I also tested with different and expensive RegEx patterns and results are same, no fragmentation.
**Code:**
http://pastebin.com/ZuuBUXk3
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
namespace LOH_RegEx
{
internal class Program
{
private static List<string> storage = new List<string>();
private const int ChunkSize = 100000;
private static StringBuilder _sb = new StringBuilder(ChunkSize * 5);
private static void Main(string[] args)
{
var pinnedText = new string(' ', ChunkSize * 10);
var sourceCodePin = GCHandle.Alloc(pinnedText, GCHandleType.Pinned);
var rgx = new Regex("A", RegexOptions.CultureInvariant | RegexOptions.Compiled);
try
{
for (var i = 0; i < 30000; i++)
{
//Simulate that we read data from stream to SB
UpdateSB(i);
CopyInto(pinnedText);
var rgxMatch = rgx.Match(pinnedText);
if (!rgxMatch.Success)
{
Console.WriteLine("RegEx failed!");
Console.ReadLine();
}
//Extra buffer to fragment LoH
storage.Add(new string('z', 50000));
if ((i%100) == 0)
{
Console.Write(i + ",");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.WriteLine("OOM Crash!");
Console.ReadLine();
}
}
private static unsafe void CopyInto(string text)
{
fixed (char* pChar = text)
{
int i;
for (i = 0; i < _sb.Length; i++)
{
pChar[i] = _sb[i];
}
pChar[i + 1] = '\0';
}
}
private static void UpdateSB(int extraSize)
{
_sb.Remove(0,_sb.Length);
var rnd = new Random();
for (var i = 0; i < ChunkSize + extraSize; i++)
{
_sb.Append((char)rnd.Next(60, 80));
}
}
}
} | 1 |
5,608,952 | 04/10/2011 00:39:14 | 264,052 | 02/02/2010 04:03:26 | 1,705 | 7 | Question about authentication in C/S communication model. | I am studying the authentication and authorization of the IIS (Internet Information Service). I am not sure if the following statement is correct. Could someone give some advice?
> The ultimate goal of security between
> a server and a client, is to make both
> ends of the communication sure about
> the identity of its peer. Thus,
> ideally, either end needs to prove its
> identity to its peer.
>
> For the server, HTTPS can be used.
>
> For the client, various authentication
> methods can be used based on the
> request processing pipeline of the
> server.
>
> But in practice, we often don't have
> to implement such a rigorous
> discipline. It's often seen that only
> one peer or neither peer is
> authenticated.
Thanks! | security | iis | null | null | null | 04/10/2011 09:55:25 | not a real question | Question about authentication in C/S communication model.
===
I am studying the authentication and authorization of the IIS (Internet Information Service). I am not sure if the following statement is correct. Could someone give some advice?
> The ultimate goal of security between
> a server and a client, is to make both
> ends of the communication sure about
> the identity of its peer. Thus,
> ideally, either end needs to prove its
> identity to its peer.
>
> For the server, HTTPS can be used.
>
> For the client, various authentication
> methods can be used based on the
> request processing pipeline of the
> server.
>
> But in practice, we often don't have
> to implement such a rigorous
> discipline. It's often seen that only
> one peer or neither peer is
> authenticated.
Thanks! | 1 |
11,700,896 | 07/28/2012 12:09:05 | 1,558,490 | 07/27/2012 18:34:24 | 1 | 0 | NOTHING as String in PHP | How I can show 'NOTHING' as string?
I need it to be displayed instead of showing empty string value as results.
else if ($colorByChance == 5)
{
$color='NOTHING';
} | php | null | null | null | null | null | open | NOTHING as String in PHP
===
How I can show 'NOTHING' as string?
I need it to be displayed instead of showing empty string value as results.
else if ($colorByChance == 5)
{
$color='NOTHING';
} | 0 |
11,037,766 | 06/14/2012 16:49:10 | 22,539 | 09/26/2008 04:48:21 | 3,848 | 170 | Format decimal with commas, preserve trailing zeros | I'd like to convert a decimal to a string, with commas as thousands seperators, and preserve the same precision the decimal was created with. (Will have 2-5 significant digits)
decimal d = 1234.4500M;
//I'd like "1,234.4500"
var notRight = d.ToString("###,###.#######"); //1,234.45
var notRightEither = d.ToString("N"); //1,234.45
var notRightEither2 = d.ToString("G"); //1234.45000
Is there no built in way to do this without parsing the string manually? | c# | .net | decimal | string-formatting | null | null | open | Format decimal with commas, preserve trailing zeros
===
I'd like to convert a decimal to a string, with commas as thousands seperators, and preserve the same precision the decimal was created with. (Will have 2-5 significant digits)
decimal d = 1234.4500M;
//I'd like "1,234.4500"
var notRight = d.ToString("###,###.#######"); //1,234.45
var notRightEither = d.ToString("N"); //1,234.45
var notRightEither2 = d.ToString("G"); //1234.45000
Is there no built in way to do this without parsing the string manually? | 0 |
10,582,219 | 05/14/2012 11:14:07 | 1,129,530 | 01/04/2012 08:53:47 | 41 | 0 | Mobile website development tutorials | Can you please tell me where i could see tutorials for Mobile website development.
Thank you already. | mobile-web | null | null | null | null | 05/14/2012 16:41:45 | not constructive | Mobile website development tutorials
===
Can you please tell me where i could see tutorials for Mobile website development.
Thank you already. | 4 |
5,061,716 | 02/21/2011 02:27:15 | 623,611 | 02/18/2011 18:15:46 | 33 | 9 | A Project to do.. | i want to ask if there is somewhere... a bank.. or a list where there is prodject ideas for begginer/Intermediate in php+HTML+CSS ...
You know.. sometimes you want to do coding...but you don't have idea of what to do.
Thanks to answering. | php | html | css | null | null | 02/21/2011 06:22:01 | off topic | A Project to do..
===
i want to ask if there is somewhere... a bank.. or a list where there is prodject ideas for begginer/Intermediate in php+HTML+CSS ...
You know.. sometimes you want to do coding...but you don't have idea of what to do.
Thanks to answering. | 2 |
8,920,145 | 01/19/2012 01:56:40 | 390,388 | 07/13/2010 11:18:58 | 346 | 5 | count the number of words in a string | Is there a function to count the number of words in a string?
for example
`str1 <- "How many words are in this sentence"`
to return a result of 7
Thanks. | string | r | null | null | null | null | open | count the number of words in a string
===
Is there a function to count the number of words in a string?
for example
`str1 <- "How many words are in this sentence"`
to return a result of 7
Thanks. | 0 |
10,694,052 | 05/21/2012 23:45:41 | 1,255,978 | 03/08/2012 00:21:59 | 20 | 0 | Grails springSecurityService.getCurrentUser() is Null when using custom AuthenticationProvider | One controller in my app needs to be accessible by users authenticated against an external database.
I have set up a custom user object,
class CustomUserDetails extends GrailsUser {
final String externalId
CustomUserDetails(String username, String password, boolean enabled,
boolean accountNonExpired, boolean credentialsNonExpired,
boolean accountNonLocked,
Collection<GrantedAuthority> authorities,
long id, String externalId) {
super(username, password, enabled, accountNonExpired,
credentialsNonExpired, accountNonLocked, authorities, id)
this.externalId = externalId
}
}
and a custom AuthenticationProvider
class CustomAuthenticationProvider implements AuthenticationProvider {
def springSecurityService
Authentication authenticate(Authentication customAuth) {
/* Do stuff to validate the user's credentials here */
def userDetails = new CustomUserDetails(customAuth.getPrincipal(), customAuth.getCredentials(), true, true, true, true,
[new GrantedAuthorityImpl('ROLE_SPECIAL_USER')], 9999999, "externalDatabaseIdString")
def token = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.authorities)
return token
}
boolean supports(Class authentication) {
return true
}
}
I've made entries in Config.groovy to add this to the springsecurity.providerNames list, and added the following to conf/spring/resources.groovy
beans = {
customAuthenticationProvider(info.proadvisors.auth.CustomAuthenticationProvider){ bean -> bean.autowire = "byName" }
userDetailsService(org.codehaus.groovy.grails.plugins.springsecurity.GormUserDetailsService){ bean -> bean.autowire = "byName" }
}
Here's the problem - in my controller, springSecurityService is being injected but springSecurityService.getCurrentUser() is null, and returns a null pointer exception when I try to access the externalId property that should be on the authenticated user object.
If, in my CustomAuthenticationProvider, instead of creating an instance of CustomUserDetails I use GormUserDetailsService to give me a GrailsUser object and use that to build the token, the controller works properly and getCurrentUser() works.
Any ideas on why this isn't working?
| grails | spring-security | null | null | null | null | open | Grails springSecurityService.getCurrentUser() is Null when using custom AuthenticationProvider
===
One controller in my app needs to be accessible by users authenticated against an external database.
I have set up a custom user object,
class CustomUserDetails extends GrailsUser {
final String externalId
CustomUserDetails(String username, String password, boolean enabled,
boolean accountNonExpired, boolean credentialsNonExpired,
boolean accountNonLocked,
Collection<GrantedAuthority> authorities,
long id, String externalId) {
super(username, password, enabled, accountNonExpired,
credentialsNonExpired, accountNonLocked, authorities, id)
this.externalId = externalId
}
}
and a custom AuthenticationProvider
class CustomAuthenticationProvider implements AuthenticationProvider {
def springSecurityService
Authentication authenticate(Authentication customAuth) {
/* Do stuff to validate the user's credentials here */
def userDetails = new CustomUserDetails(customAuth.getPrincipal(), customAuth.getCredentials(), true, true, true, true,
[new GrantedAuthorityImpl('ROLE_SPECIAL_USER')], 9999999, "externalDatabaseIdString")
def token = new UsernamePasswordAuthenticationToken(userDetails, null, userDetails.authorities)
return token
}
boolean supports(Class authentication) {
return true
}
}
I've made entries in Config.groovy to add this to the springsecurity.providerNames list, and added the following to conf/spring/resources.groovy
beans = {
customAuthenticationProvider(info.proadvisors.auth.CustomAuthenticationProvider){ bean -> bean.autowire = "byName" }
userDetailsService(org.codehaus.groovy.grails.plugins.springsecurity.GormUserDetailsService){ bean -> bean.autowire = "byName" }
}
Here's the problem - in my controller, springSecurityService is being injected but springSecurityService.getCurrentUser() is null, and returns a null pointer exception when I try to access the externalId property that should be on the authenticated user object.
If, in my CustomAuthenticationProvider, instead of creating an instance of CustomUserDetails I use GormUserDetailsService to give me a GrailsUser object and use that to build the token, the controller works properly and getCurrentUser() works.
Any ideas on why this isn't working?
| 0 |
1,105,934 | 07/09/2009 19:18:13 | 135,863 | 07/09/2009 19:18:11 | 1 | 0 | Ajax http / https problem | i would like to ask you for workaround on following problem.
My site can use http and https protocol, it doesnt affect the content. My site uses jquery ajax calls, which fills some areas on page, too.
Now, i would like to do all ajax calls by https protocol. (please dont ask me why :))
When i am on page with https protocol, all is correct. Ajaxes are working.
When im on page with http protocol, i got javascript error:
Access to restricted URI denied
I know that this is cross domain problem (in fact its not, its cross protocol problem), and i know, that i should use same protocol in ajax call as protocol on current page.
Still i want to have all ajax calls starting with https, and call them from page starting with http.
is there any workaround to achieve this(some json/proxy solution?), or is it simply imposible? | jquery | ajax | https | null | null | null | open | Ajax http / https problem
===
i would like to ask you for workaround on following problem.
My site can use http and https protocol, it doesnt affect the content. My site uses jquery ajax calls, which fills some areas on page, too.
Now, i would like to do all ajax calls by https protocol. (please dont ask me why :))
When i am on page with https protocol, all is correct. Ajaxes are working.
When im on page with http protocol, i got javascript error:
Access to restricted URI denied
I know that this is cross domain problem (in fact its not, its cross protocol problem), and i know, that i should use same protocol in ajax call as protocol on current page.
Still i want to have all ajax calls starting with https, and call them from page starting with http.
is there any workaround to achieve this(some json/proxy solution?), or is it simply imposible? | 0 |
9,627,678 | 03/09/2012 01:23:14 | 570,958 | 01/11/2011 08:05:45 | 336 | 33 | Sending mp3 file through PHP to be used with the audio tag of HTML5 fails in the middle of the mp3 | I'm trying to send my mp3 files through a PHP script in order to hide the path to the file in the HTML. Everything works perfectly fine except half way into the mp3 chrome gives me a GET [URL] error. And the rest of the mp3 is just blank. The audio tag thinks it's still reading the file, but there is no sound.
This is how I'm sending the mp3 file from php:
if (file_exists($filename)) {
header("Content-Transfer-Encoding: binary");
header("Content-Type: audio/mpeg");
header('Content-length: ' . filesize($filename));
header('Content-Disposition: inline; filename="' . $filename . '"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($filename);
exit;
}
else {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
echo "no file";
} | php | mp3 | html5-audio | null | null | null | open | Sending mp3 file through PHP to be used with the audio tag of HTML5 fails in the middle of the mp3
===
I'm trying to send my mp3 files through a PHP script in order to hide the path to the file in the HTML. Everything works perfectly fine except half way into the mp3 chrome gives me a GET [URL] error. And the rest of the mp3 is just blank. The audio tag thinks it's still reading the file, but there is no sound.
This is how I'm sending the mp3 file from php:
if (file_exists($filename)) {
header("Content-Transfer-Encoding: binary");
header("Content-Type: audio/mpeg");
header('Content-length: ' . filesize($filename));
header('Content-Disposition: inline; filename="' . $filename . '"');
header('X-Pad: avoid browser bug');
header('Cache-Control: no-cache');
readfile($filename);
exit;
}
else {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
echo "no file";
} | 0 |
7,388,734 | 09/12/2011 13:33:19 | 636,818 | 02/27/2011 20:44:39 | 19 | 1 | XMLSpy Validator | What XML validator does XMLspy uses? I am running into an issue that I can validate an XML file against the schema using Oxygen but yet it is not valid when I use XMLSpy! does anyone has any general thoughts regarding this?
Thanks a lot :) | xml | xsd | xmlspy | null | null | null | open | XMLSpy Validator
===
What XML validator does XMLspy uses? I am running into an issue that I can validate an XML file against the schema using Oxygen but yet it is not valid when I use XMLSpy! does anyone has any general thoughts regarding this?
Thanks a lot :) | 0 |
10,691,540 | 05/21/2012 19:41:15 | 1,407,983 | 05/21/2012 13:28:50 | -1 | 0 | check user name and password on database (script included) | i posted my question [here][1] so before i edit my post the post was closed by admin for closed as not a real question!!!!
so i post my quastion here again with complet codes:
Before posting here i checked and searched here but i cant find any posts can helped to me so maybe my question as like other questions:
i have login form like this:
<html>
<head>
<title>Password Checking Script</title>
</head>
<body>
<form action="check_user-pass.php" method="POST">
<h3>Please Login</h3>
User Name: <input type="text" name="user_name">
<br>Password: <input type="password" name="password">
<input type="submit" name="submit" value="Login!">
</form>
</body>
</html>
and as you see by this form i send user pass to "check_user-pass.php"
i tried it with more code but couldn't do that as well!!
so my question exactly what cod must be included in "check_user-pass.php" that check user and pass on my database if the user and pass exist on database returned OK and if the user and password not exist on database the returned value NO ???
sorry for my bad English.
<?php
ob_start();
$host=""; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name
$tbl_name=""; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("$db_name") or die(mysql_error());
echo "Connected to Database<br />";
// Check $username and $password
/*
if(empty($_POST['username']))
{
echo "UserName/Password is empty!";
return false;
}
if(empty($_POST['password']))
{
echo "Password is empty!";
return false;
}
*/
// Define $username and $password
$username=$_POST['username'];
$password=$_POST['password'];
// To protect MySQL injection (more detail about MySQL injection)
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $username and $password, table row must be 1 row
if($count==1){
session_register("username");
session_register("password");
return true;
echo "Login Successful";
}
else {
echo "Wrong Username or Password";
return false;
}
ob_end_flush();
?>
but not worked for me!!
[1]: http://stackoverflow.com/questions/10690611/check-user-name-and-password-on-database | php | sql | login | null | null | 06/14/2012 18:41:30 | too localized | check user name and password on database (script included)
===
i posted my question [here][1] so before i edit my post the post was closed by admin for closed as not a real question!!!!
so i post my quastion here again with complet codes:
Before posting here i checked and searched here but i cant find any posts can helped to me so maybe my question as like other questions:
i have login form like this:
<html>
<head>
<title>Password Checking Script</title>
</head>
<body>
<form action="check_user-pass.php" method="POST">
<h3>Please Login</h3>
User Name: <input type="text" name="user_name">
<br>Password: <input type="password" name="password">
<input type="submit" name="submit" value="Login!">
</form>
</body>
</html>
and as you see by this form i send user pass to "check_user-pass.php"
i tried it with more code but couldn't do that as well!!
so my question exactly what cod must be included in "check_user-pass.php" that check user and pass on my database if the user and pass exist on database returned OK and if the user and password not exist on database the returned value NO ???
sorry for my bad English.
<?php
ob_start();
$host=""; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name=""; // Database name
$tbl_name=""; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("$db_name") or die(mysql_error());
echo "Connected to Database<br />";
// Check $username and $password
/*
if(empty($_POST['username']))
{
echo "UserName/Password is empty!";
return false;
}
if(empty($_POST['password']))
{
echo "Password is empty!";
return false;
}
*/
// Define $username and $password
$username=$_POST['username'];
$password=$_POST['password'];
// To protect MySQL injection (more detail about MySQL injection)
$username = stripslashes($username);
$password = stripslashes($password);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $username and $password, table row must be 1 row
if($count==1){
session_register("username");
session_register("password");
return true;
echo "Login Successful";
}
else {
echo "Wrong Username or Password";
return false;
}
ob_end_flush();
?>
but not worked for me!!
[1]: http://stackoverflow.com/questions/10690611/check-user-name-and-password-on-database | 3 |
4,955,283 | 02/10/2011 09:25:36 | 609,587 | 02/09/2011 10:45:15 | 3 | 0 | which one is better for web development ? | Asp.net , php, Ruby on rails in terms of job opportunity and time period of learning. | php | asp.net | ruby-on-rails | ruby | null | 02/10/2011 09:30:29 | not constructive | which one is better for web development ?
===
Asp.net , php, Ruby on rails in terms of job opportunity and time period of learning. | 4 |
10,469,978 | 05/06/2012 10:55:09 | 283,055 | 05/11/2009 14:24:50 | 6,616 | 108 | Should I consider switching to Silverlight from WPF? | I have been using WPF for a new project which is far from done. It's a hobby project and a very useful one.
I'd like to have cross-platform compatibility (i.e. Linux + Mac + Windows), but Windows is the primary target. I'm pretty good with web languages and C# and Erlang, but C/C++ are not among them and I hate Java. So it was a natural move to choose WPF for me.
However, after reading numerous sources like http://www.mono-project.com/WPF:
> At this point, we strongly suggest that users interested in WPF adopt
> Silverlight instead as it can now be used outside of the browser and
> offers a rich set of cross platform APIs and features.
I'm starting to wonder if I should port my app to Silverlight and use it instead.
A couple of facts:
- My application is pure desktop application and meant to be so. It needs lower level access to system resources (but not that low that .NET wouldn't be enough).
- I'd like to have the three platforms support, but Windows is the primary concern.
- I'd prefer C# and .NET and something equivalent to WPF where the UI is declarative, separated from code in a clean way and allows for rich user interfaces.
I've heard Silverlight works in Mac already, and support for Linux is possible via Moonlight.
**Should I consider switching to Silverlight from WPF and what problems may arise?** | c# | .net | wpf | silverlight | null | 05/06/2012 17:43:19 | not constructive | Should I consider switching to Silverlight from WPF?
===
I have been using WPF for a new project which is far from done. It's a hobby project and a very useful one.
I'd like to have cross-platform compatibility (i.e. Linux + Mac + Windows), but Windows is the primary target. I'm pretty good with web languages and C# and Erlang, but C/C++ are not among them and I hate Java. So it was a natural move to choose WPF for me.
However, after reading numerous sources like http://www.mono-project.com/WPF:
> At this point, we strongly suggest that users interested in WPF adopt
> Silverlight instead as it can now be used outside of the browser and
> offers a rich set of cross platform APIs and features.
I'm starting to wonder if I should port my app to Silverlight and use it instead.
A couple of facts:
- My application is pure desktop application and meant to be so. It needs lower level access to system resources (but not that low that .NET wouldn't be enough).
- I'd like to have the three platforms support, but Windows is the primary concern.
- I'd prefer C# and .NET and something equivalent to WPF where the UI is declarative, separated from code in a clean way and allows for rich user interfaces.
I've heard Silverlight works in Mac already, and support for Linux is possible via Moonlight.
**Should I consider switching to Silverlight from WPF and what problems may arise?** | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.