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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
913,548 | 05/27/2009 01:23:38 | 80,857 | 03/21/2009 12:59:22 | 13 | 3 | Whats the most popular Linux distro for a USB flash drive? | I want to put Linux on a USB flash drive in order to run some extension to Pure Data that aren't support for Windows. Is there a particular distro that everyone is using for Linux on a flash drive? | usb | flash-drives | linux | distro | popularity | 05/27/2009 01:29:06 | off topic | Whats the most popular Linux distro for a USB flash drive?
===
I want to put Linux on a USB flash drive in order to run some extension to Pure Data that aren't support for Windows. Is there a particular distro that everyone is using for Linux on a flash drive? | 2 |
10,613,871 | 05/16/2012 07:27:40 | 1,348,702 | 04/21/2012 19:14:57 | 44 | 0 | perform contains operation for hashtable | I have a hashtable "listUserEvents' which is of the form string,vector. I am trying to see if the hashtable has some data for the given string or not.
listUserEvents = getUserInfo();
for (int i = 0; i < compareEventData.size(); i++) {
EventData eventForExistingDate = (EventData) compareEventData.elementAt(i);
//here i want to check if listUserEvents the hashtable has eventForExistingDate.getSummary() for string "hello"
}
how to perform this?
| java | vector | hashtable | null | null | null | open | perform contains operation for hashtable
===
I have a hashtable "listUserEvents' which is of the form string,vector. I am trying to see if the hashtable has some data for the given string or not.
listUserEvents = getUserInfo();
for (int i = 0; i < compareEventData.size(); i++) {
EventData eventForExistingDate = (EventData) compareEventData.elementAt(i);
//here i want to check if listUserEvents the hashtable has eventForExistingDate.getSummary() for string "hello"
}
how to perform this?
| 0 |
8,304,383 | 11/29/2011 00:43:12 | 724,403 | 04/25/2011 21:28:34 | 21 | 0 | Passing stored cookies from PHP crawler to Javascript and using them | How would I accomplish this? I'm using curl with PHP on the server, then executing the postback function in my browser through Javascript. The server handles the login and navigation, but after much trial and error it seems I need to access the client side functions to get the data I need.
How would I use the cookies from the Javascript end? I apologize if this seems like too simple a question, but I'm having a very difficult time finding good information on the topic and my knowledge of Javascript is minimal.
For a reference to other related questions, see here:
http://stackoverflow.com/questions/8303474/using-curl-on-server-how-to-redirect-javascript-requests-to-target-server
For the most part however, this and the one prior to that have been worked around in other ways and this is my current roadblock. | php | javascript | cookies | null | null | null | open | Passing stored cookies from PHP crawler to Javascript and using them
===
How would I accomplish this? I'm using curl with PHP on the server, then executing the postback function in my browser through Javascript. The server handles the login and navigation, but after much trial and error it seems I need to access the client side functions to get the data I need.
How would I use the cookies from the Javascript end? I apologize if this seems like too simple a question, but I'm having a very difficult time finding good information on the topic and my knowledge of Javascript is minimal.
For a reference to other related questions, see here:
http://stackoverflow.com/questions/8303474/using-curl-on-server-how-to-redirect-javascript-requests-to-target-server
For the most part however, this and the one prior to that have been worked around in other ways and this is my current roadblock. | 0 |
9,241,809 | 02/11/2012 16:25:40 | 792,826 | 06/10/2011 13:38:58 | 42 | 1 | Overloads with sendmail on Linux server | We're having trouble with a script our our server that uses sendmail to send a large (opt-in) mailing list. The script sends a batch of emails (currently 100), waits a bit (currently 25 seconds), and then sends another batch.
When we first set this up it ran perfectly. We do a mailing every week or two, and after a few mailings we started getting very high server loads as reported by WHM. We have a dual core machine, so the server load should never go over 2. At one point, after the script had been running unattended for several hours, it was 5000! Memory usage was also up to over 97%.
We cut the batch size, increased the delay, but we still have to monitor the mailing constantly. We went in with top to see what was happening but the only thing we could tell for certain was that sendmail was basically taking over the server.
I don't have a lot of experience with Linux. If this was Windows I'd look for disc fragmentation, but I think Linux is not subject to that kind of problem. The mailing list includes over 400,000 names. When we first started using the script there were no problems, and the problems seem to be getting worse over time.
Any ideas as to what the problem might be or a way to fix it? | linux | script | sendmail | null | null | 02/12/2012 23:27:47 | off topic | Overloads with sendmail on Linux server
===
We're having trouble with a script our our server that uses sendmail to send a large (opt-in) mailing list. The script sends a batch of emails (currently 100), waits a bit (currently 25 seconds), and then sends another batch.
When we first set this up it ran perfectly. We do a mailing every week or two, and after a few mailings we started getting very high server loads as reported by WHM. We have a dual core machine, so the server load should never go over 2. At one point, after the script had been running unattended for several hours, it was 5000! Memory usage was also up to over 97%.
We cut the batch size, increased the delay, but we still have to monitor the mailing constantly. We went in with top to see what was happening but the only thing we could tell for certain was that sendmail was basically taking over the server.
I don't have a lot of experience with Linux. If this was Windows I'd look for disc fragmentation, but I think Linux is not subject to that kind of problem. The mailing list includes over 400,000 names. When we first started using the script there were no problems, and the problems seem to be getting worse over time.
Any ideas as to what the problem might be or a way to fix it? | 2 |
8,561,341 | 12/19/2011 12:25:22 | 459,367 | 08/02/2010 06:02:44 | 189 | 6 | imort CSV data to Mysql table | i have one csv file which contains library group and it's data...
group consider as sheet and for each sheet contains phrase name and phrase value...
I want to insert this csv data to two different table using mysql how can i ?
suppose i have 2 table like
phrase_library_group
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| GROUP_ID | bigint(20) | NO | PRI | NULL | auto_increment |
| GROUP_NAME | varchar(100) | NO | | NULL | |
| ------------+--------------+------+-----+---------+----------------+
phrase_list
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| PHRASE_ID | bigint(20) | NO | PRI | NULL | auto_increment |
| PHRASE_NAME | varchar(100) | NO | | NULL | |
| PHRASE_DESC | varchar(500) | NO | | NULL | |
| GROUP_ID | bigint(20) | NO | MUL | NULL | |
| ------------+--------------+------+-----+---------+----------------+
here in image Additional_meds/Antibiotic Warnings/... are groups
and each group contains different phrases..like Additional_meds contains total 12 records as see below.
csv like ![enter image description here][1]
[1]: http://i.stack.imgur.com/i5VFd.png | mysql | database | csv | null | null | null | open | imort CSV data to Mysql table
===
i have one csv file which contains library group and it's data...
group consider as sheet and for each sheet contains phrase name and phrase value...
I want to insert this csv data to two different table using mysql how can i ?
suppose i have 2 table like
phrase_library_group
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| GROUP_ID | bigint(20) | NO | PRI | NULL | auto_increment |
| GROUP_NAME | varchar(100) | NO | | NULL | |
| ------------+--------------+------+-----+---------+----------------+
phrase_list
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| PHRASE_ID | bigint(20) | NO | PRI | NULL | auto_increment |
| PHRASE_NAME | varchar(100) | NO | | NULL | |
| PHRASE_DESC | varchar(500) | NO | | NULL | |
| GROUP_ID | bigint(20) | NO | MUL | NULL | |
| ------------+--------------+------+-----+---------+----------------+
here in image Additional_meds/Antibiotic Warnings/... are groups
and each group contains different phrases..like Additional_meds contains total 12 records as see below.
csv like ![enter image description here][1]
[1]: http://i.stack.imgur.com/i5VFd.png | 0 |
10,276,966 | 04/23/2012 08:07:36 | 956,689 | 09/21/2011 10:27:33 | 1,007 | 7 | appropriate database structure for a location based game | I'm trying to structure a database for a game in a way that avoids large rewrites. The system uses one big database ordered by longitude, when a player joins, their current longitude is written to the database. The reason for this is so that the database can quickly be polled for other nearby players.
Not really understanding that much about databases I was wondering the best structure to use to achieve this. I want to avoid larger re-ordering rewrites when players join so I'm going to make the database prior to the game launching and create blank spaces for every value of longitude, however it dawned in me that I may need multiple slots for each value due to more than one player being at the same location - this doesn't scale well at all.
What would be the best structure to achieve this? Perhaps player id's that index into another database storing information? | database | null | null | null | null | 04/30/2012 15:56:14 | not a real question | appropriate database structure for a location based game
===
I'm trying to structure a database for a game in a way that avoids large rewrites. The system uses one big database ordered by longitude, when a player joins, their current longitude is written to the database. The reason for this is so that the database can quickly be polled for other nearby players.
Not really understanding that much about databases I was wondering the best structure to use to achieve this. I want to avoid larger re-ordering rewrites when players join so I'm going to make the database prior to the game launching and create blank spaces for every value of longitude, however it dawned in me that I may need multiple slots for each value due to more than one player being at the same location - this doesn't scale well at all.
What would be the best structure to achieve this? Perhaps player id's that index into another database storing information? | 1 |
8,338,844 | 12/01/2011 09:12:48 | 676,280 | 03/25/2011 07:20:54 | 1 | 0 | what kind of IO card should i use? | i have to control an led display board and a four channel relay using serial port.
>what kind of IO card should i use? | io | null | null | null | null | 12/02/2011 04:00:56 | off topic | what kind of IO card should i use?
===
i have to control an led display board and a four channel relay using serial port.
>what kind of IO card should i use? | 2 |
5,832,628 | 04/29/2011 13:23:06 | 731,130 | 04/29/2011 13:17:40 | 1 | 0 | h264 or mp4 with mediaelement.js | I've been using the mediaelement.js(http://mediaelementjs.com/) for our site. I've noticed that I have to convert all the mp4 videos with the codec h264 . If I use the code mpeg-4 for my mp4 video the audio is ok but the video is black.
any idea why is that ?
thanks. | mediaelement | mediaelement.js | null | null | null | null | open | h264 or mp4 with mediaelement.js
===
I've been using the mediaelement.js(http://mediaelementjs.com/) for our site. I've noticed that I have to convert all the mp4 videos with the codec h264 . If I use the code mpeg-4 for my mp4 video the audio is ok but the video is black.
any idea why is that ?
thanks. | 0 |
6,410,916 | 06/20/2011 12:12:25 | 615,780 | 02/14/2011 06:07:39 | 520 | 0 | How do I make a function to be a thread safe in C++?? | Let's say I have a thread pool that has 5 child threads. And they are calling a function called "functionA()" How do I make the function to be thread safe?
Also if those 5 threads are called at the same time then are they executed concurrently?
or do they wait until a thread that currently works in the function to be finished ?
Thanks in advance.. | c++ | multithreading | null | null | null | 06/20/2011 12:27:11 | not a real question | How do I make a function to be a thread safe in C++??
===
Let's say I have a thread pool that has 5 child threads. And they are calling a function called "functionA()" How do I make the function to be thread safe?
Also if those 5 threads are called at the same time then are they executed concurrently?
or do they wait until a thread that currently works in the function to be finished ?
Thanks in advance.. | 1 |
9,025,556 | 01/26/2012 21:24:24 | 892,387 | 08/12/2011 19:44:09 | 99 | 1 | Is there a way to get all facebook schools? | Is there a way to retrieve all secondary schools in Facebook's database? I want to match colleges for users of my app against Facebook's database but don't know how to get this information. | facebook | facebook-graph-api | facebook-fql | education | null | 01/30/2012 16:07:51 | not a real question | Is there a way to get all facebook schools?
===
Is there a way to retrieve all secondary schools in Facebook's database? I want to match colleges for users of my app against Facebook's database but don't know how to get this information. | 1 |
1,040,053 | 06/24/2009 18:21:30 | 12,503 | 09/16/2008 14:35:36 | 255 | 25 | Does "An Introduction to Object-Oriented Programming" by Timothy Budd still have value? | If one has a good understanding of the different principles that make up OOP does the book "An Introduction to Object-Oriented Programming" by Timothy Budd would still have value to read?
It's mentioned in a few texts and it sounds like a great book to read when you're starting off but what if you've got a bit of experience under your belt? | oop | books | null | null | null | null | open | Does "An Introduction to Object-Oriented Programming" by Timothy Budd still have value?
===
If one has a good understanding of the different principles that make up OOP does the book "An Introduction to Object-Oriented Programming" by Timothy Budd would still have value to read?
It's mentioned in a few texts and it sounds like a great book to read when you're starting off but what if you've got a bit of experience under your belt? | 0 |
7,767,594 | 10/14/2011 12:30:26 | 869,162 | 07/29/2011 10:17:35 | 24 | 0 | Simple Jquery working on Chrome, not on FF & other browsers | I wrote those simple lines in order to show an .elemproduct div only if it has a background-image set.
I develop under chrome, and just realised that this code is onyl working under webkit browsers.
When failing, it shows up every .elemproduct, as if the "if" statement wasnt recognised.
function hideBox() {
var $bg = $('.elemproduct');
$bg.each(function() {
if ($(this).css("background-image") === "url(http://www.infiniscale.com/beta/)") {
return true;
}
else{
$(this).show();
}
});
return true;
};
Any ideas ? | jquery | css | cross-browser | show-hide | null | null | open | Simple Jquery working on Chrome, not on FF & other browsers
===
I wrote those simple lines in order to show an .elemproduct div only if it has a background-image set.
I develop under chrome, and just realised that this code is onyl working under webkit browsers.
When failing, it shows up every .elemproduct, as if the "if" statement wasnt recognised.
function hideBox() {
var $bg = $('.elemproduct');
$bg.each(function() {
if ($(this).css("background-image") === "url(http://www.infiniscale.com/beta/)") {
return true;
}
else{
$(this).show();
}
});
return true;
};
Any ideas ? | 0 |
10,070,601 | 04/09/2012 08:12:51 | 795,688 | 06/13/2011 09:27:40 | 49 | 5 | how to make an editText look and feel like image shown below in android | ![i want to customize edittext like below when user click on comma text should transform into a entity like below so can i can delete it on touch at a single touch][1].like some what Tags section of this page.
[1]: http://i.stack.imgur.com/VzKah.png
thanks in advance | android | edittext | null | null | null | 04/10/2012 06:11:48 | not a real question | how to make an editText look and feel like image shown below in android
===
![i want to customize edittext like below when user click on comma text should transform into a entity like below so can i can delete it on touch at a single touch][1].like some what Tags section of this page.
[1]: http://i.stack.imgur.com/VzKah.png
thanks in advance | 1 |
6,329,151 | 06/13/2011 10:19:04 | 765,823 | 05/23/2011 10:22:19 | 20 | 0 | C# insert a varible. | I have this code, where i have an arrayList. I use the method arrayList.Contains.
if (arrayList2.Contains(5))
{
//something
}
I would like to replace arrayList2 in the code, with a varible (a string for example) that contains the value arrayList2.
string hello = "arrayList2" // create a varible with the value of the name of the arrayList
if (hello.Contains(5)) // insert the varible "hello" instead of "arrayList2"
{
//something
}
This method doesn't work, any ideas how i can get it to work? | c# | null | null | null | null | 06/13/2011 11:23:57 | not a real question | C# insert a varible.
===
I have this code, where i have an arrayList. I use the method arrayList.Contains.
if (arrayList2.Contains(5))
{
//something
}
I would like to replace arrayList2 in the code, with a varible (a string for example) that contains the value arrayList2.
string hello = "arrayList2" // create a varible with the value of the name of the arrayList
if (hello.Contains(5)) // insert the varible "hello" instead of "arrayList2"
{
//something
}
This method doesn't work, any ideas how i can get it to work? | 1 |
9,883,418 | 03/27/2012 04:31:30 | 149,076 | 08/01/2009 20:50:45 | 3,021 | 190 | What level of expertise would this interview item suggest? unset foo; echo bar | read foo; echo $foo | Imagine that you are preparing for an in-depth technical interview and you are asked to rate your expertise in shell scripting (hypothetically on a scale of one to ten). Then look at the following shell command line example and answer the questions: *What does this do?* and *Why?*
unset foo; echo bar | read foo; echo "$foo"
What level of expertise would you map to correctly answer this question **for the general case** (not merely for one or another, specific, version of the shell)?
Now imagine that you're given the following example:
cat "$SOMELIST_OF_HOSTS" | while read host; do ssh $host "$some_cmd"; done
... and the interviewer explains that this command "doesn't work" and that it seems to only execute the *ssh* command on a few of the hosts listed in the (large) file (something like on in every few hundred hostnames, seemingly scattered from among the list). Naturally he or she asks: *Why is it doing that?* and *How might you fix it?*
Then rate the level of expertise to which you would map someone who can answer those questions correctly.
| bash | interview-questions | ksh | zsh | sh | 03/28/2012 04:46:12 | off topic | What level of expertise would this interview item suggest? unset foo; echo bar | read foo; echo $foo
===
Imagine that you are preparing for an in-depth technical interview and you are asked to rate your expertise in shell scripting (hypothetically on a scale of one to ten). Then look at the following shell command line example and answer the questions: *What does this do?* and *Why?*
unset foo; echo bar | read foo; echo "$foo"
What level of expertise would you map to correctly answer this question **for the general case** (not merely for one or another, specific, version of the shell)?
Now imagine that you're given the following example:
cat "$SOMELIST_OF_HOSTS" | while read host; do ssh $host "$some_cmd"; done
... and the interviewer explains that this command "doesn't work" and that it seems to only execute the *ssh* command on a few of the hosts listed in the (large) file (something like on in every few hundred hostnames, seemingly scattered from among the list). Naturally he or she asks: *Why is it doing that?* and *How might you fix it?*
Then rate the level of expertise to which you would map someone who can answer those questions correctly.
| 2 |
6,465,258 | 06/24/2011 08:30:49 | 405,383 | 07/29/2010 07:15:23 | 381 | 11 | add layout as a view in Android | i have a pretty complex layout defined in xml file , now i want to add this layout as a view using addView or something else.
as layout is pretty much complex , its pretty cumbersome process to write the code for layout and then add it as a view. so is there anyway to load layout resource and add is as a view. | android | android-layout | null | null | null | null | open | add layout as a view in Android
===
i have a pretty complex layout defined in xml file , now i want to add this layout as a view using addView or something else.
as layout is pretty much complex , its pretty cumbersome process to write the code for layout and then add it as a view. so is there anyway to load layout resource and add is as a view. | 0 |
3,974,250 | 10/20/2010 02:14:04 | 325,418 | 05/09/2009 15:50:29 | 6,948 | 181 | In Rails 2.x, what is the difference between "rake gems:unpack" and "rake gems:freeze"? | It seems that both can freeze a gem into the `vendor` directory, but `rake gems:unpack` requires the gem to be listed
in `config/environment.rb` as `config.gem '<name of the gem>'` before the `rake` is done.
On the other hand, `rake gems:freeze` requires installing the gem `gemsonrails` first, and uses the syntax `rake gems:freeze GEM=haml` and it
doesn't require listing the gem in `environment.rb` first. But it doesn't work with the current GEM class (probably requires gem 1.3.6 instead of 1.3.7).
Besides these, what are the differences between them? Do they work very similarly and achieve the same purpose? `gemsonrails`'s webpage wasn't updated since 2007; is `rake gems:unpack` the
more preferred way of freezing a gem if not using Bundler?
| ruby-on-rails | rubygems | rake | null | null | null | open | In Rails 2.x, what is the difference between "rake gems:unpack" and "rake gems:freeze"?
===
It seems that both can freeze a gem into the `vendor` directory, but `rake gems:unpack` requires the gem to be listed
in `config/environment.rb` as `config.gem '<name of the gem>'` before the `rake` is done.
On the other hand, `rake gems:freeze` requires installing the gem `gemsonrails` first, and uses the syntax `rake gems:freeze GEM=haml` and it
doesn't require listing the gem in `environment.rb` first. But it doesn't work with the current GEM class (probably requires gem 1.3.6 instead of 1.3.7).
Besides these, what are the differences between them? Do they work very similarly and achieve the same purpose? `gemsonrails`'s webpage wasn't updated since 2007; is `rake gems:unpack` the
more preferred way of freezing a gem if not using Bundler?
| 0 |
11,476,410 | 07/13/2012 18:41:04 | 861,949 | 07/25/2011 16:11:48 | 57 | 10 | Two’s- complement addition forms an abelian group | I was reading about techniques to detect overflow in C . one of the examples to show incorrect solution to detect overflow in addition was this one :
/* Determine whether arguments can be added without overflow */
int tadd_ok(int x, int y) {
int sum = x+y;
return (sum-x == y) && (sum-y == x);
}
and it said it doesn't work because :<br>
> two’s-complement addition forms an abelian group, and so the
> expression (x+y)-x will evaluate to y regardless of whether or not the
> addition overflows, and that (x+y)-y will always evaluate to x
What does it exactly mean ? Does it mean that C compiler replace `sum` with `x+y` ?<br>
To figure out what is it saying I even traced assembly code of the program, but there was no sign of replacement .
| c | optimization | assembly | compiler | null | 07/16/2012 02:49:34 | not a real question | Two’s- complement addition forms an abelian group
===
I was reading about techniques to detect overflow in C . one of the examples to show incorrect solution to detect overflow in addition was this one :
/* Determine whether arguments can be added without overflow */
int tadd_ok(int x, int y) {
int sum = x+y;
return (sum-x == y) && (sum-y == x);
}
and it said it doesn't work because :<br>
> two’s-complement addition forms an abelian group, and so the
> expression (x+y)-x will evaluate to y regardless of whether or not the
> addition overflows, and that (x+y)-y will always evaluate to x
What does it exactly mean ? Does it mean that C compiler replace `sum` with `x+y` ?<br>
To figure out what is it saying I even traced assembly code of the program, but there was no sign of replacement .
| 1 |
8,905,612 | 01/18/2012 05:28:27 | 1,044,581 | 11/13/2011 20:42:38 | 45 | 0 | How do I add or use the MAX Function to a Date field containing DateSerial function to query most recent date? | I am using the DateSerial Function to convert the date on a column like this:
(DateSerial(CInt(Left([EXAMPLE_TBL.APP_DATE],4)),CInt(Mid([EXAMPLE_TBL.APP_DATE],5,2)),
CInt(Right([EXAMPLE_TBL.APP_DATE],2)))) AS Application_Date
The date comes from an Oracle linked table which is in a text datatype in Access. All is working, however, I need to add the MAX Function or find a way to get the most recent APP_DATE.
How do I add the MAX Function or what Function can I use so that if there are two APP_DATES, I get the most recent?
Thanks everyone! | sql | ms-access-2007 | null | null | null | null | open | How do I add or use the MAX Function to a Date field containing DateSerial function to query most recent date?
===
I am using the DateSerial Function to convert the date on a column like this:
(DateSerial(CInt(Left([EXAMPLE_TBL.APP_DATE],4)),CInt(Mid([EXAMPLE_TBL.APP_DATE],5,2)),
CInt(Right([EXAMPLE_TBL.APP_DATE],2)))) AS Application_Date
The date comes from an Oracle linked table which is in a text datatype in Access. All is working, however, I need to add the MAX Function or find a way to get the most recent APP_DATE.
How do I add the MAX Function or what Function can I use so that if there are two APP_DATES, I get the most recent?
Thanks everyone! | 0 |
6,653,002 | 07/11/2011 15:59:44 | 839,241 | 07/11/2011 15:59:44 | 1 | 0 | Test vs. Production | What are the drawbacks of having developers who work in both test and prodcution environments?
Logic seems to imply that mistakes can be more easily prevented if some developers work ONLY in test environment, then hand off their finished product to those who work strictly in production | testing | null | null | null | null | 07/12/2011 20:34:34 | off topic | Test vs. Production
===
What are the drawbacks of having developers who work in both test and prodcution environments?
Logic seems to imply that mistakes can be more easily prevented if some developers work ONLY in test environment, then hand off their finished product to those who work strictly in production | 2 |
10,710,944 | 05/22/2012 22:14:12 | 370,627 | 06/18/2010 19:25:47 | 121 | 3 | Why are Chrome exceptions for third-party cookies not working (results in inability to use Disqus)? | So Disqus has not been working for me for some time, and they finally, handily, added a little notification that it's due to third party cookies being blocked. Great, I said, let's take care of that.
So I added an exception for disqus.com to Chrome's preferences, but it does not seem to be working. I did this vis Preferences -> Advanced -> Content Settings -> Manage Exceptions, where I have added an 'allow' exception for `disqus.com`. I have third-party cookies otherwise blocked.
Disqus still doesn't work, though, giving me the same error on every site that it's unable to work with third party cookies. The error persists even if I go to disqus.com and login, then revisit a site.
Why might disqus be failing here? | google-chrome | cookies | disqus | null | null | 07/20/2012 12:34:31 | off topic | Why are Chrome exceptions for third-party cookies not working (results in inability to use Disqus)?
===
So Disqus has not been working for me for some time, and they finally, handily, added a little notification that it's due to third party cookies being blocked. Great, I said, let's take care of that.
So I added an exception for disqus.com to Chrome's preferences, but it does not seem to be working. I did this vis Preferences -> Advanced -> Content Settings -> Manage Exceptions, where I have added an 'allow' exception for `disqus.com`. I have third-party cookies otherwise blocked.
Disqus still doesn't work, though, giving me the same error on every site that it's unable to work with third party cookies. The error persists even if I go to disqus.com and login, then revisit a site.
Why might disqus be failing here? | 2 |
513,048 | 02/04/2009 20:05:38 | 7,756 | 09/15/2008 14:21:40 | 1,921 | 80 | What are the fast reporting solutions that work with .Net? | I'm looking for fast reporting services that are compatible with .Net (C# specifically). Additionally since many of these companies are coy about their pricing (e.g. Cognos) it would be helpful to know how expensive they tend to be.
We are doing serial reporting to PDF and Excel from a SQL Server 2005 database. Specifically because of the number of reports being generated (e.g. 6,000 20 page reports) at a time, we're looking for a fast solution.
Understandably, this may be considered not programming related. If so please add a comment to the question and I will remove the question if that seems to be the communal viewpoint. | .net | reporting-services | reporting | null | null | 05/16/2012 16:51:20 | not constructive | What are the fast reporting solutions that work with .Net?
===
I'm looking for fast reporting services that are compatible with .Net (C# specifically). Additionally since many of these companies are coy about their pricing (e.g. Cognos) it would be helpful to know how expensive they tend to be.
We are doing serial reporting to PDF and Excel from a SQL Server 2005 database. Specifically because of the number of reports being generated (e.g. 6,000 20 page reports) at a time, we're looking for a fast solution.
Understandably, this may be considered not programming related. If so please add a comment to the question and I will remove the question if that seems to be the communal viewpoint. | 4 |
6,166,867 | 05/29/2011 09:15:57 | 478,687 | 10/17/2010 17:59:50 | 375 | 15 | Attach UAC Manifest file to any PE using Update Resource | I want to build a simple tool to attach UAC manifest file to a given exe file the code works correctly but nothing happens.I must say that when i manually compile with the mainfest file it works ok.
procedure TForm1.Button1Click(Sender: TObject);
var
myRes:THandle;
test:PChar;
begin
test:='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+#13#10+
'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">'+#13#10+
'<assemblyIdentity version="1.1.1.1"'+#13#10+
'processorArchitecture="X86"'+#13#10+
'name="[APP TO TEST WITH]"'+#13#10+
'type="win32"/>'+#13#10+
'<description>elevate execution level</description>'+#13#10+
'<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">'+#13#10+
'<security>'+#13#10+
'<requestedPrivileges>'+#13#10+
'<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>'+#13#10+
'</requestedPrivileges>'+#13#10+
'</security>'+#13#10+
'</trustInfo>'+#13#10+
'</assembly> ';
myRes := BeginUpdateResource('testuac.exe',false);
UpdateResource(myRes,MakeIntResource(24),'1',1033,test,length(test));
EndUpdateResource(myres,false);
ShowMessage(SysErrorMessage(GetLastError));
end;//Compiled with Delphi 7
The code works the resource appears inside the exe but it doesn't work . Any ideea why? | delphi | resources | uac | null | null | null | open | Attach UAC Manifest file to any PE using Update Resource
===
I want to build a simple tool to attach UAC manifest file to a given exe file the code works correctly but nothing happens.I must say that when i manually compile with the mainfest file it works ok.
procedure TForm1.Button1Click(Sender: TObject);
var
myRes:THandle;
test:PChar;
begin
test:='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+#13#10+
'<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">'+#13#10+
'<assemblyIdentity version="1.1.1.1"'+#13#10+
'processorArchitecture="X86"'+#13#10+
'name="[APP TO TEST WITH]"'+#13#10+
'type="win32"/>'+#13#10+
'<description>elevate execution level</description>'+#13#10+
'<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">'+#13#10+
'<security>'+#13#10+
'<requestedPrivileges>'+#13#10+
'<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>'+#13#10+
'</requestedPrivileges>'+#13#10+
'</security>'+#13#10+
'</trustInfo>'+#13#10+
'</assembly> ';
myRes := BeginUpdateResource('testuac.exe',false);
UpdateResource(myRes,MakeIntResource(24),'1',1033,test,length(test));
EndUpdateResource(myres,false);
ShowMessage(SysErrorMessage(GetLastError));
end;//Compiled with Delphi 7
The code works the resource appears inside the exe but it doesn't work . Any ideea why? | 0 |
9,677,884 | 03/13/2012 03:13:11 | 888,149 | 08/10/2011 14:50:54 | 97 | 0 | Open source projects | I'm a computer science student and I want to get started contributing with open source projects. Can someone help me? Where do I start? Can you suggest small projects where I can start? (C/C++, java, python)
Also, where big projects like: linux kernel, firefox, mysql, apache... are hosted? (github?) Are they on public repositories where a can start deploying code?
Thanks! | open-source | project | source | null | null | 03/22/2012 03:08:04 | off topic | Open source projects
===
I'm a computer science student and I want to get started contributing with open source projects. Can someone help me? Where do I start? Can you suggest small projects where I can start? (C/C++, java, python)
Also, where big projects like: linux kernel, firefox, mysql, apache... are hosted? (github?) Are they on public repositories where a can start deploying code?
Thanks! | 2 |
3,083,398 | 06/21/2010 09:22:05 | 266,971 | 02/05/2010 10:50:42 | 274 | 21 | Deploy multiple instances of the same application on JBoss | I want to deploy multiple instances of the same Seam/EJB3 application that differ only in their database settings on the same JBoss server. That way I want to provide different demo instances of this application.
Is this possible at all? And if it is what do I need to change in the configuration of JBoss and the application instances themselves (I could use ant to build different versions of the application with different configuration files if needed). | deployment | java-ee | jboss | ejb-3.0 | seam | null | open | Deploy multiple instances of the same application on JBoss
===
I want to deploy multiple instances of the same Seam/EJB3 application that differ only in their database settings on the same JBoss server. That way I want to provide different demo instances of this application.
Is this possible at all? And if it is what do I need to change in the configuration of JBoss and the application instances themselves (I could use ant to build different versions of the application with different configuration files if needed). | 0 |
1,736,883 | 11/15/2009 07:29:15 | 211,341 | 11/15/2009 07:29:15 | 1 | 0 | how to send net-snmp traps from "C" | I need to write code to send traps from my application (using net-snmp APIs)
Anyone has a simple sample code to do that?
Thanks,
Gil
| snmp | null | null | null | null | null | open | how to send net-snmp traps from "C"
===
I need to write code to send traps from my application (using net-snmp APIs)
Anyone has a simple sample code to do that?
Thanks,
Gil
| 0 |
6,189,158 | 05/31/2011 14:31:53 | 666,490 | 03/18/2011 17:55:26 | 37 | 0 | what is the correct way to clear quartz.net ramjobstore without re-starting app in c#c | If there is a way to do this , can I also confirm by viewing the ramstore before and after clear. How can we view the contents of the ramstore programmatically ? In my case I am reading all job and trigger info from file. On some custom event I need to stop the scheduler and start all over again without re-starting the app.
thank you | c# | scheduled-tasks | quartz-scheduler | scheduler | quartz.net | null | open | what is the correct way to clear quartz.net ramjobstore without re-starting app in c#c
===
If there is a way to do this , can I also confirm by viewing the ramstore before and after clear. How can we view the contents of the ramstore programmatically ? In my case I am reading all job and trigger info from file. On some custom event I need to stop the scheduler and start all over again without re-starting the app.
thank you | 0 |
9,020,852 | 01/26/2012 15:50:05 | 312,873 | 04/09/2010 14:19:40 | 186 | 8 | scala combinator parser to keep original input | I would like to compose a parser from another parser to have the consumed input as an argument to the ast construction.
Say I have
def ingredient = amount ~ nameOfIngredient ^^ {
case amount ~ name => Ingredient(name, amount)
}
What I'm looking for is a way to have another parser to construct an element of:
case class RecipeRow(orginalText: String, ingredient: Ingredient)
So I'm looking for a way to retrieve the original consumed input to the parser in a composition. Maybe something like:
def recipeRow = ingredient withConsumedInput ^^ {
case (amount ~ name, consumed) => RecipeRow(consumed, Ingredient(name, amount))
}
I guess the signature in this case would be:
def withConsumedInput [U](p: => Parser[U]): Parser[(U, String)]
Is there another simple way to get what I want or do I need to write that thing? It feels like it probably is a better way… | scala | parser-combinators | null | null | null | null | open | scala combinator parser to keep original input
===
I would like to compose a parser from another parser to have the consumed input as an argument to the ast construction.
Say I have
def ingredient = amount ~ nameOfIngredient ^^ {
case amount ~ name => Ingredient(name, amount)
}
What I'm looking for is a way to have another parser to construct an element of:
case class RecipeRow(orginalText: String, ingredient: Ingredient)
So I'm looking for a way to retrieve the original consumed input to the parser in a composition. Maybe something like:
def recipeRow = ingredient withConsumedInput ^^ {
case (amount ~ name, consumed) => RecipeRow(consumed, Ingredient(name, amount))
}
I guess the signature in this case would be:
def withConsumedInput [U](p: => Parser[U]): Parser[(U, String)]
Is there another simple way to get what I want or do I need to write that thing? It feels like it probably is a better way… | 0 |
11,445,916 | 07/12/2012 06:11:31 | 1,503,240 | 07/05/2012 07:33:38 | 3 | 0 | Superfish menus not working | These guys take a [header](http://www.teamclarke.com/header/) and footer (http://www.teamclarke.com/header/) and insert there own content in between. Problem is its broke the superfish menu's. Any help would be greatly appreciated.
http://mlsr.realtylink.org/mlsr_get/res_sale_result.cfm?cid=1135545&agentid=36599 | javascript | css | wordpress | superfish | null | 07/13/2012 15:03:49 | not a real question | Superfish menus not working
===
These guys take a [header](http://www.teamclarke.com/header/) and footer (http://www.teamclarke.com/header/) and insert there own content in between. Problem is its broke the superfish menu's. Any help would be greatly appreciated.
http://mlsr.realtylink.org/mlsr_get/res_sale_result.cfm?cid=1135545&agentid=36599 | 1 |
2,236,743 | 02/10/2010 12:33:19 | 262,667 | 01/30/2010 22:08:04 | 53 | 3 | git refusing to fetch into current branch | I set up a remote repository and I can push new changes to it, but I cannot fetch from it, I always get the (rather cryptic) error message:
fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
fatal: The remote end hung up unexpectedly
What does it mean? What should I do to enable fetching?
(Note that this remote repo is only used as a backup repo, so it should be pretty much an exact copy of my local repository. I really can't understand why I can push to it but not fetch from it...) | git | fetch | null | null | null | null | open | git refusing to fetch into current branch
===
I set up a remote repository and I can push new changes to it, but I cannot fetch from it, I always get the (rather cryptic) error message:
fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
fatal: The remote end hung up unexpectedly
What does it mean? What should I do to enable fetching?
(Note that this remote repo is only used as a backup repo, so it should be pretty much an exact copy of my local repository. I really can't understand why I can push to it but not fetch from it...) | 0 |
6,270,688 | 06/07/2011 19:40:48 | 788,121 | 06/07/2011 19:40:48 | 1 | 0 | Where can I find a list of all conjugations of German verbs | To improve the quality of my dictionary I need a list of all conjugations of German verbs. Does anyone know how I could create such a list or where I could find one?
It doesn't need to be specifically for verbs, as long as I get all inflections connected to the basic form of the word. And I'm also interested in such lists for English... | list | language | german | null | null | 06/07/2011 20:01:51 | off topic | Where can I find a list of all conjugations of German verbs
===
To improve the quality of my dictionary I need a list of all conjugations of German verbs. Does anyone know how I could create such a list or where I could find one?
It doesn't need to be specifically for verbs, as long as I get all inflections connected to the basic form of the word. And I'm also interested in such lists for English... | 2 |
9,218,265 | 02/09/2012 20:29:17 | 1,088,536 | 12/08/2011 20:40:33 | 18 | 0 | Automatic Commit in VisualHG | Is it possible to setup VisualHg such that i'm automatically presented with a commit screen every time I quit Visual studio 2010?
This would be extremely useful if I forget to commit some changes.
| visual-studio | visual-studio-2010 | version-control | mercurial | visualhg | null | open | Automatic Commit in VisualHG
===
Is it possible to setup VisualHg such that i'm automatically presented with a commit screen every time I quit Visual studio 2010?
This would be extremely useful if I forget to commit some changes.
| 0 |
7,935,784 | 10/28/2011 23:08:55 | 906,596 | 08/22/2011 20:16:06 | 1 | 0 | Python Backup file script problems | I've been working on a backup script below, copying files from one server to another, with several
requirements. The code is below. Any help? And I have a
sample test input.
`
import arcpy # Import arcpy module
from arcpy import env # Import env module from arcpy
import os # Import os module
import logging # Import logging module
import shutil # Import shutil module
inFile = "G:\data" # Input specified
outFile = "D:\data" # Output specified
backup = "D:\backup" # Intermediate backup file
logdirectory = "S:\backup_directory\log\*.log"
log = logging.getLogger("G:\data") # Creates logger instance
hdlr = logging.FileHandler("G:\data\*.log") # Creates FileHandler
formatter = logging.Formatter("%(asctime)s %(levelName)s %(message)s") # Creates Formatter
hdlr.setFormatter(formatter) # Attaches Formatter to
FileHandler
logger.addHandler(hdlr) # Attaches FileHandler to Logger
logger.setLevel(logging.NOTE) # Sets logger note
inFile = open("G:\users\tchaney\TestInputFile.txt", "r") #
Opens the data file to be read, and assigns it to the variable, inFile
outFile = open("G:\users\tchaney\TestOutputFile.txt", "w") #
Opens a data output file to be written to, and assigns it to outFile
shutil.copyfile(logger, "D:\data\copy_[fileDate].log") # Copy logfile to archive as
"copy_[filedate].log"
#for "*.log" in "logdirectory" # For loop to check current
date, and returns files 7 days old or less
#return(currDate - fileDate) <= 7
#logger.note("Log files updated")
for inLine in inFile: # same as file.readline() - reads
one line at a time into a string variable, loop to read, stop service, write, start service.
service, srcFile, destFile = inLine.split(",") # Split each line, while removing
the comma, and store each field
if os.path.exists("srcFile"): # If source exists, for each
service in the array, stop the service
for service in inFile[:]:
os.system("AGSSOM.EXE -x")
if os.path.exists("destFile"): # If destination variable exists,
copy destination to backup, and remove destination
#arcpy.env.overwriteOutput = True (needed with shutil?)
shutil.copyfile("G:\data\*", "D:\backup\*")
os.remove("destFile")
else:
logger.note("Filename did not exist prior to copy")
shutil.copyfile("srcFile", "destFile") # Copy source to destination
if not os.path.exists("destFile"): # If destination does not exist,
copy backup to destination, and add logger note
shutil.copyfile("D:\backup\*", "D:\data\*")
logger.note("[filename] copied from backup")
for service in inFile[:]: # For each service in the array,
start the service
os.system("AGSSOM.EXE -s")
else: # If the source is not found,
add logger note
logger.note("Source not found")
inFile.close() # Close input file
outFile.close() # Close output file
`
I have fixed the syntax errors, with the exception of the part of the code that is commented out - log
directory for loop. It gives me a syntax error at the part of the code. If I comment it out, it runs
but gives me this error message -
> I have fixed the syntax errors, with the exception of the part of the code that is commented out - log
directory for loop. It gives me a syntax error at the part of the code. If I comment it out, it runs
but gives me three error messages... | python | python-2.6 | null | null | null | 10/30/2011 13:26:27 | too localized | Python Backup file script problems
===
I've been working on a backup script below, copying files from one server to another, with several
requirements. The code is below. Any help? And I have a
sample test input.
`
import arcpy # Import arcpy module
from arcpy import env # Import env module from arcpy
import os # Import os module
import logging # Import logging module
import shutil # Import shutil module
inFile = "G:\data" # Input specified
outFile = "D:\data" # Output specified
backup = "D:\backup" # Intermediate backup file
logdirectory = "S:\backup_directory\log\*.log"
log = logging.getLogger("G:\data") # Creates logger instance
hdlr = logging.FileHandler("G:\data\*.log") # Creates FileHandler
formatter = logging.Formatter("%(asctime)s %(levelName)s %(message)s") # Creates Formatter
hdlr.setFormatter(formatter) # Attaches Formatter to
FileHandler
logger.addHandler(hdlr) # Attaches FileHandler to Logger
logger.setLevel(logging.NOTE) # Sets logger note
inFile = open("G:\users\tchaney\TestInputFile.txt", "r") #
Opens the data file to be read, and assigns it to the variable, inFile
outFile = open("G:\users\tchaney\TestOutputFile.txt", "w") #
Opens a data output file to be written to, and assigns it to outFile
shutil.copyfile(logger, "D:\data\copy_[fileDate].log") # Copy logfile to archive as
"copy_[filedate].log"
#for "*.log" in "logdirectory" # For loop to check current
date, and returns files 7 days old or less
#return(currDate - fileDate) <= 7
#logger.note("Log files updated")
for inLine in inFile: # same as file.readline() - reads
one line at a time into a string variable, loop to read, stop service, write, start service.
service, srcFile, destFile = inLine.split(",") # Split each line, while removing
the comma, and store each field
if os.path.exists("srcFile"): # If source exists, for each
service in the array, stop the service
for service in inFile[:]:
os.system("AGSSOM.EXE -x")
if os.path.exists("destFile"): # If destination variable exists,
copy destination to backup, and remove destination
#arcpy.env.overwriteOutput = True (needed with shutil?)
shutil.copyfile("G:\data\*", "D:\backup\*")
os.remove("destFile")
else:
logger.note("Filename did not exist prior to copy")
shutil.copyfile("srcFile", "destFile") # Copy source to destination
if not os.path.exists("destFile"): # If destination does not exist,
copy backup to destination, and add logger note
shutil.copyfile("D:\backup\*", "D:\data\*")
logger.note("[filename] copied from backup")
for service in inFile[:]: # For each service in the array,
start the service
os.system("AGSSOM.EXE -s")
else: # If the source is not found,
add logger note
logger.note("Source not found")
inFile.close() # Close input file
outFile.close() # Close output file
`
I have fixed the syntax errors, with the exception of the part of the code that is commented out - log
directory for loop. It gives me a syntax error at the part of the code. If I comment it out, it runs
but gives me this error message -
> I have fixed the syntax errors, with the exception of the part of the code that is commented out - log
directory for loop. It gives me a syntax error at the part of the code. If I comment it out, it runs
but gives me three error messages... | 3 |
8,075,371 | 11/10/2011 05:32:15 | 1,036,781 | 11/09/2011 02:01:46 | 20 | 0 | How to create a popup window with spinner for android? | i would like to create a popup window which will appear the first time the user opens the application and ask the user to select the setting within a spinner (example something close like the picture below)

and also, i would like it to popup automatically rather then having the need to press on a button. is it possible to do so ?
please help. thanks alot. =)
| android | spinner | popupwindow | null | null | null | open | How to create a popup window with spinner for android?
===
i would like to create a popup window which will appear the first time the user opens the application and ask the user to select the setting within a spinner (example something close like the picture below)

and also, i would like it to popup automatically rather then having the need to press on a button. is it possible to do so ?
please help. thanks alot. =)
| 0 |
7,748,317 | 10/13/2011 01:02:38 | 142,368 | 07/21/2009 21:45:36 | 298 | 21 | Generate JSON to Convert into ECMAScript 5 Ready Consumption | [In my client/server web app][1], I am generating large JSON strings (using JSON.NET JToken classes in C# web services) which I pass via AJAX Get requests to the client.
I would like to be able to define certain properties in the ES5 style: `prop: { value: '1', enumerable: false, writable: true }`, but there's a hitch.
First, JSON.parse() simply interprets the 'enumerable' and 'writable' properties as generic properties on a generic JavaScript object. This is probably expected and desirable behavior, but is the a comparable method to 'parse' the JSON with respect to new ES5 property attributes?
Second, Object.create() works, but it has some limitations. For example,
//Native works
var prop = Object.create(Object.prototype, { prop: { value: '1', enumerable: false, writable: true } });
//prop === "1"
//Parse works
var prop = Object.create(Object.prototype, JSON.parse({ "prop": { "value": '1', "enumerable": false, "writable": true } });
//prop === "1"
//Parse fails
var prop = Object.create(Object.prototype, JSON.parse({ "prop": { "value": '1', "enumerable": "false", "writable": "true" } });
// prop === JSON.parse({ "prop": { "value": '1', "enumerable": "false", "writable": "true" } })
The problem here, of course, is that `"true" !== true`, which instructs `Object.create()` to return the same object as `JSON.parse()`. Further, either because of the truthy evaluation of a particular prop attribute OR because I'm attempting to create particularly large objects, `Object.create()` seems to be quite fragile.
Is there a better way to "parse" these objects in a way that respects the ES5 prop attributes?
[1]: http://stackoverflow.com/questions/7094563/how-to-search-and-manipulate-complex-javascript-objects-in-a-jquery-fashion
| javascript | json | json.net | ecmascript-5 | null | null | open | Generate JSON to Convert into ECMAScript 5 Ready Consumption
===
[In my client/server web app][1], I am generating large JSON strings (using JSON.NET JToken classes in C# web services) which I pass via AJAX Get requests to the client.
I would like to be able to define certain properties in the ES5 style: `prop: { value: '1', enumerable: false, writable: true }`, but there's a hitch.
First, JSON.parse() simply interprets the 'enumerable' and 'writable' properties as generic properties on a generic JavaScript object. This is probably expected and desirable behavior, but is the a comparable method to 'parse' the JSON with respect to new ES5 property attributes?
Second, Object.create() works, but it has some limitations. For example,
//Native works
var prop = Object.create(Object.prototype, { prop: { value: '1', enumerable: false, writable: true } });
//prop === "1"
//Parse works
var prop = Object.create(Object.prototype, JSON.parse({ "prop": { "value": '1', "enumerable": false, "writable": true } });
//prop === "1"
//Parse fails
var prop = Object.create(Object.prototype, JSON.parse({ "prop": { "value": '1', "enumerable": "false", "writable": "true" } });
// prop === JSON.parse({ "prop": { "value": '1', "enumerable": "false", "writable": "true" } })
The problem here, of course, is that `"true" !== true`, which instructs `Object.create()` to return the same object as `JSON.parse()`. Further, either because of the truthy evaluation of a particular prop attribute OR because I'm attempting to create particularly large objects, `Object.create()` seems to be quite fragile.
Is there a better way to "parse" these objects in a way that respects the ES5 prop attributes?
[1]: http://stackoverflow.com/questions/7094563/how-to-search-and-manipulate-complex-javascript-objects-in-a-jquery-fashion
| 0 |
8,587,960 | 12/21/2011 09:57:20 | 815,600 | 06/25/2011 19:07:18 | 795 | 62 | How to document a project | I am new and has started working on a project which has no paperwork with them. I and my team was told to do some documentation as we are working on the project. It is made in c# .net and we are using Visual Studio 2010 for this. I have never documented any project so far and have no idea where to start. Can someone guide me to some tips for this like what all things need to be noted down and how should I proceed? Its a pretty huge project and we will be working on small areas of it and need to document it. On google I have come across some documentation software as well but I suspect that I can use it here. Any good documentation article for beginners will also work fine for me.
Thanks. | documentation | documentation-generation | code-documentation | null | null | null | open | How to document a project
===
I am new and has started working on a project which has no paperwork with them. I and my team was told to do some documentation as we are working on the project. It is made in c# .net and we are using Visual Studio 2010 for this. I have never documented any project so far and have no idea where to start. Can someone guide me to some tips for this like what all things need to be noted down and how should I proceed? Its a pretty huge project and we will be working on small areas of it and need to document it. On google I have come across some documentation software as well but I suspect that I can use it here. Any good documentation article for beginners will also work fine for me.
Thanks. | 0 |
10,462,829 | 05/05/2012 14:33:19 | 1,376,127 | 05/05/2012 00:25:22 | 6 | 0 | Compiling PHP error | I want to make a program in php that can send and receive emails through a gmail address. I was originally using a XAMPP server on my PPC Mac running OS X 10.4 Tiger, but it didn't have the ssl support that I needed. Because of this, I tried to set up an (updated) Apache server because the one shipped with my mac was outdated. By compiling from the source, I have installed an Apache server (2.2), the imap extension for php, and the openssl extension for php. (Though I don't know if that's needed.)
I have recently asked a related question (<http://stackoverflow.com/questions/10457982/compiling-php-error-make-libs-libphp5-bundle-error-1>)
I configured like this (the --without-iconv is in response to the previous answer):
>./configure --with-imap=/usr/local/imap-2007f/ --enable-sockets --with-imap-ssl=/usr/local/ssl --with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs --with-kerberos --without-iconv
The problem I had before has been resolved, and I now have a new error message that I can't find any related info about.
>/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_EVP_CIPHER_CTX_block_size
_EVP_CIPHER_block_size
_EVP_CIPHER_iv_length
_EVP_CIPHER_key_length
_EVP_MD_size
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
I am assuming there will be a similar solution regarding installing libraries, but I couldn't seem to find the appropriate ones and don't know if these are necessary to php's compilation.
All help is appreciated, thanks! | php | openssl | imap | null | null | 05/07/2012 21:29:32 | too localized | Compiling PHP error
===
I want to make a program in php that can send and receive emails through a gmail address. I was originally using a XAMPP server on my PPC Mac running OS X 10.4 Tiger, but it didn't have the ssl support that I needed. Because of this, I tried to set up an (updated) Apache server because the one shipped with my mac was outdated. By compiling from the source, I have installed an Apache server (2.2), the imap extension for php, and the openssl extension for php. (Though I don't know if that's needed.)
I have recently asked a related question (<http://stackoverflow.com/questions/10457982/compiling-php-error-make-libs-libphp5-bundle-error-1>)
I configured like this (the --without-iconv is in response to the previous answer):
>./configure --with-imap=/usr/local/imap-2007f/ --enable-sockets --with-imap-ssl=/usr/local/ssl --with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs --with-kerberos --without-iconv
The problem I had before has been resolved, and I now have a new error message that I can't find any related info about.
>/usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: Undefined symbols:
_EVP_CIPHER_CTX_block_size
_EVP_CIPHER_block_size
_EVP_CIPHER_iv_length
_EVP_CIPHER_key_length
_EVP_MD_size
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
I am assuming there will be a similar solution regarding installing libraries, but I couldn't seem to find the appropriate ones and don't know if these are necessary to php's compilation.
All help is appreciated, thanks! | 3 |
9,994,636 | 04/03/2012 13:47:05 | 620,053 | 02/16/2011 16:56:12 | 1,108 | 84 | Eclipse->New Android Projects always compile java 1.4 | Everytime I add/create or copy a Project inside my Eclipse-Workspace it will be recognized as a Java 1.4 Project, which leads to a sum of errors. I have to fix this myself under properties->java-compiler and check 1.6 there. So I have a few questions on that:
Is it possible to pre-define which compiler Eclipse has to choose?
Is there a config file telling eclipse which compiler to choose?
| java | android | eclipse | java-compiler-api | null | null | open | Eclipse->New Android Projects always compile java 1.4
===
Everytime I add/create or copy a Project inside my Eclipse-Workspace it will be recognized as a Java 1.4 Project, which leads to a sum of errors. I have to fix this myself under properties->java-compiler and check 1.6 there. So I have a few questions on that:
Is it possible to pre-define which compiler Eclipse has to choose?
Is there a config file telling eclipse which compiler to choose?
| 0 |
7,057,484 | 08/14/2011 14:50:03 | 892,401 | 08/12/2011 20:01:45 | 16 | 0 | Mysql: Selecting Fields That DO NOT Match | Ok, so, I have 2 tables (categories_forms and categories_fields). This is my query to show all fields that match (categories_fields are all fields that can be shown on a form, and categories_forms contain a category_id and field_id if that field from categories_fields is to be shown):
$fields = mysql_query("SELECT cforms.id, cforms.required, cfields.field FROM $db[categories_forms] as cforms
JOIN $db[categories_fields] as cfields ON cforms.field_id=cfields.id
WHERE cforms.category_id='$category'");
Now, I want to give the user the option to add fields that are not currently there in an admin panel. I know there is a better way to do this, but this is how I came up with it:
$fields = mysql_query("SELECT field, id FROM $db[categories_fields] as cfields");
while($f = mysql_fetch_array($fields)) {
$checkit = mysql_fetch_array(mysql_query("SELECT id FROM $db[categories_forms] WHERE category_id='$category' AND field_id='$f[id]'"));
if(! $checkit['id']) {
// Not include, give the option to add it
}
}
Is there an easier way to do this with MySQL?
| mysql | null | null | null | null | null | open | Mysql: Selecting Fields That DO NOT Match
===
Ok, so, I have 2 tables (categories_forms and categories_fields). This is my query to show all fields that match (categories_fields are all fields that can be shown on a form, and categories_forms contain a category_id and field_id if that field from categories_fields is to be shown):
$fields = mysql_query("SELECT cforms.id, cforms.required, cfields.field FROM $db[categories_forms] as cforms
JOIN $db[categories_fields] as cfields ON cforms.field_id=cfields.id
WHERE cforms.category_id='$category'");
Now, I want to give the user the option to add fields that are not currently there in an admin panel. I know there is a better way to do this, but this is how I came up with it:
$fields = mysql_query("SELECT field, id FROM $db[categories_fields] as cfields");
while($f = mysql_fetch_array($fields)) {
$checkit = mysql_fetch_array(mysql_query("SELECT id FROM $db[categories_forms] WHERE category_id='$category' AND field_id='$f[id]'"));
if(! $checkit['id']) {
// Not include, give the option to add it
}
}
Is there an easier way to do this with MySQL?
| 0 |
11,425,989 | 07/11/2012 05:20:48 | 1,263,455 | 03/12/2012 06:48:13 | 56 | 3 | Problems with location being displayed on iPad simulator and iPad | I seem to have two problems in displaying the current location in both the simulator and iPad.
1) The code below works fine to display a dummy location of 'Santa Cruz,California,United States' in the simulator, as I have set it to display so. But for the first time I install the app, and click 'Ok' for the alertview which asks if my app is allowed to take the current location, it is not displayed; I have to leave the view, then load it again.
Some changes I can make in the code?
2)The same though doesn't work on the iPad device. It just pops the alert view up, but no matter what I do, the location just doesn't get displayed!(It does show the location arrow in the notification bar)
Please help.
In <code>viewDidLoad</code>
<code>
//Core location details
if ([CLLocationManager locationServicesEnabled])
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // if I move
locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; // 3Km
[locationManager startUpdatingLocation];
}
else
{
locationLabel.text = @"Location service disabled";
}
</code>
In the <code>didUpdateToLocation</code> method
<code>
//Core location delegate protocol
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
int latitude1 = newLocation.coordinate.latitude;
// double decimal = fabs(newLocation.coordinate.latitude - degrees);
// int minutes = decimal * 60;
// double seconds = decimal * 3600 - minutes * 60;
// latitude = [NSString stringWithFormat:@"%d° %d' %1.4f\"", degrees, minutes, seconds];
int longitude1 = newLocation.coordinate.longitude;
// decimal = fabs(newLocation.coordinate.longitude - degrees);
// minutes = decimal * 60;
// seconds = decimal * 3600 - minutes * 60;
// longitude = [NSString stringWithFormat:@"%d° %d' %1.4f\"", degrees, minutes, seconds];
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude1 longitude:longitude1];
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error)
{
NSLog(@"----------------Placemark is %@-----------------", placemarks);
NSString *locality,*state,*country,*locationString;
if(error == nil && [placemarks count] >0)
{
CLPlacemark *placemark = [placemarks objectAtIndex:0];
locality = placemark.locality;
state = placemark.administrativeArea;
country = placemark.country;
locationString = [NSString stringWithFormat:@"%@, %@, %@", locality,state,country];
}
else if (error==nil && [placemarks count] == 0)
{
locationString = NSLocalizedString(@"Unable to retrieve location", @"XMSG: Unable to retrieve location");
}
else if(error!=nil)
{
locationString = NSLocalizedString(@"Error in retrieving location", @"XMSG: Error in retrieving location");
}
if(note !=nil)
{
locationLabel.text=note.location;
}
else
{
self.locationLabel.text = locationString;
}
[locationManager stopUpdatingLocation];
}];
}
</code> | ipad | ios-simulator | cllocationmanager | clgeocoder | null | null | open | Problems with location being displayed on iPad simulator and iPad
===
I seem to have two problems in displaying the current location in both the simulator and iPad.
1) The code below works fine to display a dummy location of 'Santa Cruz,California,United States' in the simulator, as I have set it to display so. But for the first time I install the app, and click 'Ok' for the alertview which asks if my app is allowed to take the current location, it is not displayed; I have to leave the view, then load it again.
Some changes I can make in the code?
2)The same though doesn't work on the iPad device. It just pops the alert view up, but no matter what I do, the location just doesn't get displayed!(It does show the location arrow in the notification bar)
Please help.
In <code>viewDidLoad</code>
<code>
//Core location details
if ([CLLocationManager locationServicesEnabled])
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // if I move
locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers; // 3Km
[locationManager startUpdatingLocation];
}
else
{
locationLabel.text = @"Location service disabled";
}
</code>
In the <code>didUpdateToLocation</code> method
<code>
//Core location delegate protocol
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
int latitude1 = newLocation.coordinate.latitude;
// double decimal = fabs(newLocation.coordinate.latitude - degrees);
// int minutes = decimal * 60;
// double seconds = decimal * 3600 - minutes * 60;
// latitude = [NSString stringWithFormat:@"%d° %d' %1.4f\"", degrees, minutes, seconds];
int longitude1 = newLocation.coordinate.longitude;
// decimal = fabs(newLocation.coordinate.longitude - degrees);
// minutes = decimal * 60;
// seconds = decimal * 3600 - minutes * 60;
// longitude = [NSString stringWithFormat:@"%d° %d' %1.4f\"", degrees, minutes, seconds];
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude1 longitude:longitude1];
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error)
{
NSLog(@"----------------Placemark is %@-----------------", placemarks);
NSString *locality,*state,*country,*locationString;
if(error == nil && [placemarks count] >0)
{
CLPlacemark *placemark = [placemarks objectAtIndex:0];
locality = placemark.locality;
state = placemark.administrativeArea;
country = placemark.country;
locationString = [NSString stringWithFormat:@"%@, %@, %@", locality,state,country];
}
else if (error==nil && [placemarks count] == 0)
{
locationString = NSLocalizedString(@"Unable to retrieve location", @"XMSG: Unable to retrieve location");
}
else if(error!=nil)
{
locationString = NSLocalizedString(@"Error in retrieving location", @"XMSG: Error in retrieving location");
}
if(note !=nil)
{
locationLabel.text=note.location;
}
else
{
self.locationLabel.text = locationString;
}
[locationManager stopUpdatingLocation];
}];
}
</code> | 0 |
11,217,611 | 06/26/2012 23:59:01 | 1,484,087 | 06/26/2012 22:07:07 | 1 | 0 | Java Servlet/Jsp image upload along with form values | I have a jsp form that accepts details about Employee name, sex, age, E-mail address and a <input type = file to upload his photo. My question is, how can I access the other form elements values using Servlet and save the uploaded image to a specific directory.
Awaiting your answer.... | java | image | servlets | parameters | upload | 06/28/2012 02:53:25 | not a real question | Java Servlet/Jsp image upload along with form values
===
I have a jsp form that accepts details about Employee name, sex, age, E-mail address and a <input type = file to upload his photo. My question is, how can I access the other form elements values using Servlet and save the uploaded image to a specific directory.
Awaiting your answer.... | 1 |
3,650,548 | 09/06/2010 09:59:37 | 215,980 | 11/21/2009 06:42:30 | 123 | 1 | Hosting Plan -- Need advise | I am planning to host a site which will have a huge traffic (Around 10000 users and all will be posting text, images, and will be rating other members).
So please advise me on the server configuration would require, or Which hosting plan is suitable.
Thanks
| hosting | web-hosting | null | null | null | 09/06/2010 14:05:07 | off topic | Hosting Plan -- Need advise
===
I am planning to host a site which will have a huge traffic (Around 10000 users and all will be posting text, images, and will be rating other members).
So please advise me on the server configuration would require, or Which hosting plan is suitable.
Thanks
| 2 |
4,732,040 | 01/19/2011 05:30:54 | 566,449 | 01/07/2011 05:20:45 | 1 | 0 | DotNetNuke or Asp.net MVC? | i want to develop a webapplication something like ebay but i am confused which one is to work on dnn or asp.net mvc.I have worked on both n got skills to manage in both.
i know mvc applications are faster performance wise but dnn has got builtin modules all i have to is to build some custom modules thats will be fast development.but if we talk about flexibility(loosely coupled) n scalbility its asp.net mvc.
Any suggestions would be greatly appreciated specailly from those developers who worked on both (dnn and Asp.net MVC) on core level.
cheers
thanks
Best Regards
Waqar Iqbal.
| asp.net-mvc | null | null | null | null | 01/19/2011 15:11:58 | off topic | DotNetNuke or Asp.net MVC?
===
i want to develop a webapplication something like ebay but i am confused which one is to work on dnn or asp.net mvc.I have worked on both n got skills to manage in both.
i know mvc applications are faster performance wise but dnn has got builtin modules all i have to is to build some custom modules thats will be fast development.but if we talk about flexibility(loosely coupled) n scalbility its asp.net mvc.
Any suggestions would be greatly appreciated specailly from those developers who worked on both (dnn and Asp.net MVC) on core level.
cheers
thanks
Best Regards
Waqar Iqbal.
| 2 |
9,842,578 | 03/23/2012 16:07:05 | 833,139 | 07/07/2011 08:30:15 | 469 | 2 | ASP.NET set div height to contain all data | I use VS2010, C#, ASP.NET; I read some data from SQL server and fill my DIV, I don't want to give this DIV a fixed height or scroll bar, rather I want it to have its height automatically set to maximum data, what should I do? how should I set my styles?
also I have another horizontal DIV that should be displayed at the bottom of page, how can I set it so that it is always fixed to bottom of page (not bottom of screen)?
a good example is the Related questions column in this site! and the gray horizontal DIV at the bottom of page
thanks | asp.net | div | null | null | null | null | open | ASP.NET set div height to contain all data
===
I use VS2010, C#, ASP.NET; I read some data from SQL server and fill my DIV, I don't want to give this DIV a fixed height or scroll bar, rather I want it to have its height automatically set to maximum data, what should I do? how should I set my styles?
also I have another horizontal DIV that should be displayed at the bottom of page, how can I set it so that it is always fixed to bottom of page (not bottom of screen)?
a good example is the Related questions column in this site! and the gray horizontal DIV at the bottom of page
thanks | 0 |
3,705,136 | 09/13/2010 23:27:22 | 442,917 | 09/08/2010 23:17:42 | 1 | 0 | Receive HTTP 500 error or blank page on IIS6 ASP.NET website | I have three web servers running a number of different websites. All 3 servers are running Win2003 with IIS6. I have one troublesome website however that is an ASP.NET website. Many users at random times through the day receive a blank page when trying to load the site. Looking through the IIS logs for the site I can see that usually this generates a HTTP 500 error. I can also see that our monitoring tools are reporting the site is down due to it receiving an HTTP 500 as well.
Searching through the internet I have found the perfect KB article from Microsoft, however it applies to IIS7 (http://support.microsoft.com/kb/949350). Has anyone experienced this in IIS6 and how can I resolve the issue?
If you have any questions or need more details I would be happy to respond!
Thanks! | asp.net | iis6 | windows-server-2003 | http-status-code-500 | null | null | open | Receive HTTP 500 error or blank page on IIS6 ASP.NET website
===
I have three web servers running a number of different websites. All 3 servers are running Win2003 with IIS6. I have one troublesome website however that is an ASP.NET website. Many users at random times through the day receive a blank page when trying to load the site. Looking through the IIS logs for the site I can see that usually this generates a HTTP 500 error. I can also see that our monitoring tools are reporting the site is down due to it receiving an HTTP 500 as well.
Searching through the internet I have found the perfect KB article from Microsoft, however it applies to IIS7 (http://support.microsoft.com/kb/949350). Has anyone experienced this in IIS6 and how can I resolve the issue?
If you have any questions or need more details I would be happy to respond!
Thanks! | 0 |
7,515,448 | 09/22/2011 13:23:57 | 705,998 | 04/13/2011 12:07:38 | 103 | 0 | How to make a favourite list iphone | I am making an app that has two tabs, one of which is a "favourite" tab. In the other tab called "search", I have a list of results displayed in a table view, when you tap one, you get to see the detail of that particular result. What I'm trying to do here is, there is a button in the detail view, when it is pressed, the current result gets sent to the "favourite" tab. I tried to use delegate to pass the information, but it didn't work out. Here is my code:
DetailViewController.m
-(IBAction) addSomething {
[self.delegate detailViewController:self addToFavourite:self.something];
}
FavouriteViewController.m, implement the delegate method:
- (void) detailViewController:(DetailViewController *)detailViewController addToFavourite:(Something *)something{
detailViewController.delegate = self;
[thingsList addObject:something];
[theTableView reloadData];
}
Everything is built and fine, but when I click "add" button in the detail view, the data doesn't get sent to "favourite" tab's view. Can anyone help me with this one? Do I need to use core data in this case, I never used core data before. Thanks. | iphone | core-data | delegates | uitabbarcontroller | null | null | open | How to make a favourite list iphone
===
I am making an app that has two tabs, one of which is a "favourite" tab. In the other tab called "search", I have a list of results displayed in a table view, when you tap one, you get to see the detail of that particular result. What I'm trying to do here is, there is a button in the detail view, when it is pressed, the current result gets sent to the "favourite" tab. I tried to use delegate to pass the information, but it didn't work out. Here is my code:
DetailViewController.m
-(IBAction) addSomething {
[self.delegate detailViewController:self addToFavourite:self.something];
}
FavouriteViewController.m, implement the delegate method:
- (void) detailViewController:(DetailViewController *)detailViewController addToFavourite:(Something *)something{
detailViewController.delegate = self;
[thingsList addObject:something];
[theTableView reloadData];
}
Everything is built and fine, but when I click "add" button in the detail view, the data doesn't get sent to "favourite" tab's view. Can anyone help me with this one? Do I need to use core data in this case, I never used core data before. Thanks. | 0 |
11,214,346 | 06/26/2012 19:09:48 | 1,115,761 | 12/26/2011 01:58:25 | 3 | 0 | How can I disable/block meta viewport on my iphone? | Is there any way possible to disable or make the viewport zoomable? hosts file edits, anything at all? like I said, it's jailbroken. and I'm experienced with editing plists and the like. | iphone | viewport | null | null | null | 06/28/2012 13:42:12 | not a real question | How can I disable/block meta viewport on my iphone?
===
Is there any way possible to disable or make the viewport zoomable? hosts file edits, anything at all? like I said, it's jailbroken. and I'm experienced with editing plists and the like. | 1 |
11,696,995 | 07/27/2012 23:48:41 | 110,795 | 05/21/2009 22:49:20 | 510 | 4 | SQL: retrieve records between dates in all databases | I would like to select all the records in a table between two dates. I have a query like:
<code>SELECT * FROM <table> WHERE (thedate BETWEEN DATE('2012-04-01') AND DATE('2012-06-30'))</code>
This is fine for HSQL, Oracle, PostgreSQL, but it doesn't work in SQL Server due to the lack of the Date function. Is there a way to get this to work generally for all databases (including SQL Server) or do I need to use an ORM like Hibernate (I know I should, but I'm specifically asking if this can be done in SQL)? | sql | sql-server | datetime | null | null | null | open | SQL: retrieve records between dates in all databases
===
I would like to select all the records in a table between two dates. I have a query like:
<code>SELECT * FROM <table> WHERE (thedate BETWEEN DATE('2012-04-01') AND DATE('2012-06-30'))</code>
This is fine for HSQL, Oracle, PostgreSQL, but it doesn't work in SQL Server due to the lack of the Date function. Is there a way to get this to work generally for all databases (including SQL Server) or do I need to use an ORM like Hibernate (I know I should, but I'm specifically asking if this can be done in SQL)? | 0 |
863,866 | 05/14/2009 15:04:44 | 12,730 | 09/16/2008 15:27:13 | 215 | 28 | Should I use a Field or Property within the class to set values | So I got into a friendly argument with a co-worker over a piece of code:
public sealed class NewObject
{
private string _stuff = string.Empty;
public string Stuff
{
get { return GetAllStuff(); }
}
private string GetAllStuff()
{
//Heavy string manipulation of _stuff
}
public NewObject(string stuffToStartWith)
{
_stuff = stuffToStartWith;
}
public static NewObject operator +(NewObject obj1, NewObject obj2)
{
if (obj1 == null)
throw new ArgumentNullException();
if (obj2 == null)
throw new ArgumentNullException();
NewObject result = new NewObject(string.Empty);
result._stuff = String.Concat(obj1._stuff, obj2._stuff);
return result;
}
}
The argument was over the operator override. My co-worker feels that it's not best programming practice to set values of private fields anywhere but the constructor. The solution proposed by my co-worker was to refactor the name of the `Stuff` property to `AllStuff` and add a property, `Stuff`, that has a `get` AND `set` accessor and use the new `Stuff` property in the operator override. Making it look like this:
public static NewObject operator +(NewObject obj1, NewObject obj2)
{
if (obj1 == null)
throw new ArgumentNullException();
if (obj2 == null)
throw new ArgumentNullException();
NewObject result = new NewObject(string.Empty);
result.Stuff = String.Concat(obj1.Stuff, obj2.Stuff);
return result;
}
I disagree. I feel the first way is better since it keeps the property read-only outside the class. My question is, which way is the best practice for object-oriented design? | c# | null | null | null | null | null | open | Should I use a Field or Property within the class to set values
===
So I got into a friendly argument with a co-worker over a piece of code:
public sealed class NewObject
{
private string _stuff = string.Empty;
public string Stuff
{
get { return GetAllStuff(); }
}
private string GetAllStuff()
{
//Heavy string manipulation of _stuff
}
public NewObject(string stuffToStartWith)
{
_stuff = stuffToStartWith;
}
public static NewObject operator +(NewObject obj1, NewObject obj2)
{
if (obj1 == null)
throw new ArgumentNullException();
if (obj2 == null)
throw new ArgumentNullException();
NewObject result = new NewObject(string.Empty);
result._stuff = String.Concat(obj1._stuff, obj2._stuff);
return result;
}
}
The argument was over the operator override. My co-worker feels that it's not best programming practice to set values of private fields anywhere but the constructor. The solution proposed by my co-worker was to refactor the name of the `Stuff` property to `AllStuff` and add a property, `Stuff`, that has a `get` AND `set` accessor and use the new `Stuff` property in the operator override. Making it look like this:
public static NewObject operator +(NewObject obj1, NewObject obj2)
{
if (obj1 == null)
throw new ArgumentNullException();
if (obj2 == null)
throw new ArgumentNullException();
NewObject result = new NewObject(string.Empty);
result.Stuff = String.Concat(obj1.Stuff, obj2.Stuff);
return result;
}
I disagree. I feel the first way is better since it keeps the property read-only outside the class. My question is, which way is the best practice for object-oriented design? | 0 |
10,145,681 | 04/13/2012 17:42:53 | 51,649 | 01/05/2009 13:47:38 | 1,957 | 51 | jQuery children returns a boolean? | I've come across this line and I can guess what it's doing but shouldn't there be a `length > 0` on the children or will it always return/can be used as a boolean?
Or does jQuery's children return a boolean, or is this person relying on the existence of the returned children?
append(($(this).children()) ? '<div class="vAlignWrapper" style="overflow: hidden;">' + $(this).html() + '</div>' : ' ').
I'm trying to debug a large JS file and I'm trying to make sure each line does what its supposed to do. | javascript | jquery | null | null | null | null | open | jQuery children returns a boolean?
===
I've come across this line and I can guess what it's doing but shouldn't there be a `length > 0` on the children or will it always return/can be used as a boolean?
Or does jQuery's children return a boolean, or is this person relying on the existence of the returned children?
append(($(this).children()) ? '<div class="vAlignWrapper" style="overflow: hidden;">' + $(this).html() + '</div>' : ' ').
I'm trying to debug a large JS file and I'm trying to make sure each line does what its supposed to do. | 0 |
9,025,182 | 01/26/2012 20:54:24 | 612,143 | 02/10/2011 21:25:05 | 280 | 1 | what is preventing PHP from connecting to my MySQL database? | I am having a problem connecting to a MySQL database using a Bitnami LAMP stack. This is the code I used to connect on the shared-hosting server where I originally hosted the database:
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
if ($dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) { // Make the connnection.
if (!mysql_select_db (DB_NAME)) { // If it can't select the database.
// Handle the error.
trigger_error("Could not select the database!\n<br />MySQL Error: " . mysql_error());
exit();
} // End of mysql_select_db IF.
} else { // If it couldn't connect to MySQL.
trigger_error("Could not connect to MySQL!\n<br />MySQL Error: " . mysql_error());
exit();
} // End of $dbc IF.
Running this on my Bitnami server, I get no response (not even an error message). (PHP is working fine.)
I then tried
<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
and got
Could not connect: Access denied for user 'username'@'localhost' (using password: YES)
this username/password combination definitely exists and (as far as I can tell) has access to the database in question. I am wondering what I am doing wrong and why the original script does not produce an error (or connect). | php | mysql | bitnami | null | null | null | open | what is preventing PHP from connecting to my MySQL database?
===
I am having a problem connecting to a MySQL database using a Bitnami LAMP stack. This is the code I used to connect on the shared-hosting server where I originally hosted the database:
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
if ($dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) { // Make the connnection.
if (!mysql_select_db (DB_NAME)) { // If it can't select the database.
// Handle the error.
trigger_error("Could not select the database!\n<br />MySQL Error: " . mysql_error());
exit();
} // End of mysql_select_db IF.
} else { // If it couldn't connect to MySQL.
trigger_error("Could not connect to MySQL!\n<br />MySQL Error: " . mysql_error());
exit();
} // End of $dbc IF.
Running this on my Bitnami server, I get no response (not even an error message). (PHP is working fine.)
I then tried
<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
and got
Could not connect: Access denied for user 'username'@'localhost' (using password: YES)
this username/password combination definitely exists and (as far as I can tell) has access to the database in question. I am wondering what I am doing wrong and why the original script does not produce an error (or connect). | 0 |
9,712,775 | 03/15/2012 01:24:38 | 639,028 | 03/01/2011 08:37:46 | 43 | 1 | Background image won't show | Below is the HTML and CSS code for my sidebar.
<div id="sidebar">
<header>
<h3 class="site-title">The Code Stitchery</h3>
</header>
<nav>
<ul>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
CSS
nav a {
background: url(/Images/tape_measure_unit.png) no-repeat;
display: block;
padding: 2px 4px;
text-align: center;
width: 256px;
height: 36px;
}
The background images show up just fine in Eclipse's Web Page Editor, but when I go to open the same page in a web browser, only the text is showing.
I've tried the recommendations from some other posts, including:
- http://stackoverflow.com/questions/4633409/background-image-wont-show-up-in-css-unless-i-load-an-image-using-the-img-tag
- http://stackoverflow.com/questions/7091925/background-images-not-appearing
- http://stackoverflow.com/questions/8048263/background-image-wont-show-up
but I'm still stumped.
This is what the sidebar looks like in Eclipse's Web Page Editor:
![A screenshot of the offending page][1]
This is what it looks like in Mozilla Firefox:
![enter image description here][2]
Any tips for getting the images to show properly?
[1]: http://i.stack.imgur.com/hcvro.png
[2]: http://i.stack.imgur.com/YCXy6.png | html5 | css3 | null | null | null | null | open | Background image won't show
===
Below is the HTML and CSS code for my sidebar.
<div id="sidebar">
<header>
<h3 class="site-title">The Code Stitchery</h3>
</header>
<nav>
<ul>
<li><a href="#">Portfolio</a></li>
<li><a href="#">Blog</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
CSS
nav a {
background: url(/Images/tape_measure_unit.png) no-repeat;
display: block;
padding: 2px 4px;
text-align: center;
width: 256px;
height: 36px;
}
The background images show up just fine in Eclipse's Web Page Editor, but when I go to open the same page in a web browser, only the text is showing.
I've tried the recommendations from some other posts, including:
- http://stackoverflow.com/questions/4633409/background-image-wont-show-up-in-css-unless-i-load-an-image-using-the-img-tag
- http://stackoverflow.com/questions/7091925/background-images-not-appearing
- http://stackoverflow.com/questions/8048263/background-image-wont-show-up
but I'm still stumped.
This is what the sidebar looks like in Eclipse's Web Page Editor:
![A screenshot of the offending page][1]
This is what it looks like in Mozilla Firefox:
![enter image description here][2]
Any tips for getting the images to show properly?
[1]: http://i.stack.imgur.com/hcvro.png
[2]: http://i.stack.imgur.com/YCXy6.png | 0 |
4,853,380 | 01/31/2011 16:32:39 | 163,495 | 08/26/2009 12:55:15 | 761 | 34 | Setting Z-Index in DataBound items on a Canvas | I am trying to bind a list of items to an ItemsControl, using a Canvas layout, where the item has multiple "levels". This is easiest to explain using an image:
![Problem][1]
My lower level is a drop-shadow in this case. Because I assumed the drop shadow would be attached to the main element (a Button), I created another visual element, a Border, which sits behind the Button and has the shadow attached. What I would like is for all of my shadow elements to be at the same overall ZIndex, and all of the Button elements to be above them.
In practice, it appears that WPF renders the contents of my template as a single UI element, essentially flattening the ZIndexes within it. Is there any way I can make it so that the ZIndex values are not flattened?
I have created a sample below which shows the problem:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="250" Width="600" Background="White">
<Window.Resources>
<DropShadowEffect Color="Blue" BlurRadius="75" x:Key="ActionDropShadow" />
<XmlDataProvider x:Key="myData" XPath="Data/Items">
<x:XData>
<Data xmlns="">
<Items>
<Item X="50" Title="AAA" />
<Item X="100" Title="BBB" />
<Item X="150" Title="CCC" />
</Items>
</Data>
</x:XData>
</XmlDataProvider>
<DataTemplate x:Key="BoxTemplate">
<Grid>
<Border Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Background="White" BorderThickness="1">
<TextBlock Text="{Binding XPath=@Title}" />
</Button>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ItemsControl Grid.Column="0" x:Name="list" ItemTemplate="{StaticResource BoxTemplate}" ItemsSource="{Binding Source={StaticResource myData},XPath=*}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding XPath=@X}" />
<Setter Property="Canvas.Top" Value="50" />
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="80" />
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
<Canvas Grid.Column="1">
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="50" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="50" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="AAA" />
</Button>
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="100" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="100" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="BBB" />
</Button>
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="150" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="150" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="CCC" />
</Button>
</Canvas>
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center">Databinding Version</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center">What it should look like</TextBlock>
</Grid>
</Window>
Thanks in advance for any ideas you can offer!
[1]: http://i.stack.imgur.com/wOFzA.png
| wpf | data-binding | canvas | null | null | null | open | Setting Z-Index in DataBound items on a Canvas
===
I am trying to bind a list of items to an ItemsControl, using a Canvas layout, where the item has multiple "levels". This is easiest to explain using an image:
![Problem][1]
My lower level is a drop-shadow in this case. Because I assumed the drop shadow would be attached to the main element (a Button), I created another visual element, a Border, which sits behind the Button and has the shadow attached. What I would like is for all of my shadow elements to be at the same overall ZIndex, and all of the Button elements to be above them.
In practice, it appears that WPF renders the contents of my template as a single UI element, essentially flattening the ZIndexes within it. Is there any way I can make it so that the ZIndex values are not flattened?
I have created a sample below which shows the problem:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="250" Width="600" Background="White">
<Window.Resources>
<DropShadowEffect Color="Blue" BlurRadius="75" x:Key="ActionDropShadow" />
<XmlDataProvider x:Key="myData" XPath="Data/Items">
<x:XData>
<Data xmlns="">
<Items>
<Item X="50" Title="AAA" />
<Item X="100" Title="BBB" />
<Item X="150" Title="CCC" />
</Items>
</Data>
</x:XData>
</XmlDataProvider>
<DataTemplate x:Key="BoxTemplate">
<Grid>
<Border Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Background="White" BorderThickness="1">
<TextBlock Text="{Binding XPath=@Title}" />
</Button>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ItemsControl Grid.Column="0" x:Name="list" ItemTemplate="{StaticResource BoxTemplate}" ItemsSource="{Binding Source={StaticResource myData},XPath=*}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.Left" Value="{Binding XPath=@X}" />
<Setter Property="Canvas.Top" Value="50" />
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="80" />
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
<Canvas Grid.Column="1">
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="50" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="50" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="AAA" />
</Button>
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="100" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="100" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="BBB" />
</Button>
<Border Panel.ZIndex="5" Canvas.Top="50" Canvas.Left="150" Width="50" Height="80" Background="Black" BorderThickness="1" Effect="{StaticResource ActionDropShadow}" />
<Button Panel.ZIndex="10" Canvas.Top="50" Canvas.Left="150" Width="50" Height="80" Background="White" BorderThickness="1">
<TextBlock Text="CCC" />
</Button>
</Canvas>
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center">Databinding Version</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center">What it should look like</TextBlock>
</Grid>
</Window>
Thanks in advance for any ideas you can offer!
[1]: http://i.stack.imgur.com/wOFzA.png
| 0 |
6,716,410 | 07/16/2011 09:04:15 | 825,782 | 07/02/2011 05:20:27 | 3 | 0 | how can I order like this in mysql | How can I order in mysql like
1 1/2 2 3/1 3/2 3/12 5 5/1 7 13/1
when i or der it bring 1 1/2 13/1 befor 5
format is x/x whre x is number | mysql | null | null | null | null | 07/16/2011 17:34:51 | not a real question | how can I order like this in mysql
===
How can I order in mysql like
1 1/2 2 3/1 3/2 3/12 5 5/1 7 13/1
when i or der it bring 1 1/2 13/1 befor 5
format is x/x whre x is number | 1 |
8,231,730 | 11/22/2011 18:21:28 | 561,731 | 01/03/2011 20:37:07 | 28,201 | 1,633 | Closures in auto executing functions vs objects | Let us say I have the following:
var foo = (function(){
var bar = 0;
return {
getBar: function(){
return bar;
},
addOne: function(){
bar++;
},
addRandom: function(rand){
bar += rand;
}
}
})();
And I have the following:
var foo2 = function(){
var bar = 0;
this.getBar = function(){
return bar;
};
this.addOne = function(){
bar++;
};
this.addRandom = function(rand){
bar += rand;
}
};
Is the only difference in executing the functions a `new`?
alert(foo.getBar()); //0
foo.addOne();
foo.addRandom(32);
alert(foo.getBar()); //33
var foo2_obj = new foo2;
alert(foo2_obj.getBar());//0
foo2_obj.addOne();
foo2_obj.addRandom(32);
alert(foo2_obj.getBar());//33
They both out put the exact same thing.
So what is the difference in the long run?
What can one do that the other cannot?
Fiddle Demo of the above: http://jsfiddle.net/maniator/YtBpe/ | javascript | object | closures | null | null | null | open | Closures in auto executing functions vs objects
===
Let us say I have the following:
var foo = (function(){
var bar = 0;
return {
getBar: function(){
return bar;
},
addOne: function(){
bar++;
},
addRandom: function(rand){
bar += rand;
}
}
})();
And I have the following:
var foo2 = function(){
var bar = 0;
this.getBar = function(){
return bar;
};
this.addOne = function(){
bar++;
};
this.addRandom = function(rand){
bar += rand;
}
};
Is the only difference in executing the functions a `new`?
alert(foo.getBar()); //0
foo.addOne();
foo.addRandom(32);
alert(foo.getBar()); //33
var foo2_obj = new foo2;
alert(foo2_obj.getBar());//0
foo2_obj.addOne();
foo2_obj.addRandom(32);
alert(foo2_obj.getBar());//33
They both out put the exact same thing.
So what is the difference in the long run?
What can one do that the other cannot?
Fiddle Demo of the above: http://jsfiddle.net/maniator/YtBpe/ | 0 |
5,126,718 | 02/26/2011 11:51:35 | 173,766 | 09/15/2009 14:42:11 | 20 | 1 | Importing large json file into mongodb | I have a 80MB json file which I need to insert into MongoDB using pymongo. I tried GridFS but figured out that it is mostly for storing a single large file (atleast from what I figure out).
Can anybody advise me on how to go about it.
Thanks | python | json | mongodb | nosql | pymongo | 01/24/2012 21:54:50 | not a real question | Importing large json file into mongodb
===
I have a 80MB json file which I need to insert into MongoDB using pymongo. I tried GridFS but figured out that it is mostly for storing a single large file (atleast from what I figure out).
Can anybody advise me on how to go about it.
Thanks | 1 |
9,189,290 | 02/08/2012 07:27:58 | 525,088 | 11/30/2010 11:40:04 | 8 | 0 | How can I switch user without password in ubuntu server 11.1? | How can I switch user without password in ubuntu server 11.1 ?
in CentOS
> passwd -d -u *username*
but Ubuntu 11.10 not work
any idea?
thanks.
Joe
| ubuntu | null | null | null | null | 02/08/2012 10:01:34 | off topic | How can I switch user without password in ubuntu server 11.1?
===
How can I switch user without password in ubuntu server 11.1 ?
in CentOS
> passwd -d -u *username*
but Ubuntu 11.10 not work
any idea?
thanks.
Joe
| 2 |
10,791,763 | 05/29/2012 00:26:54 | 774,078 | 05/28/2011 06:28:01 | 77 | 7 | jQuery $.post basics | I'm just learning how to use jquery, and I'm beyond confused. Here's what I'm trying to do (for practice/learning purposes):
1. Take an input
2. Post the input into a div tag using jquery
Here's my code.. but it's not working
<script type="text/javascript">
function test(data) {
$.post("<?php echo $_SERVER['PHP_SELF']; ?>", function(data) {
$("#lol").innerHTML = data;
});
}
</script>
<form action="" onsubmit="test($(this.children()))" method="POST">
<input type="hidden"
value="derp" />
<input type="text"
name="herp" />
<a href="javascript:void(0)"
onclick="test($(this).parent())">
Submit
</a>
</form>
<div id="lol">...</div>
Some help/tutorial explanation would be absolutely wonderful. Thanks! | php | javascript | jquery | html | null | 05/29/2012 02:05:20 | not a real question | jQuery $.post basics
===
I'm just learning how to use jquery, and I'm beyond confused. Here's what I'm trying to do (for practice/learning purposes):
1. Take an input
2. Post the input into a div tag using jquery
Here's my code.. but it's not working
<script type="text/javascript">
function test(data) {
$.post("<?php echo $_SERVER['PHP_SELF']; ?>", function(data) {
$("#lol").innerHTML = data;
});
}
</script>
<form action="" onsubmit="test($(this.children()))" method="POST">
<input type="hidden"
value="derp" />
<input type="text"
name="herp" />
<a href="javascript:void(0)"
onclick="test($(this).parent())">
Submit
</a>
</form>
<div id="lol">...</div>
Some help/tutorial explanation would be absolutely wonderful. Thanks! | 1 |
6,676,304 | 07/13/2011 08:43:15 | 829,563 | 07/05/2011 11:10:58 | 1 | 0 | Changing text of selected item in listbox just deletes it. | G'day all,
I'm having a problem using the `listbox1.items[x] = stringhere` for some reason when ever I call this property to change the text all it does is remove the item completely from the listbox. Thanks a bunch guys.
Here is the code: (The problem occurs inside the case "tb_MName" switch)
public void SetMovieEditable(string sendername, string movie)
{
Boolean changeoccured = false;
XDoc.Load(tb_DBDir.Text + "\\MMM.xml");
int x = lb_Movies.SelectedIndex;
foreach (XmlNode XNode in XDoc.DocumentElement.ChildNodes)
{
//Only do the work if we are working with the right XmlNode
if (XNode.Attributes.GetNamedItem("Name").Value == lb_Movies.SelectedItem.ToString())
{
switch (sendername)
{
//Movie name has been changed?
case "tb_MName":
//Is the new movie name actually different from current name?
if (tb_MName.Text != XNode.Attributes.GetNamedItem("Name").Value)
{
//Add input to the debugging window
DebugStatus(sendername, movie, XNode.Attributes.GetNamedItem("Name").Value, movie);
//This should be changing the items text but instead just deletes it.
lb_Movies.Items[x] = movie;
//Change the value of the XmlNodes name attribute to the new movie name
XNode.Attributes.GetNamedItem("Name").Value = lb_Movies.Items[x].ToString();
//If a change has occured
changeoccured = true;
}
else { changeoccured = false; }
break;
}
if (changeoccured != false)
{
//save the document with the change
XDoc.Save(tb_DBDir.Text + "\\MMM.xml");
}
}
}
}
private void tb_MName_KeyPress(object sender, KeyPressEventArgs e)
{
//Did they just press enter?
if (e.KeyChar == 13)
{
//Lets begin the change of the old movie name to the new movie name
SetMovieEditable(tb_MName.Name, tb_MName.Text);
//Does the new movie name match the actual files name? If not then do you want to rename it?
if (tb_MName.Text != Path.GetFileNameWithoutExtension(lb_FName.Text))
{
if (MessageBox.Show("Would you like to rename the file to match the new Movie name?", "Rename file?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.Yes)
{
//Update the FName label with the MName text box
lb_FName.Text = tb_MName.Text;
//Lets begin the change of the old filename to the new filename
SetMovieEditable(lb_FName.Name, tb_MName.Text);
}
}
}
}
private void lb_Movies_SelectedIndexChanged(object sender, EventArgs e)
{
//Showing the saved properties of the selected movie
DisplayMovie(lb_Movies.SelectedItem.ToString());
} | c# | text | listbox | item | deleting | 07/15/2011 11:02:46 | too localized | Changing text of selected item in listbox just deletes it.
===
G'day all,
I'm having a problem using the `listbox1.items[x] = stringhere` for some reason when ever I call this property to change the text all it does is remove the item completely from the listbox. Thanks a bunch guys.
Here is the code: (The problem occurs inside the case "tb_MName" switch)
public void SetMovieEditable(string sendername, string movie)
{
Boolean changeoccured = false;
XDoc.Load(tb_DBDir.Text + "\\MMM.xml");
int x = lb_Movies.SelectedIndex;
foreach (XmlNode XNode in XDoc.DocumentElement.ChildNodes)
{
//Only do the work if we are working with the right XmlNode
if (XNode.Attributes.GetNamedItem("Name").Value == lb_Movies.SelectedItem.ToString())
{
switch (sendername)
{
//Movie name has been changed?
case "tb_MName":
//Is the new movie name actually different from current name?
if (tb_MName.Text != XNode.Attributes.GetNamedItem("Name").Value)
{
//Add input to the debugging window
DebugStatus(sendername, movie, XNode.Attributes.GetNamedItem("Name").Value, movie);
//This should be changing the items text but instead just deletes it.
lb_Movies.Items[x] = movie;
//Change the value of the XmlNodes name attribute to the new movie name
XNode.Attributes.GetNamedItem("Name").Value = lb_Movies.Items[x].ToString();
//If a change has occured
changeoccured = true;
}
else { changeoccured = false; }
break;
}
if (changeoccured != false)
{
//save the document with the change
XDoc.Save(tb_DBDir.Text + "\\MMM.xml");
}
}
}
}
private void tb_MName_KeyPress(object sender, KeyPressEventArgs e)
{
//Did they just press enter?
if (e.KeyChar == 13)
{
//Lets begin the change of the old movie name to the new movie name
SetMovieEditable(tb_MName.Name, tb_MName.Text);
//Does the new movie name match the actual files name? If not then do you want to rename it?
if (tb_MName.Text != Path.GetFileNameWithoutExtension(lb_FName.Text))
{
if (MessageBox.Show("Would you like to rename the file to match the new Movie name?", "Rename file?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == System.Windows.Forms.DialogResult.Yes)
{
//Update the FName label with the MName text box
lb_FName.Text = tb_MName.Text;
//Lets begin the change of the old filename to the new filename
SetMovieEditable(lb_FName.Name, tb_MName.Text);
}
}
}
}
private void lb_Movies_SelectedIndexChanged(object sender, EventArgs e)
{
//Showing the saved properties of the selected movie
DisplayMovie(lb_Movies.SelectedItem.ToString());
} | 3 |
9,851,453 | 03/24/2012 11:44:42 | 1,109,646 | 12/21/2011 10:29:36 | 10 | 0 | Why does Google use inline JavaScript and CSS? | I can only see inline CSS and JS while viewing the source code of Google webpage. I don't see any CSS file or JS file being included.
How do they include jquery, plugins etc? (or) Does Google use Jquery? | javascript | css | google | null | null | 03/24/2012 19:47:22 | not constructive | Why does Google use inline JavaScript and CSS?
===
I can only see inline CSS and JS while viewing the source code of Google webpage. I don't see any CSS file or JS file being included.
How do they include jquery, plugins etc? (or) Does Google use Jquery? | 4 |
10,795,733 | 05/29/2012 08:39:15 | 1,341,180 | 04/18/2012 11:25:42 | 1 | 0 | UITableView is reviled only after it is scrolled upwards | I have storyboard with UIView and a UITableView in it. The UITableView has custom cells.
When I run the app, Only the first row of the table is shown, the rest of the table is hidden.
The rows are not seen on the screen, but they respond to user interaction as accpected.
The rest of the cells are revieled only after the table is scrolled upwards.
What could be the problem?
Thanks in advance,
Luda | objective-c | uitableview | scroll | hidden | custom-cell | null | open | UITableView is reviled only after it is scrolled upwards
===
I have storyboard with UIView and a UITableView in it. The UITableView has custom cells.
When I run the app, Only the first row of the table is shown, the rest of the table is hidden.
The rows are not seen on the screen, but they respond to user interaction as accpected.
The rest of the cells are revieled only after the table is scrolled upwards.
What could be the problem?
Thanks in advance,
Luda | 0 |
10,906,747 | 06/06/2012 00:18:59 | 1,377,650 | 05/06/2012 05:27:20 | 14 | 1 | Java apache Httpclient form-based login myspace | So I am trying to login to a website (in this example myspace) using Apache's HttpClient v.4 but I am not sure where I am going wrong in the process, when I test this code, the Post Login Cookies are the same as the Initial login cookies, but that shouldn't be.
I have looked around online to see if anyone else has tried, but I haven't found a good resource that has worked for me.
I am using this example: http://hc.apache.org/httpcomponents-client-ga/examples.html ( Form Based Login)
try{
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://www.myspace.com/auth/form");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println("Login form get: " + response.getStatusLine());
if (entity != null) {
entity.consumeContent();
}
System.out.println("Initial set of cookies:");
List<Cookie> cookies = httpclient.getCookieStore().getCookies();
if (cookies.isEmpty()) {
System.out.println("None");
} else {
for (int i = 0; i < cookies.size(); i++) {
System.out.println("- " + cookies.get(i).toString());
}
}
HttpPost httpost = new HttpPost("http://www.myspace.com/auth/form");
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("email", "someEmail"));
nvps.add(new BasicNameValuePair("password", "somePassword"));
httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
response = httpclient.execute(httpost);
entity = response.getEntity();
//System.out.println("Double check we've got right page " + EntityUtils.toString(entity));
System.out.println("Login form get: " + response.getStatusLine());
if (entity != null) {
entity.consumeContent();
}
System.out.println("Post logon cookies:");
cookies = httpclient.getCookieStore().getCookies();
if (cookies.isEmpty()) {
System.out.println("None");
} else {
for (int i = 0; i < cookies.size(); i++) {
System.out.println("- " + cookies.get(i).toString());
}
}
httpclient.getConnectionManager().shutdown();
}
catch(Exception e){e.printStackTrace();} | java | forms | apache | login | httpclient | null | open | Java apache Httpclient form-based login myspace
===
So I am trying to login to a website (in this example myspace) using Apache's HttpClient v.4 but I am not sure where I am going wrong in the process, when I test this code, the Post Login Cookies are the same as the Initial login cookies, but that shouldn't be.
I have looked around online to see if anyone else has tried, but I haven't found a good resource that has worked for me.
I am using this example: http://hc.apache.org/httpcomponents-client-ga/examples.html ( Form Based Login)
try{
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://www.myspace.com/auth/form");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println("Login form get: " + response.getStatusLine());
if (entity != null) {
entity.consumeContent();
}
System.out.println("Initial set of cookies:");
List<Cookie> cookies = httpclient.getCookieStore().getCookies();
if (cookies.isEmpty()) {
System.out.println("None");
} else {
for (int i = 0; i < cookies.size(); i++) {
System.out.println("- " + cookies.get(i).toString());
}
}
HttpPost httpost = new HttpPost("http://www.myspace.com/auth/form");
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("email", "someEmail"));
nvps.add(new BasicNameValuePair("password", "somePassword"));
httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
response = httpclient.execute(httpost);
entity = response.getEntity();
//System.out.println("Double check we've got right page " + EntityUtils.toString(entity));
System.out.println("Login form get: " + response.getStatusLine());
if (entity != null) {
entity.consumeContent();
}
System.out.println("Post logon cookies:");
cookies = httpclient.getCookieStore().getCookies();
if (cookies.isEmpty()) {
System.out.println("None");
} else {
for (int i = 0; i < cookies.size(); i++) {
System.out.println("- " + cookies.get(i).toString());
}
}
httpclient.getConnectionManager().shutdown();
}
catch(Exception e){e.printStackTrace();} | 0 |
3,436,058 | 08/08/2010 21:08:09 | 227,332 | 12/08/2009 17:43:03 | 803 | 49 | Model, Business Rules and Persistence | I'm having trouble figuring out the best approach for an certain application. I'm not really used to newer architectures that superseded old TLA (three layer architecture), so that's where I'm coming from.
When designing the *Model* and the *DAL* for my application (POCO classes, right??), I got the following doubts:
1. **Should my Model classes only expose properties and implement rule validations?** A few years ago I'd implement classes that were analogous to the real world, so if I had a *Person* who could *Walk*, I'd create such a method. Now, every sample I check (MVC, MVVM, etc.) have "dumb classes", which expose data and, when required, validate those data. What about complex operations? Should they become, somehow, part of the VM (I doubt this is right...).
2. **When using LINQ to SQL as an ORM mapper, should I expose in the model all the attributes of the entity?** For example, most of my entities have an ID column as its primary key. This should be of no concern of the Model or Business, just an implementation detail of my database schema.
3. **If (1) and (2) are false, so the Model *should* expose complex operations on the classes and not all of the entities attributes should be exposed, how do I create the Model classes using LINQ to SQL and sqlmetal?** I've seen some samples that use partial classes to extend the functionality of the schema entities, but that would result in exposing the entity details (since it's just an extension).
3. **If (2) is false, what is the most correct way of using sqlmetal and LINQ as an ORM?** I use sqlmetal to extract the schema, LINQ to select entities, and then what? Create new entities based on what I have on the database?
4. **In my researches I found that the VM from MVVM and the P from MVP are somewhat similar. What are the responsibilities of a *Presenter*? And those of a *ViewModel*?** I'm focusing on those two patterns because they completely isolate the View from the Model, an aspect that I prefer.
5. **What are some methodologies when designing such [MVVM, MVP] applications?** Should I begin thinking about the Model, then the {P, VM} layer, then the view? This is more of a subjective question, I know, but examples would be nice.
*I hope I was able to make the questions objective enough. I've added explanations to my doubts in order to simplify answering, but I'm afraid this has made the post a little bit too large. Anyway, thanks a lot for reading, any suggestions are very welcome.* | model | business | sqlmetal | null | null | null | open | Model, Business Rules and Persistence
===
I'm having trouble figuring out the best approach for an certain application. I'm not really used to newer architectures that superseded old TLA (three layer architecture), so that's where I'm coming from.
When designing the *Model* and the *DAL* for my application (POCO classes, right??), I got the following doubts:
1. **Should my Model classes only expose properties and implement rule validations?** A few years ago I'd implement classes that were analogous to the real world, so if I had a *Person* who could *Walk*, I'd create such a method. Now, every sample I check (MVC, MVVM, etc.) have "dumb classes", which expose data and, when required, validate those data. What about complex operations? Should they become, somehow, part of the VM (I doubt this is right...).
2. **When using LINQ to SQL as an ORM mapper, should I expose in the model all the attributes of the entity?** For example, most of my entities have an ID column as its primary key. This should be of no concern of the Model or Business, just an implementation detail of my database schema.
3. **If (1) and (2) are false, so the Model *should* expose complex operations on the classes and not all of the entities attributes should be exposed, how do I create the Model classes using LINQ to SQL and sqlmetal?** I've seen some samples that use partial classes to extend the functionality of the schema entities, but that would result in exposing the entity details (since it's just an extension).
3. **If (2) is false, what is the most correct way of using sqlmetal and LINQ as an ORM?** I use sqlmetal to extract the schema, LINQ to select entities, and then what? Create new entities based on what I have on the database?
4. **In my researches I found that the VM from MVVM and the P from MVP are somewhat similar. What are the responsibilities of a *Presenter*? And those of a *ViewModel*?** I'm focusing on those two patterns because they completely isolate the View from the Model, an aspect that I prefer.
5. **What are some methodologies when designing such [MVVM, MVP] applications?** Should I begin thinking about the Model, then the {P, VM} layer, then the view? This is more of a subjective question, I know, but examples would be nice.
*I hope I was able to make the questions objective enough. I've added explanations to my doubts in order to simplify answering, but I'm afraid this has made the post a little bit too large. Anyway, thanks a lot for reading, any suggestions are very welcome.* | 0 |
8,844,353 | 01/13/2012 00:26:23 | 436,560 | 09/01/2010 03:12:59 | 742 | 105 | Can operating system vulnerabilities affect database security? | Let's say an operating system is installed on a computer and a DBMS is installed on the same computer. Suppose that the operating system has a security vulnerability. Is there a possibility that the security vulnerability of the OS causes a security vulnerability of the DBMS?
Thanks. | security | operating-system | dbms | null | null | 01/13/2012 00:35:42 | off topic | Can operating system vulnerabilities affect database security?
===
Let's say an operating system is installed on a computer and a DBMS is installed on the same computer. Suppose that the operating system has a security vulnerability. Is there a possibility that the security vulnerability of the OS causes a security vulnerability of the DBMS?
Thanks. | 2 |
774,924 | 04/21/2009 22:25:35 | 74,865 | 03/06/2009 20:16:16 | 82 | 8 | Where do I put my custom Levels folder in XNA game? | I am quite lost with where and how to store the *.txt level files in my game.
What I want in my game is the availability of a few "prebaked" levels that come installed with the game but also the ability for users to create their OWN levels.
So what I did is created a new directory inside visual studio in the "Content" called levels, and put a "level1.txt" there. But the only way I can access the level *.txt files is by using full path, and I cannot INCLUDE them in my visual studio solution because it does not build:
"C:\My Documents\blahblabh....\levels\level1.txt"
- Do I put these "prebaked" maps instead into some directory near the executable? How do I create a directory inside the /bin directory Before I compile the project?
- How do I dissalow users from deleting the "prebaked" levels that come installed with the game?
- Also, Where do I store the User Custom created levels? I assume that should be done with StorageDevice. But that ties in with the first question on how to create a directory after game is deployed.
Any pointers would be welcome! Thank you | xna | storage | null | null | null | null | open | Where do I put my custom Levels folder in XNA game?
===
I am quite lost with where and how to store the *.txt level files in my game.
What I want in my game is the availability of a few "prebaked" levels that come installed with the game but also the ability for users to create their OWN levels.
So what I did is created a new directory inside visual studio in the "Content" called levels, and put a "level1.txt" there. But the only way I can access the level *.txt files is by using full path, and I cannot INCLUDE them in my visual studio solution because it does not build:
"C:\My Documents\blahblabh....\levels\level1.txt"
- Do I put these "prebaked" maps instead into some directory near the executable? How do I create a directory inside the /bin directory Before I compile the project?
- How do I dissalow users from deleting the "prebaked" levels that come installed with the game?
- Also, Where do I store the User Custom created levels? I assume that should be done with StorageDevice. But that ties in with the first question on how to create a directory after game is deployed.
Any pointers would be welcome! Thank you | 0 |
5,054,077 | 02/19/2011 22:59:06 | 624,806 | 02/19/2011 22:59:06 | 1 | 0 | How to recognize numbers using webcam? | I am doing my masters project on image processing. And I got stuck inbetween. I want to recognize the numbers from the webcam image. So far I am able to take images. Also I can store and retrieve it in '.jpg' format. (You can suggest me to switch to other format too if necessary). Then I am trying to subtract 2 images using mask on the sides. But some how I figure it out this is not the efficient way to do it. I am naive in this part of the world of MATLAB. Can you please guide me?
Thank you very much! | image | matlab | processing | null | null | 09/15/2011 05:43:36 | not a real question | How to recognize numbers using webcam?
===
I am doing my masters project on image processing. And I got stuck inbetween. I want to recognize the numbers from the webcam image. So far I am able to take images. Also I can store and retrieve it in '.jpg' format. (You can suggest me to switch to other format too if necessary). Then I am trying to subtract 2 images using mask on the sides. But some how I figure it out this is not the efficient way to do it. I am naive in this part of the world of MATLAB. Can you please guide me?
Thank you very much! | 1 |
4,746,766 | 01/20/2011 11:51:32 | 166,044 | 08/31/2009 14:28:07 | 1 | 3 | Spring and Mybatis multiple data sources setup | My applications uses Spring3+MyBatis3. I'm trying to setup multiple data source for it. Setup looks like:
<!-- db1 setup-->
<bean id="db1SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
p:configLocation="WEB-INF/mybatis/sqlMapConfig.xml"
p:dataSource-ref="db1DataSource" />
<bean id="db1SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="db1SqlSessionFactory"/>
</bean>
<!-- db2 setup -->
<bean id="db2SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
p:configLocation="WEB-INF/mybatis/sqlMapConfig.xml"
p:dataSource-ref="db2DataSource" />
<bean id="db2SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="db2SqlSessionFactory"/>
</bean>
in logs found message:
No unique bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined: expected single matching bean but found 2: [db1SqlSessionFactory, db2SqlSessionFactory]
I googled and looked into mybatis manuals but couldn't find way how to setup multiple data sources with mybatis.
Any ideas? | spring | datasource | mybatis | null | null | null | open | Spring and Mybatis multiple data sources setup
===
My applications uses Spring3+MyBatis3. I'm trying to setup multiple data source for it. Setup looks like:
<!-- db1 setup-->
<bean id="db1SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
p:configLocation="WEB-INF/mybatis/sqlMapConfig.xml"
p:dataSource-ref="db1DataSource" />
<bean id="db1SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="db1SqlSessionFactory"/>
</bean>
<!-- db2 setup -->
<bean id="db2SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
p:configLocation="WEB-INF/mybatis/sqlMapConfig.xml"
p:dataSource-ref="db2DataSource" />
<bean id="db2SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="db2SqlSessionFactory"/>
</bean>
in logs found message:
No unique bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined: expected single matching bean but found 2: [db1SqlSessionFactory, db2SqlSessionFactory]
I googled and looked into mybatis manuals but couldn't find way how to setup multiple data sources with mybatis.
Any ideas? | 0 |
11,377,538 | 07/07/2012 18:21:21 | 1,509,104 | 07/07/2012 18:14:07 | 1 | 0 | Batch: How to make a .txt file with all files in a folder without extensions | right now i have this code:
@echo off
dir Maps /A-D /b /o:gne >Maplist.txt
start notepad Maplist.txt
But i makes Maplist.txt like this:
a.bsp
b.bsp
c.bsp
but i want it without ".bsp"
please help | file | list | batch | extension | filelist | null | open | Batch: How to make a .txt file with all files in a folder without extensions
===
right now i have this code:
@echo off
dir Maps /A-D /b /o:gne >Maplist.txt
start notepad Maplist.txt
But i makes Maplist.txt like this:
a.bsp
b.bsp
c.bsp
but i want it without ".bsp"
please help | 0 |
8,820,790 | 01/11/2012 14:16:38 | 461,712 | 09/29/2010 12:24:33 | 811 | 55 | Is there an editor like markItUp, but for CSS? | I want to know if there is an editor like [Markitup][1] but one that allows you to edit CSS and not HTML. I am generating the HTML from templates but I want to edit the CSS in a little text editor like [Markitup][1] but one that caters for CSS. Any help would be greatly appreciated.
[1]: http://markitup.jaysalvat.com/home/ | css | editor | wysiwyg | null | null | 01/11/2012 14:27:39 | not constructive | Is there an editor like markItUp, but for CSS?
===
I want to know if there is an editor like [Markitup][1] but one that allows you to edit CSS and not HTML. I am generating the HTML from templates but I want to edit the CSS in a little text editor like [Markitup][1] but one that caters for CSS. Any help would be greatly appreciated.
[1]: http://markitup.jaysalvat.com/home/ | 4 |
10,956,520 | 06/08/2012 22:01:51 | 1,445,447 | 06/08/2012 21:49:42 | 1 | 0 | ASP.NET Repeaters? | I am relatively new to ASP.NET world. The environment that I currently work in is full of aspx pages and repeaters. Even though I have a decent working knowledge of the above mentioned, I am looking for resources/books primarily that can act more like an extensive text and cover everything that is there to be said about these at a pro level.
I have been looking at ASP.NET4 in terms of books and theoretical knowledge, and that is the world of JSONs and AJAX (looks like repeaters are from an older world)- so everything that I learn in context of ASP.NET4 is not applicable directly to my environment (I do use JSONs/AJAX etc lightly).
This is not the typical code request that we see in the forum and I am sorry if my post is out of the norm. However, this is a great forum with knowledgeable members and I am a frequent visitor- so I though I would ask this basic question anyway. Any suggestions(and/or clarifications on contents of ASP.NET 1-4) are very welcome.
Thanks,
K.
| mvc | null | null | null | null | 06/10/2012 00:35:43 | not a real question | ASP.NET Repeaters?
===
I am relatively new to ASP.NET world. The environment that I currently work in is full of aspx pages and repeaters. Even though I have a decent working knowledge of the above mentioned, I am looking for resources/books primarily that can act more like an extensive text and cover everything that is there to be said about these at a pro level.
I have been looking at ASP.NET4 in terms of books and theoretical knowledge, and that is the world of JSONs and AJAX (looks like repeaters are from an older world)- so everything that I learn in context of ASP.NET4 is not applicable directly to my environment (I do use JSONs/AJAX etc lightly).
This is not the typical code request that we see in the forum and I am sorry if my post is out of the norm. However, this is a great forum with knowledgeable members and I am a frequent visitor- so I though I would ask this basic question anyway. Any suggestions(and/or clarifications on contents of ASP.NET 1-4) are very welcome.
Thanks,
K.
| 1 |
3,794,641 | 09/25/2010 16:59:16 | 233,286 | 12/16/2009 21:02:57 | 66 | 9 | Best development environment for PHP? | What is the best development environment for PHP?
I use Notepad++ with Vibrant Ink style and Windows Explorer for ftp.
very amateurish | php | windows | development-environment | null | null | 09/25/2010 19:32:16 | not constructive | Best development environment for PHP?
===
What is the best development environment for PHP?
I use Notepad++ with Vibrant Ink style and Windows Explorer for ftp.
very amateurish | 4 |
535,509 | 02/11/2009 05:19:11 | 46,255 | 12/15/2008 04:13:44 | 324 | 21 | What's the best way to shut down a .Net winforms application and delete the executable | I need to shut down my application and then delete the executable. I am doing it by kicking off a low priority batch job and then immediately shutting down the exe. Is there a better way? | c# | .net | winforms | shutdown | null | null | open | What's the best way to shut down a .Net winforms application and delete the executable
===
I need to shut down my application and then delete the executable. I am doing it by kicking off a low priority batch job and then immediately shutting down the exe. Is there a better way? | 0 |
5,021,120 | 02/16/2011 19:25:26 | 444,757 | 09/10/2010 21:16:34 | 10 | 0 | ffmpeg mp3 conversion failed | using ffmpeg to convert from flv to mp3 gives the following result<pre>
] ffmpeg-0.6.1 >> ffmpeg -i name.flv name.mp3
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Feb 14 2011 12:33:38 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
configuration:
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
[flv @ 0x10869420]Could not find codec parameters (Video: 0x0000)
[flv @ 0x10869420]Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'name.flv':
Metadata:
audiocodecid : 5
duration : 10
videocodecid : -1
canSeekToEnd : true
Duration: 00:00:10.17, start: 0.000000, bitrate: N/A
Stream #0.0: Video: 0x0000, 1k tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16
Output #0, mp3, to 'name.mp3':
Stream #0.0: Audio: 0x0000, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Encoder (codec id 86017) not found for output stream #0.0</pre>
you can see in last line it says codec id 86017 not found.
when i run following command:<br/>
ffmpeg -formats > ffmpeg-format.txt<br/>
mp3 is listed in available formats as <br/>DE mp3 MPEG audio layer 3<br/>.What can be the error.is it that mp3 codec is not properly installed?Help will be appreciated | ffmpeg | mp3 | flv | null | null | 04/25/2012 13:54:24 | off topic | ffmpeg mp3 conversion failed
===
using ffmpeg to convert from flv to mp3 gives the following result<pre>
] ffmpeg-0.6.1 >> ffmpeg -i name.flv name.mp3
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
built on Feb 14 2011 12:33:38 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)
configuration:
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.11. 0 / 0.11. 0
[flv @ 0x10869420]Could not find codec parameters (Video: 0x0000)
[flv @ 0x10869420]Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from 'name.flv':
Metadata:
audiocodecid : 5
duration : 10
videocodecid : -1
canSeekToEnd : true
Duration: 00:00:10.17, start: 0.000000, bitrate: N/A
Stream #0.0: Video: 0x0000, 1k tbr, 1k tbn, 1k tbc
Stream #0.1: Audio: nellymoser, 8000 Hz, mono, s16
Output #0, mp3, to 'name.mp3':
Stream #0.0: Audio: 0x0000, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Encoder (codec id 86017) not found for output stream #0.0</pre>
you can see in last line it says codec id 86017 not found.
when i run following command:<br/>
ffmpeg -formats > ffmpeg-format.txt<br/>
mp3 is listed in available formats as <br/>DE mp3 MPEG audio layer 3<br/>.What can be the error.is it that mp3 codec is not properly installed?Help will be appreciated | 2 |
9,407,768 | 02/23/2012 05:37:52 | 510,390 | 11/17/2010 05:22:01 | 13 | 0 | How to do a set difference, except without eliminating repeated elements | I am trying to do the following in Matlab. Take two lists of numbers, possibly containing repeated elements, and subtract one set from the other set.
Ex: A=[1 1 2 4]; B=[1 2 4];
Desired result would be A-B=C=[1]
Or, another example, E=[3 3 5 5]; F=[3 3 5];
Desired result would be E-F=G=[5]
I wish I could do this using Matlab's set operations, but their function setdiff does not respect the repeated elements in the matrices. I appreciate that this is correct from a strict set theory standpoint, but would nevertheless like to tackle problems like: "I have 3 apples and 4 oranges, and you take 2 apples and 1 orange, how many of each do I have left." My range of possible values in these sets is in the thousands, so building a large matrix for tallying elements and then subtracting matrices does not seem feasible for speed reasons. I will have to do thousands of these calculations with thousands of set elements during a gui menu operation.
Example of what I would like to avoid for tackling the second example above:
E=[0 0 2 0 2]; F=[0 0 2 0 1];
G=E-F=[0 0 0 0 1];
Thanks for your help! | list | matlab | repeated | set-difference | null | null | open | How to do a set difference, except without eliminating repeated elements
===
I am trying to do the following in Matlab. Take two lists of numbers, possibly containing repeated elements, and subtract one set from the other set.
Ex: A=[1 1 2 4]; B=[1 2 4];
Desired result would be A-B=C=[1]
Or, another example, E=[3 3 5 5]; F=[3 3 5];
Desired result would be E-F=G=[5]
I wish I could do this using Matlab's set operations, but their function setdiff does not respect the repeated elements in the matrices. I appreciate that this is correct from a strict set theory standpoint, but would nevertheless like to tackle problems like: "I have 3 apples and 4 oranges, and you take 2 apples and 1 orange, how many of each do I have left." My range of possible values in these sets is in the thousands, so building a large matrix for tallying elements and then subtracting matrices does not seem feasible for speed reasons. I will have to do thousands of these calculations with thousands of set elements during a gui menu operation.
Example of what I would like to avoid for tackling the second example above:
E=[0 0 2 0 2]; F=[0 0 2 0 1];
G=E-F=[0 0 0 0 1];
Thanks for your help! | 0 |
9,215,512 | 02/09/2012 17:14:41 | 520,159 | 11/25/2010 12:45:13 | 168 | 7 | How do I change the color of the axes of a matplotlib 3D plot? | I have set
import matplotlib as mpl
AXES_COLOR = '#333333'
mpl.rc('axes', edgecolor=AXES_COLOR, labelcolor=AXES_COLOR, grid=True)
mpl.rc('xtick', color=AXES_COLOR)
mpl.rc('ytick', color=AXES_COLOR)
mpl.rc('grid', color=AXES_COLOR)
The color of the axes labels and the ticks are properly set both in 2D and in 3D. However, the `edgecolor` doesn't apply to 3D axes and they remain black. Likewise, the grid isn't affected.
I think figured out how to access the individual axes of a 3D plot:
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d # Needed for 3d projection.
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.w_zaxis # <- the z axis
The [documentation][1] mentions a property that we can use until the developers have finished refactoring their 3D code:
import pprint
pprint.pprint(ax.w_xaxis._AXINFO)
{'x': {'color': (0.95, 0.95, 0.95, 0.5),
'i': 0,
'juggled': (1, 0, 2),
'tickdir': 1},
'y': {'color': (0.9, 0.9, 0.9, 0.5),
'i': 1,
'juggled': (0, 1, 2),
'tickdir': 0},
'z': {'color': (0.925, 0.925, 0.925, 0.5),
'i': 2,
'juggled': (0, 2, 1),
'tickdir': 0}}
However, the color parameter changes the color of the background of the axes planes (between the wired of the grid), not the color of the edges of these planes.
Am I digging too deep ?
[1]: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/api.html#module-mpl_toolkits.mplot3d.axis3d | matplotlib | null | null | null | null | null | open | How do I change the color of the axes of a matplotlib 3D plot?
===
I have set
import matplotlib as mpl
AXES_COLOR = '#333333'
mpl.rc('axes', edgecolor=AXES_COLOR, labelcolor=AXES_COLOR, grid=True)
mpl.rc('xtick', color=AXES_COLOR)
mpl.rc('ytick', color=AXES_COLOR)
mpl.rc('grid', color=AXES_COLOR)
The color of the axes labels and the ticks are properly set both in 2D and in 3D. However, the `edgecolor` doesn't apply to 3D axes and they remain black. Likewise, the grid isn't affected.
I think figured out how to access the individual axes of a 3D plot:
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d # Needed for 3d projection.
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.w_zaxis # <- the z axis
The [documentation][1] mentions a property that we can use until the developers have finished refactoring their 3D code:
import pprint
pprint.pprint(ax.w_xaxis._AXINFO)
{'x': {'color': (0.95, 0.95, 0.95, 0.5),
'i': 0,
'juggled': (1, 0, 2),
'tickdir': 1},
'y': {'color': (0.9, 0.9, 0.9, 0.5),
'i': 1,
'juggled': (0, 1, 2),
'tickdir': 0},
'z': {'color': (0.925, 0.925, 0.925, 0.5),
'i': 2,
'juggled': (0, 2, 1),
'tickdir': 0}}
However, the color parameter changes the color of the background of the axes planes (between the wired of the grid), not the color of the edges of these planes.
Am I digging too deep ?
[1]: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/api.html#module-mpl_toolkits.mplot3d.axis3d | 0 |
7,397,987 | 09/13/2011 07:01:56 | 859,154 | 07/23/2011 09:23:42 | 422 | 8 | How can a customer can be sure that the file came from me? | Our company sends `files by email` to customers.
How can a customer be **SURE** that the file came from `my company` ?
i was thinking about **calc** the **MD5** of the file
and then send it to him with **another email**
(i.e. : "this is the second mail with the md5 for the first email file")
this will also ensure him ( and us) if the the document has been altered
is there any **smarter way** ?
we don't have any web site that he can download files from ( certificate etc...)
We just send emails.
| c# | security | authentication | software-engineering | null | 09/13/2011 07:18:07 | off topic | How can a customer can be sure that the file came from me?
===
Our company sends `files by email` to customers.
How can a customer be **SURE** that the file came from `my company` ?
i was thinking about **calc** the **MD5** of the file
and then send it to him with **another email**
(i.e. : "this is the second mail with the md5 for the first email file")
this will also ensure him ( and us) if the the document has been altered
is there any **smarter way** ?
we don't have any web site that he can download files from ( certificate etc...)
We just send emails.
| 2 |
4,684,512 | 01/13/2011 19:47:27 | 574,794 | 01/13/2011 19:47:27 | 1 | 0 | WPF: How do I handle events in a DataTemplate that is in a separate file? | I have a DataTemplate with a ListView control. This DataTemplate is located in Templates.xaml (which is a ResourceDictionary). Template.xaml is then included into my main UserControl SourceManager.xaml through ResourceDictionary.MergedDictionaries. I want to raise the SelectionChanged event of the DataTemplate's ListView but I want the handler in the code behind to be in SourceManager.xaml.cs.
How can I achieve that?
Templates.xaml:
<ResourceDictionary x:Class="LawBib.Templates"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataTemplate x:Key="SectionTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@Title}" />
<ListView x:Name="GroupList" ItemsSource="{Binding XPath=Source}">
<ListView.Template>
<ControlTemplate>
<WrapPanel IsItemsHost="True">
</WrapPanel>
</ControlTemplate>
</ListView.Template>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<Image Source="images/source.png" />
<TextBlock Text="{Binding XPath=@Title}" HorizontalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</DataTemplate>
</ResourceDictionary>
SourceManager.xaml:
<UserControl x:Class="LawBib.SourceManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Background="#f5f7f8">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources.xaml" />
<ResourceDictionary Source="Templates.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
...
</UserControl>
| wpf | events | datatemplate | null | null | null | open | WPF: How do I handle events in a DataTemplate that is in a separate file?
===
I have a DataTemplate with a ListView control. This DataTemplate is located in Templates.xaml (which is a ResourceDictionary). Template.xaml is then included into my main UserControl SourceManager.xaml through ResourceDictionary.MergedDictionaries. I want to raise the SelectionChanged event of the DataTemplate's ListView but I want the handler in the code behind to be in SourceManager.xaml.cs.
How can I achieve that?
Templates.xaml:
<ResourceDictionary x:Class="LawBib.Templates"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DataTemplate x:Key="SectionTemplate">
<StackPanel>
<TextBlock Text="{Binding XPath=@Title}" />
<ListView x:Name="GroupList" ItemsSource="{Binding XPath=Source}">
<ListView.Template>
<ControlTemplate>
<WrapPanel IsItemsHost="True">
</WrapPanel>
</ControlTemplate>
</ListView.Template>
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<Image Source="images/source.png" />
<TextBlock Text="{Binding XPath=@Title}" HorizontalAlignment="Center" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
</DataTemplate>
</ResourceDictionary>
SourceManager.xaml:
<UserControl x:Class="LawBib.SourceManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Background="#f5f7f8">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources.xaml" />
<ResourceDictionary Source="Templates.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
...
</UserControl>
| 0 |
10,886,451 | 06/04/2012 18:40:38 | 1,435,736 | 06/04/2012 18:00:18 | 1 | 0 | android/iPhone fighting game | Sorry for my English. Its not my native language.
I'm planning to create a fighting game for both android and iPhone.
I'm working with a prototype in html5, but I can change to another framework/engine if necessary.
One key features I want is online multiplayer OR local multiplayer. Since it will be a fast game like Street Fighter, it will require fast response from the server. It is possible to have a good response from online server?
I read somewhere about OpenFaint and similars. It will provide the required multiplayer functionality?
Important: if online play is not possible, I would like to have local multiplayer via WLAN or bluetooth. Its even preferable over online multiplayer. Its possible to have this kind of functionality on android?
Which language/framework do you recommend?
Thanks! | android | iphone | html5 | null | null | 06/06/2012 12:15:37 | not constructive | android/iPhone fighting game
===
Sorry for my English. Its not my native language.
I'm planning to create a fighting game for both android and iPhone.
I'm working with a prototype in html5, but I can change to another framework/engine if necessary.
One key features I want is online multiplayer OR local multiplayer. Since it will be a fast game like Street Fighter, it will require fast response from the server. It is possible to have a good response from online server?
I read somewhere about OpenFaint and similars. It will provide the required multiplayer functionality?
Important: if online play is not possible, I would like to have local multiplayer via WLAN or bluetooth. Its even preferable over online multiplayer. Its possible to have this kind of functionality on android?
Which language/framework do you recommend?
Thanks! | 4 |
10,350,874 | 04/27/2012 12:47:52 | 64,226 | 02/09/2009 16:17:59 | 4,465 | 66 | ADO.NET Funny Connection Pool Behaviour when bury SQL Exception | I am catching a sql exception and not rethrowing it. This seems to mean that the connection is not returned to the pool as I would expect. Is this possible?
using (IDbCommand paymentCommand = this.Connection.CreateCommand())
{
try
{
database stuff
}
catch (SqlException ex)
{
//LOG CALL
}
} | c# | ado.net | null | null | null | null | open | ADO.NET Funny Connection Pool Behaviour when bury SQL Exception
===
I am catching a sql exception and not rethrowing it. This seems to mean that the connection is not returned to the pool as I would expect. Is this possible?
using (IDbCommand paymentCommand = this.Connection.CreateCommand())
{
try
{
database stuff
}
catch (SqlException ex)
{
//LOG CALL
}
} | 0 |
5,562,054 | 04/06/2011 05:57:03 | 685,754 | 03/31/2011 12:51:24 | 13 | 3 | Stackoverflow Web Architecture | This may sound weird question but I will give it a shot anyway. Can anyone tell me what is the Architecture behind Stackoverflow.
We are a bunch of developers and had a bit of a discussion as to what is the Architecture/technology behind this great invention. :)
Some guess with technology is ASP.NET MVC may be MySQL db, but we could be wrong.
Thanks... | mvc | architecture | stackoverflow | lamp | null | 04/06/2011 06:10:55 | off topic | Stackoverflow Web Architecture
===
This may sound weird question but I will give it a shot anyway. Can anyone tell me what is the Architecture behind Stackoverflow.
We are a bunch of developers and had a bit of a discussion as to what is the Architecture/technology behind this great invention. :)
Some guess with technology is ASP.NET MVC may be MySQL db, but we could be wrong.
Thanks... | 2 |
6,950,629 | 08/05/2011 02:00:20 | 865,477 | 07/27/2011 13:25:18 | 1 | 0 | Make some virtual mac address | I want to make some virtual mac address by one wireless cart.
so I can get some ip address from wireless modem too.
How can I do it in windows or ubuntu? | windows | linux | ubuntu | null | null | 08/05/2011 02:06:17 | off topic | Make some virtual mac address
===
I want to make some virtual mac address by one wireless cart.
so I can get some ip address from wireless modem too.
How can I do it in windows or ubuntu? | 2 |
1,306,502 | 08/20/2009 14:16:44 | 83,719 | 03/27/2009 17:22:51 | 11 | 3 | Understanding how a browsers work |
Recently I been doing some Web UI work, and it is frustrating to deal with all the compatibility issues, and the unexpected browser (FF, IE, Safari) behaviors.
* Event bubbling
* creating and destroying elements
* dynamically adding elements with behaviors (that did not initially execute)
* interacting with modals
* z-index
I seek to understand how and why browsers work the way they do, and how they are built. Also any pointers or links about best practices. Thanks
| cross-browser | css | null | null | null | null | open | Understanding how a browsers work
===
Recently I been doing some Web UI work, and it is frustrating to deal with all the compatibility issues, and the unexpected browser (FF, IE, Safari) behaviors.
* Event bubbling
* creating and destroying elements
* dynamically adding elements with behaviors (that did not initially execute)
* interacting with modals
* z-index
I seek to understand how and why browsers work the way they do, and how they are built. Also any pointers or links about best practices. Thanks
| 0 |
4,682,181 | 01/13/2011 16:04:21 | 163,358 | 08/26/2009 09:10:45 | 39 | 3 | Jquery tools - live tooltip for Ajax | I have a working version of tooltip (jQuery Tools - http://flowplayer.org/tools/demos/tooltip/index.html) ,
jQuery(document).ready(function() {
jQuery('.more_info').each(function(){
jQuery(this).tooltip({
effect: 'slide',
offset: [10, 570],
predelay: 100,
position: "bottom left"}).dynamic( {
bottom: {
direction: 'down',
bounce: true
}
});
});
});
after ajax is loaded , tooltips not working any more because , script already was loaded , i tried solution from forum http://flowplayer.org/tools/forum/30/37281 , but is not working , or is not implemented correctly
here is code :
jQuery(document).ready(function() {
jQuery('.more_info').each(function(){
jQuery(this).not('.tt_init').tooltip({
effect: 'slide',
offset: [10, 570],
predelay: 100,
position: "bottom left"}).dynamic( {
bottom: {
direction: 'down',
bounce: true
}
});
jQuery(this).not('.tt_init').addClass('tt_init');
});
});
and nothing ... I'm doing something wrong , Thank you for helping ;) , sorry for my bad English | jquery | tooltip | jquery-tools | null | null | null | open | Jquery tools - live tooltip for Ajax
===
I have a working version of tooltip (jQuery Tools - http://flowplayer.org/tools/demos/tooltip/index.html) ,
jQuery(document).ready(function() {
jQuery('.more_info').each(function(){
jQuery(this).tooltip({
effect: 'slide',
offset: [10, 570],
predelay: 100,
position: "bottom left"}).dynamic( {
bottom: {
direction: 'down',
bounce: true
}
});
});
});
after ajax is loaded , tooltips not working any more because , script already was loaded , i tried solution from forum http://flowplayer.org/tools/forum/30/37281 , but is not working , or is not implemented correctly
here is code :
jQuery(document).ready(function() {
jQuery('.more_info').each(function(){
jQuery(this).not('.tt_init').tooltip({
effect: 'slide',
offset: [10, 570],
predelay: 100,
position: "bottom left"}).dynamic( {
bottom: {
direction: 'down',
bounce: true
}
});
jQuery(this).not('.tt_init').addClass('tt_init');
});
});
and nothing ... I'm doing something wrong , Thank you for helping ;) , sorry for my bad English | 0 |
6,394,337 | 06/18/2011 06:33:36 | 716,334 | 04/20/2011 02:47:28 | 37 | 0 | How do I get the RECT of title bar's window controls (maximize, minimize, close buttons) ? I tried to make a custom color title bar.. | I am trying to intercept the WM_NCPAINT message by first calling ::DefWindowProc, then paint over it. However, when I paint the window controls of the title bar or non-client area, I need to have its RECT structure. Therefore, how do I access the REcT structure? | c++ | windows | winapi | controls | null | null | open | How do I get the RECT of title bar's window controls (maximize, minimize, close buttons) ? I tried to make a custom color title bar..
===
I am trying to intercept the WM_NCPAINT message by first calling ::DefWindowProc, then paint over it. However, when I paint the window controls of the title bar or non-client area, I need to have its RECT structure. Therefore, how do I access the REcT structure? | 0 |
7,110,782 | 08/18/2011 16:23:14 | 439,621 | 09/04/2010 13:47:27 | 80 | 3 | Fast writing bytearray to file | I use `_FileStream.Write(_ByteArray, 0, _ByteArray.Length);` to write a bytearray to a file. I noticed that's very slow.
I read a line from a text file, convert it to a bytearray and then need to write it to a new (large > 500 Mb) file. Please some advice to speed up the write process. | c# | bytearray | null | null | null | null | open | Fast writing bytearray to file
===
I use `_FileStream.Write(_ByteArray, 0, _ByteArray.Length);` to write a bytearray to a file. I noticed that's very slow.
I read a line from a text file, convert it to a bytearray and then need to write it to a new (large > 500 Mb) file. Please some advice to speed up the write process. | 0 |
7,769,486 | 10/14/2011 14:56:17 | 972,681 | 09/30/2011 08:04:26 | 1 | 0 | What is OracleXEUniv.exe functionality? | A have some step by step description where downloading of OracleXEUniv.exe is one step.
But I cannot find what is it for? What is functionality of this file?
Than you. | oracle | null | null | null | null | 10/14/2011 22:20:47 | off topic | What is OracleXEUniv.exe functionality?
===
A have some step by step description where downloading of OracleXEUniv.exe is one step.
But I cannot find what is it for? What is functionality of this file?
Than you. | 2 |
3,839,661 | 10/01/2010 13:34:49 | 13,440 | 09/16/2008 19:07:33 | 985 | 30 | C# COM port communication problem | I have a C# code which communicates with three different COM ports. The COM ports are actually three serial port to USB converters.
The code each time switches 'off' and 'on' the devices to which it is communicating, then initializes the three com ports, tries to send and read data and then closes the com port. This keeps continuing for a pre-defined number of loops.
My problem is that after about 8 or 9 iterations, the COM port communication stops working. Sometime it throws an error saying the port is closed, sometime it does not throw any exception but it is actually not reading or writing anything from the com port. Some point it was only writing but not reading back the data.
What might be the reason and any tips to debug this problem?
Thanks... | c# | null | null | null | null | null | open | C# COM port communication problem
===
I have a C# code which communicates with three different COM ports. The COM ports are actually three serial port to USB converters.
The code each time switches 'off' and 'on' the devices to which it is communicating, then initializes the three com ports, tries to send and read data and then closes the com port. This keeps continuing for a pre-defined number of loops.
My problem is that after about 8 or 9 iterations, the COM port communication stops working. Sometime it throws an error saying the port is closed, sometime it does not throw any exception but it is actually not reading or writing anything from the com port. Some point it was only writing but not reading back the data.
What might be the reason and any tips to debug this problem?
Thanks... | 0 |
6,123,347 | 05/25/2011 10:56:21 | 740,648 | 05/05/2011 19:59:07 | 41 | 0 | Method lines amount. Clean code | What is the optimal amount of lines in method shold be used?
Curly braces doesn't count.
What code is better? Code is runing in Main()
//1st
string line;
while ((line = Console.ReadLine()).ToLower() != Break)
{
commandAnalyzer.AnalyzeAndRun(line);
}
// or 2nd
RunTextualInterface(commandAnalyzer);
private static void RunTextualInterface(TextCommandAnalyzer commandAnalyzer)
{
while (notBreakCommand())
{
analyzeCommandWithHelpOf(commandAnalyzer);
}
}
private static void analyzeCommandWithHelpOf(TextCommandAnalyzer commandAnalyzer)
{
commandAnalyzer.AnalyzeAndRun(readNewLine());
}
private static bool notBreakCommand()
{
return readNewLine() != Break;
}
private static string readNewLine()
{
return Console.ReadLine().ToLower();
}
// result just the same
P.S I am asking cause out teacher said that every method must have max 6 lines.
| c# | null | null | null | null | 05/25/2011 11:07:14 | not constructive | Method lines amount. Clean code
===
What is the optimal amount of lines in method shold be used?
Curly braces doesn't count.
What code is better? Code is runing in Main()
//1st
string line;
while ((line = Console.ReadLine()).ToLower() != Break)
{
commandAnalyzer.AnalyzeAndRun(line);
}
// or 2nd
RunTextualInterface(commandAnalyzer);
private static void RunTextualInterface(TextCommandAnalyzer commandAnalyzer)
{
while (notBreakCommand())
{
analyzeCommandWithHelpOf(commandAnalyzer);
}
}
private static void analyzeCommandWithHelpOf(TextCommandAnalyzer commandAnalyzer)
{
commandAnalyzer.AnalyzeAndRun(readNewLine());
}
private static bool notBreakCommand()
{
return readNewLine() != Break;
}
private static string readNewLine()
{
return Console.ReadLine().ToLower();
}
// result just the same
P.S I am asking cause out teacher said that every method must have max 6 lines.
| 4 |
9,867,781 | 03/26/2012 06:48:16 | 736,969 | 05/03/2011 21:40:38 | 96 | 0 | writing a game server? | I want to write an mmo game server, but I can't seem to find any links that will tell me where to start off. Do I have to have my own server? Could I make a game server using GoDaddy as a host? Any information is a help. | sockets | serversocket | mmo | null | null | 03/26/2012 07:05:24 | not a real question | writing a game server?
===
I want to write an mmo game server, but I can't seem to find any links that will tell me where to start off. Do I have to have my own server? Could I make a game server using GoDaddy as a host? Any information is a help. | 1 |
9,345,961 | 02/19/2012 01:53:01 | 153,382 | 08/09/2009 19:38:06 | 211 | 2 | Using respond_with how can I flash a notice? | The flash method only shows the message after the page reloads... what do I do to get it to appear when I'm using :remote => true? | ruby-on-rails-3 | jquery-ajax | notice | null | null | null | open | Using respond_with how can I flash a notice?
===
The flash method only shows the message after the page reloads... what do I do to get it to appear when I'm using :remote => true? | 0 |
7,752,568 | 10/13/2011 10:12:26 | 990,940 | 10/12/2011 07:21:31 | 1 | 0 | gotta get my object into a subclass, cant do it :( | this is what i have to do...
• Define a dog class that inherits from an animal class. The animal class must have an
instance method called 'eat'.
• The 'eat' method must receive one argument which is the food to be eaten. The method
must display "eating: [food that was passed in]"
• Create a module called Poodle that is mixed into the dog class. The Poodle module must
have a method called 'bark' that displays "annoying squeaky woof".
• Initialize a dog object and call the eat and bark methods
this is how far i got>>
class Dog
def initialize(breed, bark)
@breed = breed
@bark = bark
end
def bark
puts '#{@breed} has : #{@bark}'
end
def eat
print "food to be eaten :"
food = gets.STDIN
puts 'eating: #{food}'
end
end
d = Dog.new('Poodle','annoying squeaky woof')
d.bark
d.eat
now i have a problem with the heap where is the top of the heap i need to put the object: d = Dog.new('Poodle','annoying squeaky woof'). my program needs to get the info from the object and put it in the class. now i wat to also get the dog class into a animal class can someone please explain how to do that cause i am way new. dont do it for me just talk me through it i wana do this myself i got me issues now with Ruby lol | class | object | module | subclass | null | 10/15/2011 03:13:26 | not a real question | gotta get my object into a subclass, cant do it :(
===
this is what i have to do...
• Define a dog class that inherits from an animal class. The animal class must have an
instance method called 'eat'.
• The 'eat' method must receive one argument which is the food to be eaten. The method
must display "eating: [food that was passed in]"
• Create a module called Poodle that is mixed into the dog class. The Poodle module must
have a method called 'bark' that displays "annoying squeaky woof".
• Initialize a dog object and call the eat and bark methods
this is how far i got>>
class Dog
def initialize(breed, bark)
@breed = breed
@bark = bark
end
def bark
puts '#{@breed} has : #{@bark}'
end
def eat
print "food to be eaten :"
food = gets.STDIN
puts 'eating: #{food}'
end
end
d = Dog.new('Poodle','annoying squeaky woof')
d.bark
d.eat
now i have a problem with the heap where is the top of the heap i need to put the object: d = Dog.new('Poodle','annoying squeaky woof'). my program needs to get the info from the object and put it in the class. now i wat to also get the dog class into a animal class can someone please explain how to do that cause i am way new. dont do it for me just talk me through it i wana do this myself i got me issues now with Ruby lol | 1 |
10,428,589 | 05/03/2012 09:27:12 | 820,861 | 06/29/2011 10:25:07 | 23 | 0 | How to Handle android background activity | I have activity stack in my android application.Suppose A and B.When the application starts the Activity A is visible.From this activity i call Activity B using startActivityForResult method.Now from here if i press Home button of device then activity runs in background that is OK.But when i relaunch the application by taping on activity icon a new instance of activity is start and show activity A rather showing the activity B.Please help me in this.Any help would be highly appreciated. | android | null | null | null | null | null | open | How to Handle android background activity
===
I have activity stack in my android application.Suppose A and B.When the application starts the Activity A is visible.From this activity i call Activity B using startActivityForResult method.Now from here if i press Home button of device then activity runs in background that is OK.But when i relaunch the application by taping on activity icon a new instance of activity is start and show activity A rather showing the activity B.Please help me in this.Any help would be highly appreciated. | 0 |
5,492,330 | 03/30/2011 21:01:36 | 598,931 | 02/01/2011 18:53:02 | 102 | 7 | Color Selector in JavaScript | I have been trying to re-create a Color Selector function that is found here:
http://www.chismbrothers.com/site/colorit
I think I have most of the functionality in JSFiddle but Im missing something or a few things.
http://jsfiddle.net/NinjaSk8ter/EvnJM/
since this rely's on changing the color of 2 Images, Im not even sure how to upload those on JSFiddle.
Can someone point me in the right direction? What am I missing? How much am I missing? | javascript | html | css | null | null | null | open | Color Selector in JavaScript
===
I have been trying to re-create a Color Selector function that is found here:
http://www.chismbrothers.com/site/colorit
I think I have most of the functionality in JSFiddle but Im missing something or a few things.
http://jsfiddle.net/NinjaSk8ter/EvnJM/
since this rely's on changing the color of 2 Images, Im not even sure how to upload those on JSFiddle.
Can someone point me in the right direction? What am I missing? How much am I missing? | 0 |
8,726,228 | 01/04/2012 11:38:38 | 648,814 | 03/07/2011 20:43:51 | 1,502 | 118 | HTTP Post as IE6 using C# | I need to do a HTTP POST using C#. It needs to do a postback the same way as an IE6 page.
From the documentation the postback should look like
POST /.../Upload.asp?b_customerId=[O/M1234] HTTP/1.1
Content-length: 12345
Content-type: multipart/form-data; boundary=vxvxv
Host: www.foo.com
--vxvxv
Content-disposition: form-data; name=”File1”; filename=”noColonsSpacesOrAmpersandsInHere”
Content-type: text/xml
<?xml version=”1.0” encoding=”UTF-8”?>
...
<bat:Batch ...
.......
</bat:Batch>
--vxvxv--
I think im having trouble with the boundry charecters. I tried setting the boundry in the post data and fiddler shows something similar but I get an page back with the error "Invalid procedure call or argument". the Content-dispositio in the body rather than the header to keep it within the boundrys. Im not sure that is right. Am i setting the boundry the correct way? Can anyone give some guidence on how to do a HTTP POST using C# ? Thanks
**My Code**
data = "--vxvxv" + Environment.NewLine + "Content-disposition: form-data; name=\"File1\";" + Environment.NewLine + "filename=\"provideTest.xml\"" + Environment.NewLine + "Content-type: text/xml" + Environment.NewLine + @"<?xml version=""1.0"" encoding=""UTF-8""?>" + Environment.NewLine+ data + Environment.NewLine + "--vxvxv--";
var encoding = ASCIIEncoding.UTF8;
HttpWebRequest request;
var postData = encoding.GetBytes(data);
request = (HttpWebRequest)WebRequest.Create(url);
request.ContentLength = postData.Length;
request.Method = "POST";
request.ContentType = "multipart/form-data; boundary=vxvxv";
request.Host = "www.foo.com";
request.ContentLength = postData.Length;
X509Certificate2Collection certCollect = new X509Certificate2Collection();
X509Certificate2 cert = new X509Certificate2(@"C:\a\cert.pfx", "password");
certCollect.Add(cert);
request.ClientCertificates = certCollect;
using (Stream writeStream = request.GetRequestStream()) {
writeStream.Write(postData, 0, postData.Length);
}
WebResponse webResponse = request.GetResponse();
string output = new StreamReader(webResponse.GetResponseStream()).ReadToEnd();
LogEntry.Write("Recieved : " + output);
return output;
**Fiddler Output (raw)**
POST https://../Upload.asp?b_customerId=%5BO/M1234%5D HTTP/1.1
Content-Type: multipart/form-data; boundary=vxvxv
Host: www.foo.com
Content-Length: 5500
Expect: 100-continue
Connection: Keep-Alive
--vxvxv
Content-disposition: form-data; name="File1";
filename="provideTest.xml"
Content-type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
...SNIP...
</bat:Batch>
--vxvxv--
| c# | internet-explorer | null | null | null | null | open | HTTP Post as IE6 using C#
===
I need to do a HTTP POST using C#. It needs to do a postback the same way as an IE6 page.
From the documentation the postback should look like
POST /.../Upload.asp?b_customerId=[O/M1234] HTTP/1.1
Content-length: 12345
Content-type: multipart/form-data; boundary=vxvxv
Host: www.foo.com
--vxvxv
Content-disposition: form-data; name=”File1”; filename=”noColonsSpacesOrAmpersandsInHere”
Content-type: text/xml
<?xml version=”1.0” encoding=”UTF-8”?>
...
<bat:Batch ...
.......
</bat:Batch>
--vxvxv--
I think im having trouble with the boundry charecters. I tried setting the boundry in the post data and fiddler shows something similar but I get an page back with the error "Invalid procedure call or argument". the Content-dispositio in the body rather than the header to keep it within the boundrys. Im not sure that is right. Am i setting the boundry the correct way? Can anyone give some guidence on how to do a HTTP POST using C# ? Thanks
**My Code**
data = "--vxvxv" + Environment.NewLine + "Content-disposition: form-data; name=\"File1\";" + Environment.NewLine + "filename=\"provideTest.xml\"" + Environment.NewLine + "Content-type: text/xml" + Environment.NewLine + @"<?xml version=""1.0"" encoding=""UTF-8""?>" + Environment.NewLine+ data + Environment.NewLine + "--vxvxv--";
var encoding = ASCIIEncoding.UTF8;
HttpWebRequest request;
var postData = encoding.GetBytes(data);
request = (HttpWebRequest)WebRequest.Create(url);
request.ContentLength = postData.Length;
request.Method = "POST";
request.ContentType = "multipart/form-data; boundary=vxvxv";
request.Host = "www.foo.com";
request.ContentLength = postData.Length;
X509Certificate2Collection certCollect = new X509Certificate2Collection();
X509Certificate2 cert = new X509Certificate2(@"C:\a\cert.pfx", "password");
certCollect.Add(cert);
request.ClientCertificates = certCollect;
using (Stream writeStream = request.GetRequestStream()) {
writeStream.Write(postData, 0, postData.Length);
}
WebResponse webResponse = request.GetResponse();
string output = new StreamReader(webResponse.GetResponseStream()).ReadToEnd();
LogEntry.Write("Recieved : " + output);
return output;
**Fiddler Output (raw)**
POST https://../Upload.asp?b_customerId=%5BO/M1234%5D HTTP/1.1
Content-Type: multipart/form-data; boundary=vxvxv
Host: www.foo.com
Content-Length: 5500
Expect: 100-continue
Connection: Keep-Alive
--vxvxv
Content-disposition: form-data; name="File1";
filename="provideTest.xml"
Content-type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
...SNIP...
</bat:Batch>
--vxvxv--
| 0 |
10,851,320 | 06/01/2012 13:35:57 | 285,983 | 03/04/2010 05:09:45 | 194 | 5 | Exclude part of the string with regex | I'm quite bad with regex, and I'm looking to match a criteria.
This is a regex expression that should go emmbed into the url for a firewall, so It will block any url that is not like the list at the end.
This is what Im currently using but its not working:
http://www.youtube.com/(*.*)list=UUFwtOm4N5djdcuTAlNIWJaQ
This is the example url (to be blocked):
http://www.youtube.com/watch?NR=1&feature=fvwp&v=P1b5VY_Bp_o&list=UUFwtOm4N5djdcuTAlNIWJaQ
I'm trying to make a regex that will Success fully match when `NR=1` or `feature=fvwp`
are NOT present, I asume I can do it like this: `(?!^feature=fvwp$)` but the `v=` and `list=UUFwtOm4N5djdcuTAlNIWJaQ` are allowed.
Also the v= should be limited to any character (uppercase and lowercase) and 11 length, I assume its: `/^[a-z0-9]{11}$/`
How can I build all that together and make it work so it would allow and match only on this urls excluding from allowing the previous criterias that I explained:
http://www.youtube.com/watch?v=4eK_RWpTgcc&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
http://www.youtube.com/watch?v=TLRl85TJwZM&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
http://www.youtube.com/watch?v=QEV9yqrpxkc&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
| regex | url | regular-language | null | null | null | open | Exclude part of the string with regex
===
I'm quite bad with regex, and I'm looking to match a criteria.
This is a regex expression that should go emmbed into the url for a firewall, so It will block any url that is not like the list at the end.
This is what Im currently using but its not working:
http://www.youtube.com/(*.*)list=UUFwtOm4N5djdcuTAlNIWJaQ
This is the example url (to be blocked):
http://www.youtube.com/watch?NR=1&feature=fvwp&v=P1b5VY_Bp_o&list=UUFwtOm4N5djdcuTAlNIWJaQ
I'm trying to make a regex that will Success fully match when `NR=1` or `feature=fvwp`
are NOT present, I asume I can do it like this: `(?!^feature=fvwp$)` but the `v=` and `list=UUFwtOm4N5djdcuTAlNIWJaQ` are allowed.
Also the v= should be limited to any character (uppercase and lowercase) and 11 length, I assume its: `/^[a-z0-9]{11}$/`
How can I build all that together and make it work so it would allow and match only on this urls excluding from allowing the previous criterias that I explained:
http://www.youtube.com/watch?v=4eK_RWpTgcc&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
http://www.youtube.com/watch?v=TLRl85TJwZM&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
http://www.youtube.com/watch?v=QEV9yqrpxkc&feature=BFa&list=UUFwtOm4N5djdcuTAlNIWJaQ
| 0 |
11,667,068 | 07/26/2012 10:09:08 | 1,543,833 | 07/22/2012 10:41:45 | 20 | 1 | Detect which dropdown selected and return its value and ID | I have few drop-down boxes. Is there any way to detect which dropdown was changed using jquery ?
<form id="products">
<select id="Ram">
<option value="0">4 GB</option>
<option value="1">8 GB</option>
</select>
<select id="Hdd">
<option value="0">300 GB</option>
<option value="1">500 GB</option>
</select>
</form>
Javascript/Jquery
$(document).ready(function() {
$('#products').change(function() {
var value = $(this).val(); //In here I want to detect and return the value.
alert(value); // Want to return dropdown ID and its selected value
});
}); | php | javascript | jquery | null | null | null | open | Detect which dropdown selected and return its value and ID
===
I have few drop-down boxes. Is there any way to detect which dropdown was changed using jquery ?
<form id="products">
<select id="Ram">
<option value="0">4 GB</option>
<option value="1">8 GB</option>
</select>
<select id="Hdd">
<option value="0">300 GB</option>
<option value="1">500 GB</option>
</select>
</form>
Javascript/Jquery
$(document).ready(function() {
$('#products').change(function() {
var value = $(this).val(); //In here I want to detect and return the value.
alert(value); // Want to return dropdown ID and its selected value
});
}); | 0 |
686,780 | 03/26/2009 17:27:57 | 25,066 | 10/04/2008 05:22:36 | 1,976 | 113 | Best resources for starting Jython | I just got my first Jython (and Python) project, and I was wondering what documentation, IDEs, etc. are best suited to a Java buff like me.
I know there are a lot of questions about starting out with Python, so I'm asking for things that might be specific to Jython. Where should I start? If it helps, I'm running Linux and Solaris only. | jython | python | ide | documentation | resources | 04/18/2012 12:07:00 | not constructive | Best resources for starting Jython
===
I just got my first Jython (and Python) project, and I was wondering what documentation, IDEs, etc. are best suited to a Java buff like me.
I know there are a lot of questions about starting out with Python, so I'm asking for things that might be specific to Jython. Where should I start? If it helps, I'm running Linux and Solaris only. | 4 |
5,226,698 | 03/07/2011 23:41:34 | 649,022 | 03/07/2011 23:41:34 | 1 | 0 | Excel vs Ms Project to manage resources | Just wanted to get your view on methods to manage resource (time). We have a team of 6 who are working on different projects and other initiatives, we would like to get view on resource utilisation on day by day basis rather than by task. Each project will be managing the task vs resouce utilisation.
There is a recomendation to use Excel to have this view (i.e each row is a initiative/task/project at a highlevel, each cell being the day and the value in the cell is the effort required). However, working on MS Project (to manage project) I've found that this is a better alternative than excel, purely since it is easier to manage in the future.
I wanted:
A) Get your views on excel vs ms project
B) On how to get a view of MS Project of daily utilisation, and easy editing (i.e not having to switch back and forth from views)
C) any other methods...
Thanks | excel | project | ms | null | null | 05/21/2011 21:59:53 | off topic | Excel vs Ms Project to manage resources
===
Just wanted to get your view on methods to manage resource (time). We have a team of 6 who are working on different projects and other initiatives, we would like to get view on resource utilisation on day by day basis rather than by task. Each project will be managing the task vs resouce utilisation.
There is a recomendation to use Excel to have this view (i.e each row is a initiative/task/project at a highlevel, each cell being the day and the value in the cell is the effort required). However, working on MS Project (to manage project) I've found that this is a better alternative than excel, purely since it is easier to manage in the future.
I wanted:
A) Get your views on excel vs ms project
B) On how to get a view of MS Project of daily utilisation, and easy editing (i.e not having to switch back and forth from views)
C) any other methods...
Thanks | 2 |
3,744,206 | 09/19/2010 01:42:07 | 305,631 | 03/31/2010 02:02:03 | 45 | 0 | Addition vs Subtraction in loss of significance with floating-points | While learning about precision in floating point arithmetic and different methods to avoid it (using a conjugate, taylor series,...) books frequently mention the subtraction of two very similar numbers or one large and one small number as the biggest cause of error. How come it is only subtraction that causes this and not addition? As I see it you would still lose just as many significant bits while shifting. | floating-point | precision | floating-accuracy | accuracy | numerical-analysis | null | open | Addition vs Subtraction in loss of significance with floating-points
===
While learning about precision in floating point arithmetic and different methods to avoid it (using a conjugate, taylor series,...) books frequently mention the subtraction of two very similar numbers or one large and one small number as the biggest cause of error. How come it is only subtraction that causes this and not addition? As I see it you would still lose just as many significant bits while shifting. | 0 |
8,246,653 | 11/23/2011 17:38:20 | 597,264 | 01/31/2011 17:56:13 | 311 | 13 | rails custom route - error after save on edit action - undefined method for nil:NilClas | I've set up a resource in my routes -
resources :cars do
resources :owners
end
and then a custom route -
match "/:cars" =>"cars#edit", :as => :car
This works - if a user visits mydomain.com/somecarname - it takes them to the edit action of the cars controller.
The problem occurs when I edit that car and hit save -
I get redirected to mydomain.com/1 (or whatever id the car is) - I presume this is the show action.
and get the following error -
undefined method `owner' for nil:NilClass
how do I set up it up to work correctly?
| ruby-on-rails | ruby-on-rails-3 | routing | null | null | null | open | rails custom route - error after save on edit action - undefined method for nil:NilClas
===
I've set up a resource in my routes -
resources :cars do
resources :owners
end
and then a custom route -
match "/:cars" =>"cars#edit", :as => :car
This works - if a user visits mydomain.com/somecarname - it takes them to the edit action of the cars controller.
The problem occurs when I edit that car and hit save -
I get redirected to mydomain.com/1 (or whatever id the car is) - I presume this is the show action.
and get the following error -
undefined method `owner' for nil:NilClass
how do I set up it up to work correctly?
| 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.