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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,671,519 | 10/06/2011 07:50:18 | 165,674 | 08/30/2009 18:29:18 | 63 | 3 | Efficient storage of array of objects holding primitives in Java | What is the most efficient way to convert the following data structure from C to Java?
struct {
int a; int b; int c; int d;
double e;
} foo[] = {
{ 0, 1, 2, 42, 37.972},
/* ... 100 more struct elements ... */,
{ 0, 3, -1, -4, -7.847}
}
I best I could think of is this:
class Foo {
public int a;
public int b;
public int c;
public int d;
public double e;
public Foo(int a, int b, int c, int d, double e) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.e = e;
}
}
Foo[] foo = new Foo[] {
new Foo(0, 1, 2, 42, 37.972),
/* ... 100 more objects ... */
new Foo(0, 3, -1, -4, -7.847)
}
But it uses way too many objects for holding simple primitives.
| java | arrays | null | null | null | null | open | Efficient storage of array of objects holding primitives in Java
===
What is the most efficient way to convert the following data structure from C to Java?
struct {
int a; int b; int c; int d;
double e;
} foo[] = {
{ 0, 1, 2, 42, 37.972},
/* ... 100 more struct elements ... */,
{ 0, 3, -1, -4, -7.847}
}
I best I could think of is this:
class Foo {
public int a;
public int b;
public int c;
public int d;
public double e;
public Foo(int a, int b, int c, int d, double e) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.e = e;
}
}
Foo[] foo = new Foo[] {
new Foo(0, 1, 2, 42, 37.972),
/* ... 100 more objects ... */
new Foo(0, 3, -1, -4, -7.847)
}
But it uses way too many objects for holding simple primitives.
| 0 |
6,325,207 | 06/12/2011 22:44:19 | 795,165 | 06/12/2011 22:44:19 | 1 | 0 | outputting data with PHP into XML | I have a little script here which uses DOMDocument to get my data from my mysql database and put it in a structured XML which is later on used to be read from.
I am having a little trouble adjusting my php code to create the right structure of my XML.
Right now my code looks like this:
Code:
<markers>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A57" TIME="18:16:40" />
</DEVS>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
</markers>
And I would like to have my code look like this:
Code:
<markers>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A57" TIME="18:16:40" />
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
</markers>
And here is the PHP code I have at the moment:
PHP Code:
<?php
require("config.php");
// Start XML file, create parent node
$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
// Opens a connection to a MySQL server
$connection=mysql_connect ($server, $db_user, $db_pass);
if (!$connection) { die('Not connected : ' . mysql_error());}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table
$query = "SELECT * FROM input WHERE (DEVS = 'DEV5' or DEVS = 'DEV10') ORDER BY TIME DESC";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$node1 = $dom->createElement("DEVS");
$parnode->appendChild($node1);
$marker = $dom->createElement("marker");
$node1->appendChild($marker);
$marker->setAttribute("USER", $row['USER']);
$marker->setAttribute("DATA1", $row['DATA1']);
$marker->setAttribute("DATA2", $row['DATA2']);
$marker->setAttribute("TIME", $row['TIME']);
$node1->setAttribute("DEVICE", $row['DEVS']);
}
echo $dom->saveXML();
?>
I need the code to have one unique tag (DEVICE) which will be used later on as a pointer to what should be read from this XML file.
I am using DOMDocument since this is the function I am most familiar with.
Any ideas would be highly appreciated.
Thanks in advance! | php | xml | domdocument | null | null | null | open | outputting data with PHP into XML
===
I have a little script here which uses DOMDocument to get my data from my mysql database and put it in a structured XML which is later on used to be read from.
I am having a little trouble adjusting my php code to create the right structure of my XML.
Right now my code looks like this:
Code:
<markers>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A57" TIME="18:16:40" />
</DEVS>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
</markers>
And I would like to have my code look like this:
Code:
<markers>
<DEVS DEVICE="DEV10">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A57" TIME="18:16:40" />
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
<DEVS DEVICE="DEV5">
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
<marker USER="PRIVET_!" DATA1="0578" DATA2="0A55" TIME="18:16:05" />
</DEVS>
</markers>
And here is the PHP code I have at the moment:
PHP Code:
<?php
require("config.php");
// Start XML file, create parent node
$dom = new DOMDocument("1.0");
$node = $dom->createElement("markers");
$parnode = $dom->appendChild($node);
// Opens a connection to a MySQL server
$connection=mysql_connect ($server, $db_user, $db_pass);
if (!$connection) { die('Not connected : ' . mysql_error());}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table
$query = "SELECT * FROM input WHERE (DEVS = 'DEV5' or DEVS = 'DEV10') ORDER BY TIME DESC";
$result = mysql_query($query);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$node1 = $dom->createElement("DEVS");
$parnode->appendChild($node1);
$marker = $dom->createElement("marker");
$node1->appendChild($marker);
$marker->setAttribute("USER", $row['USER']);
$marker->setAttribute("DATA1", $row['DATA1']);
$marker->setAttribute("DATA2", $row['DATA2']);
$marker->setAttribute("TIME", $row['TIME']);
$node1->setAttribute("DEVICE", $row['DEVS']);
}
echo $dom->saveXML();
?>
I need the code to have one unique tag (DEVICE) which will be used later on as a pointer to what should be read from this XML file.
I am using DOMDocument since this is the function I am most familiar with.
Any ideas would be highly appreciated.
Thanks in advance! | 0 |
8,531,778 | 12/16/2011 08:54:02 | 1,045,017 | 11/14/2011 05:50:02 | 10 | 0 | Java - How to send a file file from server to client? | its me again, I want to know how to send a zip file from a server to a client? | java | file-io | tcp | client-server | zipfile | 12/16/2011 17:54:55 | not a real question | Java - How to send a file file from server to client?
===
its me again, I want to know how to send a zip file from a server to a client? | 1 |
8,874,040 | 01/15/2012 22:49:29 | 313,299 | 04/10/2010 03:08:53 | 97 | 1 | How can I use a "Splash" UIViewController to conditionally redirect to another view controller? | I have a "Splash screen" ViewController extending UIViewController, set as the the initial app VC in my storyboard. This controller features a login form.
When the app starts, and before anything is displayed on the screen, I want this splash VC to check the user defaults to see if the user is already logged in. If so, I want the splash VC to redirect to the app's home VC, all before anything is displayed on the screen.
If the user is not logged in, I want the Splash VC to finish loading, displaying the login forms.
How would I go about implementing this? Would I place all of these checks in the init methods? I was having a hard time getting any code in the splash VC init methods to run at all, for some reason these methods don't get called.
Code in the viewDidLoad method runs fine, but running the code there would defeat the purpose of trying to allow the already-logged-in-user to start the app right into the home screen.
Suggestions? Thanks in advance. | objective-c | ios | cocoa-touch | cocoa | ios5 | null | open | How can I use a "Splash" UIViewController to conditionally redirect to another view controller?
===
I have a "Splash screen" ViewController extending UIViewController, set as the the initial app VC in my storyboard. This controller features a login form.
When the app starts, and before anything is displayed on the screen, I want this splash VC to check the user defaults to see if the user is already logged in. If so, I want the splash VC to redirect to the app's home VC, all before anything is displayed on the screen.
If the user is not logged in, I want the Splash VC to finish loading, displaying the login forms.
How would I go about implementing this? Would I place all of these checks in the init methods? I was having a hard time getting any code in the splash VC init methods to run at all, for some reason these methods don't get called.
Code in the viewDidLoad method runs fine, but running the code there would defeat the purpose of trying to allow the already-logged-in-user to start the app right into the home screen.
Suggestions? Thanks in advance. | 0 |
2,440,785 | 03/14/2010 01:11:17 | 244,413 | 01/06/2010 02:46:19 | 118 | 0 | How to Create a Web app to make Call like skype or msn ? | This is a very newbie question.
I want to know how to create a WEB APP to make Call ( using VOIP protocoll I think ).
What program languages do I have to learn ( client and server side ) ?
| voip | real-time | flash | skype | msn | 12/28/2011 19:13:38 | not a real question | How to Create a Web app to make Call like skype or msn ?
===
This is a very newbie question.
I want to know how to create a WEB APP to make Call ( using VOIP protocoll I think ).
What program languages do I have to learn ( client and server side ) ?
| 1 |
10,885,406 | 06/04/2012 17:23:11 | 846,009 | 07/15/2011 07:47:22 | 46 | 6 | Constant in ASP DOt Net 4 | I am new in ASP DOT Net 4. I want to ask that constant in global.asax is a good idea. If the answer is no, so please give me reason and if answer is yes, please also give reason. | asp.net-4.0 | null | null | null | null | 06/06/2012 07:16:08 | not constructive | Constant in ASP DOt Net 4
===
I am new in ASP DOT Net 4. I want to ask that constant in global.asax is a good idea. If the answer is no, so please give me reason and if answer is yes, please also give reason. | 4 |
2,572,872 | 04/03/2010 22:25:46 | 98,563 | 04/30/2009 13:36:55 | 26 | 6 | entity framework vNext wish list | I have been intensively studying and use ef4 in my project. I do feel the improvement that it has over version 1. But I found that I have something I cannot get around easily. Here is a list I want it to be better in ef vNext.
1. the model designer should allow multiple view of the same model, so that I don't need cram all my entity into a single view.
2. respect user's manual edit of edmx. Currently, the some database view object simply can not be imported to the model because the designer "smartly" think that the view does not have a primary key, so that I have to manually edit the edmx to correct designer's behavior. But in the next "update from database" task, designer will revert my customization. For now, I simply fallback to manually edit the edmx file at all, or I have to use compare tool to keep the new update, and rollback and put the new update into my old edmx file manually. Designer should be improved to allow default behavior and user's manual control. I want control not to let the designer refresh the change of imported object.
3. support user defined table function. linq is about Composability, stored proc dos not support composability. I wish I could use user defined table function which support this.
What are you wishes for EF vNext? | entity-framework | null | null | null | null | 05/18/2012 16:23:17 | not constructive | entity framework vNext wish list
===
I have been intensively studying and use ef4 in my project. I do feel the improvement that it has over version 1. But I found that I have something I cannot get around easily. Here is a list I want it to be better in ef vNext.
1. the model designer should allow multiple view of the same model, so that I don't need cram all my entity into a single view.
2. respect user's manual edit of edmx. Currently, the some database view object simply can not be imported to the model because the designer "smartly" think that the view does not have a primary key, so that I have to manually edit the edmx to correct designer's behavior. But in the next "update from database" task, designer will revert my customization. For now, I simply fallback to manually edit the edmx file at all, or I have to use compare tool to keep the new update, and rollback and put the new update into my old edmx file manually. Designer should be improved to allow default behavior and user's manual control. I want control not to let the designer refresh the change of imported object.
3. support user defined table function. linq is about Composability, stored proc dos not support composability. I wish I could use user defined table function which support this.
What are you wishes for EF vNext? | 4 |
2,356,567 | 03/01/2010 14:48:56 | 283,683 | 03/01/2010 14:46:13 | 1 | 0 | Who has great API documentation? | I'm looking for examples of companies who do great API documentation. [Flickr's][1] looks really nice. Any recommendations?
[1]: http://www.flickr.com/services/api/ | api | documentation | null | null | null | 03/01/2010 19:05:32 | not a real question | Who has great API documentation?
===
I'm looking for examples of companies who do great API documentation. [Flickr's][1] looks really nice. Any recommendations?
[1]: http://www.flickr.com/services/api/ | 1 |
6,965,374 | 08/06/2011 07:11:48 | 881,682 | 08/06/2011 07:00:21 | 1 | 0 | How to store facebook friends name in android mobile application | i am trying to get all facebook friends name in my application and store them in list.
i go through with the following code but i don't understand that after storing name in string format how to display that in my application.
Bundle parameters = new Bundle();
mAccessToken = facebook.getAccessToken();
try {
parameters.putString("format", "json");
parameters.putString(TOKEN, mAccessToken);
String url = "https://graph.facebook.com/me/friends";
String response = Util.openUrl(url, "GET", parameters);
JSONObject obj = Util.parseJson(response);
Log.i("json Response", obj.toString());
JSONArray array = obj.optJSONArray("data");
if (array != null) {
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("name");
String id = array.getJSONObject(i).getString("id");
Log.i(name,id);
}
}
Please help me.
My further project is stopped because of this.
Thanks in advanced.... | android | null | null | null | null | null | open | How to store facebook friends name in android mobile application
===
i am trying to get all facebook friends name in my application and store them in list.
i go through with the following code but i don't understand that after storing name in string format how to display that in my application.
Bundle parameters = new Bundle();
mAccessToken = facebook.getAccessToken();
try {
parameters.putString("format", "json");
parameters.putString(TOKEN, mAccessToken);
String url = "https://graph.facebook.com/me/friends";
String response = Util.openUrl(url, "GET", parameters);
JSONObject obj = Util.parseJson(response);
Log.i("json Response", obj.toString());
JSONArray array = obj.optJSONArray("data");
if (array != null) {
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("name");
String id = array.getJSONObject(i).getString("id");
Log.i(name,id);
}
}
Please help me.
My further project is stopped because of this.
Thanks in advanced.... | 0 |
4,769,020 | 01/22/2011 16:27:23 | 95,656 | 04/24/2009 18:27:07 | 308 | 14 | Android and XMPP: Currently available solutions. | I'd like to pose a question as to which XMPP library would be the best choice nowadays, for Android development.
- I've been using the patched Smack
library from [here][1] as is
suggested in many other questions
here in SO. However, that's a patched version of
the Smack API from two years ago. And
although it generally works well I'm
exploring any other, more recent
options.
- I've been looking at the official
[Smack API][2] and after a little
research, it seems it might work just
fine nowadays (although I have not
tried it yet in a real application).
- There's also another solution I came
across, [Beem's aSMACK library][3].
Beem is a fairly new XMPP client for
android and from what I understand
they are using their own patched
version of aSMACK.
- Finally, there's [aSMACK][4] but that
too hasn't been updated for quite
some time (as the site suggests).
Do you have any other suggestions or can you explain why I should choose one of the above over the rest?
[1]: http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/
[2]: http://www.igniterealtime.org/projects/smack/
[3]: http://www.beem-project.com/projects/beem/files
[4]: http://code.google.com/p/asmack/ | android | xmpp | smack | null | null | 02/12/2012 18:40:29 | not constructive | Android and XMPP: Currently available solutions.
===
I'd like to pose a question as to which XMPP library would be the best choice nowadays, for Android development.
- I've been using the patched Smack
library from [here][1] as is
suggested in many other questions
here in SO. However, that's a patched version of
the Smack API from two years ago. And
although it generally works well I'm
exploring any other, more recent
options.
- I've been looking at the official
[Smack API][2] and after a little
research, it seems it might work just
fine nowadays (although I have not
tried it yet in a real application).
- There's also another solution I came
across, [Beem's aSMACK library][3].
Beem is a fairly new XMPP client for
android and from what I understand
they are using their own patched
version of aSMACK.
- Finally, there's [aSMACK][4] but that
too hasn't been updated for quite
some time (as the site suggests).
Do you have any other suggestions or can you explain why I should choose one of the above over the rest?
[1]: http://davanum.wordpress.com/2008/12/29/updated-xmpp-client-for-android/
[2]: http://www.igniterealtime.org/projects/smack/
[3]: http://www.beem-project.com/projects/beem/files
[4]: http://code.google.com/p/asmack/ | 4 |
10,331,590 | 04/26/2012 10:26:21 | 1,294,237 | 03/26/2012 23:30:59 | 28 | 2 | .ASPX Timing out / Get to front of Ticketing system waiting line | I was wondering, hypothetically speaking of course...
If there was a way to time-out or get to the front of a waiting line for a ticketing system? Like when large festivals or events ticketing systems go live and you are placed in a virtual queue.
I know it would depend on how it is being queued, but would there be a simple enough way to time out the line or increase position in a line on the client side by javascript injection (if AJAX etc) or other means. | javascript | asp.net | injection | javascript-injection | null | 04/26/2012 10:34:26 | not a real question | .ASPX Timing out / Get to front of Ticketing system waiting line
===
I was wondering, hypothetically speaking of course...
If there was a way to time-out or get to the front of a waiting line for a ticketing system? Like when large festivals or events ticketing systems go live and you are placed in a virtual queue.
I know it would depend on how it is being queued, but would there be a simple enough way to time out the line or increase position in a line on the client side by javascript injection (if AJAX etc) or other means. | 1 |
3,468,472 | 08/12/2010 14:00:38 | 186,046 | 10/08/2009 01:12:20 | 251 | 18 | Using HTTP as a transport layer between client/server applications | I would like to expose some data to client applications via HTTP. For example, the client would go to URL: http://mysite.com/books/12345 to obtain data about book 12345. The client could do an HTTP PUT or POST to http://mysite.com/books/54321 to upload data about book 54321. Is this known as a RESTful web service?
I have no idea where to start though. I would like to write the server logic in C#/.NET keeping in mind the clients will be using non-Microsoft technologies such as C++, Objective-C, and Java, so I don't want to get locked into something that only works in the Microsoft .NET environment. The clients will also be running over cellular connections with limited bandwidth. I would like to use a compact and portable protocol over HTTP like Google Protocol Buffers to allow communications between different languages and platforms.
Which Microsoft technology should I use to write a RESTful web service like I described in my first paragraph? Which open source technology could I use to write the RESTful web service described in the first paragraph? Does it matter which web server I use? Is it OK to send binary data (protobuf) over a HTTP connection? How would I push new data out to a client from the server? | .net | http | rest | null | null | null | open | Using HTTP as a transport layer between client/server applications
===
I would like to expose some data to client applications via HTTP. For example, the client would go to URL: http://mysite.com/books/12345 to obtain data about book 12345. The client could do an HTTP PUT or POST to http://mysite.com/books/54321 to upload data about book 54321. Is this known as a RESTful web service?
I have no idea where to start though. I would like to write the server logic in C#/.NET keeping in mind the clients will be using non-Microsoft technologies such as C++, Objective-C, and Java, so I don't want to get locked into something that only works in the Microsoft .NET environment. The clients will also be running over cellular connections with limited bandwidth. I would like to use a compact and portable protocol over HTTP like Google Protocol Buffers to allow communications between different languages and platforms.
Which Microsoft technology should I use to write a RESTful web service like I described in my first paragraph? Which open source technology could I use to write the RESTful web service described in the first paragraph? Does it matter which web server I use? Is it OK to send binary data (protobuf) over a HTTP connection? How would I push new data out to a client from the server? | 0 |
4,835,310 | 01/29/2011 05:17:32 | 594,718 | 01/29/2011 05:17:32 | 1 | 0 | C++ Debugging; I can't see a mistake :( | So usually after a night of "drinking", I come home and check the level of drunkenness by programming. I decided to make a calculator program. I got an error, and now I can't go to sleep. Can someone please remove me from this misery. What is wrong with this code?
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double num1;
double num2;
char redo;
char operation;
do
{
cout<< "Please enter your calculation "<< endl;
cin >> num1 >> operation >>num2;
switch operation {
case '+':
cout<< "" <<num1+num2 << endl;
break;
case '/':
cout<< "" <<num1/num2 << endl;
break;
case '*':
cout<< "" <<num1*num2 << endl;
break;
case '/':
cout<< "" <<num1/num2 << endl;
break;
}
while (redo=='y'||redo=='Y');
system("PAUSE");
return EXIT_SUCCESS;
}
My first debug error is at the cout.. I haven't been able to sleep :( | c++ | null | null | null | null | 01/29/2011 09:31:25 | not a real question | C++ Debugging; I can't see a mistake :(
===
So usually after a night of "drinking", I come home and check the level of drunkenness by programming. I decided to make a calculator program. I got an error, and now I can't go to sleep. Can someone please remove me from this misery. What is wrong with this code?
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
double num1;
double num2;
char redo;
char operation;
do
{
cout<< "Please enter your calculation "<< endl;
cin >> num1 >> operation >>num2;
switch operation {
case '+':
cout<< "" <<num1+num2 << endl;
break;
case '/':
cout<< "" <<num1/num2 << endl;
break;
case '*':
cout<< "" <<num1*num2 << endl;
break;
case '/':
cout<< "" <<num1/num2 << endl;
break;
}
while (redo=='y'||redo=='Y');
system("PAUSE");
return EXIT_SUCCESS;
}
My first debug error is at the cout.. I haven't been able to sleep :( | 1 |
3,580,819 | 08/27/2010 01:57:03 | 240,613 | 12/30/2009 03:13:43 | 1,842 | 63 | What are the weaknesses of XML? | Reading StackOverflow and listening the podcasts by Joel Spolsky and Jeff Atwood, I start to believe that many developers hate using XML or at least **try to avoid using XML as much as possible for storing or exchanging data**.
On the other hand, I enjoy using XML a lot for several reasons:
- XML serialization is implemented in most modern languages and is **extremely easy to use**,
- Being slower than binary serialization, XML serialization is very useful when it comes to **using the same data from several programming languages** or where it is intended to be read and understand, even for debugging, by an human (JSON, for example, is more difficult to understand),
- XML supports **unicode**, and when used properly, there are no problems with different encoding, characters, etc.
- There are plenty of tools which makes it easy to work with XML data. **XSLT** is an example, making it easy to present and to transform data. **XPath** is another one, making it easy to search for data,
- XML can be stored in some SQL servers, which enables the scenarios when data which is **too complicated to be easily stored in SQL tables** must be saved and manipulated; JSON or binary data, for example, cannot be manipulated through SQL directly (except by manipulating strings, which is crazy in most situations),
- XML does not require any applications to be installed. If I want my app to use a database, I must install a database server first. If I want my app to use XML, **I don't have to install anything**,
- XML is much more **explicit and extensible** than, for example, Windows Registry or INI files,
- In most cases, there are **no CR-LF problems**, thanks to the level of abstraction provided by XML.
So, taking in account all the benefits of using XML, why so many developers hate using it? IMHO, the only problem with it is that:
- **XML is too verbose** and requires much more place than most other forms of data, especially when it comes to Base64 encoding.
Of course, there are many scenarios where XML doesn't fit at all. Storing questions and answers of SO in an XML file *on server side* will be absolutely wrong. Or, when storing an AVI video or a bunch of JPG images, XML is the worst thing to use.
But what about other scenarios? What are the weaknesses of XML? | xml | xml-serialization | discussion | data-storage | data-exchange | 04/05/2012 15:19:24 | not constructive | What are the weaknesses of XML?
===
Reading StackOverflow and listening the podcasts by Joel Spolsky and Jeff Atwood, I start to believe that many developers hate using XML or at least **try to avoid using XML as much as possible for storing or exchanging data**.
On the other hand, I enjoy using XML a lot for several reasons:
- XML serialization is implemented in most modern languages and is **extremely easy to use**,
- Being slower than binary serialization, XML serialization is very useful when it comes to **using the same data from several programming languages** or where it is intended to be read and understand, even for debugging, by an human (JSON, for example, is more difficult to understand),
- XML supports **unicode**, and when used properly, there are no problems with different encoding, characters, etc.
- There are plenty of tools which makes it easy to work with XML data. **XSLT** is an example, making it easy to present and to transform data. **XPath** is another one, making it easy to search for data,
- XML can be stored in some SQL servers, which enables the scenarios when data which is **too complicated to be easily stored in SQL tables** must be saved and manipulated; JSON or binary data, for example, cannot be manipulated through SQL directly (except by manipulating strings, which is crazy in most situations),
- XML does not require any applications to be installed. If I want my app to use a database, I must install a database server first. If I want my app to use XML, **I don't have to install anything**,
- XML is much more **explicit and extensible** than, for example, Windows Registry or INI files,
- In most cases, there are **no CR-LF problems**, thanks to the level of abstraction provided by XML.
So, taking in account all the benefits of using XML, why so many developers hate using it? IMHO, the only problem with it is that:
- **XML is too verbose** and requires much more place than most other forms of data, especially when it comes to Base64 encoding.
Of course, there are many scenarios where XML doesn't fit at all. Storing questions and answers of SO in an XML file *on server side* will be absolutely wrong. Or, when storing an AVI video or a bunch of JPG images, XML is the worst thing to use.
But what about other scenarios? What are the weaknesses of XML? | 4 |
9,880,399 | 03/26/2012 21:51:15 | 612,584 | 02/11/2011 05:58:43 | 1 | 1 | Selecting items in MySQL database within a certain day | I want to create a graph of items on a certain day using data from a MySQL database. I have the query "SELECT * FROM activities WHERE timestamp BETWEEN UNIX_TIMESTAMP() - 24 * 3600 * 7 AND UNIX_TIMESTAMP() - 24 * 3600 * 6" to select items from x days ago (where the 7 and 6 can vary in order to select the day), but it's returning an empty set in my database for some reason. | mysql | sql | null | null | null | null | open | Selecting items in MySQL database within a certain day
===
I want to create a graph of items on a certain day using data from a MySQL database. I have the query "SELECT * FROM activities WHERE timestamp BETWEEN UNIX_TIMESTAMP() - 24 * 3600 * 7 AND UNIX_TIMESTAMP() - 24 * 3600 * 6" to select items from x days ago (where the 7 and 6 can vary in order to select the day), but it's returning an empty set in my database for some reason. | 0 |
5,159,519 | 03/01/2011 19:47:18 | 640,009 | 03/01/2011 19:47:18 | 1 | 0 | Approx. cost of building web-based restaurant (Point of Sale) POS program? | What sort of time/money do you think it takes to build an intuitive program that integrates with credit card payments, POS printers/cash drawers etc? Very rough estimates are ok. Thanks!! | html | ruby-on-rails | ipad | saas | null | 03/01/2011 19:54:02 | off topic | Approx. cost of building web-based restaurant (Point of Sale) POS program?
===
What sort of time/money do you think it takes to build an intuitive program that integrates with credit card payments, POS printers/cash drawers etc? Very rough estimates are ok. Thanks!! | 2 |
4,912,481 | 02/06/2011 09:10:34 | 343,570 | 05/18/2010 01:09:17 | 1 | 0 | convert to mkv like scorp movies!! | how i can convert any format to mkv like scorp movies!!scorp is like axxo but they relase movie in 720p with a small size an | quality | mkv | null | null | null | 02/06/2011 13:27:02 | off topic | convert to mkv like scorp movies!!
===
how i can convert any format to mkv like scorp movies!!scorp is like axxo but they relase movie in 720p with a small size an | 2 |
7,046,232 | 08/12/2011 20:56:46 | 892,461 | 08/12/2011 20:56:46 | 1 | 0 | Creating SOAP message from Sample XML via Java | Iam really struggling with this . I have a webservice to call which is secured by certificate and digital signature . All this needs to be passed as a part of SOAP request which Iam creating via Java code , but even after spending days on it the digital signature part which Iam trying to create is not getting formed properly .
The code creates the request properly till BinaryToken and breaks from "Name signatureToken" ...Looking for guidance as to what is not right in the code
This is the sample XML :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-1313056420712-845854837">MIIDVjCCAj6gAwIBAgIEThbQLTANBgkqhkiG9w0BAQUFADBtMQswCQYDVQQGEwJnYjEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjEUMBIGA1UEChMLaGVhbHRoc29sdmUxFDASBgNVBAsTC2hlYWx0aHNvbHZlMQ4wDAYDVQQDEwVzaW1vbjAeFw0xMTA3MDgwOTM4NTNaFw0xMjA3MDIwOTM4NTNaMG0x</wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="XWSSGID-13130564207092015610708">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse SOAP-ENV"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#XWSSGID-1313056421405-433059543">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>3wCcYA8m7LN0TLchG80s6zUaTJE=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>ZkPCKEGpOmkhJA5Kq6oqUYU3OWQYyca676UhL
lOyRj7HQD7g0vS+wp70gY7Hos/2G7UpjmYDLPA==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1313056421331317573418">
<wsse:Reference URI="#XWSSGID-1313056420712-845854837" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1313056421405-433059543">
</ns2:GetEhaStatusRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and the code which I have written to form the above XML via code is as :
protected void setSecuritySection(SOAPFactory soapFactory, SOAPEnvelope envelope, SOAPPart soapPart) throws SOAPException, ECException {
String METHODNAME = "setSecuritySection";
KeyPairGenerator kpg;
boolean mustUnderstand = true;
SOAPHeader soapHeader = envelope.getHeader();
try {
Name securityName = soapFactory.createName("Security", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement securityElement = soapHeader.addHeaderElement(securityName);
// SOAPHeaderElement securityElement =
// soapHeader.addHeaderElement(securityName);
// securityElement.setMustUnderstand(mustUnderstand);
Name binarySecurityToken = soapFactory.createName("BinarySecurityToken", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement binarySecurityTokenElement = securityElement.addChildElement(binarySecurityToken);
Certificate cert;
String trustStoreLocation = ServerInformation.getValueForWebsphereVariable("EHA_TRUSTSTORE");
String trustStorePwd = ServerInformation.getValueForWebsphereVariable("EHA_TRUSTSTORE_PWD");
InputStream path = new FileInputStream(trustStoreLocation);
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(path, new String(new BASE64Decoder().decodeBuffer(trustStorePwd)).toCharArray());
cert = ks.getCertificate("test");
binarySecurityTokenElement.addTextNode(new BASE64Encoder().encode(cert.getEncoded()));
kpg = KeyPairGenerator.getInstance("DSA");
Name idToken = soapFactory.createName("Id", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement idElement = binarySecurityTokenElement.addChildElement(idToken);
idElement.addTextNode("test");
Name valueTypeToken = soapFactory.createName("ValueType", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3");
SOAPElement valueTypeElement = binarySecurityTokenElement.addChildElement(valueTypeToken);
valueTypeElement.addTextNode("X509v3");
Name encodingTypeToken = soapFactory.createName("EncodingType", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary");
SOAPElement encodingTypeElement = binarySecurityTokenElement.addChildElement(encodingTypeToken);
encodingTypeElement.addTextNode("Base64Binary");
Name signatureToken = soapFactory.createName("Signature", "ds", "http://www.w3.org/2000/09/xmldsig#");
SOAPHeaderElement signElement = soapHeader.addHeaderElement(signatureToken);
Name id1 = soapFactory.createName("Id");
signElement.addAttribute(id1,"XWSSGID-13130564207092015610708");
Name signedInfo = soapFactory.createName("SignedInfo");
SOAPElement signInfoElement = signElement.addChildElement(signedInfo);
//SOAPHeaderElement signInfoElement = soapHeader.addHeaderElement(signedInfo);
Name canonicalToken = soapFactory.createName("CanonicalizationMethod");
SOAPElement canonicalTokenTokenElement = signInfoElement.addChildElement(canonicalToken);
Name alg = soapFactory.createName("Algorithm");
canonicalTokenTokenElement.addAttribute(alg,"http://www.w3.org/2001/10/xml-exc-c14n#");
Name InclusiveNamespaceToken = soapFactory.createName("InclusiveNamespaces", "wsse", "http://www.w3.org/2001/10/xml-exc-c14n#");
SOAPElement element = canonicalTokenTokenElement.addChildElement(InclusiveNamespaceToken);
Name prefixList = soapFactory.createName("PrefixList");
element.addAttribute(prefixList,"wsse SOAP-ENV");
Name signatureMethodToken = soapFactory.createName("SignatureMethod","ds", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
SOAPElement signatureMethodTokenElement = signInfoElement.addChildElement(signatureMethodToken);
Name alg2 = soapFactory.createName("Algorithm");
signatureMethodTokenElement.addAttribute(alg2,"http://www.w3.org/2000/09/xmldsig#rsa-sha1");
Name referenceToken = soapFactory.createName("Reference", "ds", "#XWSSGID-1313056421405-433059543");
SOAPElement referenceTokenElement = signatureMethodTokenElement.addChildElement(referenceToken);
Name uri = soapFactory.createName("URI");
referenceTokenElement.addAttribute(uri,"#XWSSGID-1313056421405-433059543");
Name digestMethodAlgToken = soapFactory.createName("DigestMethod");
SOAPElement digestMethodAlgTokenElement = referenceTokenElement.addChildElement(digestMethodAlgToken);
Name alg3 = soapFactory.createName("Algorithm");
digestMethodAlgTokenElement.addAttribute(alg3,"http://www.w3.org/2000/09/xmldsig#sha1");
Name digestValueToken = soapFactory.createName("DigestValue" ,"ds" , "3wCcYA8m7LN0TLchG80s6zUaTJE=");
SOAPElement digestValueTokenElement = referenceTokenElement.addChildElement(digestValueToken);
digestValueTokenElement.addTextNode("3wCcYA8m7LN0TLchG80s6zUaTJE=");
Name signValueToken = soapFactory.createName("SignatureValue");
SOAPElement signValueElement = signElement.addChildElement(signValueToken);
signValueElement.addTextNode("QlYfURFjcYPu41G31bXgP4JbFdg6kWH+8ofrY+oc22FvLqVMUW3zdtvZN==");
Name keyInfoToken = soapFactory.createName("KeyInfo") ;
SOAPElement keyInfoElement = signElement.addChildElement(keyInfoToken);
Name securityRefToken = soapFactory.createName("SecurityTokenReference" ,"wsse" , "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
SOAPElement securityRefElement = keyInfoElement.addChildElement(securityRefToken);
Name id2 = soapFactory.createName("Id","wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
securityRefElement.addAttribute(id2,"XWSSGID-1313056421331317573418");
Name referenceURIToken = soapFactory.createName("Reference", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-tokenprofile1.0#X509v3");
SOAPElement refElement = securityRefElement.addChildElement(referenceURIToken);
Name uri1 = soapFactory.createName("URI");
refElement.addAttribute(uri1,"#XWSSGID-1313056420712-845854837");
Name valType = soapFactory.createName("ValueType");
refElement.addAttribute(valType,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3");
} catch (Exception ex) {
throw new SOAPException(ex);
}
Any help in solving this will be my saviour . Thanks to all . | xml | soap | null | null | null | null | open | Creating SOAP message from Sample XML via Java
===
Iam really struggling with this . I have a webservice to call which is secured by certificate and digital signature . All this needs to be passed as a part of SOAP request which Iam creating via Java code , but even after spending days on it the digital signature part which Iam trying to create is not getting formed properly .
The code creates the request properly till BinaryToken and breaks from "Name signatureToken" ...Looking for guidance as to what is not right in the code
This is the sample XML :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="XWSSGID-1313056420712-845854837">MIIDVjCCAj6gAwIBAgIEThbQLTANBgkqhkiG9w0BAQUFADBtMQswCQYDVQQGEwJnYjEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjEUMBIGA1UEChMLaGVhbHRoc29sdmUxFDASBgNVBAsTC2hlYWx0aHNvbHZlMQ4wDAYDVQQDEwVzaW1vbjAeFw0xMTA3MDgwOTM4NTNaFw0xMjA3MDIwOTM4NTNaMG0x</wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="XWSSGID-13130564207092015610708">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsse SOAP-ENV"/>
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#XWSSGID-1313056421405-433059543">
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>3wCcYA8m7LN0TLchG80s6zUaTJE=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>ZkPCKEGpOmkhJA5Kq6oqUYU3OWQYyca676UhL
lOyRj7HQD7g0vS+wp70gY7Hos/2G7UpjmYDLPA==</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1313056421331317573418">
<wsse:Reference URI="#XWSSGID-1313056420712-845854837" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="XWSSGID-1313056421405-433059543">
</ns2:GetEhaStatusRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
and the code which I have written to form the above XML via code is as :
protected void setSecuritySection(SOAPFactory soapFactory, SOAPEnvelope envelope, SOAPPart soapPart) throws SOAPException, ECException {
String METHODNAME = "setSecuritySection";
KeyPairGenerator kpg;
boolean mustUnderstand = true;
SOAPHeader soapHeader = envelope.getHeader();
try {
Name securityName = soapFactory.createName("Security", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement securityElement = soapHeader.addHeaderElement(securityName);
// SOAPHeaderElement securityElement =
// soapHeader.addHeaderElement(securityName);
// securityElement.setMustUnderstand(mustUnderstand);
Name binarySecurityToken = soapFactory.createName("BinarySecurityToken", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement binarySecurityTokenElement = securityElement.addChildElement(binarySecurityToken);
Certificate cert;
String trustStoreLocation = ServerInformation.getValueForWebsphereVariable("EHA_TRUSTSTORE");
String trustStorePwd = ServerInformation.getValueForWebsphereVariable("EHA_TRUSTSTORE_PWD");
InputStream path = new FileInputStream(trustStoreLocation);
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(path, new String(new BASE64Decoder().decodeBuffer(trustStorePwd)).toCharArray());
cert = ks.getCertificate("test");
binarySecurityTokenElement.addTextNode(new BASE64Encoder().encode(cert.getEncoded()));
kpg = KeyPairGenerator.getInstance("DSA");
Name idToken = soapFactory.createName("Id", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd");
SOAPElement idElement = binarySecurityTokenElement.addChildElement(idToken);
idElement.addTextNode("test");
Name valueTypeToken = soapFactory.createName("ValueType", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3");
SOAPElement valueTypeElement = binarySecurityTokenElement.addChildElement(valueTypeToken);
valueTypeElement.addTextNode("X509v3");
Name encodingTypeToken = soapFactory.createName("EncodingType", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary");
SOAPElement encodingTypeElement = binarySecurityTokenElement.addChildElement(encodingTypeToken);
encodingTypeElement.addTextNode("Base64Binary");
Name signatureToken = soapFactory.createName("Signature", "ds", "http://www.w3.org/2000/09/xmldsig#");
SOAPHeaderElement signElement = soapHeader.addHeaderElement(signatureToken);
Name id1 = soapFactory.createName("Id");
signElement.addAttribute(id1,"XWSSGID-13130564207092015610708");
Name signedInfo = soapFactory.createName("SignedInfo");
SOAPElement signInfoElement = signElement.addChildElement(signedInfo);
//SOAPHeaderElement signInfoElement = soapHeader.addHeaderElement(signedInfo);
Name canonicalToken = soapFactory.createName("CanonicalizationMethod");
SOAPElement canonicalTokenTokenElement = signInfoElement.addChildElement(canonicalToken);
Name alg = soapFactory.createName("Algorithm");
canonicalTokenTokenElement.addAttribute(alg,"http://www.w3.org/2001/10/xml-exc-c14n#");
Name InclusiveNamespaceToken = soapFactory.createName("InclusiveNamespaces", "wsse", "http://www.w3.org/2001/10/xml-exc-c14n#");
SOAPElement element = canonicalTokenTokenElement.addChildElement(InclusiveNamespaceToken);
Name prefixList = soapFactory.createName("PrefixList");
element.addAttribute(prefixList,"wsse SOAP-ENV");
Name signatureMethodToken = soapFactory.createName("SignatureMethod","ds", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
SOAPElement signatureMethodTokenElement = signInfoElement.addChildElement(signatureMethodToken);
Name alg2 = soapFactory.createName("Algorithm");
signatureMethodTokenElement.addAttribute(alg2,"http://www.w3.org/2000/09/xmldsig#rsa-sha1");
Name referenceToken = soapFactory.createName("Reference", "ds", "#XWSSGID-1313056421405-433059543");
SOAPElement referenceTokenElement = signatureMethodTokenElement.addChildElement(referenceToken);
Name uri = soapFactory.createName("URI");
referenceTokenElement.addAttribute(uri,"#XWSSGID-1313056421405-433059543");
Name digestMethodAlgToken = soapFactory.createName("DigestMethod");
SOAPElement digestMethodAlgTokenElement = referenceTokenElement.addChildElement(digestMethodAlgToken);
Name alg3 = soapFactory.createName("Algorithm");
digestMethodAlgTokenElement.addAttribute(alg3,"http://www.w3.org/2000/09/xmldsig#sha1");
Name digestValueToken = soapFactory.createName("DigestValue" ,"ds" , "3wCcYA8m7LN0TLchG80s6zUaTJE=");
SOAPElement digestValueTokenElement = referenceTokenElement.addChildElement(digestValueToken);
digestValueTokenElement.addTextNode("3wCcYA8m7LN0TLchG80s6zUaTJE=");
Name signValueToken = soapFactory.createName("SignatureValue");
SOAPElement signValueElement = signElement.addChildElement(signValueToken);
signValueElement.addTextNode("QlYfURFjcYPu41G31bXgP4JbFdg6kWH+8ofrY+oc22FvLqVMUW3zdtvZN==");
Name keyInfoToken = soapFactory.createName("KeyInfo") ;
SOAPElement keyInfoElement = signElement.addChildElement(keyInfoToken);
Name securityRefToken = soapFactory.createName("SecurityTokenReference" ,"wsse" , "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
SOAPElement securityRefElement = keyInfoElement.addChildElement(securityRefToken);
Name id2 = soapFactory.createName("Id","wsu","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
securityRefElement.addAttribute(id2,"XWSSGID-1313056421331317573418");
Name referenceURIToken = soapFactory.createName("Reference", "wsse", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-tokenprofile1.0#X509v3");
SOAPElement refElement = securityRefElement.addChildElement(referenceURIToken);
Name uri1 = soapFactory.createName("URI");
refElement.addAttribute(uri1,"#XWSSGID-1313056420712-845854837");
Name valType = soapFactory.createName("ValueType");
refElement.addAttribute(valType,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3");
} catch (Exception ex) {
throw new SOAPException(ex);
}
Any help in solving this will be my saviour . Thanks to all . | 0 |
11,242,820 | 06/28/2012 10:37:42 | 951,574 | 09/18/2011 19:17:24 | 43 | 7 | No error or output when C++ executable is run from Java | I am trying to run a c++ executable from my Java web application. When I go the relevant page it executes the commands and runs the executable but does not produce any output.
Here is my code:
URL createWav = QRcodeController.class.getClassLoader().getResource("createWav");
log.info("The path of the c++ executable obtained: "+ createWav.getPath());
Process p1 = Runtime.getRuntime().exec("chmod 777 " + createWav.getPath());
p1.waitFor();
int exitVal=1;
try {
Process p2 = Runtime.getRuntime().exec(createWav.getPath(), args);
exitVal = p2.waitFor();
}
catch (Exception e)
{
log.error(e.getStackTrace());
}
if(exitVal == 1)
throw new Exception("Error in c++ program");
It does not throw any error so the c++ program runs fine but it does not produce the file it is supposed to. When I run the same command from the command line in the same machine it works perfectly producing the required file. I am not sure what I am doing wrong. | java | c++ | executable | null | null | null | open | No error or output when C++ executable is run from Java
===
I am trying to run a c++ executable from my Java web application. When I go the relevant page it executes the commands and runs the executable but does not produce any output.
Here is my code:
URL createWav = QRcodeController.class.getClassLoader().getResource("createWav");
log.info("The path of the c++ executable obtained: "+ createWav.getPath());
Process p1 = Runtime.getRuntime().exec("chmod 777 " + createWav.getPath());
p1.waitFor();
int exitVal=1;
try {
Process p2 = Runtime.getRuntime().exec(createWav.getPath(), args);
exitVal = p2.waitFor();
}
catch (Exception e)
{
log.error(e.getStackTrace());
}
if(exitVal == 1)
throw new Exception("Error in c++ program");
It does not throw any error so the c++ program runs fine but it does not produce the file it is supposed to. When I run the same command from the command line in the same machine it works perfectly producing the required file. I am not sure what I am doing wrong. | 0 |
9,477,991 | 02/28/2012 07:27:32 | 1,150,119 | 01/15/2012 06:33:19 | 26 | 0 | saving text written in edit text | we are doing android chat application and want to save the values in the edit text(name of the user) to our database.When he updates it,the update should reflect in the database also.Any help in this regard will be really appreciable.
Thanks in advance. | android | android-emulator | null | null | null | null | open | saving text written in edit text
===
we are doing android chat application and want to save the values in the edit text(name of the user) to our database.When he updates it,the update should reflect in the database also.Any help in this regard will be really appreciable.
Thanks in advance. | 0 |
7,608,044 | 09/30/2011 08:51:04 | 495,776 | 11/03/2010 10:16:39 | 97 | 3 | RSpec 2.6, "Expected response to be a redirect to </bar/foo> but was a redirect to <http://test.host/bar/foo>." | I wonder why *all* my redirection tests suddenly fail. All failures are of the sort mentioned in the subject. Normally this is an issue of mixing `foo_url`and `foo_path` in controllers and/or tests, but this isn't the case here.
The controller actions all look like
redirect_to :action => :foo
and the tests all look like
response.should redirect_to(:action => :foo)
and still I get errors like
Expected response to be a redirect to </bar/foo>
but was a redirect to <http://test.host/bar/foo>.
Even when I replace `:action => :foo` with `foo_path` (or the equivalent named route) the error occurs.
Any ideas what might cause this to happen? | ruby-on-rails | redirect | rspec2 | null | null | null | open | RSpec 2.6, "Expected response to be a redirect to </bar/foo> but was a redirect to <http://test.host/bar/foo>."
===
I wonder why *all* my redirection tests suddenly fail. All failures are of the sort mentioned in the subject. Normally this is an issue of mixing `foo_url`and `foo_path` in controllers and/or tests, but this isn't the case here.
The controller actions all look like
redirect_to :action => :foo
and the tests all look like
response.should redirect_to(:action => :foo)
and still I get errors like
Expected response to be a redirect to </bar/foo>
but was a redirect to <http://test.host/bar/foo>.
Even when I replace `:action => :foo` with `foo_path` (or the equivalent named route) the error occurs.
Any ideas what might cause this to happen? | 0 |
4,248,116 | 11/22/2010 17:13:08 | 90,717 | 04/14/2009 15:21:23 | 111 | 12 | Using XDocument to search and extract Data | I am returning back from sql an xml string of multiple addresses, here is an example of what is returning back:
<Addresses>
<Address>
<LetterQueueOID>2</LetterQueueOID>
<Address1>115 MORNINGVIEW TRL</Address1>
<Address2>SCARBOROUGH, </Address2>
<Address3>M1B5L2</Address3>
<City>SCARBOROUGH</City>
<PostalCode>M1B5L2</PostalCode>
</Address>
<Address>
<LetterQueueOID>1</LetterQueueOID>
<Address1>GD PO BOX 685</Address1>
<Address2>THORNBURY, ON</Address2>
<Address3>N0H2P0</Address3>
<City>THORNBURY</City>
<ProvinceOrState>ON</ProvinceOrState>
<CountryCode>Ca</CountryCode>
<PostalCode>N0H2P0</PostalCode>
</Address>
</Addresses>
I want to use LINQ to query this xml string for specific LetterQueueOID's , i.e.
Select Address(as a string) where LetterQueueOID = 2.
All I've figured out is that i can use XDocument, but i can't figure out exactly how to get what I want:
XDocument addresses = XDocument.Parse((string)returnScalar);
IEnumerable<XElement> items = addresses.Root.Elements("Address").ToList(); | c# | linq-to-xml | null | null | null | null | open | Using XDocument to search and extract Data
===
I am returning back from sql an xml string of multiple addresses, here is an example of what is returning back:
<Addresses>
<Address>
<LetterQueueOID>2</LetterQueueOID>
<Address1>115 MORNINGVIEW TRL</Address1>
<Address2>SCARBOROUGH, </Address2>
<Address3>M1B5L2</Address3>
<City>SCARBOROUGH</City>
<PostalCode>M1B5L2</PostalCode>
</Address>
<Address>
<LetterQueueOID>1</LetterQueueOID>
<Address1>GD PO BOX 685</Address1>
<Address2>THORNBURY, ON</Address2>
<Address3>N0H2P0</Address3>
<City>THORNBURY</City>
<ProvinceOrState>ON</ProvinceOrState>
<CountryCode>Ca</CountryCode>
<PostalCode>N0H2P0</PostalCode>
</Address>
</Addresses>
I want to use LINQ to query this xml string for specific LetterQueueOID's , i.e.
Select Address(as a string) where LetterQueueOID = 2.
All I've figured out is that i can use XDocument, but i can't figure out exactly how to get what I want:
XDocument addresses = XDocument.Parse((string)returnScalar);
IEnumerable<XElement> items = addresses.Root.Elements("Address").ToList(); | 0 |
7,001,519 | 08/09/2011 19:04:46 | 877,184 | 08/03/2011 18:08:15 | 8 | 0 | Unit Testing of a protected slot | Hello I tried to implement unit testing for a protected slot
In the testing function I made an object of a class and called a protected of that class using that object
But it gave me an error as follows:
/home/puneet/puneet/office/alkimia/payment/backend/backend.h: In member function ‘void BackendTest::test_initialization()’:
/home/puneet/puneet/office/alkimia/payment/backend/backend.h:70: error: ‘void Backend::initializeUsers(const QStringList&)’ is protected
| unit-testing | protected | null | null | null | 08/10/2011 06:08:41 | not a real question | Unit Testing of a protected slot
===
Hello I tried to implement unit testing for a protected slot
In the testing function I made an object of a class and called a protected of that class using that object
But it gave me an error as follows:
/home/puneet/puneet/office/alkimia/payment/backend/backend.h: In member function ‘void BackendTest::test_initialization()’:
/home/puneet/puneet/office/alkimia/payment/backend/backend.h:70: error: ‘void Backend::initializeUsers(const QStringList&)’ is protected
| 1 |
11,472,205 | 07/13/2012 14:12:23 | 969,613 | 09/28/2011 17:22:04 | 972 | 18 | What is the WPF equivalent of Windows Forms' `StartPosition` property? | On Windows Forms, you have the `StartPosition` property which allows you to specify the position on the screen your form will be placed when it launches.
Does WPF have an equivalent and if so what is it?
Thanks | wpf | null | null | null | null | null | open | What is the WPF equivalent of Windows Forms' `StartPosition` property?
===
On Windows Forms, you have the `StartPosition` property which allows you to specify the position on the screen your form will be placed when it launches.
Does WPF have an equivalent and if so what is it?
Thanks | 0 |
471,342 | 01/22/2009 23:52:07 | 50,913 | 01/02/2009 14:47:25 | 66 | 1 | Java Socket Programming | I am building a simple client/server application using java sockets and experimenting with the ObjectOutputStream etc.
I have been following the tutorial at this url [http://java.sun.com/developer/technicalArticles/ALT/sockets][1] starting half way down when it talks about transporting objects over sockets.
See my code for the client [http://pastebin.com/m37e4c577][2] However this doesn't seem to work and i cannot figure out what's not working. The code commented out at the bottom is directly copied out of the tutorial - and this works when i just use that instead of creating the client object.
Can anyone see anything i am doing wrong?
Thanks in advanced.
[1]: http://java.sun.com/developer/technicalArticles/ALT/sockets/
[2]: http://pastebin.com/m37e4c577 "http://pastebin.com/m37e4c577" | sockets | java | objectinputstream | network-programming | null | null | open | Java Socket Programming
===
I am building a simple client/server application using java sockets and experimenting with the ObjectOutputStream etc.
I have been following the tutorial at this url [http://java.sun.com/developer/technicalArticles/ALT/sockets][1] starting half way down when it talks about transporting objects over sockets.
See my code for the client [http://pastebin.com/m37e4c577][2] However this doesn't seem to work and i cannot figure out what's not working. The code commented out at the bottom is directly copied out of the tutorial - and this works when i just use that instead of creating the client object.
Can anyone see anything i am doing wrong?
Thanks in advanced.
[1]: http://java.sun.com/developer/technicalArticles/ALT/sockets/
[2]: http://pastebin.com/m37e4c577 "http://pastebin.com/m37e4c577" | 0 |
8,652,445 | 12/28/2011 06:04:27 | 1,118,749 | 12/28/2011 05:40:41 | 1 | 0 | Can anyone explain this C program ? I am new to HACKING | Can anyone explain how this C program works especially the pointer variables? Explanation for C code is enough not necessary for SHELLCODE
Here's the Program: [Exploit_buffer_overflow][1]
[1]: https://docs.google.com/document/d/1fjR_QmaLWjRjP5fJtLwRCQhfkmx3E-PSwJ_0_Wi1QCo/edit | c | linux | pointers | hacking | exploit | 12/28/2011 08:05:11 | not a real question | Can anyone explain this C program ? I am new to HACKING
===
Can anyone explain how this C program works especially the pointer variables? Explanation for C code is enough not necessary for SHELLCODE
Here's the Program: [Exploit_buffer_overflow][1]
[1]: https://docs.google.com/document/d/1fjR_QmaLWjRjP5fJtLwRCQhfkmx3E-PSwJ_0_Wi1QCo/edit | 1 |
8,517,891 | 12/15/2011 09:33:56 | 1,085,557 | 12/07/2011 12:06:13 | 6 | 0 | How to redirect a user when the close [X] button is clicked | please an looking for a javascript that will help redirect a user when the close[X] button is clicked, thanks. | javascript | null | null | null | null | 12/15/2011 10:09:07 | not a real question | How to redirect a user when the close [X] button is clicked
===
please an looking for a javascript that will help redirect a user when the close[X] button is clicked, thanks. | 1 |
7,442,876 | 09/16/2011 09:47:21 | 936,705 | 09/09/2011 11:55:16 | 11 | 1 | fluent nhibernate: querying Many-to-many entity with equivalent of the 'any' keyword | I have a mant-to-many relationship modeled in the database (with a bridge table) between Student and Professor (_students_selected) , in my entites i have modeled it as a many-to-many relationship i.e. a Professor has many Students.
HasManyToMany(x => x.Students)
.Table("_students_selected").ChildKeyColumn("student_key").ParentKeyColumn("professor_key");
public class Professor
{
private IList<Students> _students;
public virtual Student Students
{
get { return _students; }
set { _students = value; }
}
}
I am unable to query over the professors students, i have tried the following however nhibernate does not recognise Any to filter through the list. Whats the equivalent to any?
_unitOfWork.Session.QueryOver<Professor>()
.Where(x => x.Students.Any(i => i.Id.IsIn(childStudentList))).List();
| linq | nhibernate | fluent | any | null | null | open | fluent nhibernate: querying Many-to-many entity with equivalent of the 'any' keyword
===
I have a mant-to-many relationship modeled in the database (with a bridge table) between Student and Professor (_students_selected) , in my entites i have modeled it as a many-to-many relationship i.e. a Professor has many Students.
HasManyToMany(x => x.Students)
.Table("_students_selected").ChildKeyColumn("student_key").ParentKeyColumn("professor_key");
public class Professor
{
private IList<Students> _students;
public virtual Student Students
{
get { return _students; }
set { _students = value; }
}
}
I am unable to query over the professors students, i have tried the following however nhibernate does not recognise Any to filter through the list. Whats the equivalent to any?
_unitOfWork.Session.QueryOver<Professor>()
.Where(x => x.Students.Any(i => i.Id.IsIn(childStudentList))).List();
| 0 |
7,126,994 | 08/19/2011 20:22:58 | 903,079 | 08/19/2011 20:22:58 | 1 | 0 | Delete row and column of 2D array in c | Given an integer matrix of size, say, M x N, you have to write a program to remove all the
rows and columns consisting of all zeros. Your program must remove those rows and columns
that consist of zero valued elements only. That is, if all the elements in a row (column) are
zeros, then remove that row (column). All the remaining rows and columns should be output
eg1: 3 3 or 3 3
1 2 3 0 3 4
2 1 3 0 2 3
0 0 0 0 8 7
output: o/p
1 2 3 3 4
2 1 3 2 3
8 7
m already take the input the array n make 2D array but what r approach for Delete m can'nt get it.. plz help its my assignment | c | multidimensional-array | null | null | null | 08/20/2011 09:32:13 | not a real question | Delete row and column of 2D array in c
===
Given an integer matrix of size, say, M x N, you have to write a program to remove all the
rows and columns consisting of all zeros. Your program must remove those rows and columns
that consist of zero valued elements only. That is, if all the elements in a row (column) are
zeros, then remove that row (column). All the remaining rows and columns should be output
eg1: 3 3 or 3 3
1 2 3 0 3 4
2 1 3 0 2 3
0 0 0 0 8 7
output: o/p
1 2 3 3 4
2 1 3 2 3
8 7
m already take the input the array n make 2D array but what r approach for Delete m can'nt get it.. plz help its my assignment | 1 |
5,882,875 | 05/04/2011 11:49:49 | 162,622 | 08/25/2009 10:45:47 | 329 | 25 | [Java] Books about Design pattern | I don't know if I can post this topic here, so if I can't, I'm sorry :)
So, I found the book "Design Patterns: Elements of Reusable Object-Oriented Software" on amazon (http://www.amazon.fr/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612). This book presents design pattern in a C++ environment.
Does someone know a similar book for a Java/JEE environment ? Or, what books advice me to improve my knowledge in design pattern ?
I know foudation and a little more about design pattern, so I don't want a presentation book but instead an advanced book.
Thanks for your help :) | java | design-patterns | books | java-ee | null | 09/26/2011 13:42:42 | not constructive | [Java] Books about Design pattern
===
I don't know if I can post this topic here, so if I can't, I'm sorry :)
So, I found the book "Design Patterns: Elements of Reusable Object-Oriented Software" on amazon (http://www.amazon.fr/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612). This book presents design pattern in a C++ environment.
Does someone know a similar book for a Java/JEE environment ? Or, what books advice me to improve my knowledge in design pattern ?
I know foudation and a little more about design pattern, so I don't want a presentation book but instead an advanced book.
Thanks for your help :) | 4 |
11,196,025 | 06/25/2012 19:28:26 | 470,749 | 10/08/2010 23:38:36 | 63 | 8 | Google Website Optimizer A/B testing with server-side code | Basically, we want to A/B test 2 different page layout headers. There are some structural differences (it's not just switching out the CSS).
I've been able to get this much working: our Zend Framework (server side PHP) looks for a certain boolean variable to decide which HTML file to use as the layout (the original or the variation). This binary switch works beautifully. Each different layout is able to load nicely.
I just haven't been able to get the 0 or 1 from your GWO utmx("combination") function.
When during the page load is the result of that function available? For me, it seems like it always returns 0 regardless of when I call it. Or, when does the __utmx cookie get set? I could simply refresh the page after that is set. Is there a callback for the utmx() function?
I've tried multiple strategies, but my most recent plan was this:
In PHP code, check the __utmx cookie to get the assigned variation number. Save that to a custom cookie. Decide which layout to render based on that number. Then, in the javascript, after page load, it simply checks for the presence of the custom cookie, and if it's absent, it simply refreshes the page immediately (prompting the server-side code to look at the __utmx cookie as described above). That way, on a user's 2nd visit onward, my custom cookie already exists (containing the value of the variation) and can tell the server-side code which layout to use. On the user's first visit, right after GWO assigns the 0 or 1 for the variation, I'd use javascript to refresh the page so that my server-side code could read the __utmx cookie.
I haven't figured out when/how the __utmx cookie gets set though (or when utmx("combination") will work).
http://stackoverflow.com/questions/3623447/a-b-test-with-google-web-optimizer-what-cookie-tells-me-visitor-got-a-or-b hasn't helped.
Server side code:
$cookieNameForThisExperiment = 'gwo_variation_header-and-navbar'; //This is for Google Website Optimizer split testing of the header-and-navbar
$variation1 = 'variation1';
if (!isset($_COOKIE[$cookieNameForThisExperiment]) && isset($_COOKIE["__utmx"])) {
$utmx = explode(':', $_COOKIE["__utmx"]);
$variation = $utmx[2]; //Careful: this will not work if there are multiple Google experiments running simultaneously and might not even work for testing more than "original" vs 1 "variation". http://productforums.google.com/forum/#!category-topic/websiteoptimizer/technical-questions/kilJ7lJU2NY
$variationName = 'original';
if ($variation == 1) {
$variationName = $variation1;
}
Extrabux_Cookie::setCookie($cookieNameForThisExperiment, $variationName, time() + (60 * 60 * 24 * 30));
}
if (isset($_COOKIE[$cookieNameForThisExperiment]) && $_COOKIE[$cookieNameForThisExperiment] == $variation1) {
$this->_helper->layout()->setLayout('main_new'); //Use new layout only in this variation.
} //Otherwise, continue using the original layout. | google-website-optimizer | ab-testing | null | null | null | null | open | Google Website Optimizer A/B testing with server-side code
===
Basically, we want to A/B test 2 different page layout headers. There are some structural differences (it's not just switching out the CSS).
I've been able to get this much working: our Zend Framework (server side PHP) looks for a certain boolean variable to decide which HTML file to use as the layout (the original or the variation). This binary switch works beautifully. Each different layout is able to load nicely.
I just haven't been able to get the 0 or 1 from your GWO utmx("combination") function.
When during the page load is the result of that function available? For me, it seems like it always returns 0 regardless of when I call it. Or, when does the __utmx cookie get set? I could simply refresh the page after that is set. Is there a callback for the utmx() function?
I've tried multiple strategies, but my most recent plan was this:
In PHP code, check the __utmx cookie to get the assigned variation number. Save that to a custom cookie. Decide which layout to render based on that number. Then, in the javascript, after page load, it simply checks for the presence of the custom cookie, and if it's absent, it simply refreshes the page immediately (prompting the server-side code to look at the __utmx cookie as described above). That way, on a user's 2nd visit onward, my custom cookie already exists (containing the value of the variation) and can tell the server-side code which layout to use. On the user's first visit, right after GWO assigns the 0 or 1 for the variation, I'd use javascript to refresh the page so that my server-side code could read the __utmx cookie.
I haven't figured out when/how the __utmx cookie gets set though (or when utmx("combination") will work).
http://stackoverflow.com/questions/3623447/a-b-test-with-google-web-optimizer-what-cookie-tells-me-visitor-got-a-or-b hasn't helped.
Server side code:
$cookieNameForThisExperiment = 'gwo_variation_header-and-navbar'; //This is for Google Website Optimizer split testing of the header-and-navbar
$variation1 = 'variation1';
if (!isset($_COOKIE[$cookieNameForThisExperiment]) && isset($_COOKIE["__utmx"])) {
$utmx = explode(':', $_COOKIE["__utmx"]);
$variation = $utmx[2]; //Careful: this will not work if there are multiple Google experiments running simultaneously and might not even work for testing more than "original" vs 1 "variation". http://productforums.google.com/forum/#!category-topic/websiteoptimizer/technical-questions/kilJ7lJU2NY
$variationName = 'original';
if ($variation == 1) {
$variationName = $variation1;
}
Extrabux_Cookie::setCookie($cookieNameForThisExperiment, $variationName, time() + (60 * 60 * 24 * 30));
}
if (isset($_COOKIE[$cookieNameForThisExperiment]) && $_COOKIE[$cookieNameForThisExperiment] == $variation1) {
$this->_helper->layout()->setLayout('main_new'); //Use new layout only in this variation.
} //Otherwise, continue using the original layout. | 0 |
2,960,113 | 06/02/2010 17:44:03 | 356,713 | 06/02/2010 17:41:01 | 1 | 0 | Anyone out there using EWDraw | I am working on a project that uses the EWDraw ActiveX componenet and I would like to find out if there are others out there? | delphi-2010 | null | null | null | null | 06/07/2010 19:33:48 | not a real question | Anyone out there using EWDraw
===
I am working on a project that uses the EWDraw ActiveX componenet and I would like to find out if there are others out there? | 1 |
7,986,497 | 11/02/2011 19:51:31 | 807,208 | 06/20/2011 18:41:10 | 25 | 2 | Configure a WCF RIA Service with a Secure Endpoint in web.config | The standard method to configure a WCF Ria Service with a secure endpoint (SSL) is to set RequiresSecureEndpoint = true on the EnableClientAccessAttribute as shown below:
[RequiresAuthentication]
[EnableClientAccess(RequiresSecureEndpoint = true)]
public class Module1DomainService : LinqToEntitiesDomainService<AdventureWorksDataModel>
{
.
.
.
}
I need to know if the RequiresSecureEndpoint = true option can be set in the web.config file or if there's an equivalent method to create a secure endpoint (SSL) for a WCF RIA Service. | .net | wcf | ria | null | null | null | open | Configure a WCF RIA Service with a Secure Endpoint in web.config
===
The standard method to configure a WCF Ria Service with a secure endpoint (SSL) is to set RequiresSecureEndpoint = true on the EnableClientAccessAttribute as shown below:
[RequiresAuthentication]
[EnableClientAccess(RequiresSecureEndpoint = true)]
public class Module1DomainService : LinqToEntitiesDomainService<AdventureWorksDataModel>
{
.
.
.
}
I need to know if the RequiresSecureEndpoint = true option can be set in the web.config file or if there's an equivalent method to create a secure endpoint (SSL) for a WCF RIA Service. | 0 |
4,719,054 | 01/17/2011 23:33:30 | 579,205 | 01/17/2011 23:31:13 | 1 | 0 | Factorial Question | How come the number N! can terminate in exactly 1,2,3,4, or 6 zeroes by never 5 zeroes? | math | probability | null | null | null | 01/18/2011 00:46:02 | off topic | Factorial Question
===
How come the number N! can terminate in exactly 1,2,3,4, or 6 zeroes by never 5 zeroes? | 2 |
4,502,461 | 12/21/2010 18:10:49 | 550,331 | 12/21/2010 18:10:49 | 1 | 0 | How to program an Operating System? | I love to code, but I am currently only doing web development. I'd like to do something that will be unique and fun and very different from web programming.
Yeah, this might be a dumb question, but I think it would be really cool to build a really simple Operating System. So please do not say anything rude. I just want to know the following things:
*Where to start?
*Resources
*What language would I use?
I was thinking something simple like a cmd based | operating-system | null | null | null | null | 12/12/2011 05:30:56 | not constructive | How to program an Operating System?
===
I love to code, but I am currently only doing web development. I'd like to do something that will be unique and fun and very different from web programming.
Yeah, this might be a dumb question, but I think it would be really cool to build a really simple Operating System. So please do not say anything rude. I just want to know the following things:
*Where to start?
*Resources
*What language would I use?
I was thinking something simple like a cmd based | 4 |
10,989,909 | 06/12/2012 02:35:48 | 615,477 | 12/25/2009 04:06:13 | 30 | 0 | How high is Java web application memory & CPU usage compared with PHP 5.4 | I have zero experience building website with Java. Recently I need to develop complex web application.
Currently I'm converting PHP apps to get it works in PHP 5.4. With modern website requirement, PHP application needs better frameworking from start. Use Zend framework or Drupal 7 looks good move.
But Zend or Drupal 7 comes with a price. 300MB VPS seems not relevant anymore for an average PHP website. In this case, Resource usage rate is very important to me.
Because lots of complex web application is built with Java web framework, I just wonder how high is Java resource usage (memory & CPU) compared with PHP 5.4?
I hope it will be same or even better, so that I have more choice. | java | php | web-frameworks | null | null | 06/12/2012 08:17:16 | off topic | How high is Java web application memory & CPU usage compared with PHP 5.4
===
I have zero experience building website with Java. Recently I need to develop complex web application.
Currently I'm converting PHP apps to get it works in PHP 5.4. With modern website requirement, PHP application needs better frameworking from start. Use Zend framework or Drupal 7 looks good move.
But Zend or Drupal 7 comes with a price. 300MB VPS seems not relevant anymore for an average PHP website. In this case, Resource usage rate is very important to me.
Because lots of complex web application is built with Java web framework, I just wonder how high is Java resource usage (memory & CPU) compared with PHP 5.4?
I hope it will be same or even better, so that I have more choice. | 2 |
5,664,958 | 04/14/2011 14:42:28 | 62,282 | 02/04/2009 06:10:58 | 406 | 12 | mvc and castle windsor - registratrion events | When I register components when castle's container in my app startup - should I see these classes being instantiated when I debug.
_container = new WindsorContainer();
_container.Register(
AllTypes.FromAssemblyContaining<ValidationPatterns>()
.BasedOn(typeof(IValidator<>))
.WithService.Base());
Should I be able to see each of the relevant classes that fit the types i.e. inherit from IValidator, being instantiated?
Hope that makes sense | asp.net-mvc-2 | castle-windsor | null | null | null | null | open | mvc and castle windsor - registratrion events
===
When I register components when castle's container in my app startup - should I see these classes being instantiated when I debug.
_container = new WindsorContainer();
_container.Register(
AllTypes.FromAssemblyContaining<ValidationPatterns>()
.BasedOn(typeof(IValidator<>))
.WithService.Base());
Should I be able to see each of the relevant classes that fit the types i.e. inherit from IValidator, being instantiated?
Hope that makes sense | 0 |
8,649,919 | 12/27/2011 22:26:11 | 1,094,339 | 12/12/2011 18:34:57 | 19 | 0 | Could not open port for debugger. Another process may be using the port | When I debug my app i get this error from MonoDevelop "Could not open port for debugger. Another process may be using the port." any idea what is causing it and how to fix it? Thanks? | monotouch | null | null | null | null | null | open | Could not open port for debugger. Another process may be using the port
===
When I debug my app i get this error from MonoDevelop "Could not open port for debugger. Another process may be using the port." any idea what is causing it and how to fix it? Thanks? | 0 |
42,788 | 09/03/2008 23:03:32 | 683 | 08/07/2008 17:57:52 | 11 | 3 | PHP Library Best Practices? | I'm working on a project that I'd eventually like to package as a reusable PHP library. Can anyone suggest some best practices for doing so? Directory structure? File naming conventions? Anything else I might not be thinking of? Or should I just put everything in an appropriately named .php file or two and call it good? Thanks. | php | null | null | null | null | 05/29/2012 06:13:08 | not constructive | PHP Library Best Practices?
===
I'm working on a project that I'd eventually like to package as a reusable PHP library. Can anyone suggest some best practices for doing so? Directory structure? File naming conventions? Anything else I might not be thinking of? Or should I just put everything in an appropriately named .php file or two and call it good? Thanks. | 4 |
10,666,495 | 05/19/2012 15:23:42 | 1,051,043 | 11/17/2011 05:01:52 | 9 | 0 | ArrayOutOfBounds Exception | I have been using this - 1 resolution for a while now, and was wondering if there is a way to correct the for loop arrayoutofbounds without the use of -1. Please advise?
for(int i = 0; i < hand.length - 1 ; i++)
{
if(this.hand[i].getRank() == this.hand[i + 1].getRank())
return true;
} | java | arrays | null | null | null | 05/22/2012 13:55:58 | too localized | ArrayOutOfBounds Exception
===
I have been using this - 1 resolution for a while now, and was wondering if there is a way to correct the for loop arrayoutofbounds without the use of -1. Please advise?
for(int i = 0; i < hand.length - 1 ; i++)
{
if(this.hand[i].getRank() == this.hand[i + 1].getRank())
return true;
} | 3 |
8,525,269 | 12/15/2011 19:06:37 | 856,498 | 07/21/2011 17:15:47 | 71 | 3 | Ubuntu - how do deal with non installable package issue | I am running ubuntu with sphinx - sphinx works just fine. I cannot however install anything else - I get this message:
The following packages have unmet dependencies:
sphinx : Depends: mysql but it is not installable
If I try to run apt-get -f install it suggest that I remove sphinx which I do not want to.
How can I get rid of this error? I have mysql running fine as well. | ubuntu | sphinx | null | null | null | 12/16/2011 00:25:15 | off topic | Ubuntu - how do deal with non installable package issue
===
I am running ubuntu with sphinx - sphinx works just fine. I cannot however install anything else - I get this message:
The following packages have unmet dependencies:
sphinx : Depends: mysql but it is not installable
If I try to run apt-get -f install it suggest that I remove sphinx which I do not want to.
How can I get rid of this error? I have mysql running fine as well. | 2 |
3,828,838 | 09/30/2010 08:06:19 | 421,372 | 08/16/2010 05:04:56 | 162 | 9 | Check the state of a local Service | How do I check whether the local service inside my application is running? | android | service | null | null | null | null | open | Check the state of a local Service
===
How do I check whether the local service inside my application is running? | 0 |
7,572,942 | 09/27/2011 17:02:31 | 731,278 | 04/29/2011 14:50:13 | 323 | 0 | Hg Merge specific commit from another branch | I have two branches Dev and Feature1. I was working on Feature1, creating said feature, and committed it. I then wrote the code for Feature2 but committed it under Feature1 branch instead of a new branch (Feature2). So now i have two features in Feature1 branch as two separate commits, but I only want to include the second feature back into Dev.
What is the mercurial way to do this? | mercurial | null | null | null | null | null | open | Hg Merge specific commit from another branch
===
I have two branches Dev and Feature1. I was working on Feature1, creating said feature, and committed it. I then wrote the code for Feature2 but committed it under Feature1 branch instead of a new branch (Feature2). So now i have two features in Feature1 branch as two separate commits, but I only want to include the second feature back into Dev.
What is the mercurial way to do this? | 0 |
1,538,766 | 10/08/2009 16:02:32 | 179,301 | 09/25/2009 21:29:05 | 1 | 0 | What is the name of the CentOS font? | What is the name of the font used in the CentOS logo?
[Link to CentOS Site][1]
[1]: http://www.centos.org/ | design | fonts | linux | centos | null | 10/08/2009 18:12:15 | off topic | What is the name of the CentOS font?
===
What is the name of the font used in the CentOS logo?
[Link to CentOS Site][1]
[1]: http://www.centos.org/ | 2 |
3,236,432 | 07/13/2010 10:58:42 | 388,341 | 07/10/2010 07:42:37 | 59 | 3 | how to put my webpage so that i can find my page in google search ? (please all come and see this) | how to upload my webpage so that i can find my page in google search ?
> i am using this post also to thank the
> people who helped me (or tried to help
> me) so far and i am gald to inform
> that i am putting the names of these
> helpers in the credit page of my
> program.
>
>
>
adatapost (India/Gujarat/Mehsana)
Christian Sciberras (Malta Island)
Amarghosh (India/Karnataka/Bangalore)
Carson Myers (Canada/British Columbia/Kelowna)
balexandre (Denmark/Stroby)
rockinthesixstring (Canada/Calgary)
bobince (Germany/Bavaria)
Adam Dempsey (United Kingdom)
Stefan (Sweden)
Andreas Jansson (United Kingdom/London)
Ashley (United Kingdom)
BrunoLM (Brazil)
Piskvor ()
Martin (United Kingdom/London)
TNi ()
Matthew Flaschen ()
qw3n ()
Christian ()
JC Leyba ()
AlbertVanHalen ()
so_is_this
deadmill
>
> Please provide your real name and
> country . (When the world unites
> nothing is impossible :D)
>
> Thanx again friends...
| html | null | null | null | null | 07/14/2010 13:34:57 | off topic | how to put my webpage so that i can find my page in google search ? (please all come and see this)
===
how to upload my webpage so that i can find my page in google search ?
> i am using this post also to thank the
> people who helped me (or tried to help
> me) so far and i am gald to inform
> that i am putting the names of these
> helpers in the credit page of my
> program.
>
>
>
adatapost (India/Gujarat/Mehsana)
Christian Sciberras (Malta Island)
Amarghosh (India/Karnataka/Bangalore)
Carson Myers (Canada/British Columbia/Kelowna)
balexandre (Denmark/Stroby)
rockinthesixstring (Canada/Calgary)
bobince (Germany/Bavaria)
Adam Dempsey (United Kingdom)
Stefan (Sweden)
Andreas Jansson (United Kingdom/London)
Ashley (United Kingdom)
BrunoLM (Brazil)
Piskvor ()
Martin (United Kingdom/London)
TNi ()
Matthew Flaschen ()
qw3n ()
Christian ()
JC Leyba ()
AlbertVanHalen ()
so_is_this
deadmill
>
> Please provide your real name and
> country . (When the world unites
> nothing is impossible :D)
>
> Thanx again friends...
| 2 |
6,751,599 | 07/19/2011 17:44:44 | 842,222 | 07/13/2011 07:49:22 | 6 | 0 | Is linux purely made in C ? if it is then is gnome or kde made in C or some object oriented language? | i had a debate that Linux was pure C. But most of the codes must be C till the system programming part {Kernel, Shell, etc..}. But the code must be more or less having GUI libraries or framework that are supported in C {GTK} or something more of an object oriented language. Coz Object orientaton is the essence of GUI {makes is easier to design/implement even though it might have an API made in C}. so what you think? i think the ans should be like "Linux is made majorly in C". You agree ? | c | null | null | null | null | 07/19/2011 17:47:47 | off topic | Is linux purely made in C ? if it is then is gnome or kde made in C or some object oriented language?
===
i had a debate that Linux was pure C. But most of the codes must be C till the system programming part {Kernel, Shell, etc..}. But the code must be more or less having GUI libraries or framework that are supported in C {GTK} or something more of an object oriented language. Coz Object orientaton is the essence of GUI {makes is easier to design/implement even though it might have an API made in C}. so what you think? i think the ans should be like "Linux is made majorly in C". You agree ? | 2 |
4,203,624 | 11/17/2010 10:53:12 | 346,031 | 05/20/2010 11:07:10 | 639 | 45 | What are the Java API's weakest points ? | I want to know:
What are the weakest points of the Java API in your opinion? What are its worst aspects? What is really user-UNfriendly?
This is not a rant thread, but rather a collection of design issues you encounter in the API.
I for example really dislike Java's date handling. It's pretty cumbersome to use the Calendar class. If the usage of the Calendar class isn't enough, you have to keep in mind that it counts months from zero, so January is zero and February is one. This is really unintuitive. I know there are reasons for this design, but why on earth can't there be some default convention and a simple, non-deprecated constructor for Date() which also counts months from 1. | java | api | jdk | jre | null | 11/17/2010 11:00:26 | not constructive | What are the Java API's weakest points ?
===
I want to know:
What are the weakest points of the Java API in your opinion? What are its worst aspects? What is really user-UNfriendly?
This is not a rant thread, but rather a collection of design issues you encounter in the API.
I for example really dislike Java's date handling. It's pretty cumbersome to use the Calendar class. If the usage of the Calendar class isn't enough, you have to keep in mind that it counts months from zero, so January is zero and February is one. This is really unintuitive. I know there are reasons for this design, but why on earth can't there be some default convention and a simple, non-deprecated constructor for Date() which also counts months from 1. | 4 |
3,469,475 | 08/12/2010 15:44:50 | 304,141 | 03/29/2010 11:17:24 | 215 | 6 | Does anybody else gets unconfortable with languages that are "too high level" ? | Like most professionals in the area of software development, I'm always open for learning new technologies/frameworks that might improve productivity. Relatively speaking, I'm still a novice in the area(3-4 years of experience) and my first contact with software development was in the .NET plataform with VB.NET language. At the time I had a very simplified view of software : Using Visual Studio 2005 was the only way to write/build software. The autogenerated ADO.NET classes hid all the "complexity" of accessing a database and with no understanding of how things happened "under the hood" made me a hostage of that environment. Problems were impossible to debug and most of the time I needed to follow step-by-step tutorials to solve them.
As the time passed, I felt that if I was going to work with software, I needed a better understanding of it so I started expanding my knowledge of C#/.NET and eventually wrote my first mixed C#/C++ programs. Ironically, it was this Microsoft technology that made me switch my working environment from windows to linux(through the mono project) which I can't live without today. The learning curve was hard, but messing arround with linux/C gave me a much better understanding of how operating systems/computers works than in Windows/C#. It was only after I wrote a few unix C programs that I really understood the need of languages like C#/Java that provide useful services like platform independence/automatic memory management while also providing decent performance(not that this seems to matter much these days).
Maybe its just me and my need to understand how things works, but I felt really 'at home' when writting C(and even a little assembly) code. Of course I can't use C for my daily work, but I felt that by understanding a little more low level computing I became a better C# programmer.
These days I use Java for the majority of my work. I think of the JVM's simplicity compared to the CLR as an advantage. Plus most of the advantages of C# over Java are nothing more than syntatic sugar(if you don't believe me, try decompiling a C# program that has a lot of linq/lambda expressions).Java seems to have more control over its loading process than .NET(In my opinion, the only real advantage of CLI over JVM is the possibility of running multiple isolated programs in the same process through appdomains).
Last week I started a web project and as a learning experience I decided to use groovy/grails. To those that don't know, groovy is a dynamic language that when compiled produces JVM compatible bytecode, and grails is a web MVC framework that is built on top of groovy and other JVM technologies like hibernate, spring. In less than five minutes one can build a fully working CRUD web application, so its productivity is unquestionable.
I don't know if its just because I'm not used to dynamic programming, but I'm really unconfortable when programming in groovy. Its flexibility actually makes me very confused sometimes: While it supports a most of java syntax rules, almost none of those rules are enforced, and if you write groovy programs using a groovy-like style, they look nothing like java programs. Its like theres no rules in the language and I kept wondering if thats really a good thing. The following snippet is a simple groovy program that prints a string
class groovyprogram {
static main(args) {
def n = 5
def s = getString(n)
println s
}
static getString(n) {
"hello ${n}"
}
}
This is the Java equivalent :
public class javaprogram {
public static void main(String[] args) {
Integer n = 5;
String s = getString(n);
System.out.println(s);
}
static String getString(Integer n) {
return "Hello " + n.toString();
}
}
The above Java code is also a valid Groovy code. Here's another groovy version that produces the same output :
class groovyprogram2 {
static main(args){
def n = 5
println ("hello ${n}")
}
}
Or even :
def n = 5
println "hello ${n}"
The following, even without producing any output, is a valid groovy program :
"hello world"
Since all groovy is compiled to JVM, the groovy compiler does a lot of magic under the hoods. The above example will probably be compiled into a Java class containing a method that returns the "hello world" String. In truth, the compiled class has a LOT more than a method that returns the "hello world" string. Try compiling that code and then examining the generated .class file in eclipse, you will get scared on how much bytecode groovy generates just to make that groovy code behave like a script.
I'm wondering how helpful this syntatic sugar really is. Does it really matter not having to declare the Type a method is suposed to return? Will anyone get more productive by not typing semicolons at the end of statement? What about optional parentesis for passing method arguments?
In my opinion think that groovy's lack of standards makes it very difficult for a programmer to follow coding patterns. Any C programmer can easily understand any language that follows a C like syntax. Its really fustrating when you see a lot of groovy samples that follows Java syntax and then you stumble upon the following :
def list = {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[airlineInstanceList: Airline.list(params), airlineInstanceTotal: Airline.count()]
}
This is a sample groovy code that gets scaffolded by grails.
In my current project I'm loosing a lot of time trying to debug some simple unit tests that throws obscure groovy exceptions that never happened with the old Java/EasyMock combination. Probably next week I will start the project using my old JEE environment using plain Spring-MVC/Hibernate with a lot of beans configuration files.
After these experiences I think that theres a limit in the level of abstraction an activity can have to be called software development, and I don't feel that a software developer is complete unless he can completely control/debug his environment. I posted this so I could hear people's opinion about this. Does anyone else has the same kind of troubles with these really 'high level' environments?
| c# | java | c | groovy | dynamic-languages | 08/12/2010 15:51:08 | not constructive | Does anybody else gets unconfortable with languages that are "too high level" ?
===
Like most professionals in the area of software development, I'm always open for learning new technologies/frameworks that might improve productivity. Relatively speaking, I'm still a novice in the area(3-4 years of experience) and my first contact with software development was in the .NET plataform with VB.NET language. At the time I had a very simplified view of software : Using Visual Studio 2005 was the only way to write/build software. The autogenerated ADO.NET classes hid all the "complexity" of accessing a database and with no understanding of how things happened "under the hood" made me a hostage of that environment. Problems were impossible to debug and most of the time I needed to follow step-by-step tutorials to solve them.
As the time passed, I felt that if I was going to work with software, I needed a better understanding of it so I started expanding my knowledge of C#/.NET and eventually wrote my first mixed C#/C++ programs. Ironically, it was this Microsoft technology that made me switch my working environment from windows to linux(through the mono project) which I can't live without today. The learning curve was hard, but messing arround with linux/C gave me a much better understanding of how operating systems/computers works than in Windows/C#. It was only after I wrote a few unix C programs that I really understood the need of languages like C#/Java that provide useful services like platform independence/automatic memory management while also providing decent performance(not that this seems to matter much these days).
Maybe its just me and my need to understand how things works, but I felt really 'at home' when writting C(and even a little assembly) code. Of course I can't use C for my daily work, but I felt that by understanding a little more low level computing I became a better C# programmer.
These days I use Java for the majority of my work. I think of the JVM's simplicity compared to the CLR as an advantage. Plus most of the advantages of C# over Java are nothing more than syntatic sugar(if you don't believe me, try decompiling a C# program that has a lot of linq/lambda expressions).Java seems to have more control over its loading process than .NET(In my opinion, the only real advantage of CLI over JVM is the possibility of running multiple isolated programs in the same process through appdomains).
Last week I started a web project and as a learning experience I decided to use groovy/grails. To those that don't know, groovy is a dynamic language that when compiled produces JVM compatible bytecode, and grails is a web MVC framework that is built on top of groovy and other JVM technologies like hibernate, spring. In less than five minutes one can build a fully working CRUD web application, so its productivity is unquestionable.
I don't know if its just because I'm not used to dynamic programming, but I'm really unconfortable when programming in groovy. Its flexibility actually makes me very confused sometimes: While it supports a most of java syntax rules, almost none of those rules are enforced, and if you write groovy programs using a groovy-like style, they look nothing like java programs. Its like theres no rules in the language and I kept wondering if thats really a good thing. The following snippet is a simple groovy program that prints a string
class groovyprogram {
static main(args) {
def n = 5
def s = getString(n)
println s
}
static getString(n) {
"hello ${n}"
}
}
This is the Java equivalent :
public class javaprogram {
public static void main(String[] args) {
Integer n = 5;
String s = getString(n);
System.out.println(s);
}
static String getString(Integer n) {
return "Hello " + n.toString();
}
}
The above Java code is also a valid Groovy code. Here's another groovy version that produces the same output :
class groovyprogram2 {
static main(args){
def n = 5
println ("hello ${n}")
}
}
Or even :
def n = 5
println "hello ${n}"
The following, even without producing any output, is a valid groovy program :
"hello world"
Since all groovy is compiled to JVM, the groovy compiler does a lot of magic under the hoods. The above example will probably be compiled into a Java class containing a method that returns the "hello world" String. In truth, the compiled class has a LOT more than a method that returns the "hello world" string. Try compiling that code and then examining the generated .class file in eclipse, you will get scared on how much bytecode groovy generates just to make that groovy code behave like a script.
I'm wondering how helpful this syntatic sugar really is. Does it really matter not having to declare the Type a method is suposed to return? Will anyone get more productive by not typing semicolons at the end of statement? What about optional parentesis for passing method arguments?
In my opinion think that groovy's lack of standards makes it very difficult for a programmer to follow coding patterns. Any C programmer can easily understand any language that follows a C like syntax. Its really fustrating when you see a lot of groovy samples that follows Java syntax and then you stumble upon the following :
def list = {
params.max = Math.min(params.max ? params.int('max') : 10, 100)
[airlineInstanceList: Airline.list(params), airlineInstanceTotal: Airline.count()]
}
This is a sample groovy code that gets scaffolded by grails.
In my current project I'm loosing a lot of time trying to debug some simple unit tests that throws obscure groovy exceptions that never happened with the old Java/EasyMock combination. Probably next week I will start the project using my old JEE environment using plain Spring-MVC/Hibernate with a lot of beans configuration files.
After these experiences I think that theres a limit in the level of abstraction an activity can have to be called software development, and I don't feel that a software developer is complete unless he can completely control/debug his environment. I posted this so I could hear people's opinion about this. Does anyone else has the same kind of troubles with these really 'high level' environments?
| 4 |
10,411,491 | 05/02/2012 09:58:28 | 308,224 | 04/03/2010 09:27:52 | 699 | 28 | Output conditional field in Umbraco:item | Outputting a field in Umbraco is pretty straight forward:
<umbraco:Item runat="server" field="introduction">
Lets say I'm currently rendering an article with the property 'introduction'. In case the article introduction field is empty I want instead to output a more global field on the home site node, let's call it 'global_introduction'.
Does anybody know how to do this?
I know about the optional attribute `xslt`, but don't know if it will suffice... or exactly how to do it. | umbraco | null | null | null | null | null | open | Output conditional field in Umbraco:item
===
Outputting a field in Umbraco is pretty straight forward:
<umbraco:Item runat="server" field="introduction">
Lets say I'm currently rendering an article with the property 'introduction'. In case the article introduction field is empty I want instead to output a more global field on the home site node, let's call it 'global_introduction'.
Does anybody know how to do this?
I know about the optional attribute `xslt`, but don't know if it will suffice... or exactly how to do it. | 0 |
10,544,092 | 05/11/2012 01:01:38 | 293,562 | 03/14/2010 20:41:31 | 351 | 5 | File transfer speeds between two specific machines on LAN is extremely slow | I have a few machines on my personal LAN and have no problem transferring files between them except between two specific computers. I have never seen anything like this before. Those two computers can transfer files with other machines on the network without problems, just not with each other. What could be causing something like this? My router is running DD-WRT. | networking | lan | null | null | null | 05/11/2012 01:53:55 | off topic | File transfer speeds between two specific machines on LAN is extremely slow
===
I have a few machines on my personal LAN and have no problem transferring files between them except between two specific computers. I have never seen anything like this before. Those two computers can transfer files with other machines on the network without problems, just not with each other. What could be causing something like this? My router is running DD-WRT. | 2 |
7,647,722 | 10/04/2011 12:14:53 | 341,358 | 05/14/2010 15:08:42 | 52 | 2 | Is there a way to get the shadowPath for a UILabel text? | I'm currently using a UILabel to display some text. I'm using CALayer to give it a nice shadow. But: performance is really bad when I'm positioning (and moving) a lot of UILabel elements on the screen.
I've read in a few blogposts that setting the shadowPath of a CALayer optimizes the performance, I gave it a shot with a rounded rectangle and it actually works. So now i'm trying to figure out how to get the shadowPath for a text on a UILabel.
Somebody that has an idea? Otherwise I'll have to render my text in coregraphics I guess.
Here's an example with the shadowPath on a rectangle layer:
backgroundImage.layer.shadowOffset = CGSizeMake(0, 0);
backgroundImage.layer.shadowRadius = LIST_TITLE_VIEW_SHADOW_SIZE;
backgroundImage.layer.shadowOpacity = LIST_TITLE_VIEW_SHADOW_OPACITY;
backgroundImage.layer.shadowPath = [UIBezierPath bezierPathWithRect:backgroundImage.bounds].CGPath; | ios | uilabel | shadowpath | null | null | null | open | Is there a way to get the shadowPath for a UILabel text?
===
I'm currently using a UILabel to display some text. I'm using CALayer to give it a nice shadow. But: performance is really bad when I'm positioning (and moving) a lot of UILabel elements on the screen.
I've read in a few blogposts that setting the shadowPath of a CALayer optimizes the performance, I gave it a shot with a rounded rectangle and it actually works. So now i'm trying to figure out how to get the shadowPath for a text on a UILabel.
Somebody that has an idea? Otherwise I'll have to render my text in coregraphics I guess.
Here's an example with the shadowPath on a rectangle layer:
backgroundImage.layer.shadowOffset = CGSizeMake(0, 0);
backgroundImage.layer.shadowRadius = LIST_TITLE_VIEW_SHADOW_SIZE;
backgroundImage.layer.shadowOpacity = LIST_TITLE_VIEW_SHADOW_OPACITY;
backgroundImage.layer.shadowPath = [UIBezierPath bezierPathWithRect:backgroundImage.bounds].CGPath; | 0 |
4,008,188 | 10/24/2010 12:25:58 | 397,688 | 07/21/2010 08:36:45 | 1 | 0 | Artificial Intelligence Project | I'm searching for an idea regarding AI term project. I've researched a lot about AI areas, but not able to decide/come up with reasonable project that can be implemented within 2 months (approx. 5-10 hours a week) and easy to test&document, but at the same time be non-trivial (to implement).
Do you guys have any ideas, previous projects, future project that meet this criteria?
Note, I'm not interested in ready solutions/implementation, but in ideas or project specification.
Thanks a lot.
Regards. | artificial-intelligence | null | null | null | null | null | open | Artificial Intelligence Project
===
I'm searching for an idea regarding AI term project. I've researched a lot about AI areas, but not able to decide/come up with reasonable project that can be implemented within 2 months (approx. 5-10 hours a week) and easy to test&document, but at the same time be non-trivial (to implement).
Do you guys have any ideas, previous projects, future project that meet this criteria?
Note, I'm not interested in ready solutions/implementation, but in ideas or project specification.
Thanks a lot.
Regards. | 0 |
6,155,094 | 05/27/2011 16:22:53 | 557,534 | 12/29/2010 19:52:14 | 164 | 6 | Is it possible to get the Linux source code for mmap and the Windows source code for MapViewOfFile? | Goog afternoon, I recently downloaded the www.kernel.org mainline 2.6.39 Linux kernel source distribution. We are looking for the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset). After we decompressed the tar.bz2 distribution, we found a file mmap.c which contains memory mapping source code.
However, we could not the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset) in mmap.c.
Do any Linux engineers or adminstrators knwo where we obtain the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset)?
Also, we are interested in the Windows source code for MapViewOfFile. I know this a stretch because Microsoft OS source code is not in the open source domain.
In case anybody is wondering why we need this source code, we are trying to optimize the runtime performant of a C++ deduplicating program prototype using a cached memory mapped file implementation on a 32-bit architecture. We want to understand how to use mmap and MapViewOfFile in order the optimize the runtime performant of our prototype? Thank you. | c++ | windows | linux-kernel | null | null | null | open | Is it possible to get the Linux source code for mmap and the Windows source code for MapViewOfFile?
===
Goog afternoon, I recently downloaded the www.kernel.org mainline 2.6.39 Linux kernel source distribution. We are looking for the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset). After we decompressed the tar.bz2 distribution, we found a file mmap.c which contains memory mapping source code.
However, we could not the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset) in mmap.c.
Do any Linux engineers or adminstrators knwo where we obtain the Linux source code for void *mmap(void* start , size_t length, int prot, int flags, int fd, off_t offset)?
Also, we are interested in the Windows source code for MapViewOfFile. I know this a stretch because Microsoft OS source code is not in the open source domain.
In case anybody is wondering why we need this source code, we are trying to optimize the runtime performant of a C++ deduplicating program prototype using a cached memory mapped file implementation on a 32-bit architecture. We want to understand how to use mmap and MapViewOfFile in order the optimize the runtime performant of our prototype? Thank you. | 0 |
7,816,455 | 10/19/2011 04:13:38 | 998,487 | 10/17/2011 03:55:21 | 3 | 0 | get property value in action class struts2 | <s:div id="test" align="right"><br>
<s:iterator value="categoryList" ><br>
<tr><br>
<td><br>
<s:url id="category" action="/getProduct.action"></s:url><br>
<s:a href="%{category}"><s:property value="name"/></s:a><br>
</td><br>
</tr><br>
</s:iterator><br>
</s:div><br>
// i have list of categories and i make it clickable. I want that when click on any <br>category getProperty will run with selected category<br>
Example:-<br>
Books <br>
Shoes<br>
Furniture<br>
//these are the list of categories. when user click on Books getPropertyaction will run and <br>"Books" parameter will go with it <br>
// mean get "Books" in getPropertyaction <br> | struts2 | null | null | null | null | 11/14/2011 04:43:04 | not a real question | get property value in action class struts2
===
<s:div id="test" align="right"><br>
<s:iterator value="categoryList" ><br>
<tr><br>
<td><br>
<s:url id="category" action="/getProduct.action"></s:url><br>
<s:a href="%{category}"><s:property value="name"/></s:a><br>
</td><br>
</tr><br>
</s:iterator><br>
</s:div><br>
// i have list of categories and i make it clickable. I want that when click on any <br>category getProperty will run with selected category<br>
Example:-<br>
Books <br>
Shoes<br>
Furniture<br>
//these are the list of categories. when user click on Books getPropertyaction will run and <br>"Books" parameter will go with it <br>
// mean get "Books" in getPropertyaction <br> | 1 |
6,025,492 | 05/17/2011 02:04:42 | 756,622 | 05/17/2011 02:04:42 | 1 | 0 | what is the best source for server design patterns/best practices? | I've searched for a while for a good book which covers server designed patterns. I'm looking for something along the lines of Gang of Four.
Concepts include:
-- Threaded vs Process vs combo based solutions<br>
-- How to triage requests properly. i.e. I expect only limited requests from any domain, so I may only allocate a certain number of workers per domain.<br>
-- Worker timeouts<br>
-- poll/select/epoll use cases<br>
-- And those things I don't know!<br>
<br>
Any suggestions please!<br>
<br>
Thanks!<br> | c | linux | design-patterns | pthreads | processes | null | open | what is the best source for server design patterns/best practices?
===
I've searched for a while for a good book which covers server designed patterns. I'm looking for something along the lines of Gang of Four.
Concepts include:
-- Threaded vs Process vs combo based solutions<br>
-- How to triage requests properly. i.e. I expect only limited requests from any domain, so I may only allocate a certain number of workers per domain.<br>
-- Worker timeouts<br>
-- poll/select/epoll use cases<br>
-- And those things I don't know!<br>
<br>
Any suggestions please!<br>
<br>
Thanks!<br> | 0 |
390,920 | 12/24/2008 06:44:58 | 32,688 | 10/30/2008 08:54:51 | 62 | 0 | In excel automation, how to gracefully handle invalid file format error upon file opening? | I'm trying to open a Microsoft Excel file in a C# program using the 'excelApp.Workbooks.Open()' method. As it happens, if the format of the file is invalid, this method causes an error message box to be displayed. I, however, don't want that; I wish to handle this error gracefully in my own code.
My question is, how do I do that?
The above method doesn't throw any exception which I can catch. Even if it did, there's still that pesky message box anyway. So perhaps the only way would be to validate the file format _before_ opening it. Is there, then, another method in Excel API to allow such validation?
| excel | officedev | c# | null | null | null | open | In excel automation, how to gracefully handle invalid file format error upon file opening?
===
I'm trying to open a Microsoft Excel file in a C# program using the 'excelApp.Workbooks.Open()' method. As it happens, if the format of the file is invalid, this method causes an error message box to be displayed. I, however, don't want that; I wish to handle this error gracefully in my own code.
My question is, how do I do that?
The above method doesn't throw any exception which I can catch. Even if it did, there's still that pesky message box anyway. So perhaps the only way would be to validate the file format _before_ opening it. Is there, then, another method in Excel API to allow such validation?
| 0 |
8,734,663 | 01/04/2012 21:58:56 | 693,679 | 04/05/2011 20:01:40 | 96 | 3 | Backbone per instance event bindings | I have a view that creates a sub-view per item in the list. Generically let's call them ListView and ListItemView. I have attached an event as follows on ListItemView:
events: {
"click .remove": "removeItem"
}
I have template-generated html for ListItemView that is approximately like the following (swapped lb/rb for {/} so you can see the "illegal" html):
<pre>{div class="entry" data-id="this_list_item_id"}<br/>
SOME STUFF HERE<br/>
{div class="meta"}<br/>
{a class="remove" href="javascript:;"}[x]{/a}<br/>
{/div}<br/>
{/div}
</pre>
The problem is, when the click on any of the [x]'s, ALL of the ListItemViews trigger their removeItem function. If I have it go off of this model's id, then I drop all the items on the page. If I have it go off the clicked item's parent's parent element to grab the data-id, I get a delete for EACH ListItemView instance. Is there a way to create an instance-specific event that would only trigger a single removeItem?
If I have ListView hold a single instance of ListItemView and reassign the ListItem model and render for each item in the list it works. I only end up with one action (removeItem) being triggered. The problem is, I have to find the click target's parent's parent to find the data-id attr. Personally, I think the below snippet is rather ugly and want a better way.
var that = $($(el.target).parent()).parent();
Any help anyone gives will be greatly appreciated.
| backbone.js | backbone-events | null | null | null | null | open | Backbone per instance event bindings
===
I have a view that creates a sub-view per item in the list. Generically let's call them ListView and ListItemView. I have attached an event as follows on ListItemView:
events: {
"click .remove": "removeItem"
}
I have template-generated html for ListItemView that is approximately like the following (swapped lb/rb for {/} so you can see the "illegal" html):
<pre>{div class="entry" data-id="this_list_item_id"}<br/>
SOME STUFF HERE<br/>
{div class="meta"}<br/>
{a class="remove" href="javascript:;"}[x]{/a}<br/>
{/div}<br/>
{/div}
</pre>
The problem is, when the click on any of the [x]'s, ALL of the ListItemViews trigger their removeItem function. If I have it go off of this model's id, then I drop all the items on the page. If I have it go off the clicked item's parent's parent element to grab the data-id, I get a delete for EACH ListItemView instance. Is there a way to create an instance-specific event that would only trigger a single removeItem?
If I have ListView hold a single instance of ListItemView and reassign the ListItem model and render for each item in the list it works. I only end up with one action (removeItem) being triggered. The problem is, I have to find the click target's parent's parent to find the data-id attr. Personally, I think the below snippet is rather ugly and want a better way.
var that = $($(el.target).parent()).parent();
Any help anyone gives will be greatly appreciated.
| 0 |
11,380,763 | 07/08/2012 05:00:20 | 1,436,631 | 06/05/2012 06:04:26 | 49 | 4 | how to create a license for my java project? | I developed a java project. I want to create a license key for my project.
for example if 12345 is the license key, then when a user enters that license key then the software should activate and should be ready to use.
but the problem is that the license key should be limited. If the key is entered and activated in one PC then it should not be able to use in any of the other PC's.
if the license key is activated, then it should expire and should not be able to activate again in any other pc.
I thought a solution for this by updating the database at server side for each and every activation key. but i need to make this without using internet.
As some of the antivirus softwares use license keys without using internet connection. so i want make this type of license keys. anyone who explain about this with a clear example and a java code may help me a lot. sorry If there are any gramatical mistakes in my english. | java | null | null | null | null | 07/08/2012 05:06:51 | not a real question | how to create a license for my java project?
===
I developed a java project. I want to create a license key for my project.
for example if 12345 is the license key, then when a user enters that license key then the software should activate and should be ready to use.
but the problem is that the license key should be limited. If the key is entered and activated in one PC then it should not be able to use in any of the other PC's.
if the license key is activated, then it should expire and should not be able to activate again in any other pc.
I thought a solution for this by updating the database at server side for each and every activation key. but i need to make this without using internet.
As some of the antivirus softwares use license keys without using internet connection. so i want make this type of license keys. anyone who explain about this with a clear example and a java code may help me a lot. sorry If there are any gramatical mistakes in my english. | 1 |
5,631,870 | 04/12/2011 07:35:18 | 701,770 | 04/11/2011 08:13:14 | 12 | 0 | what are the advantages of ASP.NET/C# in front of PHP and J2EE | these days a lot of companies use asp.net inspight of php or j2ee even if those two tools are free so what is the advantages of using asp.net over php and j2ee. is it only beacause of the IDE ? or what ?
thanks | c# | php | asp.net | visual-studio | java-ee | 04/12/2011 07:38:17 | not constructive | what are the advantages of ASP.NET/C# in front of PHP and J2EE
===
these days a lot of companies use asp.net inspight of php or j2ee even if those two tools are free so what is the advantages of using asp.net over php and j2ee. is it only beacause of the IDE ? or what ?
thanks | 4 |
6,318,387 | 06/11/2011 20:33:45 | 386,201 | 07/08/2010 03:12:28 | 227 | 24 | Symfony2 fixtures from DB? | Is it possible to generate fixtures from an existing DB in Symfony2/Doctrine? How could I do that?
Thanks! | doctrine2 | fixtures | symfony-2.0 | null | null | null | open | Symfony2 fixtures from DB?
===
Is it possible to generate fixtures from an existing DB in Symfony2/Doctrine? How could I do that?
Thanks! | 0 |
9,093,325 | 02/01/2012 09:17:49 | 682,673 | 03/29/2011 18:44:06 | 54 | 1 | Excel - Mapping product names to product IDs from a separate book | I have two spreadsheets, one is a backup from an ecommerce store which contains data like product_id, name etc and another contains just a product name and a colour e.g:
Book 1:
product_id | name
1 product one
2 product two
3 product three
Book 2:
name | colour
product one Red
product one Green
product two Red
product two Purple
What I need to do is replace every product name in Book 2 with the corresponding product_id from Book 1
Is there a formula that would do this? Doing it manually is out of the question as there are 40000 lines in book 2! | excel | spreadsheet | excel-formula | null | null | null | open | Excel - Mapping product names to product IDs from a separate book
===
I have two spreadsheets, one is a backup from an ecommerce store which contains data like product_id, name etc and another contains just a product name and a colour e.g:
Book 1:
product_id | name
1 product one
2 product two
3 product three
Book 2:
name | colour
product one Red
product one Green
product two Red
product two Purple
What I need to do is replace every product name in Book 2 with the corresponding product_id from Book 1
Is there a formula that would do this? Doing it manually is out of the question as there are 40000 lines in book 2! | 0 |
7,020,974 | 08/11/2011 04:52:16 | 885,459 | 08/09/2011 07:56:09 | 8 | 0 | Scheduled task for C++ EXE not working | I've bought a VPS, but it has been restarting on occasion. The server is meant to be running my game server 24/7, but when it restarts obviously the game goes down too.
I'm trying to setup a scheduled task to run the C++ game server EXE on start up, but it isn't working. I've already set a scheduled task to run WAMP so I know that the scheduled tasks actually work, but for the C++ EXE it just isn't.
I've even compiled a very simple program that just waits for user input before closing, and set this as a scheduled task. When I restart the server, this program doesn't even run.
Any ideas? Is this a problem specific to running an executable like this? | c++ | scheduled-tasks | null | null | null | 08/11/2011 06:47:54 | off topic | Scheduled task for C++ EXE not working
===
I've bought a VPS, but it has been restarting on occasion. The server is meant to be running my game server 24/7, but when it restarts obviously the game goes down too.
I'm trying to setup a scheduled task to run the C++ game server EXE on start up, but it isn't working. I've already set a scheduled task to run WAMP so I know that the scheduled tasks actually work, but for the C++ EXE it just isn't.
I've even compiled a very simple program that just waits for user input before closing, and set this as a scheduled task. When I restart the server, this program doesn't even run.
Any ideas? Is this a problem specific to running an executable like this? | 2 |
8,349,156 | 12/01/2011 22:24:02 | 1,076,400 | 12/01/2011 22:17:58 | 1 | 0 | Read file and add to database - PHP | I want to load a .txt file and loop through this to put data in a database.
text file format looks like this:
1231.24314, 112.341234, 34, text
34.13214234, 3455.1234, 11, text
There are hundreds of rows that I want to read out and save each row into a database in the right column
database will look something like this:
id, COLUMN1, COLUMN2, column3
How can I with the help of PHP loop through text file and save it into a database? | php | file | loops | read | null | 12/05/2011 09:56:17 | not a real question | Read file and add to database - PHP
===
I want to load a .txt file and loop through this to put data in a database.
text file format looks like this:
1231.24314, 112.341234, 34, text
34.13214234, 3455.1234, 11, text
There are hundreds of rows that I want to read out and save each row into a database in the right column
database will look something like this:
id, COLUMN1, COLUMN2, column3
How can I with the help of PHP loop through text file and save it into a database? | 1 |
9,171,669 | 02/07/2012 05:58:29 | 620,499 | 02/16/2011 23:01:00 | 410 | 2 | mysql - query to fetch most popular items which haven't been seen by user | Getting the most popular items is relatively easy. But let us say I have a table with two columns: item_id and viewer_id.
Given a viewer_id, I want to fetch the top X item_id rows which have been viewed the MOST times AND have not been viewed by the given viewer_id. So for example:
item_id | viewer_id
A | 1
A | 3
C | 2
C | 3
C | 4
D | 5
Getting most popular items not seen by viewer 2 should give back A, D.
What is a good way to go about this? | mysql | null | null | null | null | null | open | mysql - query to fetch most popular items which haven't been seen by user
===
Getting the most popular items is relatively easy. But let us say I have a table with two columns: item_id and viewer_id.
Given a viewer_id, I want to fetch the top X item_id rows which have been viewed the MOST times AND have not been viewed by the given viewer_id. So for example:
item_id | viewer_id
A | 1
A | 3
C | 2
C | 3
C | 4
D | 5
Getting most popular items not seen by viewer 2 should give back A, D.
What is a good way to go about this? | 0 |
3,559,158 | 08/24/2010 17:23:54 | 327,196 | 04/27/2010 19:28:43 | 58 | 0 | Use Powershell to create access 2007 Queries? | I have been following <a href="http://msmvps.com/blogs/richardsiddaway/archive/tags/Access/default.aspx">Richard Siddaway's Awesome Series on Powershell+Access2007</a>.
Unfortunately it ends before discussing creating/running/modifying access 2007 queries in powershell. How could this be done? | ms-access | powershell | query | null | null | null | open | Use Powershell to create access 2007 Queries?
===
I have been following <a href="http://msmvps.com/blogs/richardsiddaway/archive/tags/Access/default.aspx">Richard Siddaway's Awesome Series on Powershell+Access2007</a>.
Unfortunately it ends before discussing creating/running/modifying access 2007 queries in powershell. How could this be done? | 0 |
5,444,331 | 03/26/2011 18:27:47 | 276,959 | 02/19/2010 12:45:43 | 1,578 | 19 | I need help choosing a jQuery slider that works with the latest jQuery (1.5.1 as of writing) | There are too many out there and frankly I haven't the foggiest idea which works, which does not, which has issues, etc...
In the absence of a formal authority that reviews this stuff, I figured this would be the place to ask.
Can you recommend a jQuery slider (horizontal, carousel type) to display a set of titles, images, and some other internal layers? | jquery | jquery-plugins | recomendations | null | null | 07/31/2012 04:00:58 | off topic | I need help choosing a jQuery slider that works with the latest jQuery (1.5.1 as of writing)
===
There are too many out there and frankly I haven't the foggiest idea which works, which does not, which has issues, etc...
In the absence of a formal authority that reviews this stuff, I figured this would be the place to ask.
Can you recommend a jQuery slider (horizontal, carousel type) to display a set of titles, images, and some other internal layers? | 2 |
8,205,559 | 11/20/2011 23:09:25 | 1,056,908 | 11/20/2011 23:02:02 | 1 | 0 | DATA BASE MANAGEMENT | HI I HAVE TO DO THIS QUESTION FOR MY DATABASE CLASS, CAN SOMEONE PLEASE HELP?
Draw ERD to represent the following:
a) a professor does not have to teach a class, but can teach at most two classes, each class is taught by one and only one professor.
b) a customer can have many invoices and each invoice refers to one and only one customer. you may have customers that have not generated an invoice.
c) each team has many players and each player belongs to one team.
Thanx for you help. | database | null | null | null | null | 11/21/2011 00:27:20 | too localized | DATA BASE MANAGEMENT
===
HI I HAVE TO DO THIS QUESTION FOR MY DATABASE CLASS, CAN SOMEONE PLEASE HELP?
Draw ERD to represent the following:
a) a professor does not have to teach a class, but can teach at most two classes, each class is taught by one and only one professor.
b) a customer can have many invoices and each invoice refers to one and only one customer. you may have customers that have not generated an invoice.
c) each team has many players and each player belongs to one team.
Thanx for you help. | 3 |
11,543,439 | 07/18/2012 14:15:52 | 850,360 | 07/18/2011 16:00:17 | 143 | 1 | File uploader, latency issue or wrong setting on server | I have built a flash multi-file uploader, however it will upload the first few files then I get a #2038 error... My server guys say it is a latency issue, therefore it would be helpful if anyone could try uploading stuff using my uploader found here:
http://www.aucka.com/upload.php
I have also zipped up some images for you to test uploading.
http://www.aucka.com/test.zip
Please note it would require you select to upload all the images at once to see if it is working... If it fails an error should appear in the top right corner of the uploader.
If you are kind enough to help. could you state roughly where you are located and how many images you were able to upload before it crashed...
If anyone has any ideas why this script, which used to work fine no longer works on my server that would be very helpful...
kind regards J | php | flash | file-upload | webserver | null | 07/18/2012 14:19:45 | not a real question | File uploader, latency issue or wrong setting on server
===
I have built a flash multi-file uploader, however it will upload the first few files then I get a #2038 error... My server guys say it is a latency issue, therefore it would be helpful if anyone could try uploading stuff using my uploader found here:
http://www.aucka.com/upload.php
I have also zipped up some images for you to test uploading.
http://www.aucka.com/test.zip
Please note it would require you select to upload all the images at once to see if it is working... If it fails an error should appear in the top right corner of the uploader.
If you are kind enough to help. could you state roughly where you are located and how many images you were able to upload before it crashed...
If anyone has any ideas why this script, which used to work fine no longer works on my server that would be very helpful...
kind regards J | 1 |
702,449 | 03/31/2009 18:31:46 | 72,260 | 02/28/2009 17:51:45 | 1 | 0 | Can I build x64 app on a 32 bit machine? | How do I develop a 64bit app on a 32 bit PC?
I'm using VS 2008 on WinXP 32 bit. I set the visual studio linker to /machine:x64 and created x64 configurations. All will compile and link OK, but when I run the dependency walker on the exe I see the 64 bit mscvr90.dll, etc. pointing to all the Win32 dlls, Kernel32.dll, Advapi32, Comdlg32, Gdi32, etc.
When I copy the exe over to run on a Win64 system it is rejected "...application configuration is incorrect". How do I tell visual studio to stay away from the 32 bit realm? | visual-studio-2008 | x64 | null | null | null | null | open | Can I build x64 app on a 32 bit machine?
===
How do I develop a 64bit app on a 32 bit PC?
I'm using VS 2008 on WinXP 32 bit. I set the visual studio linker to /machine:x64 and created x64 configurations. All will compile and link OK, but when I run the dependency walker on the exe I see the 64 bit mscvr90.dll, etc. pointing to all the Win32 dlls, Kernel32.dll, Advapi32, Comdlg32, Gdi32, etc.
When I copy the exe over to run on a Win64 system it is rejected "...application configuration is incorrect". How do I tell visual studio to stay away from the 32 bit realm? | 0 |
7,399,995 | 09/13/2011 10:00:47 | 942,252 | 09/13/2011 10:00:47 | 1 | 0 | Save web page in local hard disk using Jquey or js click on imge button (like Ctrl-s event) | I have a image button named "save page" . I want add functionlty to save web page in local hard disk same like as "Ctrl-s" event do . Is It possible using jquery or js | save | null | null | null | null | null | open | Save web page in local hard disk using Jquey or js click on imge button (like Ctrl-s event)
===
I have a image button named "save page" . I want add functionlty to save web page in local hard disk same like as "Ctrl-s" event do . Is It possible using jquery or js | 0 |
9,032,716 | 01/27/2012 11:36:16 | 989,121 | 10/11/2011 08:40:52 | 2,196 | 96 | Amazon Web Services: python or ruby? | I'm about to start a fairly complex project involving AWS, particularly EC2, S3 and Dynamo, and try to decide which language to use. I know python and ruby, no java/net/php.
http://aws.amazon.com/ruby | http://aws.amazon.com/python
From my understanding, there's no official SDK for python, is [boto](http://code.google.com/p/boto) an adequate replacement?
Are there any tools/libraries in Ruby I'm going to miss if I choose Python (and vice versa)?
Which (AWS-related) community is bigger/better?
Please note: **this is not a question about what language is better or worse**! I'm only interested to hear which language has better support for AWS. | python | ruby | amazon-web-services | null | null | null | open | Amazon Web Services: python or ruby?
===
I'm about to start a fairly complex project involving AWS, particularly EC2, S3 and Dynamo, and try to decide which language to use. I know python and ruby, no java/net/php.
http://aws.amazon.com/ruby | http://aws.amazon.com/python
From my understanding, there's no official SDK for python, is [boto](http://code.google.com/p/boto) an adequate replacement?
Are there any tools/libraries in Ruby I'm going to miss if I choose Python (and vice versa)?
Which (AWS-related) community is bigger/better?
Please note: **this is not a question about what language is better or worse**! I'm only interested to hear which language has better support for AWS. | 0 |
8,006,218 | 11/04/2011 07:45:55 | 975,239 | 10/02/2011 08:43:13 | 6 | 0 | shell in the C Programming language | i want to write a shell in the Linux with C language.
what is the name of the Library and function use in this Project? thank you. | c | shell | operating-system | null | null | 11/04/2011 10:40:37 | not a real question | shell in the C Programming language
===
i want to write a shell in the Linux with C language.
what is the name of the Library and function use in this Project? thank you. | 1 |
9,771,726 | 03/19/2012 14:12:29 | 474,125 | 10/13/2010 06:33:22 | 11 | 0 | What to use with a big ERP Application, Postgresql or MySql with PHP ? | > What to use with a big ERP Application, Postgresql or MySql with PHP
> ?
i m near to develop a BIG ERP for textile insdustry,
can experts suggest me which db, is best form these two with PHP?
thanks in advance!
| php | mysql | postgresql | null | null | 03/19/2012 14:33:27 | not constructive | What to use with a big ERP Application, Postgresql or MySql with PHP ?
===
> What to use with a big ERP Application, Postgresql or MySql with PHP
> ?
i m near to develop a BIG ERP for textile insdustry,
can experts suggest me which db, is best form these two with PHP?
thanks in advance!
| 4 |
8,712,883 | 01/03/2012 13:18:23 | 82,609 | 03/25/2009 14:20:52 | 1,628 | 112 | Why is Java meta programmation support not better? | I've always asked myself this question, particularly when i see how JPA 2.0 metamodel works...
For exemple in JPA 2.0 we can, with a processor, for an entity Entity, create a metamodel class Entity_
It's then possible in JPA 2.0 Criteria api to use this metamodel to have strongly typed criterias.
For exemple, you would write:
criteriaBuilder.equal(u.get(User_.username), username);
Instead of using the fieldname as string "username".
I just wonder why it's not handled natively in Java, without having to deal with a processor and a couple of extra metadata classes.
It's not just for JPA, it could leverage too the reflection api.
So are there reasons why we can't access the metadata directly in the java classes?
Can someone provide a drawback of having such a feature?
I guess it may be a problem for encapsulation no?
-----------------------------------------
For more infos about JPA2 metamodel:
http://www.inze.be/andries/2010/09/19/jpa2-metamodel-example/
| java | reflection | jpa | metaprogramming | jpa-2.0 | 01/03/2012 14:53:26 | not constructive | Why is Java meta programmation support not better?
===
I've always asked myself this question, particularly when i see how JPA 2.0 metamodel works...
For exemple in JPA 2.0 we can, with a processor, for an entity Entity, create a metamodel class Entity_
It's then possible in JPA 2.0 Criteria api to use this metamodel to have strongly typed criterias.
For exemple, you would write:
criteriaBuilder.equal(u.get(User_.username), username);
Instead of using the fieldname as string "username".
I just wonder why it's not handled natively in Java, without having to deal with a processor and a couple of extra metadata classes.
It's not just for JPA, it could leverage too the reflection api.
So are there reasons why we can't access the metadata directly in the java classes?
Can someone provide a drawback of having such a feature?
I guess it may be a problem for encapsulation no?
-----------------------------------------
For more infos about JPA2 metamodel:
http://www.inze.be/andries/2010/09/19/jpa2-metamodel-example/
| 4 |
8,300,048 | 11/28/2011 17:47:18 | 876,605 | 08/03/2011 12:32:29 | 13 | 0 | Android Handler postDelayed executes twice | When I use Handler and its postDelayed method, the run() method executes twice. Below is part of my code.
Handler deneme = new Handler();
deneme.postDelayed(new Runnable() {
@Override
public void run()
{
randomOyna();
}
}, 1000);
where randomOyna is the method
public void randomOyna()
{
Log.v("sonOlarak", "çalıştı");
}
I monitor the LogCat and see that "çalıştı" entry is written twice, so that randomOyna is called twice. The task is scheduled truely, but executes both after 1 sec and 2 secs.
Can you help me??? | java | android | scheduled-tasks | handler | postdelayed | null | open | Android Handler postDelayed executes twice
===
When I use Handler and its postDelayed method, the run() method executes twice. Below is part of my code.
Handler deneme = new Handler();
deneme.postDelayed(new Runnable() {
@Override
public void run()
{
randomOyna();
}
}, 1000);
where randomOyna is the method
public void randomOyna()
{
Log.v("sonOlarak", "çalıştı");
}
I monitor the LogCat and see that "çalıştı" entry is written twice, so that randomOyna is called twice. The task is scheduled truely, but executes both after 1 sec and 2 secs.
Can you help me??? | 0 |
2,440,851 | 03/14/2010 01:34:06 | 215,324 | 11/20/2009 10:16:16 | 81 | 11 | Slow rendering of pages due to User Controls. | How would you troubleshoot a page that is rendering slowly in ASP.NET?
This issue is happening on only specific pages with a few user controls. Other pages work fine. Tracing has clarified that the issue is happening between "Begin Render" and "End Render".
| asp.net | performance | null | null | null | null | open | Slow rendering of pages due to User Controls.
===
How would you troubleshoot a page that is rendering slowly in ASP.NET?
This issue is happening on only specific pages with a few user controls. Other pages work fine. Tracing has clarified that the issue is happening between "Begin Render" and "End Render".
| 0 |
4,987,988 | 02/14/2011 00:52:42 | 527,464 | 12/02/2010 03:24:32 | 79 | 11 | How to remove hiss from audio tracks | Any advice on how to process audio to remove background hiss? I _don't_ need to do this programatically--just to preprocess my sounds for inclusion in my program. I am particularly interested in iMac tools, though Linux and Windows ones are of interest also. Any free tools?
Thanks in advance. | audio | signal-processing | audio-recording | null | null | 02/15/2011 15:41:18 | off topic | How to remove hiss from audio tracks
===
Any advice on how to process audio to remove background hiss? I _don't_ need to do this programatically--just to preprocess my sounds for inclusion in my program. I am particularly interested in iMac tools, though Linux and Windows ones are of interest also. Any free tools?
Thanks in advance. | 2 |
9,123,211 | 02/03/2012 03:14:48 | 1,186,612 | 02/03/2012 03:02:44 | 1 | 0 | C# Error : Data is Null. This method or property cannot be called on Null values | Im having an error when Im trying to click the button that shows the form which contains a listview
any idea or other way to get rid of this error will be appreciated. :)
private void ManageOfficeSupplies_Load(object sender, EventArgs e)
{
listviewOfficeSupplies.Items.Clear();
StreamReader sr = new StreamReader("Connect.txt");
//Read the first line of text
connectionString = sr.ReadLine();
//close the file
sr.Close();
SqlConnection conn = null;
SqlCommand cmd = null;
conn = new SqlConnection(connectionString);
cmd = conn.CreateCommand();
cmd.CommandText = "Select name,quantity From ComputerNodes";
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
ListViewItem lvi = new ListViewItem(rdr.GetString(0)); <---Data is Null. This method or property cannot be called on Null values.
lvi.SubItems.Add(rdr[1].ToString());
listviewOfficeSupplies.Items.Add(lvi);
}
rdr.Dispose();
rdr.Close();
conn.Close();
} | mysql | null | null | null | null | 02/03/2012 08:07:06 | not a real question | C# Error : Data is Null. This method or property cannot be called on Null values
===
Im having an error when Im trying to click the button that shows the form which contains a listview
any idea or other way to get rid of this error will be appreciated. :)
private void ManageOfficeSupplies_Load(object sender, EventArgs e)
{
listviewOfficeSupplies.Items.Clear();
StreamReader sr = new StreamReader("Connect.txt");
//Read the first line of text
connectionString = sr.ReadLine();
//close the file
sr.Close();
SqlConnection conn = null;
SqlCommand cmd = null;
conn = new SqlConnection(connectionString);
cmd = conn.CreateCommand();
cmd.CommandText = "Select name,quantity From ComputerNodes";
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
ListViewItem lvi = new ListViewItem(rdr.GetString(0)); <---Data is Null. This method or property cannot be called on Null values.
lvi.SubItems.Add(rdr[1].ToString());
listviewOfficeSupplies.Items.Add(lvi);
}
rdr.Dispose();
rdr.Close();
conn.Close();
} | 1 |
2,435,482 | 03/12/2010 20:00:55 | 97,925 | 04/29/2009 19:50:38 | 202 | 13 | Windows Mobile: "My network card connects to" registry settings | Can anybody please tell me the registry setting(s) that are affected in Windows Mobile 6.1 when a user selects Start -> Settings -> Connections -> Wi-Fi and then changes the value of the "My network card connects to" drop down list on the "Network Adapters" tab?
I have a device that seems to default this to "The Internet" when in fact the Wi-Fi connects to the corporate network and I would like to be able to change this programatically rather than expecting 250+ users to have to do it manually every time they reboot their devices.
Thanks. | windows-mobile | registry | networking | configuration | connection-manager | null | open | Windows Mobile: "My network card connects to" registry settings
===
Can anybody please tell me the registry setting(s) that are affected in Windows Mobile 6.1 when a user selects Start -> Settings -> Connections -> Wi-Fi and then changes the value of the "My network card connects to" drop down list on the "Network Adapters" tab?
I have a device that seems to default this to "The Internet" when in fact the Wi-Fi connects to the corporate network and I would like to be able to change this programatically rather than expecting 250+ users to have to do it manually every time they reboot their devices.
Thanks. | 0 |
5,456,421 | 03/28/2011 08:30:42 | 261,682 | 01/29/2010 09:16:02 | 539 | 24 | Issue with slideDown in IE | I have this line of code:
<SCRIPT type=text/javascript>$(document).ready(function(){$("#StraightFoods").next("div.menu_body").slideDown("slow");});</SCRIPT>
that works in firefox but for some reason triggers errors in IE and stops the rest of the JQuery working on my page. When viewing in IE, I see errors loading the page which directs me to this section in JQuery.js:
Line 4031 Char 5:
jQuery.extend( jQuery.fx, {
speeds:{
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function(fx){
jQuery.attr(fx.elem.style, "opacity", fx.now);
},
_default: function(fx){
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
fx.elem.style[ fx.prop ] = fx.now + fx.unit; //Error Line!!
else
fx.elem[ fx.prop ] = fx.now;
}
}
});
If I comment out the if / else section, my page works fine but keeping it in causes slideDown to break the rest of my page. Any ideas? | jquery | null | null | null | null | null | open | Issue with slideDown in IE
===
I have this line of code:
<SCRIPT type=text/javascript>$(document).ready(function(){$("#StraightFoods").next("div.menu_body").slideDown("slow");});</SCRIPT>
that works in firefox but for some reason triggers errors in IE and stops the rest of the JQuery working on my page. When viewing in IE, I see errors loading the page which directs me to this section in JQuery.js:
Line 4031 Char 5:
jQuery.extend( jQuery.fx, {
speeds:{
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function(fx){
jQuery.attr(fx.elem.style, "opacity", fx.now);
},
_default: function(fx){
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
fx.elem.style[ fx.prop ] = fx.now + fx.unit; //Error Line!!
else
fx.elem[ fx.prop ] = fx.now;
}
}
});
If I comment out the if / else section, my page works fine but keeping it in causes slideDown to break the rest of my page. Any ideas? | 0 |
3,234,123 | 07/13/2010 04:06:17 | 31,671 | 10/27/2008 01:07:58 | 13,995 | 704 | Using the `set` datatype in MySQL | I just came across a requirement of labeling a user as 1 of 3 different roles. Normally I have used an id, but the roles don't really relate to each other at all.
I had a look at the set datatype, and I added the 3 different options.
- Will the database internally just store the index of the set, e.g. if the set is `set('a', 'b', 'c')` and I choose `a`, will it store `a` or the index `0`?
- I haven't seen this datatype used before when looking at other people's databases. Is it bad practice? Is using an id (perhaps `role_id` which maps to a table `roles`) a better idea?
Thanks | mysql | null | null | null | null | null | open | Using the `set` datatype in MySQL
===
I just came across a requirement of labeling a user as 1 of 3 different roles. Normally I have used an id, but the roles don't really relate to each other at all.
I had a look at the set datatype, and I added the 3 different options.
- Will the database internally just store the index of the set, e.g. if the set is `set('a', 'b', 'c')` and I choose `a`, will it store `a` or the index `0`?
- I haven't seen this datatype used before when looking at other people's databases. Is it bad practice? Is using an id (perhaps `role_id` which maps to a table `roles`) a better idea?
Thanks | 0 |
582,715 | 02/24/2009 17:33:45 | 1,950 | 08/19/2008 14:57:18 | 842 | 26 | How to start recognizing design patterns as you are programming | I have general academic knowledge of the various design patterns that are discussed in GoF and Head First Design Patterns, but I have a difficult time applying them to the code that I am writing. A goal for me this year is to be able to recognize design patterns that are emerging from the code that I write.
Obviously this comes with experience (i have about 2 years in the field), but my question is how can I jumpstart my ability to recognize design patterns as I am coding, maybe a suggestion as to what patterns are easiest to start applying in client-server applications (in my case mainly c# webforms with ms sql db's, but this could definately be language agnostic). | design-patterns | work-experience | c# | language-agnostic | null | 01/28/2012 01:07:38 | off topic | How to start recognizing design patterns as you are programming
===
I have general academic knowledge of the various design patterns that are discussed in GoF and Head First Design Patterns, but I have a difficult time applying them to the code that I am writing. A goal for me this year is to be able to recognize design patterns that are emerging from the code that I write.
Obviously this comes with experience (i have about 2 years in the field), but my question is how can I jumpstart my ability to recognize design patterns as I am coding, maybe a suggestion as to what patterns are easiest to start applying in client-server applications (in my case mainly c# webforms with ms sql db's, but this could definately be language agnostic). | 2 |
3,582,487 | 08/27/2010 08:32:07 | 110,514 | 05/21/2009 13:22:56 | 318 | 5 | Is it safe to empty the tmp folder from Jboss/Server/default ? | I'm using JBoss 5.1.0.GA, I notticed the tmp folder at: server/default/tmp is mora than 1GB big.
Can I safely delete all the files in it? | jboss | jboss5.x | null | null | null | null | open | Is it safe to empty the tmp folder from Jboss/Server/default ?
===
I'm using JBoss 5.1.0.GA, I notticed the tmp folder at: server/default/tmp is mora than 1GB big.
Can I safely delete all the files in it? | 0 |
11,485,704 | 07/14/2012 17:05:46 | 1,361,941 | 04/27/2012 20:17:07 | 196 | 12 | Where to put methods? | I have data objects with methods for loading, saving, updating data. Then I have objects for more complex manipulation of this data, and to this end they require elaborated data from the data object.
So I started adding methods to the data object for answering specific questions which the manipulating objects need to know. The manipulating objects only have methods strictly related to manipulation or to some feature while info on the data object is elaborated by it. The manipulating objects asks and the manipulated object responds. That is how I imagined it at first. Then I realised they could as well be methods of the manipulating objects or extension methods.
I feel the data object is starting to have too many methods related to specific features, and more are to come. Since these features are mainly managed by the manipulating objects, they could be moved and distributed between them. The problem is some of these methods are used by different manipulating objects and manipulating objects are full enough of methods which are specifically related to manipulation. So another option would be to implement them as static extension methods and place them in the namespace where such works are carried out (so they are only visible from the working area but can be called by other objects if need be).
The question is where to put methods that:
- give info elaborated from data object info (public info), without any kind of manipulation
- are for the specific use of one or a few other objects for specific features (manipulation mainly, but also queries and presentation)
- (some use helper business objects, some only depend on the data object and require nothing else)
Should they belong to:
- the data object
- the manipulating objects
- to a static helper class in business namespace ?
I suppose the answer depends a lot on which methods we are talking about, on the design of the application, etc. so I understand specific advice may be difficult to give, but I would appreciate any tips which help me make a decision in this and other cases.
In a nutshell:
**What are the criteria or what questions should I ask myself in order to choose where to put methods?** | .net | design | methods | null | null | 07/18/2012 02:32:58 | not constructive | Where to put methods?
===
I have data objects with methods for loading, saving, updating data. Then I have objects for more complex manipulation of this data, and to this end they require elaborated data from the data object.
So I started adding methods to the data object for answering specific questions which the manipulating objects need to know. The manipulating objects only have methods strictly related to manipulation or to some feature while info on the data object is elaborated by it. The manipulating objects asks and the manipulated object responds. That is how I imagined it at first. Then I realised they could as well be methods of the manipulating objects or extension methods.
I feel the data object is starting to have too many methods related to specific features, and more are to come. Since these features are mainly managed by the manipulating objects, they could be moved and distributed between them. The problem is some of these methods are used by different manipulating objects and manipulating objects are full enough of methods which are specifically related to manipulation. So another option would be to implement them as static extension methods and place them in the namespace where such works are carried out (so they are only visible from the working area but can be called by other objects if need be).
The question is where to put methods that:
- give info elaborated from data object info (public info), without any kind of manipulation
- are for the specific use of one or a few other objects for specific features (manipulation mainly, but also queries and presentation)
- (some use helper business objects, some only depend on the data object and require nothing else)
Should they belong to:
- the data object
- the manipulating objects
- to a static helper class in business namespace ?
I suppose the answer depends a lot on which methods we are talking about, on the design of the application, etc. so I understand specific advice may be difficult to give, but I would appreciate any tips which help me make a decision in this and other cases.
In a nutshell:
**What are the criteria or what questions should I ask myself in order to choose where to put methods?** | 4 |
2,206,546 | 02/05/2010 10:36:42 | 117,352 | 06/04/2009 13:39:14 | 968 | 130 | Optimize Select Query | I am using SQL 2000, and I am running a simple select statement on a table containing about 30 million rows. The select query looks like:
select col1, col2, col3 from Table1 where col4=@col4 and col5=@col5 and col6=@col6
The table has a clustered index in it (i.e. a primary key), but that is not being used as a where criteria. All the where criterias mentioned above have no indexed in them.
How can I optimize this query?
If I add indexes for each column in the where clause, would that make any difference?
**Edit:** This is probably one of the most common interview question :) | sql | query | optimization | discussion | null | 04/05/2012 15:01:53 | not a real question | Optimize Select Query
===
I am using SQL 2000, and I am running a simple select statement on a table containing about 30 million rows. The select query looks like:
select col1, col2, col3 from Table1 where col4=@col4 and col5=@col5 and col6=@col6
The table has a clustered index in it (i.e. a primary key), but that is not being used as a where criteria. All the where criterias mentioned above have no indexed in them.
How can I optimize this query?
If I add indexes for each column in the where clause, would that make any difference?
**Edit:** This is probably one of the most common interview question :) | 1 |
11,598,889 | 07/22/2012 08:50:22 | 801,496 | 06/16/2011 12:57:47 | 109 | 13 | Sending HTTP request and parsing JSON response in C# | What's the best way to send HTTP (GET) request and parse JSON response in C# (windows phone silverlight application). Can anybody give me an example? | c# | silverlight | windows-phone-7 | null | null | 07/23/2012 13:57:22 | not constructive | Sending HTTP request and parsing JSON response in C#
===
What's the best way to send HTTP (GET) request and parse JSON response in C# (windows phone silverlight application). Can anybody give me an example? | 4 |
11,539,356 | 07/18/2012 10:32:30 | 905,194 | 08/22/2011 03:17:34 | 1 | 0 | I am turning my quote into java code so I can get a tattoo of it | public class Life {
Person you = new Person();
World myWorld = new World();
public void main() {
if(!you.selfDiscipline){
myWorld.Discipline(you);
}
}
}
Here is my quote: If you do not discipline yourself then the world will do it for you.
Would you say that code translates it pretty well? | java | null | null | null | null | 07/18/2012 10:43:27 | not constructive | I am turning my quote into java code so I can get a tattoo of it
===
public class Life {
Person you = new Person();
World myWorld = new World();
public void main() {
if(!you.selfDiscipline){
myWorld.Discipline(you);
}
}
}
Here is my quote: If you do not discipline yourself then the world will do it for you.
Would you say that code translates it pretty well? | 4 |
2,606,761 | 04/09/2010 10:49:53 | 289,573 | 03/09/2010 11:00:05 | 6 | 1 | Event problems with FF | Made this sweet little script to auto change fields after input. Works nicely in IE, Chrome and Safari, but not in FF or opera.
JS code:
function fieldChange(id, e){
var keyID = (window.event) ? event.keyCode : e.keyCode;
if (document.getElementById(id).value.length >= 2){
if (keyID >= 48 && keyID <= 57 || keyID >= 96 && keyID <= 105){
switch(id){
case "textf1":
document.getElementById("textf2").focus();
break;
case "textf2":
document.getElementById("textf3").focus();
break;
case "textf3":
if (document.getElementById(id).value.length >= 4){
document.getElementById("nubPcode").focus();
}
break;
}
}
}
HTML:
<div class="privateOrderSchema">
<input type="text" id="textf1" name="textf1" maxlength="2" size="4" onKeyUp="fieldChange('textf1')"/>-
<input type="text" id="textf2" name="textf2" maxlength="2" size="4" onKeyUp="fieldChange('textf2')" />-
<input type="text" id="textf3" name="textf3" maxlength="4" size="5" onKeyUp="fieldChange('textf3')" />
</div>
<div class="privateOrderSchema">
<input type="text" id="nubPcode" name="nubPcode" size="4" maxlength="4" />
<br />
</div>
Does anybody know how to send the "e" var in this scenario?
Tnx all :D ur gr8! | javascript | firefox | html | events | null | null | open | Event problems with FF
===
Made this sweet little script to auto change fields after input. Works nicely in IE, Chrome and Safari, but not in FF or opera.
JS code:
function fieldChange(id, e){
var keyID = (window.event) ? event.keyCode : e.keyCode;
if (document.getElementById(id).value.length >= 2){
if (keyID >= 48 && keyID <= 57 || keyID >= 96 && keyID <= 105){
switch(id){
case "textf1":
document.getElementById("textf2").focus();
break;
case "textf2":
document.getElementById("textf3").focus();
break;
case "textf3":
if (document.getElementById(id).value.length >= 4){
document.getElementById("nubPcode").focus();
}
break;
}
}
}
HTML:
<div class="privateOrderSchema">
<input type="text" id="textf1" name="textf1" maxlength="2" size="4" onKeyUp="fieldChange('textf1')"/>-
<input type="text" id="textf2" name="textf2" maxlength="2" size="4" onKeyUp="fieldChange('textf2')" />-
<input type="text" id="textf3" name="textf3" maxlength="4" size="5" onKeyUp="fieldChange('textf3')" />
</div>
<div class="privateOrderSchema">
<input type="text" id="nubPcode" name="nubPcode" size="4" maxlength="4" />
<br />
</div>
Does anybody know how to send the "e" var in this scenario?
Tnx all :D ur gr8! | 0 |
4,104,198 | 11/05/2010 07:43:37 | 355,005 | 06/01/2010 01:54:41 | 454 | 49 | what kinds of database server? | dear all..i want to make DB but i'm just know MYSQL and PostgreSQL. Can you tell what kind of DB server? | database | null | null | null | null | 04/20/2012 12:27:47 | not constructive | what kinds of database server?
===
dear all..i want to make DB but i'm just know MYSQL and PostgreSQL. Can you tell what kind of DB server? | 4 |
11,634,274 | 07/24/2012 15:31:36 | 571,907 | 01/11/2011 21:38:31 | 1,018 | 32 | Is it safe to attach an event listener to $(document) before DOM ready? | Is the following code safe? Will `document` be available?
<html>
<head>
<script type="text/javascript">
$(document).delegate(".my-class", "click", function() { /* do something here */ } );
</script>
</head>
</html> | jquery | dom | null | null | null | null | open | Is it safe to attach an event listener to $(document) before DOM ready?
===
Is the following code safe? Will `document` be available?
<html>
<head>
<script type="text/javascript">
$(document).delegate(".my-class", "click", function() { /* do something here */ } );
</script>
</head>
</html> | 0 |
4,204,782 | 11/17/2010 13:25:11 | 502,293 | 11/09/2010 18:48:19 | 18 | 1 | Can't get Galleria in iframe to load without refreshing - what's wrong? | I've been having crazy hell with getting Galleria to load in an initially hidden iframe without manually refreshing said iframe.
I am getting an error in Error Console from galleria.js, reporting 'Width & Height not found', so I've tried to set them manually about five different ways, including:
<script>
Galleria.loadTheme('/galleria/themes/classic/galleria.classic.js');
$('#gallery').galleria({
height: 450,
width: 1024
});
</script>
I've got a modified script (Slicker Show & Hide) that vanishes the iframe before the page loads, and I think this may be causing the problem, but I can't seem to find a way around it - something like making it appear offscreen, and then when called hide, move onscreen and show?
I also have a problem with my qTips not loading all the time. Is this all to do with timings or something? Would a pre-loader or something help fix this?
The site is live <a href="http://portiaab.com/rainbowwhitebg1024.html">here</a>
If anyone could please give me a hand, I'd love to get this set up so I can move on!
Cheers | jquery-plugins | iframe | galleria | null | null | null | open | Can't get Galleria in iframe to load without refreshing - what's wrong?
===
I've been having crazy hell with getting Galleria to load in an initially hidden iframe without manually refreshing said iframe.
I am getting an error in Error Console from galleria.js, reporting 'Width & Height not found', so I've tried to set them manually about five different ways, including:
<script>
Galleria.loadTheme('/galleria/themes/classic/galleria.classic.js');
$('#gallery').galleria({
height: 450,
width: 1024
});
</script>
I've got a modified script (Slicker Show & Hide) that vanishes the iframe before the page loads, and I think this may be causing the problem, but I can't seem to find a way around it - something like making it appear offscreen, and then when called hide, move onscreen and show?
I also have a problem with my qTips not loading all the time. Is this all to do with timings or something? Would a pre-loader or something help fix this?
The site is live <a href="http://portiaab.com/rainbowwhitebg1024.html">here</a>
If anyone could please give me a hand, I'd love to get this set up so I can move on!
Cheers | 0 |
10,277,207 | 04/23/2012 08:31:02 | 1,318,654 | 04/07/2012 05:55:22 | 7 | 0 | sending Activity to Back and Front | I have many more Activity in my android Application and SMS Service that run in background.
Actually my main Activity is ZigbeeActivity.java on which I have an Exit Button when I got click on Exit I wish to application sent to background for doing this I use MoveTaskToBack method and now my smsService is running at background wchich receice sms but when I run my Zigbee Activity again from my application installed on Device it get start but does not show any data hold on it i think it will start new Zigbee application Sir pl tell me how I can call my application on forground pl tell me
thanks
I am tagging the code of onCreate Method to start service.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try{
setContentView(R.layout.main);
startService(new Intent(this,SmsService.class));
}catch(Exception e){}
}
this is the code for sending activity to background
case R.id.btnExit:
ConstantClass.Clear_Main_Screen = false;
moveTaskToBack(true);
break; | java | android | eclipse | null | null | null | open | sending Activity to Back and Front
===
I have many more Activity in my android Application and SMS Service that run in background.
Actually my main Activity is ZigbeeActivity.java on which I have an Exit Button when I got click on Exit I wish to application sent to background for doing this I use MoveTaskToBack method and now my smsService is running at background wchich receice sms but when I run my Zigbee Activity again from my application installed on Device it get start but does not show any data hold on it i think it will start new Zigbee application Sir pl tell me how I can call my application on forground pl tell me
thanks
I am tagging the code of onCreate Method to start service.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try{
setContentView(R.layout.main);
startService(new Intent(this,SmsService.class));
}catch(Exception e){}
}
this is the code for sending activity to background
case R.id.btnExit:
ConstantClass.Clear_Main_Screen = false;
moveTaskToBack(true);
break; | 0 |
5,595,242 | 04/08/2011 12:47:25 | 237,743 | 12/23/2009 16:46:58 | 1,328 | 67 | Help me understand JS + CSS + HTML = Cool UI | I have been working on the UI since year or two. Many times i have satisfied myself with the JQuery, YUI and Prototype. But gradually i have been feeling the need to understand how these small things are assembled together.
I am able to find basics of CSS, JS and HTML with good books and blogs. But main mysteries i think lies in the UI component as a whole which is finished product of smart JS, CSS and HTML markup tricks.
Say for example a simple slick sliding div appearing and disparaging on the UI. Classic feature reach tables which are sortable, deletion operation slowly eating the row and stuff.
I would like to get into the basics of how these small small things and patters are implemented and integrated to form whole picture. Can some one guide me into this please. | javascript | html | css | usability | null | 04/11/2011 17:58:50 | not a real question | Help me understand JS + CSS + HTML = Cool UI
===
I have been working on the UI since year or two. Many times i have satisfied myself with the JQuery, YUI and Prototype. But gradually i have been feeling the need to understand how these small things are assembled together.
I am able to find basics of CSS, JS and HTML with good books and blogs. But main mysteries i think lies in the UI component as a whole which is finished product of smart JS, CSS and HTML markup tricks.
Say for example a simple slick sliding div appearing and disparaging on the UI. Classic feature reach tables which are sortable, deletion operation slowly eating the row and stuff.
I would like to get into the basics of how these small small things and patters are implemented and integrated to form whole picture. Can some one guide me into this please. | 1 |
61,826 | 09/15/2008 03:26:46 | 6,377 | 09/15/2008 03:26:46 | 1 | 0 | What should I learn next after VB and C# | I am currently learning VB and C# and have been for the last two and a bit years but I would really like to broaden my programming skills a little bit.
I was just wondering what people would recommend learning?
I have looked into ruby a little bit but haven't really dug my teeth into it, I have also looked into F#.
I can't really decide which way I should go. | vb.net | null | null | null | null | 05/11/2012 11:53:35 | not constructive | What should I learn next after VB and C#
===
I am currently learning VB and C# and have been for the last two and a bit years but I would really like to broaden my programming skills a little bit.
I was just wondering what people would recommend learning?
I have looked into ruby a little bit but haven't really dug my teeth into it, I have also looked into F#.
I can't really decide which way I should go. | 4 |
11,604,525 | 07/22/2012 22:34:00 | 1,544,568 | 07/22/2012 22:25:37 | 1 | 0 | iPhone development resources? | Can anybody assist? I'm VERY new (2 days into it!) to iPhone development. I'm using a Mac Mini running Lion, using Xcode 4 and MonoTouch. I'm a C sharp developer from a Windows Desktop, Mobile and Web (aspx and MVC-3) background. This Mac stuff is all new and it's a learning curve for me. I'm looking for some good resources, tutorials etc. that I can use to teach my brain how to code this iPhone and iPad lark.
I've cracked Web Services and communicating with them but I'm having trouble with [the basics like] populating tables, opening a link in Safari, using local databases etc and it's very frustrating being that I can do all this in my sleep in a Windows (Visual Studio) environment.
I would very much appreciate ANY help here guys, a pointer in the right direction (either with my current problems or sites)... thank you in advance! :) | iphone | ios | ios5 | xcode4 | monotouch | 07/22/2012 22:51:45 | not constructive | iPhone development resources?
===
Can anybody assist? I'm VERY new (2 days into it!) to iPhone development. I'm using a Mac Mini running Lion, using Xcode 4 and MonoTouch. I'm a C sharp developer from a Windows Desktop, Mobile and Web (aspx and MVC-3) background. This Mac stuff is all new and it's a learning curve for me. I'm looking for some good resources, tutorials etc. that I can use to teach my brain how to code this iPhone and iPad lark.
I've cracked Web Services and communicating with them but I'm having trouble with [the basics like] populating tables, opening a link in Safari, using local databases etc and it's very frustrating being that I can do all this in my sleep in a Windows (Visual Studio) environment.
I would very much appreciate ANY help here guys, a pointer in the right direction (either with my current problems or sites)... thank you in advance! :) | 4 |
6,503,489 | 06/28/2011 08:12:31 | 743,464 | 05/07/2011 21:57:09 | 58 | 4 | Mercurial show number of commits ahead of "origin" | I'm thinking in git terms here ... is it possible to see how many local commits you have made ahead of the origin? As in git, if you type `git status` it will tell you
Your branch is ahead of blah by blah blah
Is there a similar thing in Mercurial? I know there is hg outgoing but I don't want a command that hits the server as I want to put the output in my prompt (like the commonly implemented bashrc funciton `num_git_commits_ahead`) | git | bash | mercurial | null | null | null | open | Mercurial show number of commits ahead of "origin"
===
I'm thinking in git terms here ... is it possible to see how many local commits you have made ahead of the origin? As in git, if you type `git status` it will tell you
Your branch is ahead of blah by blah blah
Is there a similar thing in Mercurial? I know there is hg outgoing but I don't want a command that hits the server as I want to put the output in my prompt (like the commonly implemented bashrc funciton `num_git_commits_ahead`) | 0 |
11,693,557 | 07/27/2012 18:25:00 | 1,385,253 | 05/09/2012 17:25:25 | 1 | 0 | How to setup new cron task from php? | How to setup new cron task from php using Parallel Plesk Panel on site? | php | cron | task | null | null | 07/27/2012 18:41:04 | not a real question | How to setup new cron task from php?
===
How to setup new cron task from php using Parallel Plesk Panel on site? | 1 |
4,896,011 | 02/04/2011 08:39:57 | 355,325 | 06/01/2010 11:11:15 | 589 | 10 | Mathematica - Separating Notebooks | Is there a way to separate open Mathematica notebooks so that they don't share any variables? How about making it so some variables are shared but not all? | mathematica | null | null | null | null | 03/25/2012 17:09:50 | off topic | Mathematica - Separating Notebooks
===
Is there a way to separate open Mathematica notebooks so that they don't share any variables? How about making it so some variables are shared but not all? | 2 |
11,637,830 | 07/24/2012 19:19:29 | 1,147,529 | 01/13/2012 10:48:28 | 919 | 60 | JDeveloper vs IntelliJ IDEA | Recently I have started work in one company. Previously I was working only with IntelliJ. Now have to wait while I get to use IntelliJ again. So I am thinking of any IDE similar to IntelliJ. How about the JDeveloper, probably somebody is been using it already, so I would like to hear from people their opinions, who is already using it, and not the comments "how great this tool is" from it's documentation. | java | ide | intellij-idea | jdeveloper | null | 07/24/2012 19:26:01 | not constructive | JDeveloper vs IntelliJ IDEA
===
Recently I have started work in one company. Previously I was working only with IntelliJ. Now have to wait while I get to use IntelliJ again. So I am thinking of any IDE similar to IntelliJ. How about the JDeveloper, probably somebody is been using it already, so I would like to hear from people their opinions, who is already using it, and not the comments "how great this tool is" from it's documentation. | 4 |
9,125,015 | 02/03/2012 07:15:51 | 1,129,142 | 01/04/2012 03:59:07 | 36 | 0 | How to call a php function? | how do I call this function to my html page I where I want the forms to appear?
<?php
function login_bar() {
global $user;
if ($user->uid == 0 ) {
$form = drupal_get_form('horizontal_login_block');
return render($form);
} else {
// you can also integrate other module such as private message to show unread / read messages here
return '<div id="loginbar"><p>' . t('Welcome back ') . ucwords($user->name) . '<p></div>';
}
}
?> | php | function | drupal | login | null | 02/05/2012 04:26:01 | not a real question | How to call a php function?
===
how do I call this function to my html page I where I want the forms to appear?
<?php
function login_bar() {
global $user;
if ($user->uid == 0 ) {
$form = drupal_get_form('horizontal_login_block');
return render($form);
} else {
// you can also integrate other module such as private message to show unread / read messages here
return '<div id="loginbar"><p>' . t('Welcome back ') . ucwords($user->name) . '<p></div>';
}
}
?> | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.