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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,434,423 | 07/11/2012 14:03:56 | 623,423 | 02/18/2011 16:00:32 | 25 | 1 | Resin 2 to Tomcat 7 performance issues | We develop and maintain a high volume web application that runs under a legacy version of Resin (2.1.17). As part of a significant infrastructure upgrade, we are in the midst of re-hosting this application to run under Tomcat 7.0.28. We have completed the development and configuration work, and are currently load testing the new configuration in our performance lab using Load Runner. Despite running the load test with a wide variety of tuning changes, we are unable to complete a load test that matches the performance profile of previous Resin tests.
The main issues that we see with the failing Tomcat load tests are:
1. Very high CPU usage by Tomcat (close to 100%, vs Resin which averages 60%)
2. High thread usage in Tomcat. The number of active threads used by Tomcat spikes to the maximum configured and does not go down until the test is done (kind of like a square wave). Resin uses far fewer threads and never gets close to the maximum.
Here are a few architectural/background notes:
1. We run Apache 2.2 on our web servers. They serve up static content and proxy dynamic requests to the application server, which runs Tomcat.
2. The web application uses Java 1.6, Spring, Hibernate, and a legacy version of Tapestry.
3. We are running the Tomcat performance pack (APR).
4. The load runner stress test runs approximately 8 hours. At the peak of ramp-up, it creates 1600 concurrent virtual users to drive the load.
5. In order to decouple the application from Resin SSO, we integrated CAS into our login/authorization process. CAS runs on a separate server and does not appear to be under stress. Outside of this change, the web application code is essentially unchanged.
My main question is:
1. Any advice on how to troubleshoot and tune Apache/Tomcat in order to reduce thread and CPU usage?
Please let me know if you have any questions or need additional information.
| performance | tomcat7 | resin | null | null | 07/12/2012 17:07:45 | off topic | Resin 2 to Tomcat 7 performance issues
===
We develop and maintain a high volume web application that runs under a legacy version of Resin (2.1.17). As part of a significant infrastructure upgrade, we are in the midst of re-hosting this application to run under Tomcat 7.0.28. We have completed the development and configuration work, and are currently load testing the new configuration in our performance lab using Load Runner. Despite running the load test with a wide variety of tuning changes, we are unable to complete a load test that matches the performance profile of previous Resin tests.
The main issues that we see with the failing Tomcat load tests are:
1. Very high CPU usage by Tomcat (close to 100%, vs Resin which averages 60%)
2. High thread usage in Tomcat. The number of active threads used by Tomcat spikes to the maximum configured and does not go down until the test is done (kind of like a square wave). Resin uses far fewer threads and never gets close to the maximum.
Here are a few architectural/background notes:
1. We run Apache 2.2 on our web servers. They serve up static content and proxy dynamic requests to the application server, which runs Tomcat.
2. The web application uses Java 1.6, Spring, Hibernate, and a legacy version of Tapestry.
3. We are running the Tomcat performance pack (APR).
4. The load runner stress test runs approximately 8 hours. At the peak of ramp-up, it creates 1600 concurrent virtual users to drive the load.
5. In order to decouple the application from Resin SSO, we integrated CAS into our login/authorization process. CAS runs on a separate server and does not appear to be under stress. Outside of this change, the web application code is essentially unchanged.
My main question is:
1. Any advice on how to troubleshoot and tune Apache/Tomcat in order to reduce thread and CPU usage?
Please let me know if you have any questions or need additional information.
| 2 |
5,280,085 | 03/12/2011 01:05:26 | 656,221 | 03/12/2011 01:05:26 | 1 | 0 | Exercise using the "if" method | How would I do this...
Write a program to work out how much a person pays to go to the cinema. The program should input an age from a slider or a text field and then decide on the following basis:
under 5 free
aged 5 to 12, 5.29
aged 13 to 54, 6.95
are 55 and over, free
I can't figure it out.
Thanks! | java | null | null | null | null | 03/12/2011 01:18:34 | not a real question | Exercise using the "if" method
===
How would I do this...
Write a program to work out how much a person pays to go to the cinema. The program should input an age from a slider or a text field and then decide on the following basis:
under 5 free
aged 5 to 12, 5.29
aged 13 to 54, 6.95
are 55 and over, free
I can't figure it out.
Thanks! | 1 |
10,451,202 | 05/04/2012 14:53:06 | 1,285,269 | 03/22/2012 07:28:13 | 40 | 4 | what name function php I need to use to read setting file permissions on windows? | did it is possible to read the setting file permissions(Octal Notation/Symbolic Notation) using php function?
thanks. | php | permissions | settings | null | null | null | open | what name function php I need to use to read setting file permissions on windows?
===
did it is possible to read the setting file permissions(Octal Notation/Symbolic Notation) using php function?
thanks. | 0 |
5,672,461 | 04/15/2011 04:40:36 | 710,090 | 04/15/2011 04:40:36 | 1 | 0 | android - for loop drawing circles not working? | I am trying to draw multiple circles from an array and it is throwing a "force close" when I try to run the code. Any ideas here?
package com.adam.PlaySound;
import android.app.Activity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
public class ButtonPress extends Activity {
/** Called when the activity is first created. */
int numPlayers = 3;
boolean toggle = true;
LinearLayout parent;
Button button;
TextView text;
TextView text2;
DisplayMetrics dm = new DisplayMetrics();
MediaPlayer mediaPlayer[] = new MediaPlayer[numPlayers];
//this array is a placeholder for the loops in a cluster
//essentially this array will be populated through a database
//based on which cluster someone is within
//and the region arrays will be populated by the same database
String soundFiles[] = {"drums_1.mp3", "lead.mp3", "strings.mp3"};
public LoopRegion region[];
float regionX[] = {20, 80, 150};
float regionY[] = {20, 200, 350};
int regionR[] = {50, 80, 100};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//setContentView(R.id.view1);
parent = (LinearLayout) findViewById(R.id.parent);
button = (Button) findViewById(R.id.button1);
text = (TextView) findViewById(R.id.text);
text2 = (TextView) findViewById(R.id.text2);
parent.setOnTouchListener(Motion);
button.setOnClickListener(on_off);
for (int i = 0; i < numPlayers; i++){
String path = "http://soundclusters.adamlaskowitz.com/uploads/" + soundFiles[i];
mediaPlayer[i] = new MediaPlayer();
//mediaPlayer[i] = MediaPlayer.create(ButtonPress.this, R.raw.drums_2);
mediaPlayer[i] = MediaPlayer.create(ButtonPress.this, Uri.parse(path));
mediaPlayer[i].setLooping(true);
}
for (int i = 0; i < numPlayers; i++){
region[i] = new LoopRegion(this,regionX[i],regionY[i],regionR[i]);
parent.addView(region[i]);
}
getWindowManager().getDefaultDisplay().getMetrics(dm);
}
| android | draw | null | null | null | null | open | android - for loop drawing circles not working?
===
I am trying to draw multiple circles from an array and it is throwing a "force close" when I try to run the code. Any ideas here?
package com.adam.PlaySound;
import android.app.Activity;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
public class ButtonPress extends Activity {
/** Called when the activity is first created. */
int numPlayers = 3;
boolean toggle = true;
LinearLayout parent;
Button button;
TextView text;
TextView text2;
DisplayMetrics dm = new DisplayMetrics();
MediaPlayer mediaPlayer[] = new MediaPlayer[numPlayers];
//this array is a placeholder for the loops in a cluster
//essentially this array will be populated through a database
//based on which cluster someone is within
//and the region arrays will be populated by the same database
String soundFiles[] = {"drums_1.mp3", "lead.mp3", "strings.mp3"};
public LoopRegion region[];
float regionX[] = {20, 80, 150};
float regionY[] = {20, 200, 350};
int regionR[] = {50, 80, 100};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//setContentView(R.id.view1);
parent = (LinearLayout) findViewById(R.id.parent);
button = (Button) findViewById(R.id.button1);
text = (TextView) findViewById(R.id.text);
text2 = (TextView) findViewById(R.id.text2);
parent.setOnTouchListener(Motion);
button.setOnClickListener(on_off);
for (int i = 0; i < numPlayers; i++){
String path = "http://soundclusters.adamlaskowitz.com/uploads/" + soundFiles[i];
mediaPlayer[i] = new MediaPlayer();
//mediaPlayer[i] = MediaPlayer.create(ButtonPress.this, R.raw.drums_2);
mediaPlayer[i] = MediaPlayer.create(ButtonPress.this, Uri.parse(path));
mediaPlayer[i].setLooping(true);
}
for (int i = 0; i < numPlayers; i++){
region[i] = new LoopRegion(this,regionX[i],regionY[i],regionR[i]);
parent.addView(region[i]);
}
getWindowManager().getDefaultDisplay().getMetrics(dm);
}
| 0 |
4,042,712 | 10/28/2010 12:05:24 | 82,037 | 03/24/2009 14:12:17 | 272 | 11 | Aliasing a linked server? | I have a server which I need to have as a linked server to another server, using sp_addLinkedServer.
My server's name is in the format "DepartmentName.CompanyName.com", which I can usually change to [blah.blah.com], but which I can't use in the SQL Server Management Studio View creator, because it keeps deleting my square brackets...
On the other hand, because the @srvproduct is SQL Server, I can't specify a name for the server to use, either, so I can't just call it "DepartmentName".
I seem to be in a bit of a catch-22 here. Any suggestions? | sql | sql-server | sql-server-2000 | ssms | null | null | open | Aliasing a linked server?
===
I have a server which I need to have as a linked server to another server, using sp_addLinkedServer.
My server's name is in the format "DepartmentName.CompanyName.com", which I can usually change to [blah.blah.com], but which I can't use in the SQL Server Management Studio View creator, because it keeps deleting my square brackets...
On the other hand, because the @srvproduct is SQL Server, I can't specify a name for the server to use, either, so I can't just call it "DepartmentName".
I seem to be in a bit of a catch-22 here. Any suggestions? | 0 |
1,972,112 | 12/28/2009 23:31:16 | 239,870 | 12/28/2009 23:31:16 | 1 | 0 | How to add themes namespace to C# project. | I'm relatively new in C#.
I would like to use Microsoft ListBox control, but I recognized that there's no Vertical ScrollBar property. Then I found open source ListBox control on page: http://www.koders.com/csharp/fidF0FDB984AB0429D0E6DF5D90B0A30F850D0335DB.aspx
And my question is where to find file oraz description of namespace "using System.Windows.Forms.Themes" ?
Thanks a lot. | c# | listbox | open | source | themes | null | open | How to add themes namespace to C# project.
===
I'm relatively new in C#.
I would like to use Microsoft ListBox control, but I recognized that there's no Vertical ScrollBar property. Then I found open source ListBox control on page: http://www.koders.com/csharp/fidF0FDB984AB0429D0E6DF5D90B0A30F850D0335DB.aspx
And my question is where to find file oraz description of namespace "using System.Windows.Forms.Themes" ?
Thanks a lot. | 0 |
1,977,045 | 12/29/2009 21:25:44 | 214,296 | 08/17/2009 15:49:30 | 50 | 1 | How do I use a Save Dialog Box in C# to save an ASCII text file? | Okay, I'm probably missing something really simple here, but I've been at this for over an hour now and getting nowhere. :( I have a C# project using Microsoft's Visual C# 2008 Express Edition. The Save dialog box appears as desired, but it never makes the file. Practially speaking, once the file is specified, I'd like the application to maintain it with current data as a log file. For now, I'd just be happy, if I could get the ####### thing to make an empty file. Here's what I've been able to come up with so far:
private void saveLogAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (DialogResult.OK == saveFileDialog1.ShowDialog())
{
// If the file name is not an empty string open it for saving.
if (saveFileDialog1.FileName != "")
{
/* This does not work.
// Saves the Image via a FileStream created by the OpenFile method.
System.IO.FileStream fs = (System.IO.FileStream)saveFileDialog1.OpenFile();
fs.Write((byte)"Success!\r\n", 0, 10);
fs.Close();
*/
}
else
{
textBox1.Text += "An invalid filename was specified.\r\n";
}
}
}
Any suggestions would be much appreciated. Thanks.
| c# | save-dialog | ascii | text-files | null | null | open | How do I use a Save Dialog Box in C# to save an ASCII text file?
===
Okay, I'm probably missing something really simple here, but I've been at this for over an hour now and getting nowhere. :( I have a C# project using Microsoft's Visual C# 2008 Express Edition. The Save dialog box appears as desired, but it never makes the file. Practially speaking, once the file is specified, I'd like the application to maintain it with current data as a log file. For now, I'd just be happy, if I could get the ####### thing to make an empty file. Here's what I've been able to come up with so far:
private void saveLogAsToolStripMenuItem_Click(object sender, EventArgs e)
{
if (DialogResult.OK == saveFileDialog1.ShowDialog())
{
// If the file name is not an empty string open it for saving.
if (saveFileDialog1.FileName != "")
{
/* This does not work.
// Saves the Image via a FileStream created by the OpenFile method.
System.IO.FileStream fs = (System.IO.FileStream)saveFileDialog1.OpenFile();
fs.Write((byte)"Success!\r\n", 0, 10);
fs.Close();
*/
}
else
{
textBox1.Text += "An invalid filename was specified.\r\n";
}
}
}
Any suggestions would be much appreciated. Thanks.
| 0 |
10,634,303 | 05/17/2012 10:51:03 | 959,664 | 09/22/2011 17:16:28 | 38 | 1 | Linux Commad Line Zip with Regex | I have thousands of jpg files that are all called 1.jpg, 2.jpg, 3.jpg and so on. I need to zip up a range of them and I thought I could do this with regex, but so far haven't had any luck.
Here is the command
zip images.zip '[66895-105515]'.jpg
Does anyone have any ideas? | regex | linux | command-line | zip | null | null | open | Linux Commad Line Zip with Regex
===
I have thousands of jpg files that are all called 1.jpg, 2.jpg, 3.jpg and so on. I need to zip up a range of them and I thought I could do this with regex, but so far haven't had any luck.
Here is the command
zip images.zip '[66895-105515]'.jpg
Does anyone have any ideas? | 0 |
11,004,079 | 06/12/2012 20:11:12 | 1,371,386 | 05/03/2012 01:57:32 | 1 | 0 | How to set up C/C++ programming environment on windows? | I learned Java and now I want to learn c/c++, but it seem like a different ball game just setting it up. Is there an API/library for C/C++? where do I get the API(if there is one)? Does c/c++ have any compliers on windows? Does anyone manage c/c++ like oracle does with java? | c++ | c | ide | dev | null | 06/12/2012 20:15:12 | not constructive | How to set up C/C++ programming environment on windows?
===
I learned Java and now I want to learn c/c++, but it seem like a different ball game just setting it up. Is there an API/library for C/C++? where do I get the API(if there is one)? Does c/c++ have any compliers on windows? Does anyone manage c/c++ like oracle does with java? | 4 |
5,592,478 | 04/08/2011 08:28:54 | 341,065 | 05/29/2009 19:17:26 | 2,130 | 108 | Visual Studio 2010 conversion of 2005 solutions (C++ projects) loses project dependencies | I am trying to convert one rather huge VS2005 solution with many C++ projects to VS2010. After automatic conversion I can see that some of the dependencies between the projects were lost and thus my VS2010 builds fail unless I manually re-add the dependencies.
Has anybody seen this behaviour?
Is there a fix for this?
Can I avoid having the dependencies dropped during the conversion by changing/fixing the VS2005 solutions/projects? | c++ | visual-studio | visual-studio-2010 | visual-c++ | visual-studio-2005 | null | open | Visual Studio 2010 conversion of 2005 solutions (C++ projects) loses project dependencies
===
I am trying to convert one rather huge VS2005 solution with many C++ projects to VS2010. After automatic conversion I can see that some of the dependencies between the projects were lost and thus my VS2010 builds fail unless I manually re-add the dependencies.
Has anybody seen this behaviour?
Is there a fix for this?
Can I avoid having the dependencies dropped during the conversion by changing/fixing the VS2005 solutions/projects? | 0 |
2,999,580 | 06/08/2010 17:09:25 | 19,875 | 09/21/2008 07:46:57 | 658 | 41 | Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell? | Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell? In my NIB I have already set the cell height.
When I over-ride heightForRowAtIndexPath the contents of my cell don't appear, even though it is set to the height defined in the NIB.
If I don't over-ride heightForRowAtIndexPath the contents of the cell appear, but there is overflow since the default height is not large enough. | iphone | objective-c | cocoa-touch | uitableview | interface-builder | null | open | Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell?
===
Do I need to set heightForRowAtIndexPath if I am using a custom UITableViewCell? In my NIB I have already set the cell height.
When I over-ride heightForRowAtIndexPath the contents of my cell don't appear, even though it is set to the height defined in the NIB.
If I don't over-ride heightForRowAtIndexPath the contents of the cell appear, but there is overflow since the default height is not large enough. | 0 |
6,271,393 | 06/07/2011 20:43:54 | 92,213 | 04/17/2009 16:29:40 | 532 | 20 | How good is tomcatoCMS ? | i'm looking for a ZF CMS , joomla like and tomcatoCMS came up.NOw i'ld like your opinion before using it for a client.I mysql have a decent level in ZF but want to avoid support nightmare as much as possible :)
what do you think? | php | zend-framework | content-management-system | null | null | 06/07/2011 21:02:57 | not constructive | How good is tomcatoCMS ?
===
i'm looking for a ZF CMS , joomla like and tomcatoCMS came up.NOw i'ld like your opinion before using it for a client.I mysql have a decent level in ZF but want to avoid support nightmare as much as possible :)
what do you think? | 4 |
1,057,457 | 06/29/2009 09:45:04 | 104,015 | 05/09/2009 09:59:12 | 565 | 1 | how to get a cookie value from javascript and set it by PHP? | I'm new to cookie operations | cookies | null | null | null | null | 11/14/2011 13:24:28 | not a real question | how to get a cookie value from javascript and set it by PHP?
===
I'm new to cookie operations | 1 |
3,963,892 | 10/18/2010 22:23:46 | 157,894 | 08/17/2009 16:56:02 | 89 | 5 | Heroku: Running imagemagick w/ paperclip | I have installed image magick on my mac os x computer and now I want to deploy it to heroku. I've installed the the paperclip plugin on heroku but I get this error when uploading an image:
Paperclip::CommandNotFoundError
I had this error before when I didn't have imagemagick instaledl on my computer before but now that I want to deploy it, **how do I get image magick to work on heroku?** | ruby-on-rails | ruby | imagemagick | heroku | null | null | open | Heroku: Running imagemagick w/ paperclip
===
I have installed image magick on my mac os x computer and now I want to deploy it to heroku. I've installed the the paperclip plugin on heroku but I get this error when uploading an image:
Paperclip::CommandNotFoundError
I had this error before when I didn't have imagemagick instaledl on my computer before but now that I want to deploy it, **how do I get image magick to work on heroku?** | 0 |
5,320,269 | 03/16/2011 02:07:39 | 631,716 | 02/24/2011 05:42:08 | 215 | 16 | Is there a way to make sure your CSS is corss-browser capable? | Is there a way to make sure your CSS is corss-browser capable? | css | null | null | null | null | null | open | Is there a way to make sure your CSS is corss-browser capable?
===
Is there a way to make sure your CSS is corss-browser capable? | 0 |
3,645,598 | 09/05/2010 09:27:00 | 284,708 | 03/02/2010 19:40:45 | 201 | 14 | Ways to implement Flex [Bindable] in other languages | As you may know, ActionScript allows you to mark a variable as [Bindable], causing any changes to that variable to have immediate effect all over your application. Pretty neat.
How would you implement this feature in your favourite programming language? My first guess was to use events or wrapper classes, but I couldn't come up with a clean solution to this. I am especially interested in doing this with Python or JavaScript. | python | flex | bindable | null | null | null | open | Ways to implement Flex [Bindable] in other languages
===
As you may know, ActionScript allows you to mark a variable as [Bindable], causing any changes to that variable to have immediate effect all over your application. Pretty neat.
How would you implement this feature in your favourite programming language? My first guess was to use events or wrapper classes, but I couldn't come up with a clean solution to this. I am especially interested in doing this with Python or JavaScript. | 0 |
5,597,203 | 04/08/2011 15:20:45 | 644,419 | 03/04/2011 09:16:59 | 315 | 27 | Jetty, Maven plugin - how to configure default document? | We're using Jetty 6.x, and Maven-2.
Anybody knows how to configure the default document?
I mean - there's a default that serves /index.html or any of it's equivalents when accessing the application root.
And there should be a settings to control that.
(there is in tomcat and in IIS for example...)
So 1 - how do I tell it to Jetty?
And 2 - how do I do that using Maven plugin :P (yea, I know... I'm stuck with it, but am making the more or less the best of it anyway...) | maven-2 | jetty | default-document | null | null | null | open | Jetty, Maven plugin - how to configure default document?
===
We're using Jetty 6.x, and Maven-2.
Anybody knows how to configure the default document?
I mean - there's a default that serves /index.html or any of it's equivalents when accessing the application root.
And there should be a settings to control that.
(there is in tomcat and in IIS for example...)
So 1 - how do I tell it to Jetty?
And 2 - how do I do that using Maven plugin :P (yea, I know... I'm stuck with it, but am making the more or less the best of it anyway...) | 0 |
10,759,768 | 05/25/2012 18:40:50 | 689,878 | 04/03/2011 14:28:02 | 52 | 2 | How to add option in Python code? | I have a Python script a.py and b.py, I'd like to call the main function of b.py and pass arguments from a.py. How to add option in a.py from inside the code and pass it to the main of b.py ?. I tried adding the dictionary my additional option but for some unknown reason the b.py doesn't get the right value. The add_option only works for command line option.
TIA,
John | python | null | null | null | null | 05/30/2012 02:00:42 | not a real question | How to add option in Python code?
===
I have a Python script a.py and b.py, I'd like to call the main function of b.py and pass arguments from a.py. How to add option in a.py from inside the code and pass it to the main of b.py ?. I tried adding the dictionary my additional option but for some unknown reason the b.py doesn't get the right value. The add_option only works for command line option.
TIA,
John | 1 |
11,340,964 | 07/05/2012 08:57:00 | 1,139,048 | 01/09/2012 15:47:47 | 11 | 0 | difference between C(gcc 4.3.2) , C 99 strict(gcc 4.3.2) , C++(gcc-4.0.0-8) ,C++(gcc-4.3.2) | first question is same as title i.e main difference between the four of them
second question is which of the above support int64_t or long long without suffix LL.I want a data type of the range 2^63 - 1
third question is , if your answer to my second question is not C(gcc 4.3.2) , whether the code I write in C(gcc 4.3.2) for C language will be valid in rest of the three options or do I have to modify something, then what will be those modifications. | c++ | c | compiler | long-integer | null | 07/05/2012 09:34:21 | not a real question | difference between C(gcc 4.3.2) , C 99 strict(gcc 4.3.2) , C++(gcc-4.0.0-8) ,C++(gcc-4.3.2)
===
first question is same as title i.e main difference between the four of them
second question is which of the above support int64_t or long long without suffix LL.I want a data type of the range 2^63 - 1
third question is , if your answer to my second question is not C(gcc 4.3.2) , whether the code I write in C(gcc 4.3.2) for C language will be valid in rest of the three options or do I have to modify something, then what will be those modifications. | 1 |
3,681,655 | 09/10/2010 01:05:09 | 443,946 | 09/10/2010 01:03:00 | 1 | 0 | why does javascript have a set of built in objects? | any particular reason? | javascript | html | css | null | null | 09/10/2010 01:28:09 | not a real question | why does javascript have a set of built in objects?
===
any particular reason? | 1 |
9,640,927 | 03/09/2012 21:00:11 | 1,212,520 | 02/15/2012 22:09:27 | 13 | 0 | aiming algorithms 2d android game | I am developing a 2d android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will be after a distance and fires a projectile to meet it at that distance. Of course this means varying the projectile speed to meet the target.
Does anyone have any tips for a simple-ish algorithm (optimal-ish) to calculate when the projectile needs to fire and where it needs to aim if it can only travel at a constant velocity? Say the projectile goes twice the speed of the target?
The only way I can think of involves searching and seems quite large. | android | algorithm | null | null | null | 03/09/2012 23:02:53 | off topic | aiming algorithms 2d android game
===
I am developing a 2d android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will be after a distance and fires a projectile to meet it at that distance. Of course this means varying the projectile speed to meet the target.
Does anyone have any tips for a simple-ish algorithm (optimal-ish) to calculate when the projectile needs to fire and where it needs to aim if it can only travel at a constant velocity? Say the projectile goes twice the speed of the target?
The only way I can think of involves searching and seems quite large. | 2 |
438,070 | 01/13/2009 05:47:25 | 46,277 | 12/15/2008 06:39:22 | 45 | 0 | How long do you keep your programming books? | I have all these programming titles on my shelf and I'm running out of shelf space. How do you decide when to get rid of a book -- and when you do, what do you do with it? | books | null | null | null | null | 09/26/2011 14:34:36 | not constructive | How long do you keep your programming books?
===
I have all these programming titles on my shelf and I'm running out of shelf space. How do you decide when to get rid of a book -- and when you do, what do you do with it? | 4 |
5,116,322 | 02/25/2011 10:51:07 | 617,262 | 02/15/2011 05:43:44 | 1 | 0 | Getting an app.config key of console app from webservice refered by the console app. | I have a console application (say CA) which calls many webservices (say WS1, WS2, WS3). All these webservices will have the same structure (meaning: exposes same webmethods but functionality changes based between WS1, WS2, WS3).
The Webservices are accessed from CA using a single proxy. (meaning: all Webservice's interfaces/webmethods structure are same).
The question is: Is it possible to access a particular key in app.config of CA inside WS3, but in the same time I should not change the structure of webmethod.
Thanks in advance.
Harish | c# | web-services | .net-2.0 | null | null | null | open | Getting an app.config key of console app from webservice refered by the console app.
===
I have a console application (say CA) which calls many webservices (say WS1, WS2, WS3). All these webservices will have the same structure (meaning: exposes same webmethods but functionality changes based between WS1, WS2, WS3).
The Webservices are accessed from CA using a single proxy. (meaning: all Webservice's interfaces/webmethods structure are same).
The question is: Is it possible to access a particular key in app.config of CA inside WS3, but in the same time I should not change the structure of webmethod.
Thanks in advance.
Harish | 0 |
1,355,803 | 08/31/2009 04:37:26 | 165,806 | 08/31/2009 04:37:26 | 1 | 0 | Why is the C++ syntax so complicated? | I'm a novice at programming although I've been teaching myself Python for about a year and I studied C# some time ago.
This month I started C++ programming courses at my university and I just have to ask; "why is the C++ code so complicated?"
Writing "Hello world." in Python is as simple as "print 'Hello world.'" but in C++ it's:
# include <iostream>
using namespace std;
int main ()
{
cout << "Hello world.";
return 0;
}
I know there is probably a good reason for all of this but, why...
- ... do you have to include the <iostream> everytime? Do you ever *not* need it?
- ... same question for the standard library, when do you not need std::*?
- ... why is the "main" part a function? Do you ever call the main function? Why is it an integer? Why does C++ need to have a main function but Python doesn't?
- ... why do you need "std::cout << "? Isn't that needlessly long and complicated compared to Python?
- ... why do you need to return 0 even when you are never going to use it?
This is probably because I'm learning such basic C++ but every program I've made so far looks like this, so I have to retype the same code over and over again. Isn't that redundant? Couldn't the compiler just input this code itself, since it's always the same (i.e. afaik you always you <iostream>, std, int main, return 0) | c++ | redundant-code | null | null | null | 09/01/2009 04:46:54 | not constructive | Why is the C++ syntax so complicated?
===
I'm a novice at programming although I've been teaching myself Python for about a year and I studied C# some time ago.
This month I started C++ programming courses at my university and I just have to ask; "why is the C++ code so complicated?"
Writing "Hello world." in Python is as simple as "print 'Hello world.'" but in C++ it's:
# include <iostream>
using namespace std;
int main ()
{
cout << "Hello world.";
return 0;
}
I know there is probably a good reason for all of this but, why...
- ... do you have to include the <iostream> everytime? Do you ever *not* need it?
- ... same question for the standard library, when do you not need std::*?
- ... why is the "main" part a function? Do you ever call the main function? Why is it an integer? Why does C++ need to have a main function but Python doesn't?
- ... why do you need "std::cout << "? Isn't that needlessly long and complicated compared to Python?
- ... why do you need to return 0 even when you are never going to use it?
This is probably because I'm learning such basic C++ but every program I've made so far looks like this, so I have to retype the same code over and over again. Isn't that redundant? Couldn't the compiler just input this code itself, since it's always the same (i.e. afaik you always you <iostream>, std, int main, return 0) | 4 |
4,383,915 | 12/08/2010 03:32:02 | 531,802 | 12/06/2010 05:32:30 | 23 | 0 | undefined behavior of switch | #include<stdio.h>
int main()
{
int a=1;
switch(a)
{ int b=20;
case 1: printf("b is %d\n",b);
break;
default:printf("b is %d\n",b);
break;
}
return 0;
}
what do you think can be value of b in both of these printf statements ? ofcourse it is not 20. | c | null | null | null | null | 12/08/2010 03:40:08 | not a real question | undefined behavior of switch
===
#include<stdio.h>
int main()
{
int a=1;
switch(a)
{ int b=20;
case 1: printf("b is %d\n",b);
break;
default:printf("b is %d\n",b);
break;
}
return 0;
}
what do you think can be value of b in both of these printf statements ? ofcourse it is not 20. | 1 |
8,104,806 | 11/12/2011 13:45:32 | 859,172 | 07/23/2011 09:46:52 | 32 | 2 | iPhone Authorize.Net SDK integration | I am trying to integrate iPhone SDK into my project. (AIM)
I have some dificulties and I can't make it work.
I have followed the guide https://developer.authorize.net/integration/fifteenminutes/ios
AuthNet *an = [AuthNet getInstance];
[an setDelegate:self];
[an mobileDeviceLoginRequest: mobileDeviceLoginRequest];
In the code above, "an" remains null because the class AuthNet doesnt instantiate while calling "getInstance()".
In the README file, it says that I have to call
[AuthNet authNetWithAPILoginID:@"YOUR_LOGIN_ID" andTransactionKey:@"YOUR_TRANSACTION_KEY" forEnvironment:ENV_TEST];
in order to instantiate the singleton. BUT there is no such method inside "AuthNet" class.
Am I missing something?
Please help me. | iphone | sdk | authorize.net | authorize | null | null | open | iPhone Authorize.Net SDK integration
===
I am trying to integrate iPhone SDK into my project. (AIM)
I have some dificulties and I can't make it work.
I have followed the guide https://developer.authorize.net/integration/fifteenminutes/ios
AuthNet *an = [AuthNet getInstance];
[an setDelegate:self];
[an mobileDeviceLoginRequest: mobileDeviceLoginRequest];
In the code above, "an" remains null because the class AuthNet doesnt instantiate while calling "getInstance()".
In the README file, it says that I have to call
[AuthNet authNetWithAPILoginID:@"YOUR_LOGIN_ID" andTransactionKey:@"YOUR_TRANSACTION_KEY" forEnvironment:ENV_TEST];
in order to instantiate the singleton. BUT there is no such method inside "AuthNet" class.
Am I missing something?
Please help me. | 0 |
8,662,149 | 12/28/2011 22:47:11 | 1,003,104 | 10/19/2011 12:17:58 | 3 | 0 | (easy!) jQuery Script works with 1.4.1 but not in 1.7.1, different syntax? | sorry to ask, but i can't figure it out. The following script works in jQuery 1.4.1 but not in 1.7.1. I can't figure out the difference in the versions! Maybe you will know the problem.
$(".fade").hover(function(){
$(this).stop().animate({ opacity: 1.0 }, 400);
},
function () {
$(this).stop().animate({ opacity: 0.7 }, 400);
}
);
I hope you can help.
Regards | jquery | version | difference | null | null | 12/30/2011 00:25:00 | too localized | (easy!) jQuery Script works with 1.4.1 but not in 1.7.1, different syntax?
===
sorry to ask, but i can't figure it out. The following script works in jQuery 1.4.1 but not in 1.7.1. I can't figure out the difference in the versions! Maybe you will know the problem.
$(".fade").hover(function(){
$(this).stop().animate({ opacity: 1.0 }, 400);
},
function () {
$(this).stop().animate({ opacity: 0.7 }, 400);
}
);
I hope you can help.
Regards | 3 |
175,310 | 10/06/2008 17:31:16 | 20,646 | 09/22/2008 18:28:05 | 13 | 4 | How to improve java knowledge? | I'm in college. Basically I have already learnt the syntax of java from books and have been programming in java for two years (Not every other day of course, because it's a computer science and not software engineering course). However, I find myself lacking sufficient knowledge of java and feel inadequate.
For example, none of the books taught me that if I override the Object equals method, then I should override the hashCode method as well (if I want the hash containers to work properly). It was only when I couldn't get my program to run as expected and having to debug that I discovered this. I find this unproductive because I felt that it's something that should have been taught, something that should have been known in the first place. I expect that as I do more programming in java I'll run into similar "should have known" kind of problems, so I would just like to pre-empt it by learning more.
Perhaps I have been reading the wrong books, so can you point me to some good java books to read. Or is it the case that books are just to teach you the syntax, while the intricacies of java and the API should just be discovered the hard way. Or I should just read the entire API (granted the API mentions "Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.") and I admit that I didn't read it the first time round. | java | self-improvement | books | null | null | null | open | How to improve java knowledge?
===
I'm in college. Basically I have already learnt the syntax of java from books and have been programming in java for two years (Not every other day of course, because it's a computer science and not software engineering course). However, I find myself lacking sufficient knowledge of java and feel inadequate.
For example, none of the books taught me that if I override the Object equals method, then I should override the hashCode method as well (if I want the hash containers to work properly). It was only when I couldn't get my program to run as expected and having to debug that I discovered this. I find this unproductive because I felt that it's something that should have been taught, something that should have been known in the first place. I expect that as I do more programming in java I'll run into similar "should have known" kind of problems, so I would just like to pre-empt it by learning more.
Perhaps I have been reading the wrong books, so can you point me to some good java books to read. Or is it the case that books are just to teach you the syntax, while the intricacies of java and the API should just be discovered the hard way. Or I should just read the entire API (granted the API mentions "Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.") and I admit that I didn't read it the first time round. | 0 |
3,694,939 | 09/12/2010 13:08:14 | 240,958 | 12/30/2009 15:05:27 | 51 | 10 | UITableView reusable cells problem | I have a UITableView and its data gets refreshed from a server connection. For the UITableViewcell, I have layout some labels across the row. So it can consider as a grid with UILabels(total no of labels = table rows * table columns).
When the data gets refreshed I have added an animation for the UILabel to highlight the table cell update.(Labels background color changes for about 0.5 seconds and restore to the previous background color). There I compare the old value with new value and I added the animation with comparing those. It works fine.
My problem is when I scroll the table, because of the reusable cells the labels are getting animated.(although the corresponding values are not change). Anyone have an idea to how to avoid this issue? thanks. | iphone | objective-c | ipad | iphone-sdk-4.0 | null | null | open | UITableView reusable cells problem
===
I have a UITableView and its data gets refreshed from a server connection. For the UITableViewcell, I have layout some labels across the row. So it can consider as a grid with UILabels(total no of labels = table rows * table columns).
When the data gets refreshed I have added an animation for the UILabel to highlight the table cell update.(Labels background color changes for about 0.5 seconds and restore to the previous background color). There I compare the old value with new value and I added the animation with comparing those. It works fine.
My problem is when I scroll the table, because of the reusable cells the labels are getting animated.(although the corresponding values are not change). Anyone have an idea to how to avoid this issue? thanks. | 0 |
11,292,875 | 07/02/2012 11:36:59 | 1,495,921 | 07/02/2012 11:24:17 | 1 | 0 | Javascript framework for drawing Entity Relationship diagram | I would like to know the javascript diagramming framework that can be used for representing ER diagram in the UI.
The requirement includes
1. Panning (with less viewport, need to pan across if the database has lots of tables)
2. Zooming
3. Drag/Drop
4. Ability to connect two entities (arrows)
5. The Entity needs to be customizable - This is the major thing that I cant find in any of the frameworks. I need to have custom dom elements like table, form, div with layouts inside the default shapes like rectangle or whatever. By this I mean,I want to make a div into svg element and enable it to be treated as just like any other svg element.
Please let me know if there is anything available in the market for my requirements as early as possible!
Thanks in anticipation!
Sangeetha
| javascript | diagramming | null | null | null | 07/09/2012 18:17:03 | not constructive | Javascript framework for drawing Entity Relationship diagram
===
I would like to know the javascript diagramming framework that can be used for representing ER diagram in the UI.
The requirement includes
1. Panning (with less viewport, need to pan across if the database has lots of tables)
2. Zooming
3. Drag/Drop
4. Ability to connect two entities (arrows)
5. The Entity needs to be customizable - This is the major thing that I cant find in any of the frameworks. I need to have custom dom elements like table, form, div with layouts inside the default shapes like rectangle or whatever. By this I mean,I want to make a div into svg element and enable it to be treated as just like any other svg element.
Please let me know if there is anything available in the market for my requirements as early as possible!
Thanks in anticipation!
Sangeetha
| 4 |
8,392,079 | 12/05/2011 21:24:54 | 987,200 | 10/10/2011 07:00:05 | 12 | 0 | IRC-server on my PC | I want create IRC Server on my PC. My OS is xUbuntu, as a daemon I prefer to use ngircd. I have installed Apache web-server, and working DNS from no-ip.com with noip2. Now I want create on this DNS ICR server too. Can I set it? | linux | apache | irc | null | null | 12/05/2011 21:55:00 | off topic | IRC-server on my PC
===
I want create IRC Server on my PC. My OS is xUbuntu, as a daemon I prefer to use ngircd. I have installed Apache web-server, and working DNS from no-ip.com with noip2. Now I want create on this DNS ICR server too. Can I set it? | 2 |
10,712,968 | 05/23/2012 03:15:21 | 1,411,583 | 05/23/2012 03:06:48 | 1 | 0 | Use wildcard in SQL table entry | I have been looking around for such a solution, but no positive results so far...
My **table** consists of entries **data**, like
1. 1234
2. 3241
3. 8424
4. 8_24
5. 9_13
where '_' are wildcards which can be from 0-9.
I'd like to find a way to retrieve these data, like:
SELECT * from table WHERE data LIKE '8424', the query should return both 8424 and 8_24.
Thank you in advance! | sql | sql-server-2008 | visual-studio-2008 | wildcard | null | null | open | Use wildcard in SQL table entry
===
I have been looking around for such a solution, but no positive results so far...
My **table** consists of entries **data**, like
1. 1234
2. 3241
3. 8424
4. 8_24
5. 9_13
where '_' are wildcards which can be from 0-9.
I'd like to find a way to retrieve these data, like:
SELECT * from table WHERE data LIKE '8424', the query should return both 8424 and 8_24.
Thank you in advance! | 0 |
2,170,625 | 01/31/2010 05:10:43 | 262,885 | 01/31/2010 05:10:43 | 1 | 0 | Using a python module's C API in my own C module | This seems to be sort of what I want, except I want to make an instance of a C PyObject in another C module.
http://stackoverflow.com/questions/1147452/create-instance-of-a-python-class-declared-in-python-with-c-api
But I am not able to find the documentation for using a Python module from C. I can't seem to find the relevent docs online as everyone just talks about extending Python with C.
My issue is that I have a Pygame which I want to speed up. So I am making a C module which needs access to Pygame. How do I import pygame? I don't want to import two copies, right? The coding part I can figure out, I just don't know how to configure and link the code. I know I must be missing some docs, so if anyone can point me in the right direction, I'd be much obliged. | python | module | linker | pygame | null | null | open | Using a python module's C API in my own C module
===
This seems to be sort of what I want, except I want to make an instance of a C PyObject in another C module.
http://stackoverflow.com/questions/1147452/create-instance-of-a-python-class-declared-in-python-with-c-api
But I am not able to find the documentation for using a Python module from C. I can't seem to find the relevent docs online as everyone just talks about extending Python with C.
My issue is that I have a Pygame which I want to speed up. So I am making a C module which needs access to Pygame. How do I import pygame? I don't want to import two copies, right? The coding part I can figure out, I just don't know how to configure and link the code. I know I must be missing some docs, so if anyone can point me in the right direction, I'd be much obliged. | 0 |
8,255,339 | 11/24/2011 10:12:34 | 1,063,447 | 11/24/2011 07:42:15 | 1 | 0 | Mobile Website CSS and Java Script | i am trying to develop a mobile website. Please tell me which CSS and java script will be use. | javascript | css | mobile | null | null | 11/24/2011 13:31:34 | not a real question | Mobile Website CSS and Java Script
===
i am trying to develop a mobile website. Please tell me which CSS and java script will be use. | 1 |
499,348 | 01/31/2009 19:04:36 | 42,005 | 11/30/2008 22:13:40 | 95 | 13 | Free Perl IDE with Debugging | Are there any free Perl IDEs out there for Windows that have debugging capabilities, syntax highlighting, and possibly even intellisense? | perl | ide | debugging | null | null | 12/04/2011 18:21:12 | not constructive | Free Perl IDE with Debugging
===
Are there any free Perl IDEs out there for Windows that have debugging capabilities, syntax highlighting, and possibly even intellisense? | 4 |
10,645,629 | 05/18/2012 01:32:07 | 1,389,753 | 05/11/2012 15:11:41 | 16 | 0 | How do I append non numeric key-values to an array in PHP? | Trying to return a DB resultset as an array in my DAO:
I want to append string key-values to the array $retval in the below code. However, the array keeps getting overwritten each iteration instead of being appended to.
So at the end of the loop, I end up with 1 key-value instead of n pairs (n rows retrieved from the database). What am I doing wrong?
$retval = array();
while ($row = mysql_fetch_assoc($result)) {
foreach($columns as $var) {
$retval[$var]=$row[$var];
}
}
var_dump($retval);
$retval ends up as ["Japan"=>"Tokyo"] instead of the expected ["Korea"=>"Seoul","France"=>"Paris","Japan"=>"Tokyo"]
| php | null | null | null | null | null | open | How do I append non numeric key-values to an array in PHP?
===
Trying to return a DB resultset as an array in my DAO:
I want to append string key-values to the array $retval in the below code. However, the array keeps getting overwritten each iteration instead of being appended to.
So at the end of the loop, I end up with 1 key-value instead of n pairs (n rows retrieved from the database). What am I doing wrong?
$retval = array();
while ($row = mysql_fetch_assoc($result)) {
foreach($columns as $var) {
$retval[$var]=$row[$var];
}
}
var_dump($retval);
$retval ends up as ["Japan"=>"Tokyo"] instead of the expected ["Korea"=>"Seoul","France"=>"Paris","Japan"=>"Tokyo"]
| 0 |
10,472,134 | 05/06/2012 16:22:49 | 176,723 | 09/21/2009 18:15:55 | 1,661 | 104 | How to set link font for TTStyledTextLabel | So, I'm fairly new to Three20, but so far the benefits have outweighed the pains in my ass that it's taken to get things working.
I'm using some TTStyledTextLabels, and I need to use a particular font for links. I've overridden TTDefaultStyleSheet and added a new style, like so:
- (TTStyle*)futuraStyle {
return [TTTextStyle styleWithFont:[UIFont fontWithName:@"Futura-CondensedMedium" size:20] color:kColorTextLink next:nil];
}
I can use <span class=""> tags to apply this style to normal text, but it doesn't seem to affect links.
I found that if I add the style class directly to the links, as in
<a href="url" class="styleName">link!</a>
then the links do appear in the proper font. However, they are then no longer tappable! WTF? | three20 | uifont | ttstyledtextlabel | null | null | null | open | How to set link font for TTStyledTextLabel
===
So, I'm fairly new to Three20, but so far the benefits have outweighed the pains in my ass that it's taken to get things working.
I'm using some TTStyledTextLabels, and I need to use a particular font for links. I've overridden TTDefaultStyleSheet and added a new style, like so:
- (TTStyle*)futuraStyle {
return [TTTextStyle styleWithFont:[UIFont fontWithName:@"Futura-CondensedMedium" size:20] color:kColorTextLink next:nil];
}
I can use <span class=""> tags to apply this style to normal text, but it doesn't seem to affect links.
I found that if I add the style class directly to the links, as in
<a href="url" class="styleName">link!</a>
then the links do appear in the proper font. However, they are then no longer tappable! WTF? | 0 |
8,488,256 | 12/13/2011 11:18:02 | 996,611 | 10/15/2011 07:38:48 | 8 | 0 | How to download files with flash? | I develop game in shockwave. Shockwave downloads files slowly, so I want to download it to temp folder with flash. It could work in background, so users don't see it. (It could select files which need to download from db or from folder). How to do it? Or maybe I should select not flash, maybe java or what?
Can you suggest me what I should select and maybe something examples, how to do it? | flash | null | null | null | null | 04/27/2012 13:33:48 | not constructive | How to download files with flash?
===
I develop game in shockwave. Shockwave downloads files slowly, so I want to download it to temp folder with flash. It could work in background, so users don't see it. (It could select files which need to download from db or from folder). How to do it? Or maybe I should select not flash, maybe java or what?
Can you suggest me what I should select and maybe something examples, how to do it? | 4 |
8,903,011 | 01/17/2012 23:11:35 | 996,617 | 10/15/2011 07:46:00 | 1 | 0 | mission impossible: best android media player with chunk | It's so hard for me.. but i'd like merge this code
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/
with this:
http://mindtherobot.com/blog/633/android-performance-be-careful-with-byte/
I need chunks to avoid streaming interruptions.. I am not an advanced programmer, but i'd like understand how integrate these codes.
Thanks in advance for any advice
Alex | android | null | null | null | null | 01/18/2012 03:02:33 | too localized | mission impossible: best android media player with chunk
===
It's so hard for me.. but i'd like merge this code
http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/
with this:
http://mindtherobot.com/blog/633/android-performance-be-careful-with-byte/
I need chunks to avoid streaming interruptions.. I am not an advanced programmer, but i'd like understand how integrate these codes.
Thanks in advance for any advice
Alex | 3 |
10,157,066 | 04/14/2012 20:20:08 | 1,221,897 | 02/20/2012 19:56:32 | 1 | 0 | Implementation of key-Value without Map | Let's say the JVM doesn't have a Map implementation. How would you go ahead with implementing?
--I have gone thru other ques and ans,but didn't find a concrete answer.some one told do it lukin at original Map class or implement 2D array.will someone will answer wth peoper example | java | map | hashmap | null | null | 04/14/2012 21:44:19 | not a real question | Implementation of key-Value without Map
===
Let's say the JVM doesn't have a Map implementation. How would you go ahead with implementing?
--I have gone thru other ques and ans,but didn't find a concrete answer.some one told do it lukin at original Map class or implement 2D array.will someone will answer wth peoper example | 1 |
3,185,919 | 07/06/2010 11:53:02 | 222,588 | 12/02/2009 03:23:47 | 94 | 4 | publish image in facebook users wall from webos | in my application i select one image from photos and then press submit button selected image should publish in facebook user wall with some message.any idea
Thanks in advance
Aswan | webos | palm-pre | palm-os | null | null | null | open | publish image in facebook users wall from webos
===
in my application i select one image from photos and then press submit button selected image should publish in facebook user wall with some message.any idea
Thanks in advance
Aswan | 0 |
3,142,341 | 06/29/2010 15:44:37 | 336,929 | 12/10/2009 10:47:44 | 258 | 7 | ActionScript LineStyle Color Changing Prematurely | i'm attempting to draw lines beside each other, but the last line from the first color group takes on the color from the second color group before the second color is assigned. can anyone explain this?
//first color
corner.graphics.lineStyle(0, 0x00FF00, 1.0);
corner.graphics.moveTo(0, 10);
corner.graphics.lineTo(10, 0);
corner.graphics.moveTo(4, 10);
corner.graphics.lineTo(10, 4);
corner.graphics.moveTo(8, 10);
corner.graphics.lineTo(10, 8); //the color of this line is red!?
//second color
corner.graphics.lineStyle(0, 0xFF0000, 1.0);
corner.graphics.moveTo(1, 10);
corner.graphics.lineTo(10, 1);
| actionscript-3 | graphics | line | draw | null | null | open | ActionScript LineStyle Color Changing Prematurely
===
i'm attempting to draw lines beside each other, but the last line from the first color group takes on the color from the second color group before the second color is assigned. can anyone explain this?
//first color
corner.graphics.lineStyle(0, 0x00FF00, 1.0);
corner.graphics.moveTo(0, 10);
corner.graphics.lineTo(10, 0);
corner.graphics.moveTo(4, 10);
corner.graphics.lineTo(10, 4);
corner.graphics.moveTo(8, 10);
corner.graphics.lineTo(10, 8); //the color of this line is red!?
//second color
corner.graphics.lineStyle(0, 0xFF0000, 1.0);
corner.graphics.moveTo(1, 10);
corner.graphics.lineTo(10, 1);
| 0 |
1,337,457 | 08/26/2009 20:59:44 | 36,680 | 11/11/2008 19:51:55 | 645 | 10 | How to write good help pages for rich web based application screens? | I'm working on writing help pages for a web based application. What tools, resources, and/or best practices are there to write help pages that are geared towards individual pages of a rich web application with a lot of functionality?
The help system will have a button on each screen that help is available for, when the user clicks on that button a new browser window with its toolbar stripped off will popup to give help documentation for that page.
These help pages are very common in Windows and shrink wrapped software, but I can't remember seeing any web applications that use them, Gmail, Google Calendar, and google docs have well written documentation, but I actually think they don't do a good job of giving you help documentation that is relevant to the screen you are looking at.
| web-applications | null | null | null | null | 06/29/2012 16:22:25 | off topic | How to write good help pages for rich web based application screens?
===
I'm working on writing help pages for a web based application. What tools, resources, and/or best practices are there to write help pages that are geared towards individual pages of a rich web application with a lot of functionality?
The help system will have a button on each screen that help is available for, when the user clicks on that button a new browser window with its toolbar stripped off will popup to give help documentation for that page.
These help pages are very common in Windows and shrink wrapped software, but I can't remember seeing any web applications that use them, Gmail, Google Calendar, and google docs have well written documentation, but I actually think they don't do a good job of giving you help documentation that is relevant to the screen you are looking at.
| 2 |
9,664,542 | 03/12/2012 09:30:31 | 725,072 | 04/26/2011 09:10:31 | 13 | 3 | JDBC event subscribe Oracle | I'd like to monitor changes in Oracle DB using JDBC connection.
Does anyone knows if it is possible to subscribe to DB events and receive events through callbacks? I do not want to poll tables for changes explicitly.
Regards,
Vladimir | oracle | events | jdbc | callback | null | null | open | JDBC event subscribe Oracle
===
I'd like to monitor changes in Oracle DB using JDBC connection.
Does anyone knows if it is possible to subscribe to DB events and receive events through callbacks? I do not want to poll tables for changes explicitly.
Regards,
Vladimir | 0 |
8,830,703 | 01/12/2012 05:50:38 | 1,144,776 | 01/12/2012 05:45:24 | 1 | 0 | Subreport's Page Header missing from main report | I have a subreport with some labels in page header. When I run my subreport alone then everything is ok but when it runs through the main report then page header is dissapeared. I am forced to move tese labels from page header to report header but this is not the right way because if the subreport has to be expand to next page through the main report then the labels will not be shown. I am stuck. | rdlc | null | null | null | null | null | open | Subreport's Page Header missing from main report
===
I have a subreport with some labels in page header. When I run my subreport alone then everything is ok but when it runs through the main report then page header is dissapeared. I am forced to move tese labels from page header to report header but this is not the right way because if the subreport has to be expand to next page through the main report then the labels will not be shown. I am stuck. | 0 |
2,588,930 | 04/06/2010 23:03:58 | 32,196 | 10/28/2008 20:46:14 | 93 | 5 | "Using a single session in multiple threads is likely a bug" error in NHProf when using NServiceBus | When executing an NServiceBus handler that uses NHibernate for its data access operations, I am seeing an error that I am not sure if I need to be concerned with.
The handler has code that does something like this:
using (var tx = Session.BeginTransaction())
{
var accountGroup = _groupRepository.FindByID(message.GroupID);
accountGroup.CreateAccount(message.AccountNumber);
tx.Commit();
}
When I profile this process, I see the following lines:
- enlisted session in distributed transaction with isolation level: Serializable
- begin transaction with isolation level: Unspecified
- SELECT ... FROM AccountGroups this_ WHERE this_.ID = 123
- INSERT INTO Accounts ...
- commit transaction
- commit transaction
The first commit message is generated by my code when I call tx.Commit(). The second commit message, I believe occurs when we leave the Handle method of the handler and is called by NServiceBus. This second call to commit generates an alert in NHProf that states "Using a single session in multiple threads is likely a bug".
I don't think this is an issue, because there really is nothing to commit at that time, but am I doing some inappropriate here? I do want to run my code within a transaction, but when I do, I get this alert.
Any ideas?
| nservicebus | nhprof | nhibernate | null | null | null | open | "Using a single session in multiple threads is likely a bug" error in NHProf when using NServiceBus
===
When executing an NServiceBus handler that uses NHibernate for its data access operations, I am seeing an error that I am not sure if I need to be concerned with.
The handler has code that does something like this:
using (var tx = Session.BeginTransaction())
{
var accountGroup = _groupRepository.FindByID(message.GroupID);
accountGroup.CreateAccount(message.AccountNumber);
tx.Commit();
}
When I profile this process, I see the following lines:
- enlisted session in distributed transaction with isolation level: Serializable
- begin transaction with isolation level: Unspecified
- SELECT ... FROM AccountGroups this_ WHERE this_.ID = 123
- INSERT INTO Accounts ...
- commit transaction
- commit transaction
The first commit message is generated by my code when I call tx.Commit(). The second commit message, I believe occurs when we leave the Handle method of the handler and is called by NServiceBus. This second call to commit generates an alert in NHProf that states "Using a single session in multiple threads is likely a bug".
I don't think this is an issue, because there really is nothing to commit at that time, but am I doing some inappropriate here? I do want to run my code within a transaction, but when I do, I get this alert.
Any ideas?
| 0 |
5,920,839 | 05/07/2011 11:51:40 | 1,259,673 | 11/22/2010 19:44:58 | 161 | 8 | Vector subscript out of range | I'm getting the vector subscript out of range error. I've had it before, but it prints 'before' but not after and I can't see how it could be any of these lines.
cout << "before" << endl;
vector<vector<char>> animals;
vector<vector<char>> food;
vector<char> other;
int lastline = 0;
for(int i=1;i<=(c);i++){
cout << "after" << endl; | c++ | vector | range | subscript | null | 05/07/2011 21:44:32 | not a real question | Vector subscript out of range
===
I'm getting the vector subscript out of range error. I've had it before, but it prints 'before' but not after and I can't see how it could be any of these lines.
cout << "before" << endl;
vector<vector<char>> animals;
vector<vector<char>> food;
vector<char> other;
int lastline = 0;
for(int i=1;i<=(c);i++){
cout << "after" << endl; | 1 |
9,856,927 | 03/25/2012 00:31:33 | 945,418 | 09/14/2011 19:51:40 | 6 | 0 | Awk/Nawk : Pattern for extracting path/filenames from input | Input contains filenames (/path/to/file) scattered throughout
I just want the /path/to/xyz.xyz (space or newline, but never '\\ ' [a space in a file])
The rule is: Starts with '/' - begin
End at ' ' (but not '\\ ') or '\n'
Everything in between.
Only paths+basename attached.. Not basenames.
| regex | string | bash | awk | processing | 03/26/2012 13:26:26 | not a real question | Awk/Nawk : Pattern for extracting path/filenames from input
===
Input contains filenames (/path/to/file) scattered throughout
I just want the /path/to/xyz.xyz (space or newline, but never '\\ ' [a space in a file])
The rule is: Starts with '/' - begin
End at ' ' (but not '\\ ') or '\n'
Everything in between.
Only paths+basename attached.. Not basenames.
| 1 |
10,505,949 | 05/08/2012 20:25:23 | 1,251,004 | 03/05/2012 23:13:56 | 338 | 0 | Debian, mysql: How can I tune these values | I have a debian VPS with 16 GB ram (CPU: 4 * 2Ghz).
I notice some performance issues when I now have about 2,000 request / seconds.
The CPU is at:
41% user, 8% kernel, 2% IO, 49% idle
and ram:
15.71 GB total, 4.97 GB used
I'm a complete noob when it comes to servers, so I dont want to mess around to much. I notice a performance increase when raising max_connections from 1,000 to 2,000, and increased key_buffer from 512 to 1024M.
If anyone could take a look at the values below, and let me know if there's any tweaks I can do, that would be awesome. Thanks in advance:
# * Fine Tuning
#
key_buffer = 1024M
max_allowed_packet = 512M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 2000
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 32M
query_cache_size = 128M | mysql | apache | apache2 | debian | null | null | open | Debian, mysql: How can I tune these values
===
I have a debian VPS with 16 GB ram (CPU: 4 * 2Ghz).
I notice some performance issues when I now have about 2,000 request / seconds.
The CPU is at:
41% user, 8% kernel, 2% IO, 49% idle
and ram:
15.71 GB total, 4.97 GB used
I'm a complete noob when it comes to servers, so I dont want to mess around to much. I notice a performance increase when raising max_connections from 1,000 to 2,000, and increased key_buffer from 512 to 1024M.
If anyone could take a look at the values below, and let me know if there's any tweaks I can do, that would be awesome. Thanks in advance:
# * Fine Tuning
#
key_buffer = 1024M
max_allowed_packet = 512M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 2000
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 32M
query_cache_size = 128M | 0 |
3,123,542 | 06/26/2010 10:37:46 | 93,613 | 04/21/2009 06:42:14 | 697 | 62 | Is leaving comments on code a thing of past? | When i started my carreer i have been instructed to (properly) comment each and every module that i write. Instructing what a method does, how its parameters are used, and what to expect in return etc.
Then with almost 2years of doing so i started visiting legacy codes with misleading and/or useless comments. And in the process i used to remove them from the code base.
In my recent job my project manager instructed me not to worry about leaving comments at all, and suggested to rather rely on unit tests to leave a blueprint of the code i write. I agreed since i have experienced that code changes with time but comments do not stay up to date, and then it becomes rather misleading.
Then recently i read in Martin Fowler's Refactoring book to extract method wherever we see scope of leaving some comments. So is leaving comments in the modules is really an obsolete thing now?
Just to summarize:
As per my experience, we should not leave comments and rather take the following two options:
1) Extract method.
2) Unit Test to support the intent of the module.
So, should we always avoid leaving comments and rely on above two options? or do we have other alternates also? Please share your opinion.
Thanks for your interest. | project-management | code-review | code-comments | null | null | 06/27/2010 19:09:59 | not constructive | Is leaving comments on code a thing of past?
===
When i started my carreer i have been instructed to (properly) comment each and every module that i write. Instructing what a method does, how its parameters are used, and what to expect in return etc.
Then with almost 2years of doing so i started visiting legacy codes with misleading and/or useless comments. And in the process i used to remove them from the code base.
In my recent job my project manager instructed me not to worry about leaving comments at all, and suggested to rather rely on unit tests to leave a blueprint of the code i write. I agreed since i have experienced that code changes with time but comments do not stay up to date, and then it becomes rather misleading.
Then recently i read in Martin Fowler's Refactoring book to extract method wherever we see scope of leaving some comments. So is leaving comments in the modules is really an obsolete thing now?
Just to summarize:
As per my experience, we should not leave comments and rather take the following two options:
1) Extract method.
2) Unit Test to support the intent of the module.
So, should we always avoid leaving comments and rely on above two options? or do we have other alternates also? Please share your opinion.
Thanks for your interest. | 4 |
10,332,262 | 04/26/2012 11:13:56 | 840,830 | 07/12/2011 13:38:40 | 76 | 0 | Call php with onclick (faster loadingtime) | Im building a Magento platform webshop.
I call a content block in the template with:
<a href="#tab">TAB BUTTON</a>
<div id="tab"><?php echo $this->getChildHtml('CONTENT'); ?></div>
Only the content of getchildhtml is too large to load at once. Is it possible to load the php echo once clicked on the button?
Display-none will still preload the content, but i'm looking too load the php content of getchildhtml.
| php | javascript | jquery | tabs | null | 06/14/2012 11:58:38 | not a real question | Call php with onclick (faster loadingtime)
===
Im building a Magento platform webshop.
I call a content block in the template with:
<a href="#tab">TAB BUTTON</a>
<div id="tab"><?php echo $this->getChildHtml('CONTENT'); ?></div>
Only the content of getchildhtml is too large to load at once. Is it possible to load the php echo once clicked on the button?
Display-none will still preload the content, but i'm looking too load the php content of getchildhtml.
| 1 |
8,779,140 | 01/08/2012 16:26:38 | 1,137,270 | 01/08/2012 16:15:40 | 1 | 0 | Web Browser application auto start in windows | We are developing a web browser application and I have 2 important questions, as below:
1. Is it possible to 'auto run/launch' our web browser application on PC startup in Windows? If yes, please let me know all options available.
2. When the browser is minimized, can I flash the browser in taskbar when data is updated? If yes, please provide example code/options.
many thanks in advance.
Murthy | web | null | null | null | null | 03/11/2012 14:07:19 | not a real question | Web Browser application auto start in windows
===
We are developing a web browser application and I have 2 important questions, as below:
1. Is it possible to 'auto run/launch' our web browser application on PC startup in Windows? If yes, please let me know all options available.
2. When the browser is minimized, can I flash the browser in taskbar when data is updated? If yes, please provide example code/options.
many thanks in advance.
Murthy | 1 |
9,688,781 | 03/13/2012 17:14:05 | 1,204,895 | 02/12/2012 09:11:52 | 1 | 0 | Why you can put php.ini variables into .htaccess? | As in the topic - why you can put them in .htaccess.
I always thought that it should be in php.ini not in .htaccess.
.htaccess
php_value max_execution_time 240
php_value max_input_time 111
php.ini
max_execution_time 240
max_input_time 111
Why it can be like that? | php | apache | .htaccess | config | php.ini | 03/13/2012 17:17:03 | not a real question | Why you can put php.ini variables into .htaccess?
===
As in the topic - why you can put them in .htaccess.
I always thought that it should be in php.ini not in .htaccess.
.htaccess
php_value max_execution_time 240
php_value max_input_time 111
php.ini
max_execution_time 240
max_input_time 111
Why it can be like that? | 1 |
7,061,184 | 08/15/2011 02:24:28 | 596,573 | 01/31/2011 09:01:30 | 3 | 0 | Why is linear search still advertised to have a time complexity of O(N)? | It occurs to me that linear search is not really O(N) as one has to deal with cache misses. This leads me to wonder why linear searches are still advertised as having a time complexity O(N)? Shouldn't one take into account of the "distance" of the memory cell from the CPU? Besides signal propagation due to speed of light is a physical limitation nobody can escape from. Over here I'm discussing about classical, not quantum computing.
Let's do a quick analysis of what would be a reasonable bound of a linear search algorithm in the real world. Let us assume an infinitesimally small CPU encased at the centre of a spherical mass of memory cells. Each cell is implemented using a constant number of transistors k. The number of transistors per unit volume is rho. The CPU has a read/write line and a data line to every memory cell (pretend that routing these lines are not an issue), and the CPU is only capable of reading/writing to a single bit at any instant. Over here we need to find the time required to execute a linear search over N memory bits.
(Not enough rep to post images, but here is a link to a diagram I'm trying to illustrate the problem)
http://img51.imageshack.us/img51/7361/searchqn.png
**Radius of sphere**
The total volume required would be N*k/rho. Given the radius of the sphere which is required to contain all memory cells be R, we got (4/3)*pi*R^3 = N*k/rho, or R = a*N^(1/3) for some constant a.
**Elemental shell dV(r)**
Consider an elemental shell dV(r) = 4*pi*r^2*dr (grey shell in diagram) consisting of dV*rho/k memory bits residing in it. The CPU requires a time no less than 2*r/c to read/update a memory bit residing within this dV (first to assert the R/W line, and then expecting a reply from the memory cell), where c is the speed of light.
**Integrating dt**
The time taken to interface with all memory cells residing in dV(r) is given by dt = (Number of cells in dV)*(Time taken to interface each cell) = (8*pi*rho*r^3*dr)/(k*c) = b*r^3*dr for some constant b. The total time taken, T, would be the integral of b*r^3 with respect to r from r=0..a*N^(1/3), that gives us T = (b*a^4*N^(4/3))/4 = **O(N^(4/3))**.
I don't think this analysis is overkill as of now three levels of caches in computer systems is not uncommon. Soon (who knows) there might be multi-tier memory models where the distance of the memory cell from the CPU can be taken to be continuous.
*PS: For those who are interested, the time complexity for the cases where the memory cells are laid out linearly and laid out uniformly on a circular disk are O(N^2) and O(N^(3/2)) respectively. I believe the case where the transistors are distributed around in a sphere is the most optimal way in terms of efficient interfacing between CPU and memory cells.* | search | time-complexity | null | null | null | 08/15/2011 15:51:18 | not a real question | Why is linear search still advertised to have a time complexity of O(N)?
===
It occurs to me that linear search is not really O(N) as one has to deal with cache misses. This leads me to wonder why linear searches are still advertised as having a time complexity O(N)? Shouldn't one take into account of the "distance" of the memory cell from the CPU? Besides signal propagation due to speed of light is a physical limitation nobody can escape from. Over here I'm discussing about classical, not quantum computing.
Let's do a quick analysis of what would be a reasonable bound of a linear search algorithm in the real world. Let us assume an infinitesimally small CPU encased at the centre of a spherical mass of memory cells. Each cell is implemented using a constant number of transistors k. The number of transistors per unit volume is rho. The CPU has a read/write line and a data line to every memory cell (pretend that routing these lines are not an issue), and the CPU is only capable of reading/writing to a single bit at any instant. Over here we need to find the time required to execute a linear search over N memory bits.
(Not enough rep to post images, but here is a link to a diagram I'm trying to illustrate the problem)
http://img51.imageshack.us/img51/7361/searchqn.png
**Radius of sphere**
The total volume required would be N*k/rho. Given the radius of the sphere which is required to contain all memory cells be R, we got (4/3)*pi*R^3 = N*k/rho, or R = a*N^(1/3) for some constant a.
**Elemental shell dV(r)**
Consider an elemental shell dV(r) = 4*pi*r^2*dr (grey shell in diagram) consisting of dV*rho/k memory bits residing in it. The CPU requires a time no less than 2*r/c to read/update a memory bit residing within this dV (first to assert the R/W line, and then expecting a reply from the memory cell), where c is the speed of light.
**Integrating dt**
The time taken to interface with all memory cells residing in dV(r) is given by dt = (Number of cells in dV)*(Time taken to interface each cell) = (8*pi*rho*r^3*dr)/(k*c) = b*r^3*dr for some constant b. The total time taken, T, would be the integral of b*r^3 with respect to r from r=0..a*N^(1/3), that gives us T = (b*a^4*N^(4/3))/4 = **O(N^(4/3))**.
I don't think this analysis is overkill as of now three levels of caches in computer systems is not uncommon. Soon (who knows) there might be multi-tier memory models where the distance of the memory cell from the CPU can be taken to be continuous.
*PS: For those who are interested, the time complexity for the cases where the memory cells are laid out linearly and laid out uniformly on a circular disk are O(N^2) and O(N^(3/2)) respectively. I believe the case where the transistors are distributed around in a sphere is the most optimal way in terms of efficient interfacing between CPU and memory cells.* | 1 |
6,484,682 | 06/26/2011 14:51:38 | 818,566 | 01/15/2011 14:44:58 | 3 | 0 | error in backup from database? | i want backup and restore database with this code
string cmd = @"BACKUP DATABASE [" + Application.StartupPath + @"\KANOON.MDF]
TO DISK = N'"+filename +"'";
but in same path such as Desktop con not get backup?
please help me? | c# | null | null | null | null | 06/26/2011 15:00:27 | not a real question | error in backup from database?
===
i want backup and restore database with this code
string cmd = @"BACKUP DATABASE [" + Application.StartupPath + @"\KANOON.MDF]
TO DISK = N'"+filename +"'";
but in same path such as Desktop con not get backup?
please help me? | 1 |
2,707,649 | 04/25/2010 08:40:04 | 166,850 | 09/01/2009 20:26:48 | 1,036 | 93 | wave.getState() returns null | When trying to call wave.getState() in my Google Wave gadget, I get back null (no state object). How can I initialize the Wave state object? I am working in the Wave Sandbox.
My ModulePrefs contains the following:
<Require feature="wave" />
<Require feature="rpc"/>
I got the "rpc" feature from some google groups post when searching for a fix, but it doesn't seem to be any help.
The gadget contains a jQuery plugin, which defines the classes I use (not shown), attaches an event handler to the link that shows up in edit mode, and sets up the callback methods with the google wave gadget initializer:
$.fn.extend({
$.gork.InitPass.newButtonClick = function newButtonClick() {
var jer = new $.gork.InitPass.Player('Jeremias', 12, 2);
var delta = {};
delta[jer.name] = jer.serialize();
wave.getState().submitDelta(delta);
};
$.gork.InitPass.modeCallback = function modeCallback() {
var state = wave.getState();
var mode = wave.getMode();
$.gork.InitPass.getContainer().ipCombatState(state, (mode == wave.Mode.EDIT));
};
$.gork.InitPass.stateCallback = function stateCallback() {
$.gork.InitPass.getContainer().ipCombatState(
wave.getState(), (wave.getMode() == wave.Mode.EDIT));
alert('state');
};
$.gork.InitPass.init = function init() {
if (wave && wave.isInWaveContainer()) {
var mode = wave.getMode();
$('.gork-ip-container').ipCombatState(null, (mode == wave.Mode.EDIT));
wave.setModeCallback($.gork.InitPass.modeCallback);
wave.setStateCallback($.gork.InitPass.stateCallback);
}
};
})(jQuery);
gadgets.util.registerOnLoadHandler($.gork.InitPass.init);
$(function ready() {
$.gork.InitPass.getContainer().find('.gork-ip-edit .addSection a.newButton').click(
$.gork.InitPass.newButtonClick);
});
So there are two main pieces of functionality here:
- When the mode changes, ipCombatState(...) is called. This changes the visual appearance of the gadget when the user puts the gadget in Edit mode (CTRL+E), by hiding the view DIV and displaying the edit DIV.
- The newButtonClick callback (which is attached to the link "a.newButton" in the edit container) is supposed to add Jeremias (Nate's Shadowrun character) to the gadget state, so that he'll be appear as a table row in edit mode.
I have verified that the initializer method is called, and the view/edit mode switch works just fine (except the state is null). When I click on the new button link (the link at the bottom in edit mode), and trigger the newButtonClick handler, I get an error because wave.getState() also returns null.
How can I initialize the wave state so that I can work with it?
The purpose of my gadget will be to keep track of combat initiative order in a Shadowrun tabletop game (4th Ed). You can test it out in Wave and see what I have so far:
[http://gorkwobble.herobo.com/wave/init-pass.xml][1]
The actual javascript code is externalized to:
[http://gorkwobble.herobo.com/wave/init-pass.js][2]
[1]: http://gorkwobble.herobo.com/wave/init-pass.xml
[2]: http://gorkwobble.herobo.com/wave/init-pass.js
P.S. If any Shadowrun players read this, and want to hear about it when I get the gadget working, leave a comment and I'll wave you. | google-wave | javascript | jquery | getstate | null | 05/21/2011 22:27:19 | too localized | wave.getState() returns null
===
When trying to call wave.getState() in my Google Wave gadget, I get back null (no state object). How can I initialize the Wave state object? I am working in the Wave Sandbox.
My ModulePrefs contains the following:
<Require feature="wave" />
<Require feature="rpc"/>
I got the "rpc" feature from some google groups post when searching for a fix, but it doesn't seem to be any help.
The gadget contains a jQuery plugin, which defines the classes I use (not shown), attaches an event handler to the link that shows up in edit mode, and sets up the callback methods with the google wave gadget initializer:
$.fn.extend({
$.gork.InitPass.newButtonClick = function newButtonClick() {
var jer = new $.gork.InitPass.Player('Jeremias', 12, 2);
var delta = {};
delta[jer.name] = jer.serialize();
wave.getState().submitDelta(delta);
};
$.gork.InitPass.modeCallback = function modeCallback() {
var state = wave.getState();
var mode = wave.getMode();
$.gork.InitPass.getContainer().ipCombatState(state, (mode == wave.Mode.EDIT));
};
$.gork.InitPass.stateCallback = function stateCallback() {
$.gork.InitPass.getContainer().ipCombatState(
wave.getState(), (wave.getMode() == wave.Mode.EDIT));
alert('state');
};
$.gork.InitPass.init = function init() {
if (wave && wave.isInWaveContainer()) {
var mode = wave.getMode();
$('.gork-ip-container').ipCombatState(null, (mode == wave.Mode.EDIT));
wave.setModeCallback($.gork.InitPass.modeCallback);
wave.setStateCallback($.gork.InitPass.stateCallback);
}
};
})(jQuery);
gadgets.util.registerOnLoadHandler($.gork.InitPass.init);
$(function ready() {
$.gork.InitPass.getContainer().find('.gork-ip-edit .addSection a.newButton').click(
$.gork.InitPass.newButtonClick);
});
So there are two main pieces of functionality here:
- When the mode changes, ipCombatState(...) is called. This changes the visual appearance of the gadget when the user puts the gadget in Edit mode (CTRL+E), by hiding the view DIV and displaying the edit DIV.
- The newButtonClick callback (which is attached to the link "a.newButton" in the edit container) is supposed to add Jeremias (Nate's Shadowrun character) to the gadget state, so that he'll be appear as a table row in edit mode.
I have verified that the initializer method is called, and the view/edit mode switch works just fine (except the state is null). When I click on the new button link (the link at the bottom in edit mode), and trigger the newButtonClick handler, I get an error because wave.getState() also returns null.
How can I initialize the wave state so that I can work with it?
The purpose of my gadget will be to keep track of combat initiative order in a Shadowrun tabletop game (4th Ed). You can test it out in Wave and see what I have so far:
[http://gorkwobble.herobo.com/wave/init-pass.xml][1]
The actual javascript code is externalized to:
[http://gorkwobble.herobo.com/wave/init-pass.js][2]
[1]: http://gorkwobble.herobo.com/wave/init-pass.xml
[2]: http://gorkwobble.herobo.com/wave/init-pass.js
P.S. If any Shadowrun players read this, and want to hear about it when I get the gadget working, leave a comment and I'll wave you. | 3 |
8,432,404 | 12/08/2011 14:19:34 | 1,087,908 | 12/08/2011 14:12:03 | 1 | 0 | Starting with C++ and Python | I've started to venture into python. The Ctype modules greatly interests me, but I find it hard to find a good tutorial/book on the subject.
Does anyone have any good resources **besides** the python.org site on how to get started with c++ and python?
Books, blogs, and general samples very welcome.
Also, what is a good compiler for c++? Visual Studios is ok, but about 12 years ago I used Borland C++ which I liked. Is there anything like that out there today?
Thanks everyone.
| c++ | python | resources | null | null | 12/08/2011 14:22:31 | not constructive | Starting with C++ and Python
===
I've started to venture into python. The Ctype modules greatly interests me, but I find it hard to find a good tutorial/book on the subject.
Does anyone have any good resources **besides** the python.org site on how to get started with c++ and python?
Books, blogs, and general samples very welcome.
Also, what is a good compiler for c++? Visual Studios is ok, but about 12 years ago I used Borland C++ which I liked. Is there anything like that out there today?
Thanks everyone.
| 4 |
10,129,717 | 04/12/2012 18:38:07 | 1,040,498 | 11/10/2011 20:07:28 | 56 | 3 | How access to a single NumPy array in a DICOMDIR file with pydicom? | I am using DICOM with Python and Pydicom library, when I have used .dcm files I hadn't problems. But I am using DICOMDIR data sets now.
My code is the next:
ds = dicom.read_file("dicomdir")
I tried to access to the <code>pixel_array</code> elements as follows:
data = ds.pixel_array
And I get the next error: <code>TypeError: No pixel data found in this dataset.</code>
The output for <code>print ds</code> is more or less the next:
(0004, 1130) File-set ID CS: 'GEMS_11_10_111'
(0004, 1200) Offset of the First Directory Recor UL: 412
(0004, 1202) Offset of the Last Directory Record UL: 412
(0004, 1212) File-set Consistency Flag US: 0
(0004, 1220) Directory Record Sequence 7 item(s) ----
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 558
(0004, 1430) Directory Record Type CS: 'PATIENT'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0010, 0010) Patient's Name PN: '------------------'
(0010, 0020) Patient ID LO: '246992'
(0010, 0030) Patient's Birth Date DA: '19630523'
(0010, 0040) Patient's Sex CS: 'F'
---------
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 800
(0004, 1430) Directory Record Type CS: 'STUDY'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0020) Study Date DA: '20111011'
(0008, 0030) Study Time TM: '151535.000000'
(0008, 0050) Accession Number SH: '1009819901'
(0008, 1030) Study Description LO: 'MG CONVENCIONAL'
(0020, 000d) Study Instance UID UI: 1.2.840.113564.9.1.2005121220021252.20110608105548.21009819901
(0020, 0010) Study ID SH: '1009819901'
---------
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 968
(0004, 1430) Directory Record Type CS: 'SERIES'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0060) Modality CS: 'MG'
(0008, 103e) Series Description LO: 'Screen Save'
(0020, 000e) Series Instance UID UI: 1.2.840.113619.2.144.2347322947.2192645372.5
(0020, 0011) Series Number IS: '354'
---------
(0004, 1400) Offset of the Next Directory Record UL: 1298
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 0
(0004, 1430) Directory Record Type CS: 'IMAGE'
(0004, 1500) Referenced File ID CS: ['DICOM', 'PA1', 'ST1', 'SE1', 'IM1']
(0004, 1510) Referenced SOP Class UID in File UI: Secondary Capture Image Storage
(0004, 1511) Referenced SOP Instance UID in File UI: 1.2.840.113619.2.144.44653394.14990.1318380911.86
(0004, 1512) Referenced Transfer Syntax UID in F UI: Explicit VR Little Endian
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0008) Image Type CS: 'DERIVED'
(0008, 0023) Content Date DA: '20111011'
(0008, 0033) Content Time TM: '151909.000000'
(0020, 0013) Instance Number IS: '8844'
(0028, 0010) Rows US: 2298
(0028, 0011) Columns US: 1980
(0028, 1052) Rescale Intercept DS: '0'
(0028, 1053) Rescale Slope DS: '1'
---------
The last part is repeated four times. I have 4 images in my DICOMDIR dataset.
Do you know how access to the field with the Numpy Array for each image?
| python | numpy | dicom | null | null | null | open | How access to a single NumPy array in a DICOMDIR file with pydicom?
===
I am using DICOM with Python and Pydicom library, when I have used .dcm files I hadn't problems. But I am using DICOMDIR data sets now.
My code is the next:
ds = dicom.read_file("dicomdir")
I tried to access to the <code>pixel_array</code> elements as follows:
data = ds.pixel_array
And I get the next error: <code>TypeError: No pixel data found in this dataset.</code>
The output for <code>print ds</code> is more or less the next:
(0004, 1130) File-set ID CS: 'GEMS_11_10_111'
(0004, 1200) Offset of the First Directory Recor UL: 412
(0004, 1202) Offset of the Last Directory Record UL: 412
(0004, 1212) File-set Consistency Flag US: 0
(0004, 1220) Directory Record Sequence 7 item(s) ----
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 558
(0004, 1430) Directory Record Type CS: 'PATIENT'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0010, 0010) Patient's Name PN: '------------------'
(0010, 0020) Patient ID LO: '246992'
(0010, 0030) Patient's Birth Date DA: '19630523'
(0010, 0040) Patient's Sex CS: 'F'
---------
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 800
(0004, 1430) Directory Record Type CS: 'STUDY'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0020) Study Date DA: '20111011'
(0008, 0030) Study Time TM: '151535.000000'
(0008, 0050) Accession Number SH: '1009819901'
(0008, 1030) Study Description LO: 'MG CONVENCIONAL'
(0020, 000d) Study Instance UID UI: 1.2.840.113564.9.1.2005121220021252.20110608105548.21009819901
(0020, 0010) Study ID SH: '1009819901'
---------
(0004, 1400) Offset of the Next Directory Record UL: 0
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 968
(0004, 1430) Directory Record Type CS: 'SERIES'
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0060) Modality CS: 'MG'
(0008, 103e) Series Description LO: 'Screen Save'
(0020, 000e) Series Instance UID UI: 1.2.840.113619.2.144.2347322947.2192645372.5
(0020, 0011) Series Number IS: '354'
---------
(0004, 1400) Offset of the Next Directory Record UL: 1298
(0004, 1410) Record In-use Flag US: 65535
(0004, 1420) Offset of Referenced Lower-Level Di UL: 0
(0004, 1430) Directory Record Type CS: 'IMAGE'
(0004, 1500) Referenced File ID CS: ['DICOM', 'PA1', 'ST1', 'SE1', 'IM1']
(0004, 1510) Referenced SOP Class UID in File UI: Secondary Capture Image Storage
(0004, 1511) Referenced SOP Instance UID in File UI: 1.2.840.113619.2.144.44653394.14990.1318380911.86
(0004, 1512) Referenced Transfer Syntax UID in F UI: Explicit VR Little Endian
(0008, 0005) Specific Character Set CS: 'ISO_IR 100'
(0008, 0008) Image Type CS: 'DERIVED'
(0008, 0023) Content Date DA: '20111011'
(0008, 0033) Content Time TM: '151909.000000'
(0020, 0013) Instance Number IS: '8844'
(0028, 0010) Rows US: 2298
(0028, 0011) Columns US: 1980
(0028, 1052) Rescale Intercept DS: '0'
(0028, 1053) Rescale Slope DS: '1'
---------
The last part is repeated four times. I have 4 images in my DICOMDIR dataset.
Do you know how access to the field with the Numpy Array for each image?
| 0 |
3,153,491 | 06/30/2010 21:18:18 | 173,432 | 09/14/2009 22:45:13 | 273 | 5 | Load Testing tool for web applications | I am trying to load test a web application, but I am having a hard time finding good tools that are affordable. I cam across Web Performance Load Testing Tool which is pretty cool, but limits you to 10 users and after that it costs thousands.
Does anyone know any good techniques for load testing a web application?
Thanks | asp.net | testing | load-testing | null | null | 01/19/2012 19:49:48 | not constructive | Load Testing tool for web applications
===
I am trying to load test a web application, but I am having a hard time finding good tools that are affordable. I cam across Web Performance Load Testing Tool which is pretty cool, but limits you to 10 users and after that it costs thousands.
Does anyone know any good techniques for load testing a web application?
Thanks | 4 |
3,811,212 | 09/28/2010 09:07:15 | 431,434 | 08/26/2010 03:53:57 | 79 | 3 | Expert in one language or know more languages | In the corporate world, Is it better to knowledgeable(by knowledgeable I mean not a expert or novice but with some coding experience) about multiple languages.
or
is it better to be an expert in one language(say c++ or java) but having just basic knowledge on others.
I ask this question because what I feel is languages can be differentiated based on the features they provide like Garbage collection etc..but this can be implemented in other languages...and why do people prefer one language over the other?
What is the general point of view on this board?
| c# | java | c++ | coding-style | null | 09/28/2010 14:22:46 | not constructive | Expert in one language or know more languages
===
In the corporate world, Is it better to knowledgeable(by knowledgeable I mean not a expert or novice but with some coding experience) about multiple languages.
or
is it better to be an expert in one language(say c++ or java) but having just basic knowledge on others.
I ask this question because what I feel is languages can be differentiated based on the features they provide like Garbage collection etc..but this can be implemented in other languages...and why do people prefer one language over the other?
What is the general point of view on this board?
| 4 |
11,315,451 | 07/03/2012 16:45:06 | 1,499,405 | 07/03/2012 16:32:31 | 1 | 0 | PHProxy( the HTTP proxy ) can be detectable ?? | I just transformed my Windows into a Web Server via WAMP client and I installed the PHProxy script to make a HTTP proxy and access it from the internet. Now I can browse from any device thru my computer's IP with the help of PHProxy :)
**Now I'm wondering :**
Can any site detect if I am surfing from this site( its like using my computer as a 'proxy') ?
Can they detect PHProxy ? I maked many tests with the online proxy checkers ,they show me I'm not using a proxy , but actually Im not browsing thru a proxy Im browsing thru a site that sends requests to my main home computer then sends them to the browser.
I appreciate any help! | php | http | proxy | web | server | 07/03/2012 18:27:29 | off topic | PHProxy( the HTTP proxy ) can be detectable ??
===
I just transformed my Windows into a Web Server via WAMP client and I installed the PHProxy script to make a HTTP proxy and access it from the internet. Now I can browse from any device thru my computer's IP with the help of PHProxy :)
**Now I'm wondering :**
Can any site detect if I am surfing from this site( its like using my computer as a 'proxy') ?
Can they detect PHProxy ? I maked many tests with the online proxy checkers ,they show me I'm not using a proxy , but actually Im not browsing thru a proxy Im browsing thru a site that sends requests to my main home computer then sends them to the browser.
I appreciate any help! | 2 |
10,413,002 | 05/02/2012 11:41:12 | 505,011 | 11/11/2010 20:19:18 | 51 | 0 | Accessing assets in subdirectories in android? | I'm reusing my iphone resources, I have myriads of resources which have many subdirectories
I'm reusing much of native code aswell, I understand that to open assets we MUST provide relative path for ex if I have file name test1.png in assets/subdir1/subdir2/subdir3/test1.png
I have to mention whole of the relative path, As I already said I'm using much of native code so is there any way I can just access asset files using just the filename without full relative path "test1.png"? Or if this is not possible is there anyway we can logically structure our resources but the folder name actually doesn't exist physically. | android | eclipse | null | null | null | null | open | Accessing assets in subdirectories in android?
===
I'm reusing my iphone resources, I have myriads of resources which have many subdirectories
I'm reusing much of native code aswell, I understand that to open assets we MUST provide relative path for ex if I have file name test1.png in assets/subdir1/subdir2/subdir3/test1.png
I have to mention whole of the relative path, As I already said I'm using much of native code so is there any way I can just access asset files using just the filename without full relative path "test1.png"? Or if this is not possible is there anyway we can logically structure our resources but the folder name actually doesn't exist physically. | 0 |
6,305,011 | 06/10/2011 10:20:16 | 792,549 | 06/10/2011 10:05:27 | 1 | 0 | Loop for hidden folderes in Windows. | How can I loop through all hidden folders, in windows-cmd?
This code
FOR /D %i IN (*) DO @echo %i
handles only non-hidden folders. | windows | windows-xp | cmd | null | null | null | open | Loop for hidden folderes in Windows.
===
How can I loop through all hidden folders, in windows-cmd?
This code
FOR /D %i IN (*) DO @echo %i
handles only non-hidden folders. | 0 |
8,317,363 | 11/29/2011 20:34:50 | 939,752 | 09/12/2011 01:42:38 | 27 | 0 | Firing event when text is deselected/highlighted | jQuery has an event "selected". But is there an event that fires when the text is deselected? | jquery | null | null | null | null | null | open | Firing event when text is deselected/highlighted
===
jQuery has an event "selected". But is there an event that fires when the text is deselected? | 0 |
6,704,391 | 07/15/2011 08:27:15 | 816,854 | 06/27/2011 06:20:34 | 6 | 0 | divide n numbers into m groups so that each group has equal sum | I divide a group of n numbers in m subgroups such that each subgroup has same sum. I thought of brute force method but the complexity is too high, o(m^n). Can someone give a more efficient solution which can be solved in polynomial time | algorithm | null | null | null | null | 04/01/2012 09:48:03 | not constructive | divide n numbers into m groups so that each group has equal sum
===
I divide a group of n numbers in m subgroups such that each subgroup has same sum. I thought of brute force method but the complexity is too high, o(m^n). Can someone give a more efficient solution which can be solved in polynomial time | 4 |
3,644,685 | 09/05/2010 01:48:02 | 345,145 | 05/19/2010 14:05:57 | 138 | 14 | Python or Ruby Which one should I learn? | I am new to programming.. I was thinking to start learning with Ruby or Python. y main task would be web development. But I cannot choose between them. Which language do you think I should learn? | python | ruby | choice | null | null | 09/05/2010 02:07:26 | not constructive | Python or Ruby Which one should I learn?
===
I am new to programming.. I was thinking to start learning with Ruby or Python. y main task would be web development. But I cannot choose between them. Which language do you think I should learn? | 4 |
10,540,728 | 05/10/2012 19:16:05 | 858,333 | 07/22/2011 16:32:58 | 37 | 1 | Creating an SQLite3 database file through Objective-C | I'm trying to create an SQLite3 database file through Objective-C at run time. I am trying to create a table called "tblStore". I want the field names to be called "strStoreNumber" and "strStoreReg". I'm new to iOS and SQLite, so I'm having a hard time finding the syntax to perform this. In addition to creating the table, I want the created table to reside NOT in the app bundle, but rather it would reside/be stored somewhere on the phone. The table needs to be readable/writeable. I've done some reading on "user sandbox" and also a "documents directory". I'm not sure I understand the difference between the two. Ideally, my app would use a button to take input from Text Fields. After the input from the texts fields is put into strings, a check would be done to see if my "tblStore" SQLite table exists, and if it doesn't, the table will be created.
To recap:
1. What is the syntax for Obj-C/SQLite to create a table called "tblStore" with the fields "strStoreNumber" and "strStoreReg"?
2. Where should the db file reside? I need to read from and write to the tblStore db file.
3. What is the difference between a "user sandbox" and a "documents directory"?
This is what I have currently:
-(IBAction)setInput:(id)sender
{
NSString *strStoreNumber;
NSString *strRegNumber;
NSString *tableName = @"tblStore";
NSString *dbStrStore = @"strStore";
NSString *dbStrReg = @"strReg";
strStoreNumber = StoreNumber.text;
strRegNumber = RegNumber.text;
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths lastObject];
NSString* databasePath = [documentsDirectory stringByAppendingPathComponent:@"tblStore.sqlite"];
// NSString* databasePath = [[NSBundle mainBundle] pathForResource:@"tblStore" ofType:@"sqlite"];
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK)
{
NSLog(@"Opened sqlite database at %@", databasePath);
char *err;
NSString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS '%@' ('%@' TEXT PRIMARY KEY, '%@' TEXT);", tableName, dbStrStore, dbStrReg];
if (sqlite3_exec(database, [sql UTF8String], NULL, NULL, &err) != SQLITE_OK)
{
sqlite3_close(database);
NSAssert(0, @"Table failed to create.");
}
//...stuff
}
else
{
NSLog(@"Failed to open database at %@ with error %s", databasePath, sqlite3_errmsg(database));
sqlite3_close (database);
}
NSString *querystring;
// create your statement
querystring = [NSString stringWithFormat:@"SELECT strStore, strReg FROM tblStore WHERE strStore = %@ AND strReg = %@;", strStoreNumber, strRegNumber];
const char *sql = [querystring UTF8String];
NSString *szStore = nil;
NSString *szReg = nil;
sqlite3_stmt *statement = nil;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL)!=SQLITE_OK) //queryString = Statement
{
NSLog(@"sql problem occured with: %s", sql);
NSLog(@"%s", sqlite3_errmsg(database));
}
else
{
// you could handle multiple rows here
while (sqlite3_step(statement) == SQLITE_ROW)
{
szStore = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 0)];
szReg = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 1)];
}
}
sqlite3_finalize(statement);
lblStoreNumber.text = szStore;
lblRegNumber.text = szReg;
}
When I run my app, I get the following errors:
2012-05-10 14:58:38.169 CCoDBTry[355:f803] Opened sqlite database at /Users/Matt****/Library/Application Support/iPhone Simulator/5.1/Applications/5DB7A218-A0F6- 485F-B366-91FD2F9BC062/Documents/tblStore.sqlite
2012-05-10 14:58:38.307 CCoDBTry[355:f803] sql problem occured with: SELECT strStore, strReg FROM tblStore WHERE strStore = 8053 AND strReg = 4;
2012-05-10 14:58:38.308 CCoDBTry[355:f803] no such column: strStore
I appreciate anyone who takes the time out to explain some of this stuff, as I am very new and have been unsuccessful in accomplishing some of the things I've tried. Thanks so much for the help! | iphone | ios | sqlite | sqlite3 | null | null | open | Creating an SQLite3 database file through Objective-C
===
I'm trying to create an SQLite3 database file through Objective-C at run time. I am trying to create a table called "tblStore". I want the field names to be called "strStoreNumber" and "strStoreReg". I'm new to iOS and SQLite, so I'm having a hard time finding the syntax to perform this. In addition to creating the table, I want the created table to reside NOT in the app bundle, but rather it would reside/be stored somewhere on the phone. The table needs to be readable/writeable. I've done some reading on "user sandbox" and also a "documents directory". I'm not sure I understand the difference between the two. Ideally, my app would use a button to take input from Text Fields. After the input from the texts fields is put into strings, a check would be done to see if my "tblStore" SQLite table exists, and if it doesn't, the table will be created.
To recap:
1. What is the syntax for Obj-C/SQLite to create a table called "tblStore" with the fields "strStoreNumber" and "strStoreReg"?
2. Where should the db file reside? I need to read from and write to the tblStore db file.
3. What is the difference between a "user sandbox" and a "documents directory"?
This is what I have currently:
-(IBAction)setInput:(id)sender
{
NSString *strStoreNumber;
NSString *strRegNumber;
NSString *tableName = @"tblStore";
NSString *dbStrStore = @"strStore";
NSString *dbStrReg = @"strReg";
strStoreNumber = StoreNumber.text;
strRegNumber = RegNumber.text;
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* documentsDirectory = [paths lastObject];
NSString* databasePath = [documentsDirectory stringByAppendingPathComponent:@"tblStore.sqlite"];
// NSString* databasePath = [[NSBundle mainBundle] pathForResource:@"tblStore" ofType:@"sqlite"];
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK)
{
NSLog(@"Opened sqlite database at %@", databasePath);
char *err;
NSString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS '%@' ('%@' TEXT PRIMARY KEY, '%@' TEXT);", tableName, dbStrStore, dbStrReg];
if (sqlite3_exec(database, [sql UTF8String], NULL, NULL, &err) != SQLITE_OK)
{
sqlite3_close(database);
NSAssert(0, @"Table failed to create.");
}
//...stuff
}
else
{
NSLog(@"Failed to open database at %@ with error %s", databasePath, sqlite3_errmsg(database));
sqlite3_close (database);
}
NSString *querystring;
// create your statement
querystring = [NSString stringWithFormat:@"SELECT strStore, strReg FROM tblStore WHERE strStore = %@ AND strReg = %@;", strStoreNumber, strRegNumber];
const char *sql = [querystring UTF8String];
NSString *szStore = nil;
NSString *szReg = nil;
sqlite3_stmt *statement = nil;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL)!=SQLITE_OK) //queryString = Statement
{
NSLog(@"sql problem occured with: %s", sql);
NSLog(@"%s", sqlite3_errmsg(database));
}
else
{
// you could handle multiple rows here
while (sqlite3_step(statement) == SQLITE_ROW)
{
szStore = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 0)];
szReg = [NSString stringWithUTF8String:(char*)sqlite3_column_text(statement, 1)];
}
}
sqlite3_finalize(statement);
lblStoreNumber.text = szStore;
lblRegNumber.text = szReg;
}
When I run my app, I get the following errors:
2012-05-10 14:58:38.169 CCoDBTry[355:f803] Opened sqlite database at /Users/Matt****/Library/Application Support/iPhone Simulator/5.1/Applications/5DB7A218-A0F6- 485F-B366-91FD2F9BC062/Documents/tblStore.sqlite
2012-05-10 14:58:38.307 CCoDBTry[355:f803] sql problem occured with: SELECT strStore, strReg FROM tblStore WHERE strStore = 8053 AND strReg = 4;
2012-05-10 14:58:38.308 CCoDBTry[355:f803] no such column: strStore
I appreciate anyone who takes the time out to explain some of this stuff, as I am very new and have been unsuccessful in accomplishing some of the things I've tried. Thanks so much for the help! | 0 |
6,349,792 | 06/14/2011 20:36:48 | 107,152 | 05/14/2009 15:27:20 | 1,412 | 61 | Nulls in InnoDBs clustered index? | Using InnoDB in MySQL, I want to speed up selects by utilizing the clustered index better, thus including more frequently used columns in the primary key.
But some frequent columns used are allowed to be null (and some times are). Is there any way to include these in the clustered index (and allow them to be null)?
If not, are there some workarounds or is there some other way to do something similar? | mysql | optimization | innodb | clustered-index | null | null | open | Nulls in InnoDBs clustered index?
===
Using InnoDB in MySQL, I want to speed up selects by utilizing the clustered index better, thus including more frequently used columns in the primary key.
But some frequent columns used are allowed to be null (and some times are). Is there any way to include these in the clustered index (and allow them to be null)?
If not, are there some workarounds or is there some other way to do something similar? | 0 |
1,109,607 | 07/10/2009 13:43:46 | 134,300 | 07/07/2009 14:40:01 | 36 | 5 | Transitioning from "Web" into "Application" Development | I realize this comes at an enormous risk of being branded "subjective" and "discussion-based", but you don't have to argue with anyone, or me. I'd just like **honest** answers to the question. So first, the question:<br />
**In your experience, is it feasible to say I could find a job as a java or other "non-web" language/system developer without a CS degree?**
A little background : I am a LAMP(PP) Developer, and have been working with the web world for the past two years or so, and am about 90% self-taught. [edit] I have been working part-time/freelance in html/css/javascript for about 7 years, and full-time salary doing php/perl for the past 2 years, for clarification. [/edit] A friend of mine who does a lot of Java has convinced me to start learning it, and I'm starting to be curious about my potential employability in a "non-web" environment. So far I've worked for marketing firms and doing application development for a web-based system, so having a Bachelor's degree in a non-related field (music) hasn't held me back yet. <br />
Acceptable format for non-subjective answers : <br />
"Our company does not require a specific degree, if you have a few years of employment history and can prove you know programming you can get a job" <br />
-or-<br />
"With the economy being the way it is, the only way to ensure you'll get past the first level of screening is to have an extensive relevant education" | programming-languages | language-agnostic | null | null | null | null | open | Transitioning from "Web" into "Application" Development
===
I realize this comes at an enormous risk of being branded "subjective" and "discussion-based", but you don't have to argue with anyone, or me. I'd just like **honest** answers to the question. So first, the question:<br />
**In your experience, is it feasible to say I could find a job as a java or other "non-web" language/system developer without a CS degree?**
A little background : I am a LAMP(PP) Developer, and have been working with the web world for the past two years or so, and am about 90% self-taught. [edit] I have been working part-time/freelance in html/css/javascript for about 7 years, and full-time salary doing php/perl for the past 2 years, for clarification. [/edit] A friend of mine who does a lot of Java has convinced me to start learning it, and I'm starting to be curious about my potential employability in a "non-web" environment. So far I've worked for marketing firms and doing application development for a web-based system, so having a Bachelor's degree in a non-related field (music) hasn't held me back yet. <br />
Acceptable format for non-subjective answers : <br />
"Our company does not require a specific degree, if you have a few years of employment history and can prove you know programming you can get a job" <br />
-or-<br />
"With the economy being the way it is, the only way to ensure you'll get past the first level of screening is to have an extensive relevant education" | 0 |
1,713,120 | 11/11/2009 04:57:34 | 208,397 | 11/11/2009 04:43:06 | 1 | 0 | integer opeation | I found by chance that
int a = (h/2)*w+ ( (h+1)/2-h/2 ) * (w+1)/2 ;
is quals to
int b = (w * h + 1) / 2 ;
when w and h are integers(assume no overflow).
can you show me why these 2 are the same?
| c | c++ | null | null | null | 11/12/2009 10:55:39 | off topic | integer opeation
===
I found by chance that
int a = (h/2)*w+ ( (h+1)/2-h/2 ) * (w+1)/2 ;
is quals to
int b = (w * h + 1) / 2 ;
when w and h are integers(assume no overflow).
can you show me why these 2 are the same?
| 2 |
8,544,884 | 12/17/2011 12:54:43 | 1,045,055 | 11/14/2011 06:27:43 | 150 | 20 | CGAffineTransformMakeRotation changes height and width of a UIView | Before rotation frame of UIView :- (123.46 326.855; 214.773 149.148);
After rotation frame of UIView:- (109.585 304.877; 242.524 193.104);
I used the following code:-
CGAffineTransform landscapeTransform;
landscapeTransform = CGAffineTransformMakeRotation(rotate);
[contentView setTransform:landscapeTransform];
Please help.
Thanks | iphone | ios4 | cgaffinetransform | null | null | 07/20/2012 14:59:07 | not a real question | CGAffineTransformMakeRotation changes height and width of a UIView
===
Before rotation frame of UIView :- (123.46 326.855; 214.773 149.148);
After rotation frame of UIView:- (109.585 304.877; 242.524 193.104);
I used the following code:-
CGAffineTransform landscapeTransform;
landscapeTransform = CGAffineTransformMakeRotation(rotate);
[contentView setTransform:landscapeTransform];
Please help.
Thanks | 1 |
11,046,518 | 06/15/2012 07:40:09 | 1,179,877 | 01/31/2012 08:44:35 | 1 | 0 | Wamp create alias point to IP | Wamp allows us create alias that can point other drive e.g point to external dive (G), moreover, can i point to IP instead of point to drive? example point to http://xxx.xxx.xxx/test.
Note: http://xxx.xxx.xxx/test is the same network LAND just deference PC.
Thanks in advance. | wamp | null | null | null | null | 06/16/2012 08:57:10 | off topic | Wamp create alias point to IP
===
Wamp allows us create alias that can point other drive e.g point to external dive (G), moreover, can i point to IP instead of point to drive? example point to http://xxx.xxx.xxx/test.
Note: http://xxx.xxx.xxx/test is the same network LAND just deference PC.
Thanks in advance. | 2 |
9,482,400 | 02/28/2012 13:00:56 | 1,131,384 | 01/05/2012 04:55:17 | 21 | 0 | How an SQL Query is Parsed | I would like to know how an SQL query is parsed.
For Eg:
Select count(*) from Users where name = 'John' and age = '24'
Will it take the count of records with name 'John' first , and then from it filter according to Age? Or is it the other way round? | sql | query | parsing | null | null | 02/28/2012 19:03:37 | not a real question | How an SQL Query is Parsed
===
I would like to know how an SQL query is parsed.
For Eg:
Select count(*) from Users where name = 'John' and age = '24'
Will it take the count of records with name 'John' first , and then from it filter according to Age? Or is it the other way round? | 1 |
11,141,805 | 06/21/2012 15:43:27 | 1,445,214 | 06/08/2012 18:39:04 | 1 | 0 | Findcontours retrieve contours unsorted | WE are implementing OCR using opencv for android, everything went fine till the part of findning contours using Imgproc.findcontours() it gives back the contours not in the same order as they were in the input image
i.e :
input image M N O P the first contour gets from findcontours() is P
input image E F G H the first contour gets from findcontours() is E (here is right)
input image I J K L the first contour gets from findcontours() is J
so it seems that it extracts the contours randomly how can we fix this? because we want to give back the word as it was written exactly in the image | opencv | ocr | null | null | null | null | open | Findcontours retrieve contours unsorted
===
WE are implementing OCR using opencv for android, everything went fine till the part of findning contours using Imgproc.findcontours() it gives back the contours not in the same order as they were in the input image
i.e :
input image M N O P the first contour gets from findcontours() is P
input image E F G H the first contour gets from findcontours() is E (here is right)
input image I J K L the first contour gets from findcontours() is J
so it seems that it extracts the contours randomly how can we fix this? because we want to give back the word as it was written exactly in the image | 0 |
226,223 | 10/22/2008 15:13:52 | 5,055 | 09/07/2008 15:43:03 | 281 | 20 | Whats the best way to profile a sqlserver database for performance? | What techinques do you use? How do you find out which jobs take the longest to run? Is there a way to find out the offending applications? | sql-server | bestpractice | optimization | profiling | null | null | open | Whats the best way to profile a sqlserver database for performance?
===
What techinques do you use? How do you find out which jobs take the longest to run? Is there a way to find out the offending applications? | 0 |
3,245,771 | 07/14/2010 11:54:29 | 49,032 | 12/25/2008 10:13:53 | 1,012 | 46 | KDE contribution | Does it make any sense to contribute to KDE lately, now that all that's "cool" is being moved in the cloud ? It seems like these guys are in need of some contributors and I was wondering whether it's a good C++ code base to learn from and gain experience or it's better to get involved in something that has more momentum ? | c++ | kde | open-source | null | null | 07/14/2010 12:14:10 | not constructive | KDE contribution
===
Does it make any sense to contribute to KDE lately, now that all that's "cool" is being moved in the cloud ? It seems like these guys are in need of some contributors and I was wondering whether it's a good C++ code base to learn from and gain experience or it's better to get involved in something that has more momentum ? | 4 |
7,945,604 | 10/30/2011 14:54:47 | 993,466 | 10/13/2011 12:40:50 | 6 | 0 | Photos Gallery In iPhone | I want to make photos gallery like one in this link:
http://www.techistan.com/2011/08/02/apple-designing-a-multi-layer-3d-mobile-display-without-glasses-is-3d-video-bad-for-you/
Is there any help how to make it the easiest way | iphone | objective-c | ios | image | null | 10/30/2011 15:46:15 | not a real question | Photos Gallery In iPhone
===
I want to make photos gallery like one in this link:
http://www.techistan.com/2011/08/02/apple-designing-a-multi-layer-3d-mobile-display-without-glasses-is-3d-video-bad-for-you/
Is there any help how to make it the easiest way | 1 |
11,463,691 | 07/13/2012 03:22:10 | 1,276,421 | 03/18/2012 01:45:23 | 31 | 1 | How can one scrape a website that requires login but w/ a randomly generated POST parameter? | I am trying to scrape some of the html from pottermore.com - it requires a login and I found the POST parameters, which include a really long randomly generated alphanumerical access key that changes every time you log in (though the user never sees this) and lacks a parameter for the login button. Does this mean I cannot scrape the site using these methods?
Are there other methods of scraping a website like this? I know this site has been scraped before by another web app I use, but is there a more efficient way they might be doing this?
<?php
$ch=login();
$html=downloadUrl('http://www.pottermore.com/en/great-hall', $ch);
echo $html;
function downloadUrl($Url, $ch){
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/");
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch);
return $output;
}
function login(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.pottermore.com/en/signin/'); //login URL
curl_setopt ($ch, CURLOPT_POST, 1);
$postData='
Username=<I removed my username>
&Password=<I removed my password>
&RequestVerificationToken=6tI2qpg5DzV5DdFBEwg7OReQ3QTpdrVBbJ%2FWwoNJZZP2ecB3PBvd%2BdGXj5F%2BnLA4%2BQ%2BjK%2FZaaCBY7ibqA6ZWFwqFA49VDQ%2BT2f80Sz8P2E6MT4Aw4BgoC5%2Fx%2FL2IyhID5b2IUw%3D%3D
&RememberMe=false';
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$store = curl_exec ($ch); | php | html | curl | scrape | scraper | 07/14/2012 05:08:45 | too localized | How can one scrape a website that requires login but w/ a randomly generated POST parameter?
===
I am trying to scrape some of the html from pottermore.com - it requires a login and I found the POST parameters, which include a really long randomly generated alphanumerical access key that changes every time you log in (though the user never sees this) and lacks a parameter for the login button. Does this mean I cannot scrape the site using these methods?
Are there other methods of scraping a website like this? I know this site has been scraped before by another web app I use, but is there a more efficient way they might be doing this?
<?php
$ch=login();
$html=downloadUrl('http://www.pottermore.com/en/great-hall', $ch);
echo $html;
function downloadUrl($Url, $ch){
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/");
curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch);
return $output;
}
function login(){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.pottermore.com/en/signin/'); //login URL
curl_setopt ($ch, CURLOPT_POST, 1);
$postData='
Username=<I removed my username>
&Password=<I removed my password>
&RequestVerificationToken=6tI2qpg5DzV5DdFBEwg7OReQ3QTpdrVBbJ%2FWwoNJZZP2ecB3PBvd%2BdGXj5F%2BnLA4%2BQ%2BjK%2FZaaCBY7ibqA6ZWFwqFA49VDQ%2BT2f80Sz8P2E6MT4Aw4BgoC5%2Fx%2FL2IyhID5b2IUw%3D%3D
&RememberMe=false';
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$store = curl_exec ($ch); | 3 |
7,226,667 | 08/29/2011 06:03:51 | 909,058 | 08/24/2011 06:56:38 | 30 | 4 | How to open a folder in php | I am trying to open a folder by this command.
system("folder_path");
But my folder is not opening. | php | null | null | null | null | 08/29/2011 06:39:13 | not a real question | How to open a folder in php
===
I am trying to open a folder by this command.
system("folder_path");
But my folder is not opening. | 1 |
9,872,942 | 03/26/2012 13:22:25 | 1,153,032 | 01/17/2012 02:07:38 | 21 | 0 | how to get dual values when solving a LP with cplex | I want to solve my primal problem and get the dual variables corresponding to a set of its constraints. This is the code I'm using:
for(IloInt i=0;i<I;i++)
{
for(IloInt j=0;j<J;j++)
outfile<<cplex_model.getDuals(X[i][j]-y[j]) << " " <<;
}
here `X[i][j]`and `y[j]`are the variables.
Should I state the starting point and range? with a pointer? since `X[1][1]-y[1]` didn't work. | c++ | linear | dual | cplex | null | 03/27/2012 14:19:00 | not a real question | how to get dual values when solving a LP with cplex
===
I want to solve my primal problem and get the dual variables corresponding to a set of its constraints. This is the code I'm using:
for(IloInt i=0;i<I;i++)
{
for(IloInt j=0;j<J;j++)
outfile<<cplex_model.getDuals(X[i][j]-y[j]) << " " <<;
}
here `X[i][j]`and `y[j]`are the variables.
Should I state the starting point and range? with a pointer? since `X[1][1]-y[1]` didn't work. | 1 |
728,508 | 04/08/2009 04:19:19 | 88,256 | 04/07/2009 18:55:59 | 1 | 0 | What's an example of Java functionality that I could add to a JRuby/Rails project? |
This is actually two questions rolled into one.
1. Is there a particular type of Java functionality that people are using JRuby for or is it mainly because of the performance advantage that JRuby gives versus the MRI?
The reason I ask is, I'd like to add some Java functionality to a Rails project (just to show that it's possible). Ideally this Java functionality would also be useful rather than redundant. Which leads to my next question . . .
2. What's an example of something that would make a good demonstration of Java functionality being added to a simple Rails CRUD app?
I guess anything you can do in a Ruby class, you could just as easily do in a Java class (with about twice as much code), so I understand the question may be hard to answer. I'm just wondering if there is a particular type of functionality that is more appropriate to do in Java.
There's nothing at stake here, by the way. I'm just playing around and testing things out.
| java | ruby | jruby | ruby-on-rails | crud | null | open | What's an example of Java functionality that I could add to a JRuby/Rails project?
===
This is actually two questions rolled into one.
1. Is there a particular type of Java functionality that people are using JRuby for or is it mainly because of the performance advantage that JRuby gives versus the MRI?
The reason I ask is, I'd like to add some Java functionality to a Rails project (just to show that it's possible). Ideally this Java functionality would also be useful rather than redundant. Which leads to my next question . . .
2. What's an example of something that would make a good demonstration of Java functionality being added to a simple Rails CRUD app?
I guess anything you can do in a Ruby class, you could just as easily do in a Java class (with about twice as much code), so I understand the question may be hard to answer. I'm just wondering if there is a particular type of functionality that is more appropriate to do in Java.
There's nothing at stake here, by the way. I'm just playing around and testing things out.
| 0 |
6,989,669 | 08/08/2011 23:07:51 | 851,230 | 07/19/2011 04:19:12 | 6 | 0 | Controlling memory variables | I don't know exactly how I'd ask this.. I'm wanting to control like the data stored in memory by locating the memory address and what not.. Kinda like cheat engine but I'm planning on doing this in MASM if it can be done easily.. If not I want to do it in C# (if thats possible also). My last resort would be c++.
| c# | c++ | memory | assembly | masm | 08/09/2011 00:58:56 | not a real question | Controlling memory variables
===
I don't know exactly how I'd ask this.. I'm wanting to control like the data stored in memory by locating the memory address and what not.. Kinda like cheat engine but I'm planning on doing this in MASM if it can be done easily.. If not I want to do it in C# (if thats possible also). My last resort would be c++.
| 1 |
2,401,188 | 03/08/2010 12:21:45 | 288,752 | 03/08/2010 12:21:45 | 1 | 0 | Fastest way to learn Flex and J2EE? | Ok so me and my 2 friends have to make a webapp and well we think it's a good opportunity to learn JEE and Flex. The thing is we have very little knowledge about them and we have only 3 months to do it (it doesn't have to be super complicated). So my question is: what, in your opinion, would be the fastest way to learn them both? I guess we need to know some JSP, Serlvets, JPA (??), Flex, maybe JavaScript+CSS? Anything else like EJB? Should we also learn Spring (or Struts)? Obviously reading books would be a good idea, but I bet we won't make the deadline if we try to read all the books... | java | jee | flex | null | null | null | open | Fastest way to learn Flex and J2EE?
===
Ok so me and my 2 friends have to make a webapp and well we think it's a good opportunity to learn JEE and Flex. The thing is we have very little knowledge about them and we have only 3 months to do it (it doesn't have to be super complicated). So my question is: what, in your opinion, would be the fastest way to learn them both? I guess we need to know some JSP, Serlvets, JPA (??), Flex, maybe JavaScript+CSS? Anything else like EJB? Should we also learn Spring (or Struts)? Obviously reading books would be a good idea, but I bet we won't make the deadline if we try to read all the books... | 0 |
11,679,900 | 07/27/2012 00:23:54 | 1,070,338 | 11/28/2011 23:30:15 | 311 | 4 | D/B 'self' and <ClassName> to bind a function inside the class itself. (singleton in python) | This question may look silly(since I am new to python), but can you guys tell me what is the difference between self and classname when Binding?
class OnlyOne(object):
class __OnlyOne:
def __init__(self):
self.val = None
def __str__(self):
return ´self´ + self.val
instance = None
def __new__(cls): # __new__ always a classmethod
if not OnlyOne.instance:
OnlyOne.instance = OnlyOne.__OnlyOne()
return OnlyOne.instance
def __getattr__(self, name):
return getattr(self.instance, name)
def __setattr__(self, name):
return setattr(self.instance, name)
Here, I usually use Instance as self... What is the difference between using self and Only one... my intuition tells me that, it is a global variable.... if it is a global variable, it does not make sense at all(I will edit this, if its a global variable). Thanks!!
| python | variables | singleton | global-variables | null | null | open | D/B 'self' and <ClassName> to bind a function inside the class itself. (singleton in python)
===
This question may look silly(since I am new to python), but can you guys tell me what is the difference between self and classname when Binding?
class OnlyOne(object):
class __OnlyOne:
def __init__(self):
self.val = None
def __str__(self):
return ´self´ + self.val
instance = None
def __new__(cls): # __new__ always a classmethod
if not OnlyOne.instance:
OnlyOne.instance = OnlyOne.__OnlyOne()
return OnlyOne.instance
def __getattr__(self, name):
return getattr(self.instance, name)
def __setattr__(self, name):
return setattr(self.instance, name)
Here, I usually use Instance as self... What is the difference between using self and Only one... my intuition tells me that, it is a global variable.... if it is a global variable, it does not make sense at all(I will edit this, if its a global variable). Thanks!!
| 0 |
1,093,584 | 07/07/2009 17:13:49 | 39,036 | 11/19/2008 17:43:10 | 3,231 | 179 | What comes after distributed version control? | First there was a centralized model of version control (cvs, svn) and recently a distributed version control model was created (git, bzr, hg). Are there any other types of version control ideologies out there? Or what will be the next new one? | version-control | null | null | null | null | null | open | What comes after distributed version control?
===
First there was a centralized model of version control (cvs, svn) and recently a distributed version control model was created (git, bzr, hg). Are there any other types of version control ideologies out there? Or what will be the next new one? | 0 |
8,762,234 | 01/06/2012 17:57:21 | 1,134,864 | 01/06/2012 17:48:25 | 101 | 0 | Why Doesn't This Obvious Recursion Throw Warnings? | Many months back, I had to fix up some code that caused some problems. The code looked basically like this:
`void badFun() { return badFun(); }`
This obviously caused a stack overflow even in the high level language I was working with (4Test in SilkTest). There's no way this code could be seen as beneficial. The first sign of problems were warnings seen after the script finished, but no compile errors or warnings. Curiously, I tried writing programs in C++, C# and Python with the same structure, and all of them compiled/interpreted with no syntax errors or warnings, even through there were runtime errors in all cases. I didn't even see any warnings in any of these cases. Why isn't this seen as problem by default?
EDIT: I tried writing the equivalent of that function in all three languages, so I added those function tags. I'm more interested in overall reasons why code like this gets through with no warnings. Please retag if necessary. | c# | c++ | python | recursion | null | 01/08/2012 05:45:59 | not constructive | Why Doesn't This Obvious Recursion Throw Warnings?
===
Many months back, I had to fix up some code that caused some problems. The code looked basically like this:
`void badFun() { return badFun(); }`
This obviously caused a stack overflow even in the high level language I was working with (4Test in SilkTest). There's no way this code could be seen as beneficial. The first sign of problems were warnings seen after the script finished, but no compile errors or warnings. Curiously, I tried writing programs in C++, C# and Python with the same structure, and all of them compiled/interpreted with no syntax errors or warnings, even through there were runtime errors in all cases. I didn't even see any warnings in any of these cases. Why isn't this seen as problem by default?
EDIT: I tried writing the equivalent of that function in all three languages, so I added those function tags. I'm more interested in overall reasons why code like this gets through with no warnings. Please retag if necessary. | 4 |
7,617,347 | 10/01/2011 00:34:27 | 246,914 | 01/09/2010 04:29:14 | 310 | 15 | How to parse in javascript all regex between one or more parentheses | I'm trying to parse all of the text between one or more parentheses and return an array.
For example:
var string = "((CID:34746) OR (CID:8097)) ((CID:34277 OR CID:67300))";
var regex = /\(([^()]+)\)/g;
var results = string.match(regex);
// should result in ["CID:34746","CID:8097","CID:34277 OR CID:67300"]
// but instead is ["(CID:34746)", "(CID:8097)", "(CID:34277 OR CID:67300)"]
I've had 3 people on my team try to find a solution and nobody has. I've looked at all the ones I can find on SO and otherwise. ([This one is where I posted the above regex from][1]...)
The closest I've gotten is: /([^()]+)/g.
[1]: http://stackoverflow.com/questions/6208367/regex-to-match-stuff-between-parentheses | javascript | regex | null | null | null | null | open | How to parse in javascript all regex between one or more parentheses
===
I'm trying to parse all of the text between one or more parentheses and return an array.
For example:
var string = "((CID:34746) OR (CID:8097)) ((CID:34277 OR CID:67300))";
var regex = /\(([^()]+)\)/g;
var results = string.match(regex);
// should result in ["CID:34746","CID:8097","CID:34277 OR CID:67300"]
// but instead is ["(CID:34746)", "(CID:8097)", "(CID:34277 OR CID:67300)"]
I've had 3 people on my team try to find a solution and nobody has. I've looked at all the ones I can find on SO and otherwise. ([This one is where I posted the above regex from][1]...)
The closest I've gotten is: /([^()]+)/g.
[1]: http://stackoverflow.com/questions/6208367/regex-to-match-stuff-between-parentheses | 0 |
8,468,055 | 12/11/2011 22:34:16 | 705,339 | 04/13/2011 05:41:24 | 46 | 0 | New to Eclipse PDT | I usually use Adobe Dreamweaver5.5 for my PHP development, and it's a great IDE with tons of syntax coloring, code completion, etc. <br />
Due to a recent Windows crash, I had to switch my OS from Windows to Linux, in which case Dreamweaver is no longer a feasible option. After spending 2 days searching for a great PHP editor, I settled for Eclipse's PDT. <br />
So far, I've enabled some of the intellisense features, but not the following: <br />
1) In Dreamweaver, whenever the '$" symbol is typed, the software brings up a list of all the global functions and variables ($_SERVER, $_POST, $_GET, $_REQUEST, etc). I haven't been able to reproduce that in PDT. <br />
2)In Dreamweaver, whenever the 'new' keyword is typed, all the classes are displayed, along with their parameters. Even though some of the classes are displayed in PDT, the arguments for the classes are not included.So, if I decide to use a class, I have no idea what parameters to pass into the constructor. <br />
3) In Dreamweaver, I don't have to create a project before starting a PHP application; just create a folder, and start; it seems I have to always start by creating a project in Eclipse. <br />
So, 3 main questions: <br />
1) Is there a way to solve the first problem? <br />
2)Is there a way to solve the second problem? i would very much try to avoid opening up a PHP.net manual every time I need to code. <br />
3) Is there a way to start a project without creating one? Do I have to build the project after it's complete before I can use it as an application? How do I modify existing PHP applications in Eclipse without creating a new project? <br />
4) If all these are impossible, is there a free or low budget (<= $100) IDE with all these features that I can use? <br />
Please, reply.
<br />
<br />
Thanks a million.
| php5 | null | null | null | null | 12/12/2011 05:41:14 | off topic | New to Eclipse PDT
===
I usually use Adobe Dreamweaver5.5 for my PHP development, and it's a great IDE with tons of syntax coloring, code completion, etc. <br />
Due to a recent Windows crash, I had to switch my OS from Windows to Linux, in which case Dreamweaver is no longer a feasible option. After spending 2 days searching for a great PHP editor, I settled for Eclipse's PDT. <br />
So far, I've enabled some of the intellisense features, but not the following: <br />
1) In Dreamweaver, whenever the '$" symbol is typed, the software brings up a list of all the global functions and variables ($_SERVER, $_POST, $_GET, $_REQUEST, etc). I haven't been able to reproduce that in PDT. <br />
2)In Dreamweaver, whenever the 'new' keyword is typed, all the classes are displayed, along with their parameters. Even though some of the classes are displayed in PDT, the arguments for the classes are not included.So, if I decide to use a class, I have no idea what parameters to pass into the constructor. <br />
3) In Dreamweaver, I don't have to create a project before starting a PHP application; just create a folder, and start; it seems I have to always start by creating a project in Eclipse. <br />
So, 3 main questions: <br />
1) Is there a way to solve the first problem? <br />
2)Is there a way to solve the second problem? i would very much try to avoid opening up a PHP.net manual every time I need to code. <br />
3) Is there a way to start a project without creating one? Do I have to build the project after it's complete before I can use it as an application? How do I modify existing PHP applications in Eclipse without creating a new project? <br />
4) If all these are impossible, is there a free or low budget (<= $100) IDE with all these features that I can use? <br />
Please, reply.
<br />
<br />
Thanks a million.
| 2 |
6,193,141 | 05/31/2011 20:24:23 | 778,316 | 05/31/2011 20:24:23 | 1 | 0 | C# Code Snipped | Is there any control for auto complate my code in textbox at runtime?
There is a textbox in my form and when i want to write c# code at runtime.Can it be auto complete code in textbox?
| c# | null | null | null | null | 05/31/2011 20:32:29 | not a real question | C# Code Snipped
===
Is there any control for auto complate my code in textbox at runtime?
There is a textbox in my form and when i want to write c# code at runtime.Can it be auto complete code in textbox?
| 1 |
11,070,896 | 06/17/2012 11:18:00 | 1,451,522 | 06/12/2012 14:43:08 | 1 | 0 | Get text between tags PHP | I have this html line:
<time itemprop="datePublished" datetime="1923-12">December 1923</time> (USA)
How can i retrieve only "December 1923 (USA)" from that code by using PHP? | php | text | tags | between | null | 06/19/2012 03:17:37 | not a real question | Get text between tags PHP
===
I have this html line:
<time itemprop="datePublished" datetime="1923-12">December 1923</time> (USA)
How can i retrieve only "December 1923 (USA)" from that code by using PHP? | 1 |
4,362,637 | 12/06/2010 02:16:34 | 13,118 | 09/16/2008 17:10:08 | 7,086 | 272 | Writing code with issues for a technical interview | It's well known that developers have to read and understand code more than write it. So one of my standard interview questions is to give the candidate 10 lines of code and ask the following:
- Explain what the code is doing.
- Explain any significant issues with the code.
- Explain how to prioritise the fixes.
- Explain how to fix the issues.
Each specific issue then becomes a more general discussion point to establish the candidate's thinking. This approach has been quite successful in establishing how well candidates find issues and find/prioritise fixes.
The C# code sample that I use for this is a bit long in the tooth now, but I will post it as my answer to this question. Can you provide your own C#/VB code sample and talk about its significant issues? | c# | vb | source-code | interview-questions | null | 12/01/2011 18:53:47 | not constructive | Writing code with issues for a technical interview
===
It's well known that developers have to read and understand code more than write it. So one of my standard interview questions is to give the candidate 10 lines of code and ask the following:
- Explain what the code is doing.
- Explain any significant issues with the code.
- Explain how to prioritise the fixes.
- Explain how to fix the issues.
Each specific issue then becomes a more general discussion point to establish the candidate's thinking. This approach has been quite successful in establishing how well candidates find issues and find/prioritise fixes.
The C# code sample that I use for this is a bit long in the tooth now, but I will post it as my answer to this question. Can you provide your own C#/VB code sample and talk about its significant issues? | 4 |
6,637,218 | 07/09/2011 20:12:26 | 788,436 | 06/08/2011 00:33:32 | 73 | 4 | Lable For to repalce underscore | my DB model has the column name with "_" in the field name.
is there a way to dislay these values in Camel Case when displaying in the form? like
"BusinessName"
i am using asp.net MVC3 with Razor
@Html.LabelFor(model => model.business_name) | c# | asp.net | asp.net-mvc | mvc | null | null | open | Lable For to repalce underscore
===
my DB model has the column name with "_" in the field name.
is there a way to dislay these values in Camel Case when displaying in the form? like
"BusinessName"
i am using asp.net MVC3 with Razor
@Html.LabelFor(model => model.business_name) | 0 |
2,048,370 | 01/12/2010 11:01:39 | 202,325 | 11/04/2009 04:48:11 | 57 | 9 | Techs needed for building a online radio website....? | i need to build a website that streams music from an online radio station...?
In this website, the user can choose from different channels and listen to music....
What are the possible softwares or technologies that i can use to build this....?
I will be using php for server side.... I am researching about what else i'll be needing and how to proceed.... but can't get a clear idea..?
Any suggestions....??
Thanks a lot..! | php | online | radio | website | null | 01/12/2010 11:32:56 | not a real question | Techs needed for building a online radio website....?
===
i need to build a website that streams music from an online radio station...?
In this website, the user can choose from different channels and listen to music....
What are the possible softwares or technologies that i can use to build this....?
I will be using php for server side.... I am researching about what else i'll be needing and how to proceed.... but can't get a clear idea..?
Any suggestions....??
Thanks a lot..! | 1 |
6,715,076 | 07/16/2011 03:20:02 | 184,773 | 10/06/2009 06:16:54 | 2,876 | 38 | Will Unbraco work with a huge website? | I am planning on using umbraco to run a huge content driven website. I will be using MySql since I will not be able to afford SQL Server in the beginning. I The site will mirror other huge sites like wikipedia and answers.com. It will have millions of articles and the data may reach PetaBytes. i will host all data in one website so there will only be one installation of umbraco. I also will be expecting a number of visits per day. Do you think umbraco can handle data to these limits. | c# | mysql | umbraco | null | null | 07/17/2011 03:17:55 | not constructive | Will Unbraco work with a huge website?
===
I am planning on using umbraco to run a huge content driven website. I will be using MySql since I will not be able to afford SQL Server in the beginning. I The site will mirror other huge sites like wikipedia and answers.com. It will have millions of articles and the data may reach PetaBytes. i will host all data in one website so there will only be one installation of umbraco. I also will be expecting a number of visits per day. Do you think umbraco can handle data to these limits. | 4 |
9,533,251 | 03/02/2012 12:25:40 | 996,807 | 10/15/2011 11:52:14 | 19 | 0 | Hiding a division using CSS | I am trying to remove a division but I am not able to remove the `<div>` tag. So I wanted to know if I can hide a division by adding some css codes on the page. The division I am trying to hide is `<div id="views" class="menu">.... </div>`
Any help? | html | css | hide | webpage | blogger | null | open | Hiding a division using CSS
===
I am trying to remove a division but I am not able to remove the `<div>` tag. So I wanted to know if I can hide a division by adding some css codes on the page. The division I am trying to hide is `<div id="views" class="menu">.... </div>`
Any help? | 0 |
8,093,477 | 11/11/2011 11:41:09 | 786,333 | 06/06/2011 17:47:03 | 166 | 9 | MySQL check if a person is available | I have 2 tables:
`accounts`
+------+------------------------+
| id | name |
+------+------------------------+
| 1 | John |
| 2 | Lee |
| 3 | Sarah |
| 4 | Michael |
+------+------------------------+
`holidays`
+------+---------+----------------+--------------+
| id | account | start_date | end_date |
+------+---------+----------------+--------------+
| 1 | 2 | 11/11/11 | 15/11/11 |
+------+---------+----------------+--------------+
This means that Lee is not available from 11/11/11 until 15/11/11 (inclusive)
I need a query that will check who are available on a given day. For example if I specify a date of 13/11/11 Lee would be unavailable so only retrieve the other 3 accounts, but if I specify a date of 16/11/11 all accounts will be available
Any help appreciated
| mysql | sql | query | null | null | null | open | MySQL check if a person is available
===
I have 2 tables:
`accounts`
+------+------------------------+
| id | name |
+------+------------------------+
| 1 | John |
| 2 | Lee |
| 3 | Sarah |
| 4 | Michael |
+------+------------------------+
`holidays`
+------+---------+----------------+--------------+
| id | account | start_date | end_date |
+------+---------+----------------+--------------+
| 1 | 2 | 11/11/11 | 15/11/11 |
+------+---------+----------------+--------------+
This means that Lee is not available from 11/11/11 until 15/11/11 (inclusive)
I need a query that will check who are available on a given day. For example if I specify a date of 13/11/11 Lee would be unavailable so only retrieve the other 3 accounts, but if I specify a date of 16/11/11 all accounts will be available
Any help appreciated
| 0 |
2,535,088 | 03/28/2010 23:54:55 | 303,841 | 03/28/2010 23:54:55 | 1 | 0 | jquery dynamic select doesn't submit values | I have a form that includes three select boxes. The first one is categories, and selecting a category from it will populate the variables multi-select box with values specific to the selected category. Selecting variables and then clicking "add selected" will populate the target select box will those variables. The problem is, print_r shows that the values in the target select box aren't passed upon submit, and I don't understand why... Below is the code, and help is really appreciated
Here's the html markup:
<select multiple="" id="categories" name="categories[]">
<option class="category" value="Income">Income</option>
<option class="category" value="Gender">Gender</option>
<option class="category" value="Age">Age</option>
</select>
//note that i'm only showing variables for a presumably select category
<select multiple="multiple" id="variables" name="variables[]">
<option value="2">Less Than $15,000</option>
<option value="3">$15,000 - $19,999</option>
<option value="4">$20,000 - $29,999</option>
<option value="5">$30,000 - $39,999</option>
<option value="6">$40,000 - $49,999</option>
<option value="11">$90,000 - $99,999</option>
<option value="12">$100,000 - $124,999</option>
<option value="13">$125,000 - $149,999</option>
<option value="14">Greater than $149,999</option>
</select>
<select name="target[]" id="target" multiple="multiple" height="60">
</select>
And here's the jquery code:
$(function(){
var opts = {},
$cats = $("#categories"),
$target = $("#target"),
$vars = $("#variables");
$vars.find("option").each(function(){
var $opt = $(this),
cat = this.className,
value = this.value,
label = $opt.text();
if(!opts[cat]) { opts[cat] = []; }
opts[cat].push({label: label, value: value});
$opt.remove();
});
function update_variables(){
var cat = $cats.val(), new_opts = [];
$vars.empty();
$.each(opts[cat], function(){
if( $target.find('[value=' + this.value + ']').length === 0 ){
new_opts.push(option(this.value, this.label));
}
});
$vars.html(new_opts.join(''));
}
function option(value, label){
return "<option value='" + value + "'>" + label + "</option>";
}
$("#add").click(function(e){
e.preventDefault();
$vars.find(':selected').appendTo($target).attr('selected',false);
update_variables();
});
$("#remove").click(function(e){
e.preventDefault();
$target.find(':selected').remove();
update_variables();
});
$cats.change(function(){
update_variables();
}).change();
})
| jquery | dynamic | values | submit | null | null | open | jquery dynamic select doesn't submit values
===
I have a form that includes three select boxes. The first one is categories, and selecting a category from it will populate the variables multi-select box with values specific to the selected category. Selecting variables and then clicking "add selected" will populate the target select box will those variables. The problem is, print_r shows that the values in the target select box aren't passed upon submit, and I don't understand why... Below is the code, and help is really appreciated
Here's the html markup:
<select multiple="" id="categories" name="categories[]">
<option class="category" value="Income">Income</option>
<option class="category" value="Gender">Gender</option>
<option class="category" value="Age">Age</option>
</select>
//note that i'm only showing variables for a presumably select category
<select multiple="multiple" id="variables" name="variables[]">
<option value="2">Less Than $15,000</option>
<option value="3">$15,000 - $19,999</option>
<option value="4">$20,000 - $29,999</option>
<option value="5">$30,000 - $39,999</option>
<option value="6">$40,000 - $49,999</option>
<option value="11">$90,000 - $99,999</option>
<option value="12">$100,000 - $124,999</option>
<option value="13">$125,000 - $149,999</option>
<option value="14">Greater than $149,999</option>
</select>
<select name="target[]" id="target" multiple="multiple" height="60">
</select>
And here's the jquery code:
$(function(){
var opts = {},
$cats = $("#categories"),
$target = $("#target"),
$vars = $("#variables");
$vars.find("option").each(function(){
var $opt = $(this),
cat = this.className,
value = this.value,
label = $opt.text();
if(!opts[cat]) { opts[cat] = []; }
opts[cat].push({label: label, value: value});
$opt.remove();
});
function update_variables(){
var cat = $cats.val(), new_opts = [];
$vars.empty();
$.each(opts[cat], function(){
if( $target.find('[value=' + this.value + ']').length === 0 ){
new_opts.push(option(this.value, this.label));
}
});
$vars.html(new_opts.join(''));
}
function option(value, label){
return "<option value='" + value + "'>" + label + "</option>";
}
$("#add").click(function(e){
e.preventDefault();
$vars.find(':selected').appendTo($target).attr('selected',false);
update_variables();
});
$("#remove").click(function(e){
e.preventDefault();
$target.find(':selected').remove();
update_variables();
});
$cats.change(function(){
update_variables();
}).change();
})
| 0 |
11,455,902 | 07/12/2012 16:01:23 | 1,112,535 | 12/22/2011 21:48:01 | 93 | 0 | WebService check if there is data in SQL table | I'm trying to write a process that checks if there is some data in SQL table.
And then I want to do something depending on if exists or not.
So, I've this code that connects to database and it is selecting the data that I want to get from table.
public List<MedidasAdoptar> leerMedidasAdoptar()
{
DataSet Datos = new DataSet();
string connectionString = "Initial Catalog=MyDatabase;Data Source=MyServer;Integrated Security=false;User ID=SQLUser;Password=SQLPass;";
string selectCommand =
"SELECT [Número medida], [Cód_ Cliente], [Nombre Cliente], [Cód_ obra], [Nombre obra], Tipo, [Cód_ Medida], [Descripción Medida], [Respuesta Medida] FROM [MyDatabase$My table] " +
"WHERE [Cód_ Cliente] = "+codigoCliente+" AND [Cód_ obra] = "+codigoObra;
using (var MyConnection = new SqlConnection(connectionString))
using (var MyDataAdapter = new SqlDataAdapter(selectCommand, MyConnection))
{
MyDataAdapter.SelectCommand.CommandType = CommandType.Text;
MyDataAdapter.Fill(Datos);
MyDataAdapter.Dispose();
MyConnection.Close();
}
int i;
//Right here (If it is possible) I want to determine if there is some data in table
try
{
//...doing some stuff
} catch (SqlException e)
{
string msg = "";
System.Console.WriteLine(msg);
return new List<MedidasAdoptar>();
} | c# | sql | database | web-services | null | 07/13/2012 15:07:11 | not a real question | WebService check if there is data in SQL table
===
I'm trying to write a process that checks if there is some data in SQL table.
And then I want to do something depending on if exists or not.
So, I've this code that connects to database and it is selecting the data that I want to get from table.
public List<MedidasAdoptar> leerMedidasAdoptar()
{
DataSet Datos = new DataSet();
string connectionString = "Initial Catalog=MyDatabase;Data Source=MyServer;Integrated Security=false;User ID=SQLUser;Password=SQLPass;";
string selectCommand =
"SELECT [Número medida], [Cód_ Cliente], [Nombre Cliente], [Cód_ obra], [Nombre obra], Tipo, [Cód_ Medida], [Descripción Medida], [Respuesta Medida] FROM [MyDatabase$My table] " +
"WHERE [Cód_ Cliente] = "+codigoCliente+" AND [Cód_ obra] = "+codigoObra;
using (var MyConnection = new SqlConnection(connectionString))
using (var MyDataAdapter = new SqlDataAdapter(selectCommand, MyConnection))
{
MyDataAdapter.SelectCommand.CommandType = CommandType.Text;
MyDataAdapter.Fill(Datos);
MyDataAdapter.Dispose();
MyConnection.Close();
}
int i;
//Right here (If it is possible) I want to determine if there is some data in table
try
{
//...doing some stuff
} catch (SqlException e)
{
string msg = "";
System.Console.WriteLine(msg);
return new List<MedidasAdoptar>();
} | 1 |
10,793,408 | 05/29/2012 05:16:32 | 1,366,832 | 04/30/2012 22:59:24 | 1 | 0 | Making A Quiz like program | I want to create a "quiz" where the user will be asked a question and if the user can't answer it they can't move to the next question until they answer it correctly. I know this question may sound elementary but I am a novice in programming and am trying to create my first real program. So basically I would like to know what approach I should take if I want the user to be able to return back to their quiz if they leave or can't complete it. That's why I don't think Javascript would work because it's not sever side and won't save anything. Again sorry if this is very basic. | php | javascript | html5 | null | null | 05/29/2012 13:15:19 | not constructive | Making A Quiz like program
===
I want to create a "quiz" where the user will be asked a question and if the user can't answer it they can't move to the next question until they answer it correctly. I know this question may sound elementary but I am a novice in programming and am trying to create my first real program. So basically I would like to know what approach I should take if I want the user to be able to return back to their quiz if they leave or can't complete it. That's why I don't think Javascript would work because it's not sever side and won't save anything. Again sorry if this is very basic. | 4 |
11,493,213 | 07/15/2012 15:38:01 | 1,274,894 | 03/16/2012 20:24:41 | 10 | 1 | using javascript variable at php code | I need to pass js variavle to php part at this code:
<script type="text/javascript>
var x=32;
</script>
<?
echo $x;
?>
I want to use x value at php. How to do that??
is there any way without reloading the page? | php | javascript | jquery | ajax | variables | 07/16/2012 07:28:25 | not a real question | using javascript variable at php code
===
I need to pass js variavle to php part at this code:
<script type="text/javascript>
var x=32;
</script>
<?
echo $x;
?>
I want to use x value at php. How to do that??
is there any way without reloading the page? | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.