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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
185,742 | 10/09/2008 02:42:20 | 189,995 | 10/09/2008 02:26:50 | 1 | 0 | Beginner practical programming problems? | Where can I find lists of practical programming problems for a novice? Something similar to http://www.projecteuler.net, but for practical problems.
I am asking for problems even less complex than [this question][application problem]
[application problem]: http://stackoverflow.com/questions/106510/what-is-a-good-application-programming-problem-to-solve-for-beginners) | project-euler | practical | null | null | null | 05/01/2012 14:34:28 | off topic | Beginner practical programming problems?
===
Where can I find lists of practical programming problems for a novice? Something similar to http://www.projecteuler.net, but for practical problems.
I am asking for problems even less complex than [this question][application problem]
[application problem]: http://stackoverflow.com/questions/106510/what-is-a-good-application-programming-problem-to-solve-for-beginners) | 2 |
7,100,018 | 08/17/2011 21:54:31 | 899,549 | 08/17/2011 21:54:31 | 1 | 0 | How can I see how many times my app has been downloaded from the app store, I'm only able to see the last 26 weeks | I'd like to find out how many times my app has been downloaded since It is available in he app store. The best I was able to get was from the iTC mobile app that allows to select the last 26 weeks, but the app is longer available.
Thanks, Peter | download | application | app-store | itunesconnect | null | 08/18/2011 01:15:51 | off topic | How can I see how many times my app has been downloaded from the app store, I'm only able to see the last 26 weeks
===
I'd like to find out how many times my app has been downloaded since It is available in he app store. The best I was able to get was from the iTC mobile app that allows to select the last 26 weeks, but the app is longer available.
Thanks, Peter | 2 |
9,062,473 | 01/30/2012 10:31:24 | 171,459 | 09/10/2009 13:54:17 | 87 | 8 | Multitouch : Selecting hardware and software for multi-touch application | I am trying to build an internet connected touch based device using which users can do minor editing and upload photographs to web. The device will capture photographs using a USB based camera.
The question i have is where to find hardware for this custom requirement, i am looking for a touch screen around 24 inches in size.
Can any one recommend a reliable hardware vendor who supplies LCD/Capacitive based touchscreen.
I also thought to wait till launch of Windows 8, because it is built to support multi touch. I believe during launch of Win8 lot of hardware vendors will sell multi touch lcd monitors, which i can use.
If anyone can provide directions on this it will be a great help.
P.S > I am open to develop on any platform.
| multitouch | multi-touch | nui | null | null | null | open | Multitouch : Selecting hardware and software for multi-touch application
===
I am trying to build an internet connected touch based device using which users can do minor editing and upload photographs to web. The device will capture photographs using a USB based camera.
The question i have is where to find hardware for this custom requirement, i am looking for a touch screen around 24 inches in size.
Can any one recommend a reliable hardware vendor who supplies LCD/Capacitive based touchscreen.
I also thought to wait till launch of Windows 8, because it is built to support multi touch. I believe during launch of Win8 lot of hardware vendors will sell multi touch lcd monitors, which i can use.
If anyone can provide directions on this it will be a great help.
P.S > I am open to develop on any platform.
| 0 |
10,650,699 | 05/18/2012 10:12:44 | 1,238,867 | 02/28/2012 21:22:21 | 35 | 2 | Yellow warning triangle when implementing sounds i dont undertsand | When i impliment sounds in my apps, i always ge a couple of yellow warning triangles with the warning:
"implicit declaration of function "audio services create system soundID" is invalid in C99"
It dosent effect anything in my app i just wondered if its something in my code and something i should be addressing?
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"btnclick", CFSTR
("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundID);
AudioServicesPlaySystemSound (soundID);
| audio | ios5 | xcode4.3 | sounds | null | null | open | Yellow warning triangle when implementing sounds i dont undertsand
===
When i impliment sounds in my apps, i always ge a couple of yellow warning triangles with the warning:
"implicit declaration of function "audio services create system soundID" is invalid in C99"
It dosent effect anything in my app i just wondered if its something in my code and something i should be addressing?
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"btnclick", CFSTR
("mp3"), NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundID);
AudioServicesPlaySystemSound (soundID);
| 0 |
5,858,807 | 05/02/2011 15:05:35 | 709,439 | 04/15/2011 08:18:17 | 23 | 0 | On Android simple-xml serial.read() throws StackOverflowError | I'm trying to learn to use xml in Java (Android platform, using Eclipse and simple-xml-2.5.2).
I keep getting a weird java.lang.StackOverflowError in the "serial.read" line in "Training.java".
Can you help fixing the problem? Is it an xml definition error?
I include the source below:
File beacons.java:
package com.marcos.training;
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
@Element
public class Beacons {
@ElementList(inline=true)
private List<Beacon> list;
@Element
private String id;
public String getId() {
return id;
}
public Integer getSize() {
return list.size();
}
public List<Beacon> getList() {
return list;
}
}
File Beacon.java:
package com.marcos.training;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root
public class Beacon {
@Attribute
protected String ssid;
@Element
protected String bssid;
public String getSsid() {
return ssid;
}
public String getBssid() {
return bssid;
}
}
File Training.java:
package com.marcos.training;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.content.res.Resources.NotFoundException;
public class Training extends Activity {
private final static String TAG = Training.class.getCanonicalName();
TextView textStatus;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textStatus = (TextView) findViewById(R.id.textStatus);
Serializer serial = new Persister();
try {
Beacons myBeacons;
try {
myBeacons = serial.read(Beacons.class, getResources().openRawResource(R.xml.beacons));
Log.i(TAG, "Number of Beacons: " + myBeacons.getSize());
} catch (NotFoundException e) {
Log.d(TAG, "Uncaught exception", e);
return;
} catch (Exception e) {
Log.d(TAG, "Uncaught exception", e);
return;
}
int len = myBeacons.getSize();
for (int i = 0; i < len; i++) {
Beacon b = myBeacons.getList().get(i);
textStatus.append("Beacon " + (i+1) + "\n");
textStatus.append(" SSID : " + b.getSsid() + "\n");
textStatus.append(" BSSID : " + b.getBssid() + "\n");
textStatus.append("\n");;
}
} catch (Exception e) {
Log.d(TAG, "Uncaught exception", e);
}
}
}
File beacons.xml:
<?xml version="1.0" encoding="utf-8"?>
<beacons id="1">
<beacon ssid="north">
<bssid>01:02:03:04:05:06</bssid>
</beacon>
<beacon ssid="east">
<bssid>02:03:04:05:06:07</bssid>
</beacon>
<beacon ssid="south">
<bssid>03:04:05:06:07:08</bssid>
</beacon>
<beacon ssid="west">
<bssid>04:05:06:07:08:09</bssid>
</beacon>
</beacons>
| android | simplexml | null | null | null | null | open | On Android simple-xml serial.read() throws StackOverflowError
===
I'm trying to learn to use xml in Java (Android platform, using Eclipse and simple-xml-2.5.2).
I keep getting a weird java.lang.StackOverflowError in the "serial.read" line in "Training.java".
Can you help fixing the problem? Is it an xml definition error?
I include the source below:
File beacons.java:
package com.marcos.training;
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
@Element
public class Beacons {
@ElementList(inline=true)
private List<Beacon> list;
@Element
private String id;
public String getId() {
return id;
}
public Integer getSize() {
return list.size();
}
public List<Beacon> getList() {
return list;
}
}
File Beacon.java:
package com.marcos.training;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
@Root
public class Beacon {
@Attribute
protected String ssid;
@Element
protected String bssid;
public String getSsid() {
return ssid;
}
public String getBssid() {
return bssid;
}
}
File Training.java:
package com.marcos.training;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.content.res.Resources.NotFoundException;
public class Training extends Activity {
private final static String TAG = Training.class.getCanonicalName();
TextView textStatus;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textStatus = (TextView) findViewById(R.id.textStatus);
Serializer serial = new Persister();
try {
Beacons myBeacons;
try {
myBeacons = serial.read(Beacons.class, getResources().openRawResource(R.xml.beacons));
Log.i(TAG, "Number of Beacons: " + myBeacons.getSize());
} catch (NotFoundException e) {
Log.d(TAG, "Uncaught exception", e);
return;
} catch (Exception e) {
Log.d(TAG, "Uncaught exception", e);
return;
}
int len = myBeacons.getSize();
for (int i = 0; i < len; i++) {
Beacon b = myBeacons.getList().get(i);
textStatus.append("Beacon " + (i+1) + "\n");
textStatus.append(" SSID : " + b.getSsid() + "\n");
textStatus.append(" BSSID : " + b.getBssid() + "\n");
textStatus.append("\n");;
}
} catch (Exception e) {
Log.d(TAG, "Uncaught exception", e);
}
}
}
File beacons.xml:
<?xml version="1.0" encoding="utf-8"?>
<beacons id="1">
<beacon ssid="north">
<bssid>01:02:03:04:05:06</bssid>
</beacon>
<beacon ssid="east">
<bssid>02:03:04:05:06:07</bssid>
</beacon>
<beacon ssid="south">
<bssid>03:04:05:06:07:08</bssid>
</beacon>
<beacon ssid="west">
<bssid>04:05:06:07:08:09</bssid>
</beacon>
</beacons>
| 0 |
11,061,102 | 06/16/2012 05:32:53 | 1,425,248 | 05/30/2012 05:45:55 | 6 | 0 | how to Add email address into the textfield | I'm creating an iPhone App which has custom email textfields (similar to gmail, yahoo mail )in which one can add his friend's email address by selecting from the ADDRESS BOOK,FACEBOOK FRIENDS LIST,and the email Address added in the textfield .how can i create the textfield which can add friends in textfield .....and able to delete to entered friends from text field
| ios | iphone-sdk-4.0 | ios4 | xcode4.3 | null | 06/19/2012 11:46:24 | not a real question | how to Add email address into the textfield
===
I'm creating an iPhone App which has custom email textfields (similar to gmail, yahoo mail )in which one can add his friend's email address by selecting from the ADDRESS BOOK,FACEBOOK FRIENDS LIST,and the email Address added in the textfield .how can i create the textfield which can add friends in textfield .....and able to delete to entered friends from text field
| 1 |
7,801,765 | 10/18/2011 02:22:24 | 998,899 | 10/17/2011 09:44:53 | 1 | 0 | How can I get the cpu usage a jvm process consumes for each cpu core using java? | Actually I'm using java to monitor the cpu usage for a certain java process.Here are my questions:
First,is there a limit that a single process can only consume cpu processing time on 1 or limited cpu cores?Or it can use cpu time on each of the cpu core?
Second,if I want to monitor the cpu usage of a certain java process for each cpu core,how can I do that?
And I prefer to handle it using pure java,not native method. | java | cpu | performance-monitoring | null | null | null | open | How can I get the cpu usage a jvm process consumes for each cpu core using java?
===
Actually I'm using java to monitor the cpu usage for a certain java process.Here are my questions:
First,is there a limit that a single process can only consume cpu processing time on 1 or limited cpu cores?Or it can use cpu time on each of the cpu core?
Second,if I want to monitor the cpu usage of a certain java process for each cpu core,how can I do that?
And I prefer to handle it using pure java,not native method. | 0 |
10,015,288 | 04/04/2012 16:22:48 | 1,052,507 | 11/17/2011 19:08:43 | 80 | 0 | SVG Best Practice as of April 2012 | I'm reading an awful lot of articles about SVG and trying to work out the best way forward. But things are not easy,
FIRSTLY the browsers react all a little differently (and so a simple www.canIuse.com isn't enough) and they are in almost constant flux with SVG
SECONDLY many many articles are skewed because they advise based on browsers, that's fine, but they are quite old articles (mostly more than a year) so telling me that maybe one day IE will have support doesn't inspire confidence.
Feel free to comment on animation and js interactivity but I am interested in Adaptive/Flexible/Fluid design with images/image sizes, and being able to link.
I am caught between **Object**, **Embed**, **Img** and putting in the actual **source code**. I'm looking at them in the current desktop browsers, on my very simple android and a mac-pro. But I can't seem to get a decent picture on how things are right now...
**This is not about opinion, I want reasons as to why any of the four options should be excluded.**
In fact I've already excluded **i-frames** because many mobiles don't support i-frames.
| browser | svg | cross-browser | cross-platform | null | 04/06/2012 10:55:24 | not constructive | SVG Best Practice as of April 2012
===
I'm reading an awful lot of articles about SVG and trying to work out the best way forward. But things are not easy,
FIRSTLY the browsers react all a little differently (and so a simple www.canIuse.com isn't enough) and they are in almost constant flux with SVG
SECONDLY many many articles are skewed because they advise based on browsers, that's fine, but they are quite old articles (mostly more than a year) so telling me that maybe one day IE will have support doesn't inspire confidence.
Feel free to comment on animation and js interactivity but I am interested in Adaptive/Flexible/Fluid design with images/image sizes, and being able to link.
I am caught between **Object**, **Embed**, **Img** and putting in the actual **source code**. I'm looking at them in the current desktop browsers, on my very simple android and a mac-pro. But I can't seem to get a decent picture on how things are right now...
**This is not about opinion, I want reasons as to why any of the four options should be excluded.**
In fact I've already excluded **i-frames** because many mobiles don't support i-frames.
| 4 |
6,277,085 | 06/08/2011 10:02:15 | 404,949 | 07/28/2010 19:39:15 | 88 | 7 | ie7 png opacity. is it possible | 1) dont use ie8 with option "work as ie7". it lies in this case
2) use clean ie7 or ietester last version
For example test.png can be 50% tranparency jpeg picture.
I know 2 methods to use it in ie7:
background-image: "test.png"; filter: alpha(opacity=50)
you will see **gray** image
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="test.png")
alpha(opacity=50);
background: none;
you will see **white** image
2 variant came to us from ie6! | html | css | internet-explorer-7 | internet-explorer-6 | null | null | open | ie7 png opacity. is it possible
===
1) dont use ie8 with option "work as ie7". it lies in this case
2) use clean ie7 or ietester last version
For example test.png can be 50% tranparency jpeg picture.
I know 2 methods to use it in ie7:
background-image: "test.png"; filter: alpha(opacity=50)
you will see **gray** image
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="test.png")
alpha(opacity=50);
background: none;
you will see **white** image
2 variant came to us from ie6! | 0 |
11,354,205 | 07/06/2012 00:05:55 | 1,505,430 | 07/05/2012 23:44:51 | 1 | 0 | Asynchronous Game Server Data Handling | I am programming an asynchronous puzzle game server where players will create games with other players on their friends list, and play the game. For example, let's say I am making a sudoku game pulling from a bank of puzzles on the servers database.. what would be the best way to handle the security of the game?
My current thoughts are to have the puzzle sent to the client, but not the solution. With each tile being placed, it checks with the server (http post) to see if it is correct or not and returns a true/false value to the client. If the item is false, the placed piece will fall back down and there will be some feedback for the error that occurred. This also allows time to be tracked on the server end, and will deem anyone unable to just "tell" the server how long it took to complete the game.
I am using a LAMP setup (Linux, Apache, MySQL, and PHP) with Memcached to store the solution for a given amount of time to lessen the database load on the frequent checks users will post. I also have a "check in" and "check out" for any given game where the server also logs the time it takes to complete the puzzle. The ability to check out lets the time counter stop and the user can return to the puzzle later.
My question is about security vs performance costs. If I were to have many users playing games and sending 1 small request to check the validity of a single tile piece.. is this overkill? It sounds like the best secure way to implement, however I am not sure of better practices. I have also considered encrypting the solution and letting the client use it to check for errors on completion, but this might kill the validity of "time" it takes to complete the puzzle and any random benefits of finding a "hidden" bonus in the board since the client would have to tell the server when it got these things.
What are your thoughts on this?
Thanks for any help! | php | mysql | linux | asynchronous | null | 07/06/2012 11:51:15 | not a real question | Asynchronous Game Server Data Handling
===
I am programming an asynchronous puzzle game server where players will create games with other players on their friends list, and play the game. For example, let's say I am making a sudoku game pulling from a bank of puzzles on the servers database.. what would be the best way to handle the security of the game?
My current thoughts are to have the puzzle sent to the client, but not the solution. With each tile being placed, it checks with the server (http post) to see if it is correct or not and returns a true/false value to the client. If the item is false, the placed piece will fall back down and there will be some feedback for the error that occurred. This also allows time to be tracked on the server end, and will deem anyone unable to just "tell" the server how long it took to complete the game.
I am using a LAMP setup (Linux, Apache, MySQL, and PHP) with Memcached to store the solution for a given amount of time to lessen the database load on the frequent checks users will post. I also have a "check in" and "check out" for any given game where the server also logs the time it takes to complete the puzzle. The ability to check out lets the time counter stop and the user can return to the puzzle later.
My question is about security vs performance costs. If I were to have many users playing games and sending 1 small request to check the validity of a single tile piece.. is this overkill? It sounds like the best secure way to implement, however I am not sure of better practices. I have also considered encrypting the solution and letting the client use it to check for errors on completion, but this might kill the validity of "time" it takes to complete the puzzle and any random benefits of finding a "hidden" bonus in the board since the client would have to tell the server when it got these things.
What are your thoughts on this?
Thanks for any help! | 1 |
1,418,670 | 09/13/2009 19:48:38 | 1,125,173 | 07/29/2009 13:18:34 | 20 | 1 | PHP Force download return corrupted file! | Hi I'm currently working on some php - zend framework project on my osx - apache. The problem is when ever I want to force the download of some files using my php application the downloaded files is corrupted and the size of the file is 5.4 kb! I've tried so many changes in my code and even used some classes to force the download but still the problem is the same! I should say I used the force download in one my controllers' actions. Does the rewrite or something likes this has affect over the downloading of the file ?!
This is the base code :
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file["files_url"]));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file["files_url"]));
ob_clean();
flush();
readfile($file["files_url"]);
exit;*/
And the Classes I used : BF_Download
$download = new Download($file["files_url"],$file["files_title"],"on",20);
$download->download_file();
And :
$zip = new zip_file("../".$file["files_title"].".zip");
$zip->set_options(array('inmemory' => 1, 'recurse' => 0, 'storepaths' => 0));
$zip->add_files($file["files_url"]);
$zip->create_archive();
$zip->download_file();*/ | zend-framework | force | download | php | null | 05/07/2012 21:12:28 | too localized | PHP Force download return corrupted file!
===
Hi I'm currently working on some php - zend framework project on my osx - apache. The problem is when ever I want to force the download of some files using my php application the downloaded files is corrupted and the size of the file is 5.4 kb! I've tried so many changes in my code and even used some classes to force the download but still the problem is the same! I should say I used the force download in one my controllers' actions. Does the rewrite or something likes this has affect over the downloading of the file ?!
This is the base code :
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file["files_url"]));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file["files_url"]));
ob_clean();
flush();
readfile($file["files_url"]);
exit;*/
And the Classes I used : BF_Download
$download = new Download($file["files_url"],$file["files_title"],"on",20);
$download->download_file();
And :
$zip = new zip_file("../".$file["files_title"].".zip");
$zip->set_options(array('inmemory' => 1, 'recurse' => 0, 'storepaths' => 0));
$zip->add_files($file["files_url"]);
$zip->create_archive();
$zip->download_file();*/ | 3 |
27,599 | 08/26/2008 09:04:19 | 2,951 | 08/26/2008 08:47:13 | 1 | 0 | 'Reliable' SMS Unicode Encoding in PHP | I'm not very experienced with internationalisation using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for.
I'm in need of working out a reliable way to convert only 'relevant' text to Unicode to send in an SMS message, using PHP (just temporarily, whilst a service is rewritten using C#) - obviously, messages sent at the moment are either sent as plain text, or encoded using the GSM 03.38 charset.
I could conceivably convert everything to the Unicode charset (as opposed to using the standard GSM charset), but that would mean that *all* messages would be limited to 70 characters (instead of 160).
So, I guess my real question is: *what is the most reliable way to detect the requirement for a message to be Unicode-encoded, so I only have to do it when it's ****absolutely necessary**** (e.g. for non-Latin-language characters)?* | php | unicode | internationalization | sms | gsm | null | open | 'Reliable' SMS Unicode Encoding in PHP
===
I'm not very experienced with internationalisation using PHP, it must be said, and a deal of searching didn't really provide the answers I was looking for.
I'm in need of working out a reliable way to convert only 'relevant' text to Unicode to send in an SMS message, using PHP (just temporarily, whilst a service is rewritten using C#) - obviously, messages sent at the moment are either sent as plain text, or encoded using the GSM 03.38 charset.
I could conceivably convert everything to the Unicode charset (as opposed to using the standard GSM charset), but that would mean that *all* messages would be limited to 70 characters (instead of 160).
So, I guess my real question is: *what is the most reliable way to detect the requirement for a message to be Unicode-encoded, so I only have to do it when it's ****absolutely necessary**** (e.g. for non-Latin-language characters)?* | 0 |
6,490,253 | 06/27/2011 08:22:03 | 816,981 | 06/27/2011 08:22:03 | 1 | 0 | How can best deal with this complicated ACL situation using CakePHP? | I'm making a small application to handle project related information and I'm having troubles with ACL. How do I best deal with the following situation?
## My app has the following tables: ##
**users**: Keeps the users info (username, pass, email, group, etc)
**groups**: Groups where the users belong to. I have "administrators", "managers" and "registered"
**roles**: Roles for the registered users. I have "leader", "member" and "guest".
**memberships**: This table keeps the relationship between users, roles and projects.
**projects**: Keeps the projects info
**items**: Projects have several information items. This table keeps these items.
## The tables have the following relationships: ##
**users**: hasMany Memberships, belongsTo Groups.
**groups**: hasMany Users
**roles**: hasMany Memberships
**memberships**: belongsTo Users, Projects, Roles
**projects**: hasMany Memberships, Items
**items**: belongsTo Projects
Basically managers (or administrators) can assign roles to registered users. Leaders and members can belong to several projects. Those belonging to a specific project can edit that project's data and its associated items. Leaders can assign members to a project from the pool of registered users.
## Here is the situation in terms of CRUD: ##
**Administrators**: Full CRUD on everything (users, memberships, projects, items)
**Managers**: Can CRUD users of type "registered" but not "managers" or "administrators". Full CRUD on memberships, projects and items.
**registered**: Can do different things based on their roles:
**leaders (role)**: Can update their own user info and read other user data that belong to their projects (info stored in the "memberships" table). Can CRUD memberships for their projects. Can CRUD items for their own projects. Can update their own projects.
**members (role)**: Can update their own user info and read other user data that belong to their projects. Can CRUD items for their own projects. Can read memberships for their own projects. Can update their own projects.
**guests (role)**: Can update their own user info. Can read projects.
Based on the above situation what do you think will be the best approach to deal with it? I tried with ACL but somewhere on the way I lost it. I tried playing with some of the ACL plugins available with no success. The biggest challenge is to deal with the permission creation by the managers and administrators. Please help!
I'm not yet an adept cake-baker so please be kind. Your suggestions and recommendation will be greatly appreciated. Thank you! | cakephp | cakephp-1.3 | acl | null | null | null | open | How can best deal with this complicated ACL situation using CakePHP?
===
I'm making a small application to handle project related information and I'm having troubles with ACL. How do I best deal with the following situation?
## My app has the following tables: ##
**users**: Keeps the users info (username, pass, email, group, etc)
**groups**: Groups where the users belong to. I have "administrators", "managers" and "registered"
**roles**: Roles for the registered users. I have "leader", "member" and "guest".
**memberships**: This table keeps the relationship between users, roles and projects.
**projects**: Keeps the projects info
**items**: Projects have several information items. This table keeps these items.
## The tables have the following relationships: ##
**users**: hasMany Memberships, belongsTo Groups.
**groups**: hasMany Users
**roles**: hasMany Memberships
**memberships**: belongsTo Users, Projects, Roles
**projects**: hasMany Memberships, Items
**items**: belongsTo Projects
Basically managers (or administrators) can assign roles to registered users. Leaders and members can belong to several projects. Those belonging to a specific project can edit that project's data and its associated items. Leaders can assign members to a project from the pool of registered users.
## Here is the situation in terms of CRUD: ##
**Administrators**: Full CRUD on everything (users, memberships, projects, items)
**Managers**: Can CRUD users of type "registered" but not "managers" or "administrators". Full CRUD on memberships, projects and items.
**registered**: Can do different things based on their roles:
**leaders (role)**: Can update their own user info and read other user data that belong to their projects (info stored in the "memberships" table). Can CRUD memberships for their projects. Can CRUD items for their own projects. Can update their own projects.
**members (role)**: Can update their own user info and read other user data that belong to their projects. Can CRUD items for their own projects. Can read memberships for their own projects. Can update their own projects.
**guests (role)**: Can update their own user info. Can read projects.
Based on the above situation what do you think will be the best approach to deal with it? I tried with ACL but somewhere on the way I lost it. I tried playing with some of the ACL plugins available with no success. The biggest challenge is to deal with the permission creation by the managers and administrators. Please help!
I'm not yet an adept cake-baker so please be kind. Your suggestions and recommendation will be greatly appreciated. Thank you! | 0 |
8,831,138 | 01/12/2012 06:46:40 | 671,150 | 03/22/2011 12:12:23 | 30 | 0 | Persisting entities with references to other entity classes in JPA | I am working with JSF 2.1, Netbeans 7.0.1, Glassfish 3.1.1, JPA + EJB.
For instance, I have an entity class called User and it has reference (many-to-one relationship) with entity class UserType.
The table user_type associated with the entity UserType is already loaded with all possible user types and no data are supposed to be added to this table. The data from the table user_type is only used to choose from.
In one of the forms I ask user to choose UserType for the User being created by using
h:selectOneListBox tag. In the backing bean I create new UserType object, set the chosen id to it and put UserType into the User entity class. However, all other fields in created object of UserType are null.
My question is when I persist User into the database will JPA "understand" that the UserType with such id referenced by the User entity already exists in the database and will just update (merge) the existing record and not try to create a new one.
Or I have to preload the needed entity UserType from the database by its id and then put it into User and the ask JPA to update UserType?
| jpa | jsf-2.0 | merge | entity | persist | null | open | Persisting entities with references to other entity classes in JPA
===
I am working with JSF 2.1, Netbeans 7.0.1, Glassfish 3.1.1, JPA + EJB.
For instance, I have an entity class called User and it has reference (many-to-one relationship) with entity class UserType.
The table user_type associated with the entity UserType is already loaded with all possible user types and no data are supposed to be added to this table. The data from the table user_type is only used to choose from.
In one of the forms I ask user to choose UserType for the User being created by using
h:selectOneListBox tag. In the backing bean I create new UserType object, set the chosen id to it and put UserType into the User entity class. However, all other fields in created object of UserType are null.
My question is when I persist User into the database will JPA "understand" that the UserType with such id referenced by the User entity already exists in the database and will just update (merge) the existing record and not try to create a new one.
Or I have to preload the needed entity UserType from the database by its id and then put it into User and the ask JPA to update UserType?
| 0 |
3,570,244 | 08/25/2010 21:12:20 | 325,932 | 04/26/2010 11:37:21 | 17 | 0 | On postback lose value from dynamically created textbox gridview | I dynamically create gridview, and in this grid I have template field also
field.HeaderTemplate = New GridViewTemplate(ListItemType.Header, col.ColumnName)
field.ItemTemplate = New GridViewTemplate(ListItemType.Item, col.ColumnName)
grdEmpty.Columns.Add(bfield)
but when enter some value in text box in this template field i lose value on postback. And also on postback I lose all template field and i must re-create this grid.
My goal is: I have button and i want to add new row in this grid, but i want to have all value also.
I struggle with this all day, and any help is welcome.
Tnx,
| asp.net | null | null | null | null | null | open | On postback lose value from dynamically created textbox gridview
===
I dynamically create gridview, and in this grid I have template field also
field.HeaderTemplate = New GridViewTemplate(ListItemType.Header, col.ColumnName)
field.ItemTemplate = New GridViewTemplate(ListItemType.Item, col.ColumnName)
grdEmpty.Columns.Add(bfield)
but when enter some value in text box in this template field i lose value on postback. And also on postback I lose all template field and i must re-create this grid.
My goal is: I have button and i want to add new row in this grid, but i want to have all value also.
I struggle with this all day, and any help is welcome.
Tnx,
| 0 |
281,527 | 11/11/2008 17:15:55 | 4,531 | 09/04/2008 17:20:02 | 55 | 6 | Defrag a virtual hard disk (.vhd) ? | Like any other hard disk, virtual hard discs (*.vhd) will suffer from fragmentation.
So to keep good performance i guess i have to defrag first the virtual hard disc from within the virtual machine and also the (physical) hard disc the .vhd is stored on.
First, are these assumption correct?
And second, is there a way to defrag both (virtual and physical hard disc) at once?
Thanks in advance! | virtualization | vhd | null | null | null | 02/28/2012 14:57:50 | off topic | Defrag a virtual hard disk (.vhd) ?
===
Like any other hard disk, virtual hard discs (*.vhd) will suffer from fragmentation.
So to keep good performance i guess i have to defrag first the virtual hard disc from within the virtual machine and also the (physical) hard disc the .vhd is stored on.
First, are these assumption correct?
And second, is there a way to defrag both (virtual and physical hard disc) at once?
Thanks in advance! | 2 |
5,414,376 | 03/24/2011 03:21:12 | 607,559 | 02/08/2011 04:12:19 | 1 | 0 | Is there a program or app that can sort items using manual choices and deductive logic? | Eg: In a list of three items ("1", "2", "3") the user is asked which item is higher, 1 or 2. They select 1. They are then asked which is higher, 2 or 3. They select 3. The system then reasons: "1 is higher than 2. If 3 is lower than 2 it must logically be lower than 1 also." etc.
(So that you can sort a list of items with the fewest theoretical comparisons possible.)
Thanks! | application | null | null | null | null | 03/24/2011 13:08:48 | off topic | Is there a program or app that can sort items using manual choices and deductive logic?
===
Eg: In a list of three items ("1", "2", "3") the user is asked which item is higher, 1 or 2. They select 1. They are then asked which is higher, 2 or 3. They select 3. The system then reasons: "1 is higher than 2. If 3 is lower than 2 it must logically be lower than 1 also." etc.
(So that you can sort a list of items with the fewest theoretical comparisons possible.)
Thanks! | 2 |
880,878 | 05/19/2009 03:47:40 | 77,546 | 03/13/2009 04:31:07 | 966 | 48 | Is there a way to take a screenshot of the user's Windows desktop? | I want to provide the user with a scaled-down screenshot of their desktop in my application.
**Is there a way to take a screenshot of the current user's Windows desktop?**
I'm writing in C#, but if there's a better solution in another language, I'm open to it. | c# | windows | desktop | screenshot | null | null | open | Is there a way to take a screenshot of the user's Windows desktop?
===
I want to provide the user with a scaled-down screenshot of their desktop in my application.
**Is there a way to take a screenshot of the current user's Windows desktop?**
I'm writing in C#, but if there's a better solution in another language, I'm open to it. | 0 |
11,342,610 | 07/05/2012 10:38:10 | 1,242,707 | 03/01/2012 13:04:10 | 15 | 0 | Using selectors for image view in android | I have around 6 images which i am using as tabs in my application.Its just images and they aren't the tabs that android provides.
So my question is that when i click on a image i want replace the image with a another image so that it can let user know that which tab is selected.
What i am did was creating different xml for this <include> it in my layout.But its tedious to do so since I can't be creating different xml's for every image.
What i am trying to do now is using <selector> for this but not getting the result.
How is it possible to use for this ?
| android | android-imageview | null | null | null | null | open | Using selectors for image view in android
===
I have around 6 images which i am using as tabs in my application.Its just images and they aren't the tabs that android provides.
So my question is that when i click on a image i want replace the image with a another image so that it can let user know that which tab is selected.
What i am did was creating different xml for this <include> it in my layout.But its tedious to do so since I can't be creating different xml's for every image.
What i am trying to do now is using <selector> for this but not getting the result.
How is it possible to use for this ?
| 0 |
11,076,077 | 06/18/2012 01:27:10 | 383,403 | 07/05/2010 05:27:58 | 472 | 8 | Most efficient way to find the common prefix of many strings | What is the most efficient way to find the common prefix of many strings.
For example:
For this set of strings
/home/texai/www/app/application/cron/logCron.log
/home/texai/www/app/application/jobs/logCron.log
/home/texai/www/app/var/log/application.log
/home/texai/www/app/public/imagick.log
/home/texai/www/app/public/status.log
I wanna get `/home/texai/www/app/`
I want to avoid char by char comparatives. | string | algorithm | prefix | null | null | null | open | Most efficient way to find the common prefix of many strings
===
What is the most efficient way to find the common prefix of many strings.
For example:
For this set of strings
/home/texai/www/app/application/cron/logCron.log
/home/texai/www/app/application/jobs/logCron.log
/home/texai/www/app/var/log/application.log
/home/texai/www/app/public/imagick.log
/home/texai/www/app/public/status.log
I wanna get `/home/texai/www/app/`
I want to avoid char by char comparatives. | 0 |
7,776,401 | 10/15/2011 07:14:23 | 203,170 | 11/05/2009 04:43:54 | 424 | 9 | Trouble installing ADT | "Cannot complete the install because of a conflicting dependency.
Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)" | android | null | null | null | null | 10/15/2011 16:24:27 | not a real question | Trouble installing ADT
===
"Cannot complete the install because of a conflicting dependency.
Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)" | 1 |
11,088,900 | 06/18/2012 18:33:54 | 612,734 | 02/11/2011 08:26:19 | 1,238 | 92 | How does gravity affect a vector | My apologies if you think this question is supposed to be on the Math exchange, they scare me a bit and their answers usually don't make any sense to me.
Right, I'm trying to get very basic physics in Javascript. I have a vector(direction and magnitude) and I need to modify both direction and magnitude because... well... gravity. I do know how to calculate it all using an x and y speed, but I wanted to go for a different approach this time and use vectors instead though I'm failing to understand it.
I'm sorry for giving so little information, but I'm clueless...
particle.velocity.angle += ?;
particle.velocity.speed += ?;
**What's the equation of modifying the angle and speed of a vector using an acceleration?** | javascript | physics | null | null | null | null | open | How does gravity affect a vector
===
My apologies if you think this question is supposed to be on the Math exchange, they scare me a bit and their answers usually don't make any sense to me.
Right, I'm trying to get very basic physics in Javascript. I have a vector(direction and magnitude) and I need to modify both direction and magnitude because... well... gravity. I do know how to calculate it all using an x and y speed, but I wanted to go for a different approach this time and use vectors instead though I'm failing to understand it.
I'm sorry for giving so little information, but I'm clueless...
particle.velocity.angle += ?;
particle.velocity.speed += ?;
**What's the equation of modifying the angle and speed of a vector using an acceleration?** | 0 |
10,725,763 | 05/23/2012 18:29:29 | 1,317,982 | 04/06/2012 17:41:18 | 39 | 0 | Good free antivirus for Mac | I look for a good free antivirus for Mac. I like AVG, but I had a problem to install it on the Mac. Does there exist AVG for Mac or some other good antivirus? Thanks | osx | antivirus | null | null | null | 05/23/2012 19:53:27 | off topic | Good free antivirus for Mac
===
I look for a good free antivirus for Mac. I like AVG, but I had a problem to install it on the Mac. Does there exist AVG for Mac or some other good antivirus? Thanks | 2 |
9,828,375 | 03/22/2012 18:32:51 | 1,286,456 | 03/22/2012 16:29:32 | 1 | 0 | Read text data from Flash | everyone.
How can I read embedded text inside Flash?
For example, [http://www.bet365.com/home/FlashGen4/WebConsoleApp.asp?][1] there are results of games in flash format ("Chelsea - Liverpool 0-0").
How to get "Chelsea - Liverpool 0-0" from there?
[1]: http://www.bet365.com/home/FlashGen4/WebConsoleApp.asp? | flash | text | get | embedded | null | null | open | Read text data from Flash
===
everyone.
How can I read embedded text inside Flash?
For example, [http://www.bet365.com/home/FlashGen4/WebConsoleApp.asp?][1] there are results of games in flash format ("Chelsea - Liverpool 0-0").
How to get "Chelsea - Liverpool 0-0" from there?
[1]: http://www.bet365.com/home/FlashGen4/WebConsoleApp.asp? | 0 |
399,459 | 12/30/2008 03:23:45 | 17,510 | 09/18/2008 10:26:18 | 39 | 0 | NHibernate Mapping intermediary table | Hi I'm looking for some help in mapping the following tables to a hibernate mapping file:
![schema image][1]
I'm trying to fill the localCalandarGroups List with related localCalendarGroups when loading my userVOs. I'm using a intermediary table(user_localCalendarGroup) to keep the user and localCalendarGroup ids
public class UserVO
{
public virtual int id { get; set; }
public virtual string name { get; set; }
public virtual string pass { get; set; }
public virtual string email { get; set; }
public virtual string level { get; set; }
public virtual List<LocalCalendarGroupVO> localCalendarGroups { get; set; }
}
public class LocalCalendarGroupVO
{
public virtual int id { get; set; }
public virtual string name { get; set; }
}
This is my mapping file thus far. How can I make NHibernate aware of the intermediary table?
<class name="UserVO" table="tb_users" lazy="false">
<id name="id" column="id">
<generator class="native" />
</id>
<property name="name" />
<property name="pass" />
<property name="level" />
<property name="email" />
<property name="localCalendarGroups"/>
</class>
Any help,pointers much appreciated.
[1]: http://barry-jones.com/temp/sch2.jpg | nhibernate | hibernate | null | null | null | null | open | NHibernate Mapping intermediary table
===
Hi I'm looking for some help in mapping the following tables to a hibernate mapping file:
![schema image][1]
I'm trying to fill the localCalandarGroups List with related localCalendarGroups when loading my userVOs. I'm using a intermediary table(user_localCalendarGroup) to keep the user and localCalendarGroup ids
public class UserVO
{
public virtual int id { get; set; }
public virtual string name { get; set; }
public virtual string pass { get; set; }
public virtual string email { get; set; }
public virtual string level { get; set; }
public virtual List<LocalCalendarGroupVO> localCalendarGroups { get; set; }
}
public class LocalCalendarGroupVO
{
public virtual int id { get; set; }
public virtual string name { get; set; }
}
This is my mapping file thus far. How can I make NHibernate aware of the intermediary table?
<class name="UserVO" table="tb_users" lazy="false">
<id name="id" column="id">
<generator class="native" />
</id>
<property name="name" />
<property name="pass" />
<property name="level" />
<property name="email" />
<property name="localCalendarGroups"/>
</class>
Any help,pointers much appreciated.
[1]: http://barry-jones.com/temp/sch2.jpg | 0 |
10,399,105 | 05/01/2012 14:25:44 | 1,359,077 | 04/26/2012 15:21:51 | 1 | 0 | Finding and printing a value that's added from a start date to an end date inside a file in python | I need to know how to find a start and end date in a file. Then print the data in the form like this, with each asterisk represents $100, the 01: and so on represent the day of the month indicated on top in a different line
- 2001.03.1
- 01: ****
etc... then add the money from the start to the end date together and print it at the end.
the dates and sales in the file are in the format 'YYYY,MM,DD,$$$$.$$ | python | find | start | end | null | 05/01/2012 16:24:48 | not a real question | Finding and printing a value that's added from a start date to an end date inside a file in python
===
I need to know how to find a start and end date in a file. Then print the data in the form like this, with each asterisk represents $100, the 01: and so on represent the day of the month indicated on top in a different line
- 2001.03.1
- 01: ****
etc... then add the money from the start to the end date together and print it at the end.
the dates and sales in the file are in the format 'YYYY,MM,DD,$$$$.$$ | 1 |
8,856,030 | 01/13/2012 19:21:33 | 237,858 | 12/23/2009 19:31:56 | 1,467 | 33 | Limit database usage of a website | To start off - I have 2 separate websites and a database (IIS 7.5, ASP.NET and SQL Server 2008, using Linq-To-SQL for database access).
I have a separate administrative website that sometimes, during usage needs to trigger long running operations (more than 10 seconds) on database. The problem is that those operations cause sqlserver process to hit 100% CPU and then other, main customer website, can't access database promptly - there are some delays in accessing database.
I am OK with those administrative operations lasting 2x or 4x or nx times longer since they are lower priority.
I've tried using CPU Limit setting on AppPool in IIS, but that doesn't help, as w3wp.exe process never uses much of CPU... rather it's sqlservr.exe. Thanks in advance for your suggestions! | asp.net | sql | sql-server-2008 | iis | null | null | open | Limit database usage of a website
===
To start off - I have 2 separate websites and a database (IIS 7.5, ASP.NET and SQL Server 2008, using Linq-To-SQL for database access).
I have a separate administrative website that sometimes, during usage needs to trigger long running operations (more than 10 seconds) on database. The problem is that those operations cause sqlserver process to hit 100% CPU and then other, main customer website, can't access database promptly - there are some delays in accessing database.
I am OK with those administrative operations lasting 2x or 4x or nx times longer since they are lower priority.
I've tried using CPU Limit setting on AppPool in IIS, but that doesn't help, as w3wp.exe process never uses much of CPU... rather it's sqlservr.exe. Thanks in advance for your suggestions! | 0 |
1,208,247 | 07/30/2009 17:56:58 | 83,839 | 03/27/2009 22:02:03 | 353 | 22 | C# Enumerations and Duplicate Values - dangers? | I was wondering about C# Enumerations and what happens with duplicate values. I created the following small program to test things out:
namespace ConsoleTest
{
enum TestEnum
{
FirstElement = -1,
SecondElement,
ThirdElement,
Duplicate = FirstElement
}
/// <summary>
/// Summary description for MainConsole.
/// </summary>
public class MainConsole
{
/// <summary>
/// Constructor for the class.
/// </summary>
public MainConsole()
{
//
// TODO: Add constructor logic here
//
}
/// <summary>
/// Entry point for the application.
/// </summary>
/// <param name="args">Arguments to the application</param>
public static void Main(string[] args)
{
TestEnum first = TestEnum.FirstElement;
TestEnum second = TestEnum.SecondElement;
TestEnum duplicate = TestEnum.Duplicate;
foreach (string str in Enum.GetNames(typeof(TestEnum)))
{
Console.WriteLine("Name is: " + str);
}
Console.WriteLine("first string is: " + first.ToString());
Console.WriteLine("value is: " + ((int)first).ToString());
Console.WriteLine("second string is: " + second.ToString());
Console.WriteLine("value is: " + ((int)second).ToString());
Console.WriteLine("duplicate string is: " + duplicate.ToString());
Console.WriteLine("value is: " + ((int)duplicate).ToString());
TestEnum fromStr = (TestEnum)Enum.Parse(typeof(TestEnum), "duplicate", true);
Console.WriteLine("fromstr string is: " + fromStr.ToString());
Console.WriteLine("value is: " + ((int)fromStr).ToString());
if (fromStr == TestEnum.Duplicate)
{
Console.WriteLine("Duplicate compares the same as FirstElement");
}
else
{
Console.WriteLine("Duplicate does NOT compare the same as FirstElement");
}
}
}
}
Which produces the following output:
Name is: SecondElement
Name is: ThirdElement
Name is: FirstElement
Name is: Duplicate
first string is: FirstElement
value is: -1
second string is: SecondElement
value is: 0
duplicate string is: FirstElement
value is: -1
fromstr string is: FirstElement
value is: -1
Duplicate compares the same as FirstElement
Press any key to continue . . .
This seems to be EXACTLY what I want and expect since I'm constructing something that a version tag will increment every so often, so I want something that I can "assign" to the current version, and even compare to it.
Here's the question though: what's the pitfalls of this approach? Is there one? Is it just bad style (I don't want to end up on thedailywtf)? Is there a lot better way of doing something like this? I'm on .NET 2.0 and do NOT have the option to go to 3.5 or 4.0.
Opinions are welcome.
| c# | enums | .net-2.0 | null | null | null | open | C# Enumerations and Duplicate Values - dangers?
===
I was wondering about C# Enumerations and what happens with duplicate values. I created the following small program to test things out:
namespace ConsoleTest
{
enum TestEnum
{
FirstElement = -1,
SecondElement,
ThirdElement,
Duplicate = FirstElement
}
/// <summary>
/// Summary description for MainConsole.
/// </summary>
public class MainConsole
{
/// <summary>
/// Constructor for the class.
/// </summary>
public MainConsole()
{
//
// TODO: Add constructor logic here
//
}
/// <summary>
/// Entry point for the application.
/// </summary>
/// <param name="args">Arguments to the application</param>
public static void Main(string[] args)
{
TestEnum first = TestEnum.FirstElement;
TestEnum second = TestEnum.SecondElement;
TestEnum duplicate = TestEnum.Duplicate;
foreach (string str in Enum.GetNames(typeof(TestEnum)))
{
Console.WriteLine("Name is: " + str);
}
Console.WriteLine("first string is: " + first.ToString());
Console.WriteLine("value is: " + ((int)first).ToString());
Console.WriteLine("second string is: " + second.ToString());
Console.WriteLine("value is: " + ((int)second).ToString());
Console.WriteLine("duplicate string is: " + duplicate.ToString());
Console.WriteLine("value is: " + ((int)duplicate).ToString());
TestEnum fromStr = (TestEnum)Enum.Parse(typeof(TestEnum), "duplicate", true);
Console.WriteLine("fromstr string is: " + fromStr.ToString());
Console.WriteLine("value is: " + ((int)fromStr).ToString());
if (fromStr == TestEnum.Duplicate)
{
Console.WriteLine("Duplicate compares the same as FirstElement");
}
else
{
Console.WriteLine("Duplicate does NOT compare the same as FirstElement");
}
}
}
}
Which produces the following output:
Name is: SecondElement
Name is: ThirdElement
Name is: FirstElement
Name is: Duplicate
first string is: FirstElement
value is: -1
second string is: SecondElement
value is: 0
duplicate string is: FirstElement
value is: -1
fromstr string is: FirstElement
value is: -1
Duplicate compares the same as FirstElement
Press any key to continue . . .
This seems to be EXACTLY what I want and expect since I'm constructing something that a version tag will increment every so often, so I want something that I can "assign" to the current version, and even compare to it.
Here's the question though: what's the pitfalls of this approach? Is there one? Is it just bad style (I don't want to end up on thedailywtf)? Is there a lot better way of doing something like this? I'm on .NET 2.0 and do NOT have the option to go to 3.5 or 4.0.
Opinions are welcome.
| 0 |
8,288,192 | 11/27/2011 19:04:39 | 891,306 | 08/12/2011 07:21:14 | 30 | 1 | ssh issue in GitHub | I have been facing this problem for so many days. I know there are many questions already posted on stackoverflow regarding this issue, but unfortunately none of them worked in my case. I am using Windows XP. One more thing I wanna make clear is that I correctly copied the ssh key and followed exactly what's given here - http://help.github.com/win-set-up-git/
I am getting the following issue -
hjha@HJHA-LAP ~/.ssh
$ ssh -T git@github.com
Permission denied (publickey).
details -
hjha@HJHA-LAP ~/.ssh
$ ssh -v git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Documents and Settings/hjha/.ssh/config
debug1: Applying options for github.com
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file C:\\Documents\\ and\\ Settings\\hjha\\\\.ssh\\id_rsa type
-1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Documents and Settings/hjha/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Documents\\ and\\ Settings\\hjha\\\\.ssh\\id_rsa
debug1: No more authentication methods to try.
Permission denied (publickey).
| git | ssh | github | null | null | 11/27/2011 19:25:55 | off topic | ssh issue in GitHub
===
I have been facing this problem for so many days. I know there are many questions already posted on stackoverflow regarding this issue, but unfortunately none of them worked in my case. I am using Windows XP. One more thing I wanna make clear is that I correctly copied the ssh key and followed exactly what's given here - http://help.github.com/win-set-up-git/
I am getting the following issue -
hjha@HJHA-LAP ~/.ssh
$ ssh -T git@github.com
Permission denied (publickey).
details -
hjha@HJHA-LAP ~/.ssh
$ ssh -v git@github.com
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Documents and Settings/hjha/.ssh/config
debug1: Applying options for github.com
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file C:\\Documents\\ and\\ Settings\\hjha\\\\.ssh\\id_rsa type
-1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Documents and Settings/hjha/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: C:\\Documents\\ and\\ Settings\\hjha\\\\.ssh\\id_rsa
debug1: No more authentication methods to try.
Permission denied (publickey).
| 2 |
10,303,215 | 04/24/2012 17:47:16 | 1,354,382 | 04/24/2012 17:23:05 | 1 | 0 | MySQL - Return Multiple Rows based on IN () | Working with MySQL, I've got two tables - one with videos, the other with products. Each row in the products table has a column called productVideoOrder, which is a comma separated list of videoIDs (relating to the video table) in the order that the user has placed them.
What I describe below would be easier if the relationship was in an intermediate table, but for other functions of this project, the comma separated list made sense.
I'm trying to get a table that returns column one: videoTitle, column two: productName. Is there a way to left join based on a comma separated list? I would like the results table to allow repeated rows, for example, if two product lists video one in the productVideoOrder, this table would have two rows for that video, one listing product one, the other listing product two.
I can clarify anything needed. Thanks in advance!
| php | mysql | left-join | null | null | null | open | MySQL - Return Multiple Rows based on IN ()
===
Working with MySQL, I've got two tables - one with videos, the other with products. Each row in the products table has a column called productVideoOrder, which is a comma separated list of videoIDs (relating to the video table) in the order that the user has placed them.
What I describe below would be easier if the relationship was in an intermediate table, but for other functions of this project, the comma separated list made sense.
I'm trying to get a table that returns column one: videoTitle, column two: productName. Is there a way to left join based on a comma separated list? I would like the results table to allow repeated rows, for example, if two product lists video one in the productVideoOrder, this table would have two rows for that video, one listing product one, the other listing product two.
I can clarify anything needed. Thanks in advance!
| 0 |
7,594,701 | 09/29/2011 08:47:10 | 792,225 | 06/10/2011 06:22:39 | 6 | 0 | Excel having columns with dot(.) | I am working in c# windows forms product.
I am exporting some data to an excel.these data are inputted by the user.the rows in he dataset are made columns in the excel.these column names has 'dot'. While exporting,these columns remain the same.But while trying to import back the data,the column names which are having dot will have # in the dataset
eg..initially it was A.B,now in dataset it is A#B.
on the client side i cannot simply convert # to dot as the user can also give input with #.Please help me to solve this problem.I am not able to find a solution.
Thanks
Neethu | c# | excel | null | null | null | null | open | Excel having columns with dot(.)
===
I am working in c# windows forms product.
I am exporting some data to an excel.these data are inputted by the user.the rows in he dataset are made columns in the excel.these column names has 'dot'. While exporting,these columns remain the same.But while trying to import back the data,the column names which are having dot will have # in the dataset
eg..initially it was A.B,now in dataset it is A#B.
on the client side i cannot simply convert # to dot as the user can also give input with #.Please help me to solve this problem.I am not able to find a solution.
Thanks
Neethu | 0 |
8,286,589 | 11/27/2011 15:22:05 | 342,947 | 05/17/2010 10:43:52 | 80 | 2 | ReentrantLock: Lock/Unlock speed in single-threaded application | i'm using some ReentrantLock to synchronize access to a List across multiple threads. I just write a generic
try {
lock.lock();
... modify list here
} finally {
lock.unlock();
}
everywhere. I just noticed though, that most of lists across the code are going to be used by a single (gui dispatch-) thread only.
Now i'm not sure if i should remove the lock in these cases, as it might speed up my code.
How fast is ReentrantLock? Is the lock() operation somehow faster if the thread himself was the "prior owner" of the lock, even if he unlock() it? | java | multithreading | performance | locking | reentrant | null | open | ReentrantLock: Lock/Unlock speed in single-threaded application
===
i'm using some ReentrantLock to synchronize access to a List across multiple threads. I just write a generic
try {
lock.lock();
... modify list here
} finally {
lock.unlock();
}
everywhere. I just noticed though, that most of lists across the code are going to be used by a single (gui dispatch-) thread only.
Now i'm not sure if i should remove the lock in these cases, as it might speed up my code.
How fast is ReentrantLock? Is the lock() operation somehow faster if the thread himself was the "prior owner" of the lock, even if he unlock() it? | 0 |
5,195,149 | 03/04/2011 14:38:48 | 643,042 | 03/03/2011 13:21:17 | 1 | 0 | What the best solution to manage web project ? | I would find a open source application to manage my web project, if you have in french it's so good :-) | project-management | project | null | null | null | 03/04/2011 15:45:48 | not a real question | What the best solution to manage web project ?
===
I would find a open source application to manage my web project, if you have in french it's so good :-) | 1 |
11,482,564 | 07/14/2012 09:25:25 | 1,301,052 | 03/29/2012 14:28:04 | 39 | 0 | Why my code and library generate error C2059: syntax error : 'constant' | I have 2 files named SharedPtr.hxx and SharedCount.hxx bothe is modified version of boost shaed_ptr.
these files reside in my library named Core.lib.
**complete code of SharedPtr.hxx and SharedCount.hxx**
#if !defined(SHAREDCOUNT_HXX)
#define SHAREDCOUNT_HXX
/**
@file
@brief Defines a threadsafe (shared) reference-count object.
@note This implementation is a modified version of shared_count from
Boost.org
*/
#include <memory> // std::auto_ptr, std::allocator
#include <functional> // std::less
#include <exception> // std::exception
#include <new> // std::bad_alloc
#include <typeinfo> // std::type_info in get_deleter
#include <cstddef> // std::size_t
#include "ILock.hxx"
#include "ILMutex.hxx"
//#include "Logger.hxx"
using namespace IThreading;
#ifdef __BORLANDC__
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
# pragma warn -8027 // Functions containing try are not expanded inline
#endif
namespace Object
{
// verify that types are complete for increased safety
template<class T> inline void checked_delete(T * x)
{
// intentionally complex - simplification causes regressions
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
(void) sizeof(type_must_be_complete);
delete x;
};
template<class T> struct checked_deleter
{
typedef void result_type;
typedef T * argument_type;
void operator()(T * x) const
{
// resip:: disables ADL
Object::checked_delete(x);
}
};
// The standard library that comes with Borland C++ 5.5.1
// defines std::exception and its members as having C calling
// convention (-pc). When the definition of bad_weak_ptr
// is compiled with -ps, the compiler issues an error.
// Hence, the temporary #pragma option -pc below. The version
// check is deliberately conservative.
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
# pragma option push -pc
#endif
class bad_weak_ptr: public std::exception
{
public:
virtual char const * what() const throw()
{
return "Object::bad_weak_ptr";
}
};
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
# pragma option pop
#endif
class sp_counted_base
{
private:
public:
sp_counted_base(): use_count_(1), weak_count_(1)
{
}
virtual ~sp_counted_base() // nothrow
{
}
// dispose() is called when use_count_ drops to zero, to release
// the resources managed by *this.
virtual void dispose() = 0; // nothrow
// destruct() is called when weak_count_ drops to zero.
virtual void destruct() // nothrow
{
delete this;
}
virtual void * get_deleter(std::type_info const & ti) = 0;
void add_ref_copy()
{
Lock lock(mMutex); (void)lock;
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_copy: " << use_count_);
}
void add_ref_lock()
{
Lock lock(mMutex); (void)lock;
// if(use_count_ == 0) throw(resip::bad_weak_ptr());
if (use_count_ == 0) throw Object::bad_weak_ptr();
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_lock: " << use_count_);
}
void release() // nothrow
{
{
Lock lock(mMutex); (void)lock;
long new_use_count = --use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::release: " << use_count_);
if(new_use_count != 0) return;
}
dispose();
weak_release();
}
void weak_add_ref() // nothrow
{
Lock lock(mMutex); (void)lock;
++weak_count_;
}
void weak_release() // nothrow
{
long new_weak_count;
{
Lock lock(mMutex); (void)lock;
new_weak_count = --weak_count_;
}
if(new_weak_count == 0)
{
destruct();
}
}
long use_count() const // nothrow
{
Lock lock(mMutex); (void)lock;
return use_count_;
}
private:
sp_counted_base(sp_counted_base const &);
sp_counted_base & operator= (sp_counted_base const &);
long use_count_; // #shared
long weak_count_; // #weak + (#shared != 0)
mutable Mutex mMutex;
};
//
// Borland's Codeguard trips up over the -Vx- option here:
//
#ifdef __CODEGUARD__
# pragma option push -Vx-
#endif
template<class P, class D> class sp_counted_base_impl: public sp_counted_base
{
private:
P ptr; // copy constructor must not throw
D del; // copy constructor must not throw
sp_counted_base_impl(sp_counted_base_impl const &);
sp_counted_base_impl & operator= (sp_counted_base_impl const &);
typedef sp_counted_base_impl<P, D> this_type;
public:
// pre: initial_use_count <= initial_weak_count, d(p) must not throw
sp_counted_base_impl(P p, D d): ptr(p), del(d)
{
}
virtual void dispose() // nothrow
{
del(ptr);
}
virtual void * get_deleter(std::type_info const & ti)
{
return ti == typeid(D)? &del: 0;
}
void * operator new(size_t)
{
return std::allocator<this_type>().allocate(1, static_cast<this_type *>(0));
}
void operator delete(void * p)
{
std::allocator<this_type>().deallocate(static_cast<this_type *>(p), 1);
}
};
class shared_count
{
private:
sp_counted_base * pi_;
public:
shared_count(): pi_(0) // nothrow
{
}
template<class P, class D> shared_count(P p, D d): pi_(0)
{
try
{
pi_ = new sp_counted_base_impl<P, D>(p, d);
}
catch(...)
{
d(p); // delete p
throw;
}
}
// auto_ptr<Y> is special cased to provide the strong guarantee
template<class Y>
explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
{
r.release();
}
~shared_count() // nothrow
{
if(pi_ != 0) pi_->release();
}
shared_count(shared_count const & r): pi_(r.pi_) // nothrow
{
if(pi_ != 0) pi_->add_ref_copy();
}
shared_count & operator= (shared_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
if(tmp != 0) tmp->add_ref_copy();
if(pi_ != 0) pi_->release();
pi_ = tmp;
return *this;
}
void swap(shared_count & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
r.pi_ = pi_;
pi_ = tmp;
}
long use_count() const // nothrow
{
return pi_ != 0? pi_->use_count(): 0;
}
bool unique() const // nothrow
{
return use_count() == 1;
}
friend inline bool operator==(shared_count const & a, shared_count const & b)
{
return a.pi_ == b.pi_;
}
friend inline bool operator<(shared_count const & a, shared_count const & b)
{
return std::less<sp_counted_base *>()(a.pi_, b.pi_);
}
void * get_deleter(std::type_info const & ti) const
{
return pi_? pi_->get_deleter(ti): 0;
}
};
#ifdef __CODEGUARD__
# pragma option pop
#endif
} // namespace resip
#ifdef __BORLANDC__
# pragma warn .8027 // Functions containing try are not expanded inline
# pragma warn .8026 // Functions with excep. spec. are not expanded inline
#endif
#endif
// Note: This implementation is a modified version of shared_count from
// Boost.org
//
/* ====================================================================
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* ====================================================================
*/
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
and i use Shared ptr in my NET.lib classes as :
**myclass.cpp**
#include <SharedPtr.hxx>
.
.
.
SharedPtr<Attribute> IMessage::GetAttribute( uint16_t atttype )
{
StunAttributeType_t type = (AttributeType_t)atttype;
list<SharedPtr<Attribute>>::iterator iter;
SharedPtr<Attribute> att;
for (iter = attributes->begin(); iter!= attributes->end() ; iter++)
{
if (((SharedPtr<Attribute>)*iter)->Type() == type)
{
att = ((SharedPtr<Attribute>)*iter);
break;
}
}
return att;
}
by compiling NET.lib i got these errors :
**error C2059: syntax error : 'constant'**
**error C2091: function returns function**
**error C2333: 'Object::sp_counted_base_impl<P,D>::operator new' : error in function declaration; skipping function body**
**error C2059: syntax error : 'constant'**
**error C2091: function returns function**
**error C2802: static member 'operator new' has no formal parameters**
**error C2333: 'Object::sp_counted_base_impl<P,D>::operator new' : error in function declaration; skipping function body**
what is wrong here?
i need your help after afew more days googling about this error.
with best wishes | c++ | visual-c++ | syntax | error-message | null | 07/14/2012 11:08:18 | too localized | Why my code and library generate error C2059: syntax error : 'constant'
===
I have 2 files named SharedPtr.hxx and SharedCount.hxx bothe is modified version of boost shaed_ptr.
these files reside in my library named Core.lib.
**complete code of SharedPtr.hxx and SharedCount.hxx**
#if !defined(SHAREDCOUNT_HXX)
#define SHAREDCOUNT_HXX
/**
@file
@brief Defines a threadsafe (shared) reference-count object.
@note This implementation is a modified version of shared_count from
Boost.org
*/
#include <memory> // std::auto_ptr, std::allocator
#include <functional> // std::less
#include <exception> // std::exception
#include <new> // std::bad_alloc
#include <typeinfo> // std::type_info in get_deleter
#include <cstddef> // std::size_t
#include "ILock.hxx"
#include "ILMutex.hxx"
//#include "Logger.hxx"
using namespace IThreading;
#ifdef __BORLANDC__
# pragma warn -8026 // Functions with excep. spec. are not expanded inline
# pragma warn -8027 // Functions containing try are not expanded inline
#endif
namespace Object
{
// verify that types are complete for increased safety
template<class T> inline void checked_delete(T * x)
{
// intentionally complex - simplification causes regressions
typedef char type_must_be_complete[ sizeof(T)? 1: -1 ];
(void) sizeof(type_must_be_complete);
delete x;
};
template<class T> struct checked_deleter
{
typedef void result_type;
typedef T * argument_type;
void operator()(T * x) const
{
// resip:: disables ADL
Object::checked_delete(x);
}
};
// The standard library that comes with Borland C++ 5.5.1
// defines std::exception and its members as having C calling
// convention (-pc). When the definition of bad_weak_ptr
// is compiled with -ps, the compiler issues an error.
// Hence, the temporary #pragma option -pc below. The version
// check is deliberately conservative.
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
# pragma option push -pc
#endif
class bad_weak_ptr: public std::exception
{
public:
virtual char const * what() const throw()
{
return "Object::bad_weak_ptr";
}
};
#if defined(__BORLANDC__) && __BORLANDC__ == 0x551
# pragma option pop
#endif
class sp_counted_base
{
private:
public:
sp_counted_base(): use_count_(1), weak_count_(1)
{
}
virtual ~sp_counted_base() // nothrow
{
}
// dispose() is called when use_count_ drops to zero, to release
// the resources managed by *this.
virtual void dispose() = 0; // nothrow
// destruct() is called when weak_count_ drops to zero.
virtual void destruct() // nothrow
{
delete this;
}
virtual void * get_deleter(std::type_info const & ti) = 0;
void add_ref_copy()
{
Lock lock(mMutex); (void)lock;
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_copy: " << use_count_);
}
void add_ref_lock()
{
Lock lock(mMutex); (void)lock;
// if(use_count_ == 0) throw(resip::bad_weak_ptr());
if (use_count_ == 0) throw Object::bad_weak_ptr();
++use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::add_ref_lock: " << use_count_);
}
void release() // nothrow
{
{
Lock lock(mMutex); (void)lock;
long new_use_count = --use_count_;
//GenericLog(Subsystem::SIP, resip::Log::Info, << "********* SharedCount::release: " << use_count_);
if(new_use_count != 0) return;
}
dispose();
weak_release();
}
void weak_add_ref() // nothrow
{
Lock lock(mMutex); (void)lock;
++weak_count_;
}
void weak_release() // nothrow
{
long new_weak_count;
{
Lock lock(mMutex); (void)lock;
new_weak_count = --weak_count_;
}
if(new_weak_count == 0)
{
destruct();
}
}
long use_count() const // nothrow
{
Lock lock(mMutex); (void)lock;
return use_count_;
}
private:
sp_counted_base(sp_counted_base const &);
sp_counted_base & operator= (sp_counted_base const &);
long use_count_; // #shared
long weak_count_; // #weak + (#shared != 0)
mutable Mutex mMutex;
};
//
// Borland's Codeguard trips up over the -Vx- option here:
//
#ifdef __CODEGUARD__
# pragma option push -Vx-
#endif
template<class P, class D> class sp_counted_base_impl: public sp_counted_base
{
private:
P ptr; // copy constructor must not throw
D del; // copy constructor must not throw
sp_counted_base_impl(sp_counted_base_impl const &);
sp_counted_base_impl & operator= (sp_counted_base_impl const &);
typedef sp_counted_base_impl<P, D> this_type;
public:
// pre: initial_use_count <= initial_weak_count, d(p) must not throw
sp_counted_base_impl(P p, D d): ptr(p), del(d)
{
}
virtual void dispose() // nothrow
{
del(ptr);
}
virtual void * get_deleter(std::type_info const & ti)
{
return ti == typeid(D)? &del: 0;
}
void * operator new(size_t)
{
return std::allocator<this_type>().allocate(1, static_cast<this_type *>(0));
}
void operator delete(void * p)
{
std::allocator<this_type>().deallocate(static_cast<this_type *>(p), 1);
}
};
class shared_count
{
private:
sp_counted_base * pi_;
public:
shared_count(): pi_(0) // nothrow
{
}
template<class P, class D> shared_count(P p, D d): pi_(0)
{
try
{
pi_ = new sp_counted_base_impl<P, D>(p, d);
}
catch(...)
{
d(p); // delete p
throw;
}
}
// auto_ptr<Y> is special cased to provide the strong guarantee
template<class Y>
explicit shared_count(std::auto_ptr<Y> & r): pi_(new sp_counted_base_impl< Y *, checked_deleter<Y> >(r.get(), checked_deleter<Y>()))
{
r.release();
}
~shared_count() // nothrow
{
if(pi_ != 0) pi_->release();
}
shared_count(shared_count const & r): pi_(r.pi_) // nothrow
{
if(pi_ != 0) pi_->add_ref_copy();
}
shared_count & operator= (shared_count const & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
if(tmp != 0) tmp->add_ref_copy();
if(pi_ != 0) pi_->release();
pi_ = tmp;
return *this;
}
void swap(shared_count & r) // nothrow
{
sp_counted_base * tmp = r.pi_;
r.pi_ = pi_;
pi_ = tmp;
}
long use_count() const // nothrow
{
return pi_ != 0? pi_->use_count(): 0;
}
bool unique() const // nothrow
{
return use_count() == 1;
}
friend inline bool operator==(shared_count const & a, shared_count const & b)
{
return a.pi_ == b.pi_;
}
friend inline bool operator<(shared_count const & a, shared_count const & b)
{
return std::less<sp_counted_base *>()(a.pi_, b.pi_);
}
void * get_deleter(std::type_info const & ti) const
{
return pi_? pi_->get_deleter(ti): 0;
}
};
#ifdef __CODEGUARD__
# pragma option pop
#endif
} // namespace resip
#ifdef __BORLANDC__
# pragma warn .8027 // Functions containing try are not expanded inline
# pragma warn .8026 // Functions with excep. spec. are not expanded inline
#endif
#endif
// Note: This implementation is a modified version of shared_count from
// Boost.org
//
/* ====================================================================
*
* Boost Software License - Version 1.0 - August 17th, 2003
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (the "Software") to use, reproduce, display, distribute,
* execute, and transmit the Software, and to prepare derivative works of the
* Software, and to permit third-parties to whom the Software is furnished to
* do so, all subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* ====================================================================
*/
/* ====================================================================
* The Vovida Software License, Version 1.0
*
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
* and "Vovida Open Communication Application Library (VOCAL)" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact vocal@vovida.org.
*
* 4. Products derived from this software may not be called "VOCAL", nor
* may "VOCAL" appear in their name, without prior written
* permission of Vovida Networks, Inc.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* ====================================================================
*
* This software consists of voluntary contributions made by Vovida
* Networks, Inc. and many individuals on behalf of Vovida Networks,
* Inc. For more information on Vovida Networks, Inc., please see
* <http://www.vovida.org/>.
*
*/
and i use Shared ptr in my NET.lib classes as :
**myclass.cpp**
#include <SharedPtr.hxx>
.
.
.
SharedPtr<Attribute> IMessage::GetAttribute( uint16_t atttype )
{
StunAttributeType_t type = (AttributeType_t)atttype;
list<SharedPtr<Attribute>>::iterator iter;
SharedPtr<Attribute> att;
for (iter = attributes->begin(); iter!= attributes->end() ; iter++)
{
if (((SharedPtr<Attribute>)*iter)->Type() == type)
{
att = ((SharedPtr<Attribute>)*iter);
break;
}
}
return att;
}
by compiling NET.lib i got these errors :
**error C2059: syntax error : 'constant'**
**error C2091: function returns function**
**error C2333: 'Object::sp_counted_base_impl<P,D>::operator new' : error in function declaration; skipping function body**
**error C2059: syntax error : 'constant'**
**error C2091: function returns function**
**error C2802: static member 'operator new' has no formal parameters**
**error C2333: 'Object::sp_counted_base_impl<P,D>::operator new' : error in function declaration; skipping function body**
what is wrong here?
i need your help after afew more days googling about this error.
with best wishes | 3 |
3,424,721 | 08/06/2010 14:25:56 | 154,399 | 08/11/2009 14:22:17 | 341 | 2 | Compiling specific code NULLs my textures. | A very strange error: if I add some specific code to my project, any textures I use contain nothing but 0. Even when I'm not running any of the code that was added.
The specific code here is the kernels of an nVidia CUDA sample [1], the Bicubic Texture Filtering sample, in specific the CatMulRom kernel. I've traced it down to one of the subfunctions. If I reset a variable there, everything returns to normal. It's really, really strange and I have no idea anymore what it could be. Adding and using the bicubic kernel causes no problems.
Here's the change that "fixes" the problem:
__host__ __device__
float catrom_w1(float a)
{
a = 1; // Fix
return 1.0f + a*a*(-2.5f + 1.5f*a);
}
If I reset the variable, it works if I'm not using CatMulRom. If I do try to use it the textures are zero again. The textures in question are defined as follows:
texture<uchar1, 2, cudaReadModeNormalizedFloat> tex;
I've edited away the template, hoping it would solve the problem, but it persists.
[1] http://developer.download.nvidia.com/compute/cuda/sdk/website/samples.html
| c | cuda | textures | null | null | null | open | Compiling specific code NULLs my textures.
===
A very strange error: if I add some specific code to my project, any textures I use contain nothing but 0. Even when I'm not running any of the code that was added.
The specific code here is the kernels of an nVidia CUDA sample [1], the Bicubic Texture Filtering sample, in specific the CatMulRom kernel. I've traced it down to one of the subfunctions. If I reset a variable there, everything returns to normal. It's really, really strange and I have no idea anymore what it could be. Adding and using the bicubic kernel causes no problems.
Here's the change that "fixes" the problem:
__host__ __device__
float catrom_w1(float a)
{
a = 1; // Fix
return 1.0f + a*a*(-2.5f + 1.5f*a);
}
If I reset the variable, it works if I'm not using CatMulRom. If I do try to use it the textures are zero again. The textures in question are defined as follows:
texture<uchar1, 2, cudaReadModeNormalizedFloat> tex;
I've edited away the template, hoping it would solve the problem, but it persists.
[1] http://developer.download.nvidia.com/compute/cuda/sdk/website/samples.html
| 0 |
3,572,578 | 08/26/2010 06:36:25 | 353,593 | 05/29/2010 13:05:09 | 15 | 5 | Adobe native Air app works on windows7 but not on windowsXP?? | Well i have an adobe air app that captures screen and saves image on desktop. The App works fine on windows 7 but it just does not work on windowsXp..
The App use native windows exe that was built in C# using Visual Studio 2010.
Its video tutorial and code is given at
http://www.gotoandlearn.com/
The app just does not work on windows and gives no compile time or runtime time error and offcourse it does not save image on desktop.
Kindly help me on this.. | flex | air | flex4 | flexbuilder | null | null | open | Adobe native Air app works on windows7 but not on windowsXP??
===
Well i have an adobe air app that captures screen and saves image on desktop. The App works fine on windows 7 but it just does not work on windowsXp..
The App use native windows exe that was built in C# using Visual Studio 2010.
Its video tutorial and code is given at
http://www.gotoandlearn.com/
The app just does not work on windows and gives no compile time or runtime time error and offcourse it does not save image on desktop.
Kindly help me on this.. | 0 |
7,251,818 | 08/31/2011 02:02:21 | 920,799 | 08/31/2011 01:50:08 | 1 | 0 | Read from socket failed: Connection reset by peer | I got this exception when the first time I tried to connect my new ubuntu by ssh. I tried to search from google, but no luck until now.
Is there anyone who had the same problem before, thx. | linux | networking | ssh | null | null | 09/02/2011 21:18:54 | off topic | Read from socket failed: Connection reset by peer
===
I got this exception when the first time I tried to connect my new ubuntu by ssh. I tried to search from google, but no luck until now.
Is there anyone who had the same problem before, thx. | 2 |
10,736,261 | 05/24/2012 11:05:05 | 1,345,690 | 04/20/2012 05:37:09 | 51 | 1 | What are candidate key, alternate key, composite key in sql? | what are **candidate key** , **alternate key** and **composite key**
and why we use all of these | sql | sql-server | database | sql-server-2008 | sql-server-2005 | 05/24/2012 12:46:16 | not a real question | What are candidate key, alternate key, composite key in sql?
===
what are **candidate key** , **alternate key** and **composite key**
and why we use all of these | 1 |
9,896,306 | 03/27/2012 19:28:04 | 392,684 | 07/15/2010 12:32:41 | 824 | 37 | Weird line in <head> in Typo3 | I just started a new Typo3 4.6 site and I found this weird line right off the bat in the <head>
<link type="text/css" rel="stylesheet" href="data:text/css,">
Where does it come from? And how can I get rid of it? | typo3 | typoscript | null | null | null | null | open | Weird line in <head> in Typo3
===
I just started a new Typo3 4.6 site and I found this weird line right off the bat in the <head>
<link type="text/css" rel="stylesheet" href="data:text/css,">
Where does it come from? And how can I get rid of it? | 0 |
8,786,800 | 01/09/2012 10:12:47 | 859,154 | 07/23/2011 09:23:42 | 6,531 | 401 | Dropdownlist Height Like facebook's? | ![enter image description here][2]
Im trying to chenge the **height + padding** for my ddl :
I saw in facebook that all they are doing is :
![enter image description here][1]
however - my testing :
http://jsbin.com/acijuv/2/edit
is working in chrome
but not in IE8
( but facebook page **does** show it fine in my ie8)
any help ?
[1]: http://i.stack.imgur.com/2fyHo.jpg
[2]: http://i.stack.imgur.com/U9eI2.jpg | html | null | null | null | null | null | open | Dropdownlist Height Like facebook's?
===
![enter image description here][2]
Im trying to chenge the **height + padding** for my ddl :
I saw in facebook that all they are doing is :
![enter image description here][1]
however - my testing :
http://jsbin.com/acijuv/2/edit
is working in chrome
but not in IE8
( but facebook page **does** show it fine in my ie8)
any help ?
[1]: http://i.stack.imgur.com/2fyHo.jpg
[2]: http://i.stack.imgur.com/U9eI2.jpg | 0 |
6,772,956 | 07/21/2011 08:00:09 | 688,846 | 04/02/2011 11:00:50 | 67 | 11 | Why ruby on Rails is agile ? | I'm always hearing that RoR is good for Agile implementation. Could someone plaese summarize this statement and explain me why with some examples.<br/>P.S I can't read "Agile Web Development with Rails" yet.
| ruby-on-rails-3 | software-engineering | agile | null | null | 07/22/2011 12:36:15 | not constructive | Why ruby on Rails is agile ?
===
I'm always hearing that RoR is good for Agile implementation. Could someone plaese summarize this statement and explain me why with some examples.<br/>P.S I can't read "Agile Web Development with Rails" yet.
| 4 |
8,990,858 | 01/24/2012 16:59:29 | 362,704 | 06/09/2010 17:13:43 | 6 | 0 | Specific name of the effect that participants tend to be biased towards the novel system in an experiment | I am wondering if there is a specific name for the effect that participants in usability testing of systems tend to be biased towards the new system?
Possibly in the field of psychology or sociology?
Thanks! | usability | null | null | null | null | 01/29/2012 18:16:04 | off topic | Specific name of the effect that participants tend to be biased towards the novel system in an experiment
===
I am wondering if there is a specific name for the effect that participants in usability testing of systems tend to be biased towards the new system?
Possibly in the field of psychology or sociology?
Thanks! | 2 |
10,482,291 | 05/07/2012 12:43:30 | 1,293,029 | 03/26/2012 12:42:37 | 10 | 2 | Create my personal browser language | Is there any way that I can create my own browser language (eg. html) that can be supported?
I have the above idea in mind but don't know how to work it out:
using XML with namespace?
JavaScript to do the function on the back-ends?
CSS for displaying content? | html | browser | tags | language | null | 05/08/2012 19:10:01 | not constructive | Create my personal browser language
===
Is there any way that I can create my own browser language (eg. html) that can be supported?
I have the above idea in mind but don't know how to work it out:
using XML with namespace?
JavaScript to do the function on the back-ends?
CSS for displaying content? | 4 |
8,923,383 | 01/19/2012 09:00:59 | 621,089 | 02/17/2011 09:32:45 | 144 | 3 | Get DST in iphone/ipod | I am working on an US based application.
I want to get the dst as '1' irrespective of weather DST is on / off in US and dst as '0' if timezone is india.
Is there as api available for getting such output.
What i mean say is i need to get dst as '1' if that country is in dst zone.And '0' if the country is in non-dst zone.
Can anyone help me out.
Regards,
Hemant | iphone | ios4 | dst | null | null | null | open | Get DST in iphone/ipod
===
I am working on an US based application.
I want to get the dst as '1' irrespective of weather DST is on / off in US and dst as '0' if timezone is india.
Is there as api available for getting such output.
What i mean say is i need to get dst as '1' if that country is in dst zone.And '0' if the country is in non-dst zone.
Can anyone help me out.
Regards,
Hemant | 0 |
2,729,077 | 04/28/2010 11:44:56 | 92,759 | 04/19/2009 13:25:28 | 87 | 5 | Handling ID's with db4o and ASP.NET MVC2 | So, i'm looking at the TekPub sample for ASP.NET MVC2 (http://mvcstarter.codeplex.com/) using DB4o and there are a bunch of templates to create controllers etc, the generated code looks like:
public ActionResult Details(int id)
{
var item = _session.Single<Account>(x=>x.ID == id);
return View(item);
}
Now, my understanding is that using DB4o or a simliar object database that ID's are not required, so how/what exactly do I pass to enable this kind of templated code to function?
| asp.net-mvc-2 | db4o | null | null | null | null | open | Handling ID's with db4o and ASP.NET MVC2
===
So, i'm looking at the TekPub sample for ASP.NET MVC2 (http://mvcstarter.codeplex.com/) using DB4o and there are a bunch of templates to create controllers etc, the generated code looks like:
public ActionResult Details(int id)
{
var item = _session.Single<Account>(x=>x.ID == id);
return View(item);
}
Now, my understanding is that using DB4o or a simliar object database that ID's are not required, so how/what exactly do I pass to enable this kind of templated code to function?
| 0 |
11,382,223 | 07/08/2012 09:54:42 | 366,472 | 06/14/2010 15:42:45 | 844 | 20 | async http requests servicing | My page sends several HTTP requests in background. The requests are triggered by some user actions. Some user actions can cause redirect - and here we have a problem: we want redirect to happen only when all the requests were sent.
The question is: is there any Javascript library you can recommend that would allow to wait for all the reports to be sent and trigger redirect only after? | javascript | null | null | null | null | null | open | async http requests servicing
===
My page sends several HTTP requests in background. The requests are triggered by some user actions. Some user actions can cause redirect - and here we have a problem: we want redirect to happen only when all the requests were sent.
The question is: is there any Javascript library you can recommend that would allow to wait for all the reports to be sent and trigger redirect only after? | 0 |
6,532,717 | 06/30/2011 09:28:51 | 822,737 | 06/30/2011 09:28:51 | 1 | 0 | Luaj , JRuby or Jython? | I'm currently wanting to choose a scripting language for a game in Java, and I'm not really sure what would be the best (Java implentation of these languages).
I'm just saying not only is the game going to be pc(Windozes, Linux, Mac), but I want to make an Android game too! | java | jruby | jython | luaj | null | 09/18/2011 20:07:52 | not constructive | Luaj , JRuby or Jython?
===
I'm currently wanting to choose a scripting language for a game in Java, and I'm not really sure what would be the best (Java implentation of these languages).
I'm just saying not only is the game going to be pc(Windozes, Linux, Mac), but I want to make an Android game too! | 4 |
3,535,596 | 08/20/2010 23:44:26 | 348,081 | 03/08/2010 17:00:09 | 41 | 2 | suggestion of Project manager | I need suggestion of project manager (with task manager, etc) | project | task | manager | null | null | 08/21/2010 00:05:20 | off topic | suggestion of Project manager
===
I need suggestion of project manager (with task manager, etc) | 2 |
5,699,651 | 04/18/2011 07:13:28 | 712,796 | 04/18/2011 04:46:44 | 23 | 0 | C++ method-by-method approach vs Ada 95 variable-by-variable approach | when using static binding, which approach is better, C++ and C# method-by-method approach? Or Ada 95 variable-by-variable approach? | c# | c++ | methods | variable-variables | null | 04/18/2011 07:32:36 | not constructive | C++ method-by-method approach vs Ada 95 variable-by-variable approach
===
when using static binding, which approach is better, C++ and C# method-by-method approach? Or Ada 95 variable-by-variable approach? | 4 |
6,463,148 | 06/24/2011 03:54:12 | 426,578 | 08/20/2010 17:07:50 | 26 | 4 | Forced to pass by value | I just ported my code (originally written in msvc) to Code::Blocks (running GNU GCC) and I'm having a few problems in compiling my code.
The compiler is giving me an error when I try to pass a variable as an argument.
For example,
void foo(int a, int b, int c){...}
//Works on calling like this:
foo(1,2,3);
//But not like this:
foo(x,y,z);
The compiler says that there is no matching function call to void foo(int &a, int &b, int &c);
I don't want to make too many changes in my code, I've already cleaned the temporaries being passed as reference, which msvc allowed. | c++ | null | null | null | null | 06/24/2011 12:04:46 | not a real question | Forced to pass by value
===
I just ported my code (originally written in msvc) to Code::Blocks (running GNU GCC) and I'm having a few problems in compiling my code.
The compiler is giving me an error when I try to pass a variable as an argument.
For example,
void foo(int a, int b, int c){...}
//Works on calling like this:
foo(1,2,3);
//But not like this:
foo(x,y,z);
The compiler says that there is no matching function call to void foo(int &a, int &b, int &c);
I don't want to make too many changes in my code, I've already cleaned the temporaries being passed as reference, which msvc allowed. | 1 |
11,571,223 | 07/20/2012 00:24:34 | 1,529,586 | 07/16/2012 17:16:34 | 4 | 0 | Where are Android apps installed? | What is the actual directory where. APKs are installed? The only directory I could find that somewhat resembles this is
sdcard/Android/data/
but it doesn't contain all my apps. | android | apk | null | null | null | 07/23/2012 21:39:46 | off topic | Where are Android apps installed?
===
What is the actual directory where. APKs are installed? The only directory I could find that somewhat resembles this is
sdcard/Android/data/
but it doesn't contain all my apps. | 2 |
7,166,138 | 08/23/2011 18:59:25 | 324,469 | 04/23/2010 17:57:18 | 79 | 0 | How to create a program in JAVA that starts with a .exe file? | I`m very new to JAVA programming, I don`t know how it works, but I do have some experience with PHP, Javascript, Pascal and some C++.
I`we searched all day for JAVA programming tutorials and I`we found some interesting tutorials but only about the basics. I don`t want to create console programs and to learn about variables and loops.
I need a tutorial that shows me how to create a program in JAVA, something that opens a window with some tabs and multiple clickable buttons. A program that starts with a .exe file, not a .class and what contains lots of .jar files. | java | executable | null | null | null | 08/23/2011 19:12:28 | not a real question | How to create a program in JAVA that starts with a .exe file?
===
I`m very new to JAVA programming, I don`t know how it works, but I do have some experience with PHP, Javascript, Pascal and some C++.
I`we searched all day for JAVA programming tutorials and I`we found some interesting tutorials but only about the basics. I don`t want to create console programs and to learn about variables and loops.
I need a tutorial that shows me how to create a program in JAVA, something that opens a window with some tabs and multiple clickable buttons. A program that starts with a .exe file, not a .class and what contains lots of .jar files. | 1 |
8,423,928 | 12/07/2011 23:06:12 | 612,762 | 02/11/2011 08:47:44 | 48 | 0 | get xml-field with property | this is my xml-file:
<artist>
<name>Have Heart</name>
<playcount>2588</playcount>
<tagcount>0</tagcount>
<mbid>e519e012-e1a3-4592-b3f6-5a16227ab654</mbid>
<url>http://www.last.fm/music/Have+Heart</url>
<streamable>1</streamable>
<image size="small">http://userserve-ak.last.fm/serve/34/29086375.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64/29086375.jpg</image>
<image size="large">http://userserve-ak.last.fm/serve/126/29086375.jpg</image>
<image size="extralarge">http://userserve-ak.last.fm/serve/252/29086375.jpg</image>
<image size="mega">
http://userserve-ak.last.fm/serve/_/29086375/Have+Heart.jpg
</image>
</artist>
I'm looping through the data like this:
for each(artistXML in artistList.artists)
{
var artistName:String = artistXML.artist.name;
var artistPic:String =
insertArtistUrl = "http://localhost:8888/flexapp/insert_artist.php?";
}
How can I get one of the image tags? Let's say the large one. | xml | actionscript-3 | flex | actionscript | null | null | open | get xml-field with property
===
this is my xml-file:
<artist>
<name>Have Heart</name>
<playcount>2588</playcount>
<tagcount>0</tagcount>
<mbid>e519e012-e1a3-4592-b3f6-5a16227ab654</mbid>
<url>http://www.last.fm/music/Have+Heart</url>
<streamable>1</streamable>
<image size="small">http://userserve-ak.last.fm/serve/34/29086375.jpg</image>
<image size="medium">http://userserve-ak.last.fm/serve/64/29086375.jpg</image>
<image size="large">http://userserve-ak.last.fm/serve/126/29086375.jpg</image>
<image size="extralarge">http://userserve-ak.last.fm/serve/252/29086375.jpg</image>
<image size="mega">
http://userserve-ak.last.fm/serve/_/29086375/Have+Heart.jpg
</image>
</artist>
I'm looping through the data like this:
for each(artistXML in artistList.artists)
{
var artistName:String = artistXML.artist.name;
var artistPic:String =
insertArtistUrl = "http://localhost:8888/flexapp/insert_artist.php?";
}
How can I get one of the image tags? Let's say the large one. | 0 |
3,314,734 | 07/23/2010 01:26:41 | 344,458 | 05/18/2010 20:20:15 | 1 | 0 | What is the best language for a game? | I'm sorry if this is a dumb question, but what, in your opinion, is the best language to write a 2d puzzler in, and the best language for a 3d puzzler. Even the best language for both if you think there is one!
Thanks. | 3d | language | 2d | write | null | 07/23/2010 01:52:13 | not constructive | What is the best language for a game?
===
I'm sorry if this is a dumb question, but what, in your opinion, is the best language to write a 2d puzzler in, and the best language for a 3d puzzler. Even the best language for both if you think there is one!
Thanks. | 4 |
11,422,781 | 07/10/2012 22:09:19 | 1,046,501 | 11/14/2011 22:43:01 | 452 | 2 | Comparing list values by index in Python | I need to see if 2 items from a list appears in another list, and if they do, compare the items by their position in the other list. Example in pseudo code:
j=0
for x in list1 #loop through the list
i=0
for y in list1 #loop through the list again to compare items
if index of list1[j] > index of list1[i] in list2:
score[i][j] = 1 #writes the score to a 2d array(numpy) called score
i=i+1
else:
score[i][j]=0
i=i+1
j=j+1
Can someone please point me in the right direction? I've been looking at numerous list, array and .index tutorials but nothing seems to answer my question
| python | arrays | list | indexes | null | null | open | Comparing list values by index in Python
===
I need to see if 2 items from a list appears in another list, and if they do, compare the items by their position in the other list. Example in pseudo code:
j=0
for x in list1 #loop through the list
i=0
for y in list1 #loop through the list again to compare items
if index of list1[j] > index of list1[i] in list2:
score[i][j] = 1 #writes the score to a 2d array(numpy) called score
i=i+1
else:
score[i][j]=0
i=i+1
j=j+1
Can someone please point me in the right direction? I've been looking at numerous list, array and .index tutorials but nothing seems to answer my question
| 0 |
4,966,324 | 02/11/2011 06:46:44 | 594,849 | 01/29/2011 10:00:02 | 20 | 0 | how to insert ASP.NEt3.5 ajaxtoolkit Editor control text to MSSQl2005 database .. | how to insert ASP.NEt3.5 ajaxtoolkit Editor control text to MSSQl2005 database .. | asp.net | vb.net | ajaxtoolkit | null | null | null | open | how to insert ASP.NEt3.5 ajaxtoolkit Editor control text to MSSQl2005 database ..
===
how to insert ASP.NEt3.5 ajaxtoolkit Editor control text to MSSQl2005 database .. | 0 |
7,946,837 | 10/30/2011 18:21:45 | 172,029 | 09/11/2009 11:56:33 | 5,482 | 160 | Razor exception compiling template | I'm trying to use Postal to send out emails from a service (not in an ASP.NET project). I keep getting exceptions with the following message:
error CS0103: The name 'model' does not exist in the current context
I'm following the tutorial from the Postal wiki: https://github.com/andrewdavey/postal/wiki/Postal-in-non-web-scenario
My template looks like:
@model Namespace1.AlertEmailViewModel
From: support@example.com
To: @Model.FirstName @Model.LastName <@Model.Email>
Subject: Alert! @Model.ShortDescription
(The model class in question does exist.)
Any help would be appreciated. Thanks! | c# | templates | razor | postal | null | null | open | Razor exception compiling template
===
I'm trying to use Postal to send out emails from a service (not in an ASP.NET project). I keep getting exceptions with the following message:
error CS0103: The name 'model' does not exist in the current context
I'm following the tutorial from the Postal wiki: https://github.com/andrewdavey/postal/wiki/Postal-in-non-web-scenario
My template looks like:
@model Namespace1.AlertEmailViewModel
From: support@example.com
To: @Model.FirstName @Model.LastName <@Model.Email>
Subject: Alert! @Model.ShortDescription
(The model class in question does exist.)
Any help would be appreciated. Thanks! | 0 |
7,834,418 | 10/20/2011 10:14:33 | 572,598 | 01/12/2011 10:58:32 | 11 | 0 | Date Computaion in java | The date format iam using is "MM/dd/yy"
I want to perform a operation like This.
LastActDate = Todaysdate -(PrchaseDate + 1)
In myDb the date is stored as 2011-07-08 19:30:06(java util date | java | null | null | null | null | 10/21/2011 04:33:17 | not a real question | Date Computaion in java
===
The date format iam using is "MM/dd/yy"
I want to perform a operation like This.
LastActDate = Todaysdate -(PrchaseDate + 1)
In myDb the date is stored as 2011-07-08 19:30:06(java util date | 1 |
10,800,348 | 05/29/2012 13:40:06 | 189,230 | 10/13/2009 15:58:54 | 1,196 | 40 | How do you delete a git tag and propagate said delete through git pull to others? | We're currently cleaning up our git repo at work due to a ridiculous amount of branches and tags that just aren't needed.
We've done the branches part, but the tags part is proving troublesome.
We deleted the branches on the remote, and asked our team to do a `git pull --prune` to remove said branches in their local repos.
The problem is, there doesn't seem to be a way to do this with tags. We can delete the tag remotely quite easily, but we can't get that change to propogate down to a local repo when we do a `git pull`, or `gc`, or `remote prune`.
**Any ideas on how to do this?**
Or will we just have to stop people from using `git push --tags` until they re-clone the repo?
Steve | git | null | null | null | null | null | open | How do you delete a git tag and propagate said delete through git pull to others?
===
We're currently cleaning up our git repo at work due to a ridiculous amount of branches and tags that just aren't needed.
We've done the branches part, but the tags part is proving troublesome.
We deleted the branches on the remote, and asked our team to do a `git pull --prune` to remove said branches in their local repos.
The problem is, there doesn't seem to be a way to do this with tags. We can delete the tag remotely quite easily, but we can't get that change to propogate down to a local repo when we do a `git pull`, or `gc`, or `remote prune`.
**Any ideas on how to do this?**
Or will we just have to stop people from using `git push --tags` until they re-clone the repo?
Steve | 0 |
8,247,376 | 11/23/2011 18:37:13 | 665,822 | 03/18/2011 10:01:37 | 15 | 1 | Having trouble making a SOAP proxy / client using Visual Studio 2008 | I have the following web-service endpoint address:
https://*.*.*/XISOAPAdapter/MessageServlet?channel=:TrackTrace:DTHZCOMSD_PI_TRACKTRACE_TRANSP
These are the steps I'm performing.
- In my project I go to References -> Add Service Reference.
- In Address field I enter the address above.
- VS says: "VS has detected a problem with the site's security certificate"
- I confirm this exception.
- VS says that the service requires a username and password and asks for a Discovery Credential.
- Entering the username/password combination that was provided.
- Confirming.
- Getting this:
> The HTML document does not contain Web service discovery information.
> Metadata contains a reference that cannot be resolved:
> 'https://*.*.*/XISOAPAdapter/MessageServlet?channel=:TrackTrace:DTHZCOMSD_PI_TRACKTRACE_TRANSP'.
> The HTTP request is unauthorized with client authentication scheme
> 'Anonymous'. The authentication header received from the server was
> 'Basic realm="XISOAPApps"'. The remote server returned an error: (401)
> Unauthorized. If the service is defined in the current solution, try
> building the solution and adding the service reference again.
If instead of adding a Service Reference I'll go References -> Add Service Reference -> Advanced -> Add Web Reference and enter the address above, I will be asked to accept the certificate and authenticate again. After confirming I will get a webpage:
> Message Servlet is in Status OK Status information: Servlet
> com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id:
> //tc/xi/NW04S_18_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#1
> $) bound to /MessageServlet Classname ModuleProcessor: null
> Lookupname for localModuleProcessorLookupName:
> localejbs/ModuleProcessorBean Lookupname for
> remoteModuleProcessorLookupName: null ModuleProcessorClass not
> instantiated ModuleProcessorLocal is Instance of
> com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0
> ModuleProcessorRemote not instantiated
and the following text:
> The HTML document does not contain Web service discovery information
Any hints on what could be wrong? | c# | .net | web-services | soap | null | null | open | Having trouble making a SOAP proxy / client using Visual Studio 2008
===
I have the following web-service endpoint address:
https://*.*.*/XISOAPAdapter/MessageServlet?channel=:TrackTrace:DTHZCOMSD_PI_TRACKTRACE_TRANSP
These are the steps I'm performing.
- In my project I go to References -> Add Service Reference.
- In Address field I enter the address above.
- VS says: "VS has detected a problem with the site's security certificate"
- I confirm this exception.
- VS says that the service requires a username and password and asks for a Discovery Credential.
- Entering the username/password combination that was provided.
- Confirming.
- Getting this:
> The HTML document does not contain Web service discovery information.
> Metadata contains a reference that cannot be resolved:
> 'https://*.*.*/XISOAPAdapter/MessageServlet?channel=:TrackTrace:DTHZCOMSD_PI_TRACKTRACE_TRANSP'.
> The HTTP request is unauthorized with client authentication scheme
> 'Anonymous'. The authentication header received from the server was
> 'Basic realm="XISOAPApps"'. The remote server returned an error: (401)
> Unauthorized. If the service is defined in the current solution, try
> building the solution and adding the service reference again.
If instead of adding a Service Reference I'll go References -> Add Service Reference -> Advanced -> Add Web Reference and enter the address above, I will be asked to accept the certificate and authenticate again. After confirming I will get a webpage:
> Message Servlet is in Status OK Status information: Servlet
> com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id:
> //tc/xi/NW04S_18_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#1
> $) bound to /MessageServlet Classname ModuleProcessor: null
> Lookupname for localModuleProcessorLookupName:
> localejbs/ModuleProcessorBean Lookupname for
> remoteModuleProcessorLookupName: null ModuleProcessorClass not
> instantiated ModuleProcessorLocal is Instance of
> com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0
> ModuleProcessorRemote not instantiated
and the following text:
> The HTML document does not contain Web service discovery information
Any hints on what could be wrong? | 0 |
11,238,721 | 06/28/2012 05:48:18 | 1,340,222 | 04/18/2012 03:10:32 | 28 | 0 | How to add pin on map overlay ios | How we can add a pin on map overlay like we add on map??
i am creating an overlay using following code
MKOverlayView* overlayV = [[MKOverlayView alloc] initWithFrame:mMapView.frame];
[mMapView addOverlay:overlayV.overlay]; | ios | map | null | null | null | null | open | How to add pin on map overlay ios
===
How we can add a pin on map overlay like we add on map??
i am creating an overlay using following code
MKOverlayView* overlayV = [[MKOverlayView alloc] initWithFrame:mMapView.frame];
[mMapView addOverlay:overlayV.overlay]; | 0 |
2,356,432 | 03/01/2010 14:28:14 | 283,671 | 03/01/2010 14:28:14 | 1 | 0 | How to set up Avalon docking manager to resize like VS? | I am using Avalon in my WPF app. I want a window similar to that of Visual Studio, Tools on the left, then the documents in the middle and the Properties on the right. I managed to do that with this code:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:local="clr-namespace:WpfApplication1"
Title="Window1" Height="600" Width="800">
<Grid>
<ad:DockingManager x:Name="dockManager" RenderTransformOrigin="0,0">
<ad:ResizingPanel Orientation="Vertical">
<ad:ResizingPanel Orientation="Horizontal" >
<ad:DockablePane>
<ad:DockableContent Title="Toolbox" Width="100">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
<ad:DocumentPane x:Name="documentsHost" OverridesDefaultStyle="True">
<ad:DocumentContent Title="File1.doc">
<RichTextBox/>
</ad:DocumentContent >
<ad:DocumentContent Title="File2.doc">
<RichTextBox/>
</ad:DocumentContent >
</ad:DocumentPane>
<ad:DockablePane>
<ad:DockableContent Title="Project Explorer">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
</ad:ResizingPanel>
<ad:DockablePane>
<ad:DockableContent Title="Output">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
</ad:ResizingPanel>
</ad:DockingManager>
</Grid>
</Window>
The problem is that when I resize any of them, they all resize to keep their proportion. This is not what I want, I want it to be like VS where just the document window in the middle resizes with.
I would appreciate any help since I have been fighting with this for a few days now :( | wpf | avalondock | null | null | null | null | open | How to set up Avalon docking manager to resize like VS?
===
I am using Avalon in my WPF app. I want a window similar to that of Visual Studio, Tools on the left, then the documents in the middle and the Properties on the right. I managed to do that with this code:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:local="clr-namespace:WpfApplication1"
Title="Window1" Height="600" Width="800">
<Grid>
<ad:DockingManager x:Name="dockManager" RenderTransformOrigin="0,0">
<ad:ResizingPanel Orientation="Vertical">
<ad:ResizingPanel Orientation="Horizontal" >
<ad:DockablePane>
<ad:DockableContent Title="Toolbox" Width="100">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
<ad:DocumentPane x:Name="documentsHost" OverridesDefaultStyle="True">
<ad:DocumentContent Title="File1.doc">
<RichTextBox/>
</ad:DocumentContent >
<ad:DocumentContent Title="File2.doc">
<RichTextBox/>
</ad:DocumentContent >
</ad:DocumentPane>
<ad:DockablePane>
<ad:DockableContent Title="Project Explorer">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
</ad:ResizingPanel>
<ad:DockablePane>
<ad:DockableContent Title="Output">
<TextBox />
</ad:DockableContent>
</ad:DockablePane>
</ad:ResizingPanel>
</ad:DockingManager>
</Grid>
</Window>
The problem is that when I resize any of them, they all resize to keep their proportion. This is not what I want, I want it to be like VS where just the document window in the middle resizes with.
I would appreciate any help since I have been fighting with this for a few days now :( | 0 |
11,737,580 | 07/31/2012 09:59:26 | 1,519,829 | 07/12/2012 06:14:37 | 1 | 5 | detect name and delete href | How can I detect a part of a name like 'Veterans' in the class="list-name" and delete the complete link?
<li role="heading" data-role="list-divider">Please choose your Competition</li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223687"><div class="list-name">2012 Winter Sunday Mixed 3</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223614"><div class="list-name">2012 Winter Sunday Mixed 4</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223570"><div class="list-name">2012 Winter Sunday Veterans 1</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223658"><div class="list-name">2012 Winter Sunday Veterans 2</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223593"><div class="list-name">2012 Winter Monday Men 1</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223669"><div class="list-name">2012 Winter Monday Men 2</div></a></li>
...................... | delete | href | null | null | null | 08/01/2012 14:59:49 | not a real question | detect name and delete href
===
How can I detect a part of a name like 'Veterans' in the class="list-name" and delete the complete link?
<li role="heading" data-role="list-divider">Please choose your Competition</li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223687"><div class="list-name">2012 Winter Sunday Mixed 3</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223614"><div class="list-name">2012 Winter Sunday Mixed 4</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223570"><div class="list-name">2012 Winter Sunday Veterans 1</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223658"><div class="list-name">2012 Winter Sunday Veterans 2</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223593"><div class="list-name">2012 Winter Monday Men 1</div></a></li>
<li><a href="http://www.sportingpulse.com/mobile/mobile.cgi?a=CF&aID=2307&cID=223669"><div class="list-name">2012 Winter Monday Men 2</div></a></li>
...................... | 1 |
2,893,796 | 05/23/2010 22:42:44 | 240,337 | 12/29/2009 17:17:16 | 183 | 3 | Create Hello World with RESTful web service and Jersey | I follow tutorial <a href="http://java.sun.com/javaee/6/docs/tutorial/doc/gipzz.html"> here </a> on how to create web service using RESTful web service and Jersey and I get kind of stuck. The code is from HelloWorld3 in the tutorial I linked above. Here is the code. I use Netbean6.8 + glassfish v3
`RESTGreeting.java` create using `JAXB`. This class represents the HTML message in Java
package com.sun.rest;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlElement;
@XmlRootElement(name = "restgreeting")
public class RESTGreeting {
private String message;
private String name;
/**
* Creates new instance of Greeting
*/
public RESTGreeting() {
}
/* Create new instance of Greeting
* with parameters message and name
*/
public RESTGreeting(
String message,
String name) {
this.message = message;
this.name = name;
}
/** Getter for message
* return value for message
*
*/
@XmlElement
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
/* Getter for name
* return name
*/
@XmlElement
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
`HelloGreetingService.java` creates a RESTful web service that returns an HTML message
package com.sun.rest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
@Path("helloGreeting")
public class HelloGreetingService {
@Context
private UriInfo context;
/** Creates a new instance of HelloGreetingService */
public HelloGreetingService() {
}
/**
* Retrieves representation of an instance of com.sun.rest.HelloGreetingService
* @return an instance of java.lang.String
*/
@GET
@Produces("text/html")
public RESTGreeting getHtml(@QueryParam("name")
String name) {
return new RESTGreeting(
getGreeting(),
name);
}
private String getGreeting() {
return "Hello ";
}
/**
* PUT method for updating or creating an instance of HelloGreetingService
* @param content representation for the resource
* @return an HTTP response with content of the updated or created resource.
*/
@PUT
@Consumes("text/html")
public void putHtml(String content) {
}
}
However when i deploy it on Glassfish, and run it. It generate an exception. I try to debug using netbean 6.8, and figure out that this line `return new RESTGreeting(getGreeting(), name);` in `HelloGreetingService.java` cause the exception. But not sure why. Here is the stacktrace
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1029)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:637)
| java-ee | rest | jaxb | jersey | netbeans6.8 | null | open | Create Hello World with RESTful web service and Jersey
===
I follow tutorial <a href="http://java.sun.com/javaee/6/docs/tutorial/doc/gipzz.html"> here </a> on how to create web service using RESTful web service and Jersey and I get kind of stuck. The code is from HelloWorld3 in the tutorial I linked above. Here is the code. I use Netbean6.8 + glassfish v3
`RESTGreeting.java` create using `JAXB`. This class represents the HTML message in Java
package com.sun.rest;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlElement;
@XmlRootElement(name = "restgreeting")
public class RESTGreeting {
private String message;
private String name;
/**
* Creates new instance of Greeting
*/
public RESTGreeting() {
}
/* Create new instance of Greeting
* with parameters message and name
*/
public RESTGreeting(
String message,
String name) {
this.message = message;
this.name = name;
}
/** Getter for message
* return value for message
*
*/
@XmlElement
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
/* Getter for name
* return name
*/
@XmlElement
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
`HelloGreetingService.java` creates a RESTful web service that returns an HTML message
package com.sun.rest;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.GET;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
@Path("helloGreeting")
public class HelloGreetingService {
@Context
private UriInfo context;
/** Creates a new instance of HelloGreetingService */
public HelloGreetingService() {
}
/**
* Retrieves representation of an instance of com.sun.rest.HelloGreetingService
* @return an instance of java.lang.String
*/
@GET
@Produces("text/html")
public RESTGreeting getHtml(@QueryParam("name")
String name) {
return new RESTGreeting(
getGreeting(),
name);
}
private String getGreeting() {
return "Hello ";
}
/**
* PUT method for updating or creating an instance of HelloGreetingService
* @param content representation for the resource
* @return an HTTP response with content of the updated or created resource.
*/
@PUT
@Consumes("text/html")
public void putHtml(String content) {
}
}
However when i deploy it on Glassfish, and run it. It generate an exception. I try to debug using netbean 6.8, and figure out that this line `return new RESTGreeting(getGreeting(), name);` in `HelloGreetingService.java` cause the exception. But not sure why. Here is the stacktrace
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:268)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1029)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:637)
| 0 |
9,023,206 | 01/26/2012 18:21:45 | 954,986 | 09/20/2011 14:30:40 | 18 | 0 | Proper form/etiquette for breaking/continuing loops | I'm curious as to what the norm is for breaking/continuing loops. I'm fairly new to the programming scene, and I'm wondering how often breaking/continuing loops is done. It is something generally frowned upon, like goto, or not? And I get the impression that continue is in general "better" to use than break? What do you all thinl?
Thanks! | c++ | etiquette | null | null | null | 01/26/2012 18:25:20 | not constructive | Proper form/etiquette for breaking/continuing loops
===
I'm curious as to what the norm is for breaking/continuing loops. I'm fairly new to the programming scene, and I'm wondering how often breaking/continuing loops is done. It is something generally frowned upon, like goto, or not? And I get the impression that continue is in general "better" to use than break? What do you all thinl?
Thanks! | 4 |
2,370,378 | 03/03/2010 10:27:52 | 285,188 | 03/03/2010 10:20:01 | 1 | 0 | How to write application for simulating content form submission using cocoa? | Would like to ask for recommendation for ways that I can build application in cocoa to simulate user submission. For example, filling in registering form or even simulate a click in the web form. Not sure what exactly is the term for this.
Tried to google around, but didn't find any result. Closest I get is webkit, but not sure how to apply it and i thought it is only for web rendering.
Highly appreciated if someone could share some thoughts.
| cocoa | objective-c | null | null | null | null | open | How to write application for simulating content form submission using cocoa?
===
Would like to ask for recommendation for ways that I can build application in cocoa to simulate user submission. For example, filling in registering form or even simulate a click in the web form. Not sure what exactly is the term for this.
Tried to google around, but didn't find any result. Closest I get is webkit, but not sure how to apply it and i thought it is only for web rendering.
Highly appreciated if someone could share some thoughts.
| 0 |
774,293 | 04/21/2009 19:46:02 | 6,180 | 09/12/2008 19:35:26 | 2,247 | 112 | How to create an iterator over elements that match a derived type in C++? | I'd like an iterator in C++ that can only iterate over elements of a specific type. In the following example, I want to iterate only on elements that are SubType instances.
vector<Type*> the_vector;
the_vector.push_back(new Type(1));
the_vector.push_back(new SubType(2)); //SubType derives from Type
the_vector.push_back(new Type(3));
the_vector.push_back(new SubType(4));
vector<Type*>::iterator the_iterator; //***This line needs to change***
the_iterator = the_vector.begin();
while( the_iterator != the_vector.end() ) {
SubType* item = (SubType*)*the_iterator;
//only SubType(2) and SubType(4) should be in this loop.
++the_iterator;
}
How would I create this iterator in C++? | c++ | iterator | stl | null | null | null | open | How to create an iterator over elements that match a derived type in C++?
===
I'd like an iterator in C++ that can only iterate over elements of a specific type. In the following example, I want to iterate only on elements that are SubType instances.
vector<Type*> the_vector;
the_vector.push_back(new Type(1));
the_vector.push_back(new SubType(2)); //SubType derives from Type
the_vector.push_back(new Type(3));
the_vector.push_back(new SubType(4));
vector<Type*>::iterator the_iterator; //***This line needs to change***
the_iterator = the_vector.begin();
while( the_iterator != the_vector.end() ) {
SubType* item = (SubType*)*the_iterator;
//only SubType(2) and SubType(4) should be in this loop.
++the_iterator;
}
How would I create this iterator in C++? | 0 |
11,295,762 | 07/02/2012 14:33:47 | 598,247 | 02/01/2011 11:01:17 | 1,355 | 43 | Simple LINQ to Entities update throwing 'Timeout expired' | The simple method below is throwing a timeout error and I can't figure out why this might be. This may be executed in multiple times in succession and I'm wondering if this could be the cause?
public static Boolean UpdateMessageState(int messageId, int stateId, string message)
{
var repo = new MailItemRepository();
try
{
var objTask = repo.GetMailByMailId(messageId);
objTask.State = stateId;
objTask.Result = message;
repo.Save();
return true;
}
catch (Exception ex)
{
logger.Info(ex.Message);
logger.Info(ex.InnerException);
return false;
}
}
}
Error trace:
2012-07-02 15:26:38.1002|INFO|EF.Methods.MailMethods.UpdateMessageState|System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) | entity-framework | linq-to-entities | null | null | null | null | open | Simple LINQ to Entities update throwing 'Timeout expired'
===
The simple method below is throwing a timeout error and I can't figure out why this might be. This may be executed in multiple times in succession and I'm wondering if this could be the cause?
public static Boolean UpdateMessageState(int messageId, int stateId, string message)
{
var repo = new MailItemRepository();
try
{
var objTask = repo.GetMailByMailId(messageId);
objTask.State = stateId;
objTask.Result = message;
repo.Save();
return true;
}
catch (Exception ex)
{
logger.Info(ex.Message);
logger.Info(ex.InnerException);
return false;
}
}
}
Error trace:
2012-07-02 15:26:38.1002|INFO|EF.Methods.MailMethods.UpdateMessageState|System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
at System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter) | 0 |
4,383,810 | 12/08/2010 03:04:02 | 534,489 | 12/08/2010 03:04:02 | 1 | 0 | concatenating strings and snprintf in c | I'm wondering if this is the proper way to `concatenate` and `NUL` terminate strings including width.
#define FOO "foo"
const char *bar = "bar";
int n = 10;
float f = 10.2;
char *s;
int l;
l = snprintf (NULL, 0, "%-6s %-10s %4d %4f",FOO, bar, n, f);
s = malloc (l + 4); // should it be the number of formats tags?
if (s == null) return 1;
sprintf (s, "%-6s %-10s %4d %4f", FOO, bar, n, f);
| c | concatenation | snprintf | null | null | null | open | concatenating strings and snprintf in c
===
I'm wondering if this is the proper way to `concatenate` and `NUL` terminate strings including width.
#define FOO "foo"
const char *bar = "bar";
int n = 10;
float f = 10.2;
char *s;
int l;
l = snprintf (NULL, 0, "%-6s %-10s %4d %4f",FOO, bar, n, f);
s = malloc (l + 4); // should it be the number of formats tags?
if (s == null) return 1;
sprintf (s, "%-6s %-10s %4d %4f", FOO, bar, n, f);
| 0 |
10,574,464 | 05/13/2012 19:13:28 | 729,294 | 04/28/2011 12:27:11 | 396 | 1 | convex optimization in matlab | I want to speed up the convex optimization in matlab. Right now I am manually writing the iteration with the termination condition being the difference between the new parameter value and old parameter value very less around 0.0000001. So, it takes a lot of time to converge almost 2 days. Is there any way to speed this up. Actually my objective function has only three parameters. I cannot terminate based upon the number of iterations because it doesn't guarantee that it has converged to the optimum solution. I know that my first parameter's value should be greater than that of the second. So at the initial condition, second parameter's value starts increasing rapidly. After it has reached to a certain point, the first parameter's value starts increasing rapidly. While the first parameter's value starts increasing, the second parameter's value starts decreasing slowly. Eventually, I have the first parameter's value greater than that of second. Is there any way to speed up the process. 2 days is very long time. Plus calculating the gradient is also time consuming. It has lot of matrix computations. I don't want to start with the defined parameter values like parameter1's value greater than that of second. Also it's not necessary that parameter1 has always greater value than that of the second. I just know which parameter value should be greater. Any suggestions? | matlab | convex-optimization | null | null | null | null | open | convex optimization in matlab
===
I want to speed up the convex optimization in matlab. Right now I am manually writing the iteration with the termination condition being the difference between the new parameter value and old parameter value very less around 0.0000001. So, it takes a lot of time to converge almost 2 days. Is there any way to speed this up. Actually my objective function has only three parameters. I cannot terminate based upon the number of iterations because it doesn't guarantee that it has converged to the optimum solution. I know that my first parameter's value should be greater than that of the second. So at the initial condition, second parameter's value starts increasing rapidly. After it has reached to a certain point, the first parameter's value starts increasing rapidly. While the first parameter's value starts increasing, the second parameter's value starts decreasing slowly. Eventually, I have the first parameter's value greater than that of second. Is there any way to speed up the process. 2 days is very long time. Plus calculating the gradient is also time consuming. It has lot of matrix computations. I don't want to start with the defined parameter values like parameter1's value greater than that of second. Also it's not necessary that parameter1 has always greater value than that of the second. I just know which parameter value should be greater. Any suggestions? | 0 |
10,168,483 | 04/16/2012 03:44:46 | 451,590 | 09/18/2010 20:17:27 | 8 | 1 | How can I make an object available to all classes in my project without including it as a field? | I am making a text adventure engine in Java, and in order to save memory, I have a database object that holds all the currently scraped items from an XML document. I want to use it from several different classes. How can I make it available to my classes? Currently I'm using a null static field with an appropriate mutator method. | java | null | null | null | null | null | open | How can I make an object available to all classes in my project without including it as a field?
===
I am making a text adventure engine in Java, and in order to save memory, I have a database object that holds all the currently scraped items from an XML document. I want to use it from several different classes. How can I make it available to my classes? Currently I'm using a null static field with an appropriate mutator method. | 0 |
11,544,382 | 07/18/2012 15:01:45 | 1,219,868 | 02/19/2012 22:42:30 | 10 | 0 | IOS 6 screen rotation without using storyboard | Anyone who's trying the newest iOS 6 beta(version 2 or 3) has the same experience of auto rotation not working?
I am not using storyboard but pure navigation control:
self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];
And have:
- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
BUT IOS has no espouse at all, works fine with all previous iOS on 3GS/4S and 4.3,5.0.5.1 simulator, but iOS 6 seems just buggy | iphone | ios | rotation | beta | null | 07/18/2012 15:27:24 | too localized | IOS 6 screen rotation without using storyboard
===
Anyone who's trying the newest iOS 6 beta(version 2 or 3) has the same experience of auto rotation not working?
I am not using storyboard but pure navigation control:
self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:navController.view];
And have:
- (BOOL)shouldAutorotateToInterfaceOrientation: ](UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
BUT IOS has no espouse at all, works fine with all previous iOS on 3GS/4S and 4.3,5.0.5.1 simulator, but iOS 6 seems just buggy | 3 |
6,592,400 | 07/06/2011 06:31:19 | 830,980 | 07/06/2011 06:30:25 | 1 | 0 | Who knows the technical solutions about Linkedin's 3rd degree friends? | Every user maybe have a very very long list of 3rd friends.How to handle so many datas | linkedin | null | null | null | null | 07/06/2011 07:25:52 | not a real question | Who knows the technical solutions about Linkedin's 3rd degree friends?
===
Every user maybe have a very very long list of 3rd friends.How to handle so many datas | 1 |
4,342,176 | 12/03/2010 03:24:40 | 179,736 | 09/27/2009 11:27:55 | 4,765 | 40 | How do I serialize a python dictionary into a string? And then back to a dictionary? | (the dictionary will have lists and other dictionaries inside)
| python | string | list | serialization | dictionary | null | open | How do I serialize a python dictionary into a string? And then back to a dictionary?
===
(the dictionary will have lists and other dictionaries inside)
| 0 |
10,508,849 | 05/09/2012 01:47:27 | 1,357,605 | 04/26/2012 02:20:49 | 3 | 0 | Best tool to trace php file | Im new to php and i want to find out in what file actually contains the rendered HTML that i see. Seems like the header parts of the page are in the includes folder. Took me 2 days to find this out. Is there an easier way or tool to use. | php | null | null | null | null | 05/09/2012 12:25:08 | not a real question | Best tool to trace php file
===
Im new to php and i want to find out in what file actually contains the rendered HTML that i see. Seems like the header parts of the page are in the includes folder. Took me 2 days to find this out. Is there an easier way or tool to use. | 1 |
1,409,681 | 09/11/2009 08:25:43 | 162,720 | 08/25/2009 13:11:29 | 3 | 0 | ASP.NET AjaxControlToolkit Combobox - Disallow insert of items | I want to use the new **combobox control** of the Ajax control Toolkit.<br>
But I need it only for selecting an entry of a given list.<br>
The user should not be able to insert own items into the list. How to prevent this?
The ItemInsertLocation seems to have no value to set this behaviour. | asp.net | ajaxcontroltoolkit | combobox | null | null | null | open | ASP.NET AjaxControlToolkit Combobox - Disallow insert of items
===
I want to use the new **combobox control** of the Ajax control Toolkit.<br>
But I need it only for selecting an entry of a given list.<br>
The user should not be able to insert own items into the list. How to prevent this?
The ItemInsertLocation seems to have no value to set this behaviour. | 0 |
7,619,653 | 10/01/2011 10:29:05 | 690,873 | 04/04/2011 09:50:20 | 731 | 34 | Issue moving new item to newly added list until I do page refresh | I am using a jquery template for dynamically creating a list (columns) which has different items (they are also added dynamically) and also created a plugin which helps moving items from one list to 2nd or 3rd i.e. using jquery ui drag & drop, but having a problem while dropping the item to the newly added list.
Scenario: When I click add list button, it creates list on the page. So I added a list named 'list1' and each list have a button to add items on the list so by pressing it twice I added 2 items on 'list1'. And items are moveable/draggable/dropable. Now added a 2nd list named 'list2'. So if I try to move an item from 'list1' to 'list2' it doesn't do that instead the item moves to 'list1'. This is happening without page reload, but if I refresh the page and do the same action now the item can be moved to 'list2'. Here is the code that I am using the for drag and drop purposes is here (the following code is placed in my jquery plugin):
var id = $('.' + options.dropID);
var id0 = options.dropID;
$('.' + options.dropID).sortable({
helper: "clone",
revert: "invalid", // go back to original droppable when drop outside drop area
connectWith: '.' + options.dropID,
over: function (event, ui) {
// may be usefull
var sortableElement = this;
var dataToSave = {
name: ui.item.text(),
objid: ui.item.attr('title'), // id has changed for array so use original id stored in title
thisID: $(sortableElement).attr('id'),
array: $(sortableElement).sortable("serialize")
};
// save the new data
saveData(dataToSave);
}
});
so I noticed a behaviour that the different behaviour is here:
- added an item and no page load, it add following div
<div id="337" class="cardItem droppable"> </div>
so if i try to add item here it doesn't allow me.
- after page load, it modify the above div to:
<div id="337" class="cardItem droppable ui-sortable"> </div>
it adds ui-sortable to class attribute. So I try to search how or when this `ui-sortable` is added, it is done by jquery's sortable method.
and on page load I am calling the plugin like this:
<script type="text/javascript">
$(window).bind("load", function () {
$('.laneList').ListDragandDrop();
});
</script>
I also calling the ListDragandDrop() after adding the new list or item but it doesn't add `ui-sortable` to the div, and I have to refresh the page so it can make 'list2' dropable. Can you tell me what I am doing wrong or what should I modify to make it work. | jquery | jquery-ui | drag-and-drop | sortable | jquery-sortable | null | open | Issue moving new item to newly added list until I do page refresh
===
I am using a jquery template for dynamically creating a list (columns) which has different items (they are also added dynamically) and also created a plugin which helps moving items from one list to 2nd or 3rd i.e. using jquery ui drag & drop, but having a problem while dropping the item to the newly added list.
Scenario: When I click add list button, it creates list on the page. So I added a list named 'list1' and each list have a button to add items on the list so by pressing it twice I added 2 items on 'list1'. And items are moveable/draggable/dropable. Now added a 2nd list named 'list2'. So if I try to move an item from 'list1' to 'list2' it doesn't do that instead the item moves to 'list1'. This is happening without page reload, but if I refresh the page and do the same action now the item can be moved to 'list2'. Here is the code that I am using the for drag and drop purposes is here (the following code is placed in my jquery plugin):
var id = $('.' + options.dropID);
var id0 = options.dropID;
$('.' + options.dropID).sortable({
helper: "clone",
revert: "invalid", // go back to original droppable when drop outside drop area
connectWith: '.' + options.dropID,
over: function (event, ui) {
// may be usefull
var sortableElement = this;
var dataToSave = {
name: ui.item.text(),
objid: ui.item.attr('title'), // id has changed for array so use original id stored in title
thisID: $(sortableElement).attr('id'),
array: $(sortableElement).sortable("serialize")
};
// save the new data
saveData(dataToSave);
}
});
so I noticed a behaviour that the different behaviour is here:
- added an item and no page load, it add following div
<div id="337" class="cardItem droppable"> </div>
so if i try to add item here it doesn't allow me.
- after page load, it modify the above div to:
<div id="337" class="cardItem droppable ui-sortable"> </div>
it adds ui-sortable to class attribute. So I try to search how or when this `ui-sortable` is added, it is done by jquery's sortable method.
and on page load I am calling the plugin like this:
<script type="text/javascript">
$(window).bind("load", function () {
$('.laneList').ListDragandDrop();
});
</script>
I also calling the ListDragandDrop() after adding the new list or item but it doesn't add `ui-sortable` to the div, and I have to refresh the page so it can make 'list2' dropable. Can you tell me what I am doing wrong or what should I modify to make it work. | 0 |
10,374,914 | 04/29/2012 18:46:01 | 642,572 | 03/03/2011 07:45:44 | 15 | 3 | Research topics satisfying categories: tablet / security 2012 | I've been googling for a month now, and before that for 2 weeks, but now my research supervisor is telling me that me research topic, which is along the lines of "what security holes do mobile AV software have to fill to meet the security standards of current workstations", is too obvious and that there is no real problem for which i want to prvide a solution. He suggested I focus on tablets alone and the move from current workstations to tablets and the security risks that come with it,
I want a topic that would be more clearer and appealing to me though, that would include finding security holes in tablets and their software etc. for instance "using a tablet as a vessel to infiltrate the network" or "the tablet as a hacking tool".
But I'm trying to validate my topic or find problems that I'll be solving in my research in that direction when i do go that way, so that I don't fail in my presentation.
google's not giving me anything to help, Is there any place I can find Current problems in teblet/networking security that includes tablets in comparison to workstation/PC security? | android | ipad | security | blackberry | null | 04/29/2012 22:49:36 | off topic | Research topics satisfying categories: tablet / security 2012
===
I've been googling for a month now, and before that for 2 weeks, but now my research supervisor is telling me that me research topic, which is along the lines of "what security holes do mobile AV software have to fill to meet the security standards of current workstations", is too obvious and that there is no real problem for which i want to prvide a solution. He suggested I focus on tablets alone and the move from current workstations to tablets and the security risks that come with it,
I want a topic that would be more clearer and appealing to me though, that would include finding security holes in tablets and their software etc. for instance "using a tablet as a vessel to infiltrate the network" or "the tablet as a hacking tool".
But I'm trying to validate my topic or find problems that I'll be solving in my research in that direction when i do go that way, so that I don't fail in my presentation.
google's not giving me anything to help, Is there any place I can find Current problems in teblet/networking security that includes tablets in comparison to workstation/PC security? | 2 |
10,042,500 | 04/06/2012 10:53:50 | 164,783 | 08/28/2009 10:38:23 | 37 | 3 | get full activity from one app to another one app | i have A.apk and b.Apk these are the two apps. from a.apk having 1 test box and 2 buttons with some button events B.apk having simply nothing, i wold like to know any possible way to get the A.apk activity display with actions to display inside the B.apk possible ?
i means instead of running A.apk all the thing come under the B.apk Thank you | android | null | null | null | null | 04/08/2012 02:35:33 | not a real question | get full activity from one app to another one app
===
i have A.apk and b.Apk these are the two apps. from a.apk having 1 test box and 2 buttons with some button events B.apk having simply nothing, i wold like to know any possible way to get the A.apk activity display with actions to display inside the B.apk possible ?
i means instead of running A.apk all the thing come under the B.apk Thank you | 1 |
9,129,588 | 02/03/2012 13:45:57 | 1,092,359 | 12/11/2011 15:28:35 | 6 | 0 | How is n! = 𝛚(2^n)? | Page 58 of the "Introduction to algorithms" by Cormen says the above statement. I can't justify it since for n = 1
1! = 1 ≠ 𝛚(2). Maybe I do not understand the concept of of 𝛚 !
Can anybody make it go into my head ? | big-omega | null | null | null | null | 02/03/2012 17:35:17 | off topic | How is n! = 𝛚(2^n)?
===
Page 58 of the "Introduction to algorithms" by Cormen says the above statement. I can't justify it since for n = 1
1! = 1 ≠ 𝛚(2). Maybe I do not understand the concept of of 𝛚 !
Can anybody make it go into my head ? | 2 |
6,874,440 | 07/29/2011 14:10:32 | 717,336 | 04/20/2011 14:26:57 | 10 | 0 | How Ruby on Rails work | I programmed in php. And when you use some framework, then, as far as php is intepreter, all the framework loads every request. But not rails, though, ruby is interperter too... So, how does it work | ruby-on-rails | ruby | ruby-on-rails-3 | null | null | 07/29/2011 15:12:41 | not a real question | How Ruby on Rails work
===
I programmed in php. And when you use some framework, then, as far as php is intepreter, all the framework loads every request. But not rails, though, ruby is interperter too... So, how does it work | 1 |
1,138,402 | 07/16/2009 15:23:32 | 1,228 | 08/13/2008 13:58:55 | 16,036 | 695 | Easy way to convert exec sp_executesql to a normal query? | When dealing with debugging queries using Profiler and SSMS, its pretty common for me to copy a query from Profiler and test them in SSMS. Because I use parameterized sql, my queries are all sent as exec sp_executesql queries.
exec sp_executesql
N'/*some query here*/',
N'@someParameter tinyint',
@ someParameter =2
I'll take this and convert it into a normal query for ease of editing (intellisense, error checking, line numbers, etc):
DECLARE @someParameter tinyint
SET @someParameter = 2
/*some query here*/
Of course, the bigger and more complex the query, the harder to do this. And when you're going back and forth multiple times, it can be a pain in the ass and soak up lots of time.
I'm looking for an addin or macro that will automatically do this conversion for me. Does it exist?
| ssms | macros | format | sp-executesql | null | 12/20/2011 21:01:16 | not constructive | Easy way to convert exec sp_executesql to a normal query?
===
When dealing with debugging queries using Profiler and SSMS, its pretty common for me to copy a query from Profiler and test them in SSMS. Because I use parameterized sql, my queries are all sent as exec sp_executesql queries.
exec sp_executesql
N'/*some query here*/',
N'@someParameter tinyint',
@ someParameter =2
I'll take this and convert it into a normal query for ease of editing (intellisense, error checking, line numbers, etc):
DECLARE @someParameter tinyint
SET @someParameter = 2
/*some query here*/
Of course, the bigger and more complex the query, the harder to do this. And when you're going back and forth multiple times, it can be a pain in the ass and soak up lots of time.
I'm looking for an addin or macro that will automatically do this conversion for me. Does it exist?
| 4 |
7,632,244 | 10/03/2011 07:39:49 | 976,014 | 10/03/2011 03:07:18 | 1 | 0 | Android: how to change color of fonts(string words) listed in a listview? | I using a listView, but I set its **background color** to white, due to application requirements.
when I run application, it showed a blank white screen when it went into the 'chapters-menu' activity. It only show when I 'highlight' the entire listView while application is running.
I've a xml file that has the following layout with listview and buttons here.
I try to change front by using **'android:color'** attribute to **"@color/black"**, but still show blank screen.
**Here is the XML file**
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<ListView android:id="@+id/chapters_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:textColor="@color/black" />
<Button
android:id="@+id/btn_chapters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:paddingRight="5dp"
android:text="@string/btnHome" />
<Button
android:id="@+id/btn_qns"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/btnHome"
android:text="@string/btnQn" />
</RelativeLayout>
**the following are the sources codes**
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import android.app.Activity;
import android.view.View;
public class cimaE1Chapters extends Activity
{
String[] chapters;
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.cimae1chapters);
ListView list = (ListView) findViewById(R.id.chapters_list);
chapters = getResources().getStringArray(R.array.chapters_array);
list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, chapters));
}
}
It would be of great help if you could advise me as I'm new to Android programming. Thank you. | android-layout | android-listview | android-xml | android-custom-view | android-activity | null | open | Android: how to change color of fonts(string words) listed in a listview?
===
I using a listView, but I set its **background color** to white, due to application requirements.
when I run application, it showed a blank white screen when it went into the 'chapters-menu' activity. It only show when I 'highlight' the entire listView while application is running.
I've a xml file that has the following layout with listview and buttons here.
I try to change front by using **'android:color'** attribute to **"@color/black"**, but still show blank screen.
**Here is the XML file**
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<ListView android:id="@+id/chapters_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:textColor="@color/black" />
<Button
android:id="@+id/btn_chapters"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:paddingRight="5dp"
android:text="@string/btnHome" />
<Button
android:id="@+id/btn_qns"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/btnHome"
android:text="@string/btnQn" />
</RelativeLayout>
**the following are the sources codes**
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import android.app.Activity;
import android.view.View;
public class cimaE1Chapters extends Activity
{
String[] chapters;
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.cimae1chapters);
ListView list = (ListView) findViewById(R.id.chapters_list);
chapters = getResources().getStringArray(R.array.chapters_array);
list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, chapters));
}
}
It would be of great help if you could advise me as I'm new to Android programming. Thank you. | 0 |
11,716,610 | 07/30/2012 06:52:51 | 1,136,108 | 01/07/2012 15:52:13 | 100 | 0 | nth user of facebook? | Is it possible to find user's position on facebook.
Like,
user1 43,345,34 th user of facebook
user2 34,343,32 th user of facebook
By using the joining date or user id? | php | facebook | facebook-graph-api | null | null | 07/30/2012 19:25:17 | not a real question | nth user of facebook?
===
Is it possible to find user's position on facebook.
Like,
user1 43,345,34 th user of facebook
user2 34,343,32 th user of facebook
By using the joining date or user id? | 1 |
11,381,317 | 07/08/2012 07:07:47 | 465,378 | 10/03/2010 20:45:24 | 1,513 | 53 | Make a JPanel scale to fit width but keep a fixed height | I have a `JPanel` which I'm placing inside of a `JScrollPane`. I am manually painting it using `paintComponent()`, since it's being used as a canvas, and I want the panel to automatically fit to the width of the scroll pane. I can then use `getWidth()` in the painting code to automatically scale to fit the container. However, I want to be able to manually set the preferred height so the I make use of the scroll pane's vertical scrolling capabilities.
What's the best way to do this? This would obviously still work if I was just able to get the width of the scroll pane in the painting code, but I don't want to break encapsulation too much with hacky code like `getParent()`. | java | swing | jpanel | layout-manager | null | null | open | Make a JPanel scale to fit width but keep a fixed height
===
I have a `JPanel` which I'm placing inside of a `JScrollPane`. I am manually painting it using `paintComponent()`, since it's being used as a canvas, and I want the panel to automatically fit to the width of the scroll pane. I can then use `getWidth()` in the painting code to automatically scale to fit the container. However, I want to be able to manually set the preferred height so the I make use of the scroll pane's vertical scrolling capabilities.
What's the best way to do this? This would obviously still work if I was just able to get the width of the scroll pane in the painting code, but I don't want to break encapsulation too much with hacky code like `getParent()`. | 0 |
9,684,978 | 03/13/2012 13:32:04 | 1,190,584 | 02/05/2012 12:18:19 | 8 | 0 | How to generate random number | I am working on calculator application. For me all operations are cleared except "rand". Could any one tell me how to generate random number of some number by selecting rand.
For example
initially i select one(1) then rand... if so it has to be displayed random number of one(1).
| objective-c | null | null | null | null | null | open | How to generate random number
===
I am working on calculator application. For me all operations are cleared except "rand". Could any one tell me how to generate random number of some number by selecting rand.
For example
initially i select one(1) then rand... if so it has to be displayed random number of one(1).
| 0 |
2,767,447 | 05/04/2010 17:20:30 | 109,672 | 05/20/2009 00:18:25 | 65 | 3 | Ruby Dir.glob works on laptop not on desktop? | I have a ruby shell script that works perficlty on my laptop but Dir.glob dosent seem to work when I try and run it on my desktop?
Here is the code:
sFileTemplate = File.join("**", sResolutions, "**", "*."+sType)
sFiles = Dir.glob(sFileTemplate)
Both machines run OSX 10.5 and are running ruby -v 1.9.1?
Am I calling glob wrong?
Thanks | ruby | null | null | null | null | null | open | Ruby Dir.glob works on laptop not on desktop?
===
I have a ruby shell script that works perficlty on my laptop but Dir.glob dosent seem to work when I try and run it on my desktop?
Here is the code:
sFileTemplate = File.join("**", sResolutions, "**", "*."+sType)
sFiles = Dir.glob(sFileTemplate)
Both machines run OSX 10.5 and are running ruby -v 1.9.1?
Am I calling glob wrong?
Thanks | 0 |
3,133,534 | 06/28/2010 15:02:37 | 29,961 | 10/21/2008 13:38:20 | 61 | 3 | WPF Change color in Xaml based off code behind property | I am trying to change the color of my label based off an enum set in xaml. I can not get the colors to update. Any help would be great.
Thanks!
<UserControl.Resources>
<!-- Normal -->
<SolidColorBrush x:Key="Normal_bg_Unselect" Color="#FF1A73CC" />
<SolidColorBrush x:Key="Normal_fg_Unselect" Color="#FF72BAFF" />
<SolidColorBrush x:Key="Normal_bg_Select" Color="#FF1ACCBF" />
<SolidColorBrush x:Key="Normal_fg_Select" Color="#FF91FFFF" />
</UserControl.Resources>
<Grid>
<Label Name="BackgroundLabel" Width="Auto" Height="Auto" BorderThickness="0" Panel.ZIndex="1" Cursor="Hand">
<Label.Foreground>
<SolidColorBrush Color="{DynamicResource Color_LightBlue}"/>
</Label.Foreground>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Background" Value="{Binding BgUnselect}" />
<Setter Property="Foreground" Value="{Binding FgUnselect}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{Binding BgSelect}" />
<Setter Property="Foreground" Value="{Binding FgSelect}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{Binding BgUnselect}" />
<Setter Property="Foreground" Value="{Binding FgUnselect}" />
</Trigger>
</Style.Triggers>
</Style>
</Label.Style>
<Label.OpacityMask>
<LinearGradientBrush>
<GradientStop Color="#00FFFFFF" Offset="-.35"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Label.OpacityMask>
</Label>
<TextBlock Name="ContentLabel" Text="{Binding Text, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, FallbackValue='Styled Button'}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0" FontFamily="/HarringtonGroup.TrainingBuilder;component/Fonts/#HelveticaNeue" FontSize="30" Foreground="{Binding ElementName=BackgroundLabel, Path=Foreground}" />
</Grid>
Code Behind
public SolidColorBrush BgUnselect { get; set; }
public SolidColorBrush FgUnselect { get; set; }
public SolidColorBrush BgSelect { get; set; }
public SolidColorBrush FgSelect { get; set; }
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
switch (ButtonType)
{
case ButtonType.Normal:
BgUnselect = (SolidColorBrush)FindResource("Normal_bg_Unselect");
FgUnselect = (SolidColorBrush)FindResource("Normal_fg_Unselect");
BgSelect = (SolidColorBrush)FindResource("Normal_bg_Select");
FgSelect = (SolidColorBrush)FindResource("Normal_fg_Select");
return;
case ButtonType.OK:
case ButtonType.Cancel:
return;
} | wpf | xaml | binding | null | null | null | open | WPF Change color in Xaml based off code behind property
===
I am trying to change the color of my label based off an enum set in xaml. I can not get the colors to update. Any help would be great.
Thanks!
<UserControl.Resources>
<!-- Normal -->
<SolidColorBrush x:Key="Normal_bg_Unselect" Color="#FF1A73CC" />
<SolidColorBrush x:Key="Normal_fg_Unselect" Color="#FF72BAFF" />
<SolidColorBrush x:Key="Normal_bg_Select" Color="#FF1ACCBF" />
<SolidColorBrush x:Key="Normal_fg_Select" Color="#FF91FFFF" />
</UserControl.Resources>
<Grid>
<Label Name="BackgroundLabel" Width="Auto" Height="Auto" BorderThickness="0" Panel.ZIndex="1" Cursor="Hand">
<Label.Foreground>
<SolidColorBrush Color="{DynamicResource Color_LightBlue}"/>
</Label.Foreground>
<Label.Style>
<Style TargetType="{x:Type Label}">
<Setter Property="Background" Value="{Binding BgUnselect}" />
<Setter Property="Foreground" Value="{Binding FgUnselect}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{Binding BgSelect}" />
<Setter Property="Foreground" Value="{Binding FgSelect}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="False">
<Setter Property="Background" Value="{Binding BgUnselect}" />
<Setter Property="Foreground" Value="{Binding FgUnselect}" />
</Trigger>
</Style.Triggers>
</Style>
</Label.Style>
<Label.OpacityMask>
<LinearGradientBrush>
<GradientStop Color="#00FFFFFF" Offset="-.35"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Label.OpacityMask>
</Label>
<TextBlock Name="ContentLabel" Text="{Binding Text, RelativeSource={RelativeSource FindAncestor, AncestorType=UserControl}, FallbackValue='Styled Button'}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20,0,0,0" FontFamily="/HarringtonGroup.TrainingBuilder;component/Fonts/#HelveticaNeue" FontSize="30" Foreground="{Binding ElementName=BackgroundLabel, Path=Foreground}" />
</Grid>
Code Behind
public SolidColorBrush BgUnselect { get; set; }
public SolidColorBrush FgUnselect { get; set; }
public SolidColorBrush BgSelect { get; set; }
public SolidColorBrush FgSelect { get; set; }
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
switch (ButtonType)
{
case ButtonType.Normal:
BgUnselect = (SolidColorBrush)FindResource("Normal_bg_Unselect");
FgUnselect = (SolidColorBrush)FindResource("Normal_fg_Unselect");
BgSelect = (SolidColorBrush)FindResource("Normal_bg_Select");
FgSelect = (SolidColorBrush)FindResource("Normal_fg_Select");
return;
case ButtonType.OK:
case ButtonType.Cancel:
return;
} | 0 |
9,095,913 | 02/01/2012 12:36:06 | 1,080,948 | 12/05/2011 05:29:38 | 31 | 0 | fill textbox based on first text box in jsp | Hi i have three text boxes in a jsp page. When first text box value is entered then based on that text box value data will be fetched from database and will auto fill 2nd and 3rd text boxes. I am using oracle 10g. How can i do it? Any help please | javascript | jquery | ajax | jsp | null | 02/01/2012 14:41:04 | not a real question | fill textbox based on first text box in jsp
===
Hi i have three text boxes in a jsp page. When first text box value is entered then based on that text box value data will be fetched from database and will auto fill 2nd and 3rd text boxes. I am using oracle 10g. How can i do it? Any help please | 1 |
5,892,909 | 05/05/2011 05:07:27 | 617,511 | 02/15/2011 09:35:52 | 9 | 0 | Twitter integration with iphone | I am using twitter login to enter in my app.But when i clicked on twitter button twitter page is opened but getting following error.
**WHOA there!!! This page is no longer valid.it looks like someone already used the token information you provide.please return to the site tht sent you to this page or try again. it was an probably an honest mistake**
Please help
Thanks in Advance | iphone | iphone-sdk-4.0 | twitter-api | mgtwitterengine | null | null | open | Twitter integration with iphone
===
I am using twitter login to enter in my app.But when i clicked on twitter button twitter page is opened but getting following error.
**WHOA there!!! This page is no longer valid.it looks like someone already used the token information you provide.please return to the site tht sent you to this page or try again. it was an probably an honest mistake**
Please help
Thanks in Advance | 0 |
10,917,171 | 06/06/2012 15:17:15 | 1,009,091 | 10/23/2011 00:32:51 | 45 | 1 | Can a main method be placed in a parent class? And if so can a child object be instantiated inside that main method? | Let's say I have a class 'Person' and another class 'Survey' which extends person so Survey is the child class and Person class is the parent. Person was the first class I wrote and hence defined the main method there now since I have a child class, can I call methods of the child class from the main method in the parent class (or do I need to keep transferring the main method to the class that is lower most in the heirarchy although I am pertty sure this is never ever going to be necessary...)? If so is this not counter intuitive to the notion that the child class inherits attributes of the parent class but the parent class does not inherit any attributes of the child class? Please do oblige with a reply. Thanks in advance.
Also I also read another post of having a separate class maybe 'driver.java just for the main method so would this mean that all classes would have to be imported into this class for us to call methods from other class in the main method?
I hope my question is not too convoluted.
| java | inheritance | subclass | main-method | null | null | open | Can a main method be placed in a parent class? And if so can a child object be instantiated inside that main method?
===
Let's say I have a class 'Person' and another class 'Survey' which extends person so Survey is the child class and Person class is the parent. Person was the first class I wrote and hence defined the main method there now since I have a child class, can I call methods of the child class from the main method in the parent class (or do I need to keep transferring the main method to the class that is lower most in the heirarchy although I am pertty sure this is never ever going to be necessary...)? If so is this not counter intuitive to the notion that the child class inherits attributes of the parent class but the parent class does not inherit any attributes of the child class? Please do oblige with a reply. Thanks in advance.
Also I also read another post of having a separate class maybe 'driver.java just for the main method so would this mean that all classes would have to be imported into this class for us to call methods from other class in the main method?
I hope my question is not too convoluted.
| 0 |
5,449,036 | 03/27/2011 11:53:54 | 114,140 | 05/29/2009 06:59:07 | 329 | 13 | Dropping IE6 Support; What Do We Gain? ... HTML / CSS / JavaScript Functionality & Techniques. | The web development community is at the tipping point of ditching Internet Explorer 6 support - even Microsoft is counting down it's demise [http://ie6countdown.com/][1]!
This raises a very interesting question... ***What do we gain?***
We've been weighed down by the ball and chain that is IE6 for so long it's really interesting to consider *all the good stuff we've neglected*...
With IE7 as the new baseline for backwards compatibility, how will this impact web development? What HTML, CSS or JavaScript functionality / techniques can we now *expect* from our browsers?
For example, I'm really looking forward to being able to use **CSS Chained Classes**.
.class1.class2.class3 {
background: #fff;
}
<div class="class1 class2 class3">
<p>Content here.</p>
</div>
P.S This question was inspired by [CSS Differences in Internet Explorer 6, 7 and 8][2] from [Smashing Magazine][3].
[1]: http://ie6countdown.com/
[2]: http://www.smashingmagazine.com/2009/10/14/css-differences-in-internet-explorer-6-7-and-8/
[3]: http://www.smashingmagazine.com/ | javascript | html | css | internet-explorer-6 | backwards-compatibility | 03/27/2011 13:16:22 | not a real question | Dropping IE6 Support; What Do We Gain? ... HTML / CSS / JavaScript Functionality & Techniques.
===
The web development community is at the tipping point of ditching Internet Explorer 6 support - even Microsoft is counting down it's demise [http://ie6countdown.com/][1]!
This raises a very interesting question... ***What do we gain?***
We've been weighed down by the ball and chain that is IE6 for so long it's really interesting to consider *all the good stuff we've neglected*...
With IE7 as the new baseline for backwards compatibility, how will this impact web development? What HTML, CSS or JavaScript functionality / techniques can we now *expect* from our browsers?
For example, I'm really looking forward to being able to use **CSS Chained Classes**.
.class1.class2.class3 {
background: #fff;
}
<div class="class1 class2 class3">
<p>Content here.</p>
</div>
P.S This question was inspired by [CSS Differences in Internet Explorer 6, 7 and 8][2] from [Smashing Magazine][3].
[1]: http://ie6countdown.com/
[2]: http://www.smashingmagazine.com/2009/10/14/css-differences-in-internet-explorer-6-7-and-8/
[3]: http://www.smashingmagazine.com/ | 1 |
10,386,943 | 04/30/2012 16:17:14 | 203,175 | 11/05/2009 05:03:09 | 1,145 | 1 | Need a very basic Perl Template | I am a beginner in Perl. I now have a SQL statement that is working correctly, however, I want to use Perl to execute the SQL, and output the result as a file, could any expert provide a very basic template? (Starting from connect to the database)
| mysql | perl | null | null | null | 05/01/2012 09:12:36 | not a real question | Need a very basic Perl Template
===
I am a beginner in Perl. I now have a SQL statement that is working correctly, however, I want to use Perl to execute the SQL, and output the result as a file, could any expert provide a very basic template? (Starting from connect to the database)
| 1 |
10,662,590 | 05/19/2012 05:30:29 | 1,177,504 | 01/30/2012 06:44:48 | 1 | 0 | Create title automatically using the first words of the content | everyone.
I would like to generate the title of the post using the first words of the post content. Ex: The post will be submitted with the title field empty, and the first words of the content would be sent as the post title.
Thank you. | post | content | title | auto | null | 05/21/2012 16:14:51 | not a real question | Create title automatically using the first words of the content
===
everyone.
I would like to generate the title of the post using the first words of the post content. Ex: The post will be submitted with the title field empty, and the first words of the content would be sent as the post title.
Thank you. | 1 |
10,165,361 | 04/15/2012 19:36:39 | 1,222,347 | 02/21/2012 01:25:25 | 16 | 1 | Dualboot (Win7 & Ubuntu) on SSD | Advice please. Can I install Windows 7 (Windows 8) and Ubuntu on an SSD with the ability to dualboot? And if so, how best to partition the disk?
SSD - VTX3-25SAT3-60G
For example:<br>
1. Windows - 25Gb<br>
2. Linux - 25Gb<br>
2.1 /boot - 300Mb<br>
2.2 / - 20Gb<br>
2.3 /swap - 2.7Gb (16Gb RAM, just in case)
And as in this case, it is best to align the sections?
| windows | linux | operating-system | partitioning | ssd | 04/15/2012 20:10:45 | off topic | Dualboot (Win7 & Ubuntu) on SSD
===
Advice please. Can I install Windows 7 (Windows 8) and Ubuntu on an SSD with the ability to dualboot? And if so, how best to partition the disk?
SSD - VTX3-25SAT3-60G
For example:<br>
1. Windows - 25Gb<br>
2. Linux - 25Gb<br>
2.1 /boot - 300Mb<br>
2.2 / - 20Gb<br>
2.3 /swap - 2.7Gb (16Gb RAM, just in case)
And as in this case, it is best to align the sections?
| 2 |
3,673,487 | 09/09/2010 03:04:11 | 437,249 | 09/01/2010 18:30:44 | 41 | 0 | Why don't you need a powerful ide for writing Python? | I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python.
What are the reasons people use to justify this claim? | python | null | null | null | null | 09/09/2010 12:16:44 | not constructive | Why don't you need a powerful ide for writing Python?
===
I have heard before that many Python developers don't use an IDE like Eclipse because it is unnecessary with a language like Python.
What are the reasons people use to justify this claim? | 4 |
2,914,351 | 05/26/2010 15:25:56 | 351,078 | 05/26/2010 15:25:56 | 1 | 0 | np-complete but not "hard" | Is there some language that is NP-complete but for which we know some "quick" algorithm? I don't mean like the ones for knapsack where we can do well on average, I mean that even in the worst case the runtime is something like 2^n^epsilon, where the result holds for any epsilon>0 and so we can allow it to get arbitrarily close to 0. | runtime | np-complete | np-hard | asymptotic-complexity | null | 05/27/2010 07:00:02 | not a real question | np-complete but not "hard"
===
Is there some language that is NP-complete but for which we know some "quick" algorithm? I don't mean like the ones for knapsack where we can do well on average, I mean that even in the worst case the runtime is something like 2^n^epsilon, where the result holds for any epsilon>0 and so we can allow it to get arbitrarily close to 0. | 1 |
1,616,603 | 10/24/2009 00:38:27 | 163,905 | 08/27/2009 01:09:35 | 8 | 0 | php: check if certain item in an array is empy | In PHP, how would one check to see if a specified item (by name, I think - number would probably also work) in an array is empty? | php | arrays | empty | null | null | null | open | php: check if certain item in an array is empy
===
In PHP, how would one check to see if a specified item (by name, I think - number would probably also work) in an array is empty? | 0 |
8,276,142 | 11/26/2011 03:55:22 | 265,341 | 02/03/2010 14:33:09 | 1,433 | 74 | ios - how to localize the text for "more" in tab bar | I'm having 7 tabs. and i'm able to localize text for all 7 tab titles
But when the app starts, by default only 4 tabs are showing with "more" tab as 5th one. I want to localize the text for "More". How can I do that? | ios | tabs | null | null | null | null | open | ios - how to localize the text for "more" in tab bar
===
I'm having 7 tabs. and i'm able to localize text for all 7 tab titles
But when the app starts, by default only 4 tabs are showing with "more" tab as 5th one. I want to localize the text for "More". How can I do that? | 0 |
3,800,157 | 09/26/2010 22:52:24 | 395,288 | 07/18/2010 18:33:57 | 98 | 0 | Rail3 - Smart way to Display Menu & add an Active Style Class? | Given a Rails 3 App with a menu like:
<ul>
<li>Home</li>
<li>Books</li>
<li>Pages</li>
</ul>
What is a smart way in Rails to have the app know the breadcrumb,,, or when to make one of the LIs show as:
<li class="active">Books</li>
thx
| ruby-on-rails | ruby-on-rails-3 | null | null | null | null | open | Rail3 - Smart way to Display Menu & add an Active Style Class?
===
Given a Rails 3 App with a menu like:
<ul>
<li>Home</li>
<li>Books</li>
<li>Pages</li>
</ul>
What is a smart way in Rails to have the app know the breadcrumb,,, or when to make one of the LIs show as:
<li class="active">Books</li>
thx
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.