PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,672,720 | 10/06/2011 09:54:32 | 652,649 | 03/10/2011 00:08:13 | 354 | 43 | how to make an object an instanceof of its own prototype's property | taking a standard browser as example,
there is the Window class instantiated as window variable
window variable also contains the Window constructor (window.Window)
so, how to reproduce this structure?
test this in your (standard) browser:
alert(window instanceof window.Window); | javascript | scope | reference | prototyping | null | null | open | how to make an object an instanceof of its own prototype's property
===
taking a standard browser as example,
there is the Window class instantiated as window variable
window variable also contains the Window constructor (window.Window)
so, how to reproduce this structure?
test this in your (standard) browser:
alert(window instanceof window.Window); | 0 |
6,770,155 | 07/21/2011 00:40:43 | 855,001 | 07/21/2011 00:36:59 | 1 | 0 | what other ways are there to shard a user table? |
So when the user tries to login and enters his username + password, how else can we determine which database the user is located in, other than from his username and ip address (country) ? | mysql | sql-server | database | postgresql | sharding | 07/22/2011 19:01:40 | not a real question | what other ways are there to shard a user table?
===
So when the user tries to login and enters his username + password, how else can we determine which database the user is located in, other than from his username and ip address (country) ? | 1 |
4,758,113 | 01/21/2011 11:13:16 | 452,680 | 07/26/2010 07:33:54 | 133 | 6 | How to mark important lines(change the font color) of pdf file text? | HI ALL,
I have one Big pdf file.Now i want to mark some important lines of the pdf file by changing background color or font color of the pdf file.Is there any tool available to do this?
Does anybody knows please suggest me also?
Thanks & Regards,
P.SARAVANAN
| pdf | null | null | null | null | 01/21/2011 17:10:08 | off topic | How to mark important lines(change the font color) of pdf file text?
===
HI ALL,
I have one Big pdf file.Now i want to mark some important lines of the pdf file by changing background color or font color of the pdf file.Is there any tool available to do this?
Does anybody knows please suggest me also?
Thanks & Regards,
P.SARAVANAN
| 2 |
4,307,246 | 11/29/2010 19:24:49 | 185,848 | 10/07/2009 18:39:52 | 369 | 11 | Checking for and installing prereqs with Install Shield | I'm creating my first install using the Install Shield version that ships with VS 2010.
On vista and 7 only the .NET 4.0 client is required, but on XP my application reqires:
1. .NET 2.0 (I think this is required
for the following prereqs)
2. XP Update KB968930 (Windows
Management Framework Core)
3. XP Update KB971513 (Microsoft Active
Accessibility Package)
4. SAPI 5.1 (Text to Speech and Speech
Recognition)
When testing the application I've just manually run the exe for each of those (for SAPI I used the old SAPI 5.1 sdk to make sure it's installed which seems overkill). I was thinking of just creating an exe file which would run all four executables and then run the installer (or I think I could via a VB Script inside Install Shield?)
I'm wondering if there is a cleaner way to check for these, prompt the user for each one, and then quietly install as part of the install using Install Shield? Or just a simple way to package them into an install.
Thanks for your help!!
| visual-studio-2010 | installer | installshield | null | null | null | open | Checking for and installing prereqs with Install Shield
===
I'm creating my first install using the Install Shield version that ships with VS 2010.
On vista and 7 only the .NET 4.0 client is required, but on XP my application reqires:
1. .NET 2.0 (I think this is required
for the following prereqs)
2. XP Update KB968930 (Windows
Management Framework Core)
3. XP Update KB971513 (Microsoft Active
Accessibility Package)
4. SAPI 5.1 (Text to Speech and Speech
Recognition)
When testing the application I've just manually run the exe for each of those (for SAPI I used the old SAPI 5.1 sdk to make sure it's installed which seems overkill). I was thinking of just creating an exe file which would run all four executables and then run the installer (or I think I could via a VB Script inside Install Shield?)
I'm wondering if there is a cleaner way to check for these, prompt the user for each one, and then quietly install as part of the install using Install Shield? Or just a simple way to package them into an install.
Thanks for your help!!
| 0 |
4,598,160 | 01/04/2011 20:34:42 | 563,092 | 01/04/2011 20:34:42 | 1 | 0 | Visual Studio 2005 product codes? | Where can i find visual studio product codes for -
Microsoft Visual Basic
Microsoft C#
Microsoft Crystal Reports
Etc.. that have been installed? | windows | visual-studio-2005 | null | null | null | 01/04/2011 20:45:05 | off topic | Visual Studio 2005 product codes?
===
Where can i find visual studio product codes for -
Microsoft Visual Basic
Microsoft C#
Microsoft Crystal Reports
Etc.. that have been installed? | 2 |
5,851,807 | 05/01/2011 22:10:45 | 597,657 | 01/31/2011 23:28:20 | 246 | 6 | Convert if statements to for loop? | I've written a function in mikroC that scan the pressed key in a 4x4 keypad
void scan_key()
{
PORTB = 0B11111110;
if ( PORTB == 0b11101110){
Row = 1;
Column = 1;
return;
}
if ( PORTB == 0b11011110){
Row = 2;
Column = 1;
return;
}
if ( PORTB == 0b10111110){
Row = 3;
Column = 1;
return;
}
if ( PORTB == 0b01111110){
Row = 4;
Column = 1;
return;
}
PORTB = 0B11111101;
if ( PORTB == 0b11101101){
Row = 1;
Column = 2;
return;
}
if ( PORTB == 0b11011101){
Row = 2;
Column = 2;
return;
}
if ( PORTB == 0b10111101){
Row = 3;
Column = 2;
return;
}
if ( PORTB == 0b01111101){
Row = 4;
Column = 2;
return;
}
PORTB = 0B11111011;
if ( PORTB == 0b11101011){
Row = 1;
Column = 3;
return;
}
if ( PORTB == 0b11011011){
Row = 2;
Column = 3;
return;
}
if ( PORTB == 0b10111011){
Row = 3;
Column = 3;
return;
}
if ( PORTB == 0b01111011){
Row = 4;
Column = 3;
return;
}
PORTB = 0B11110111;
if ( PORTB == 0b11100111){
Row = 1;
Column = 4;
return;
}
if ( PORTB == 0b11010111){
Row = 2;
Column = 4;
return;
}
if ( PORTB == 0b10110111){
Row = 3;
Column = 4;
return;
}
if ( PORTB == 0b01110111){
Row = 4;
Column = 4;
return;
}
PORTB = 0B11110000;
}
Is there a way to convert this algorithm into a loop? | c | matrix | pic | keypad | null | 05/21/2011 22:58:43 | too localized | Convert if statements to for loop?
===
I've written a function in mikroC that scan the pressed key in a 4x4 keypad
void scan_key()
{
PORTB = 0B11111110;
if ( PORTB == 0b11101110){
Row = 1;
Column = 1;
return;
}
if ( PORTB == 0b11011110){
Row = 2;
Column = 1;
return;
}
if ( PORTB == 0b10111110){
Row = 3;
Column = 1;
return;
}
if ( PORTB == 0b01111110){
Row = 4;
Column = 1;
return;
}
PORTB = 0B11111101;
if ( PORTB == 0b11101101){
Row = 1;
Column = 2;
return;
}
if ( PORTB == 0b11011101){
Row = 2;
Column = 2;
return;
}
if ( PORTB == 0b10111101){
Row = 3;
Column = 2;
return;
}
if ( PORTB == 0b01111101){
Row = 4;
Column = 2;
return;
}
PORTB = 0B11111011;
if ( PORTB == 0b11101011){
Row = 1;
Column = 3;
return;
}
if ( PORTB == 0b11011011){
Row = 2;
Column = 3;
return;
}
if ( PORTB == 0b10111011){
Row = 3;
Column = 3;
return;
}
if ( PORTB == 0b01111011){
Row = 4;
Column = 3;
return;
}
PORTB = 0B11110111;
if ( PORTB == 0b11100111){
Row = 1;
Column = 4;
return;
}
if ( PORTB == 0b11010111){
Row = 2;
Column = 4;
return;
}
if ( PORTB == 0b10110111){
Row = 3;
Column = 4;
return;
}
if ( PORTB == 0b01110111){
Row = 4;
Column = 4;
return;
}
PORTB = 0B11110000;
}
Is there a way to convert this algorithm into a loop? | 3 |
3,993,669 | 10/22/2010 03:23:12 | 441,077 | 09/07/2010 04:04:33 | 21 | 4 | Creative sorting algorithm? | I just wanted to know if there are any sorting algorithms that are as interesting as <a href="http://en.wikipedia.org/wiki/Bogosort">Bogosort</a> to sort a pack of cards.
Use your creativity.
For a change efficiency ain't important but being creative is :) | algorithm | sorting | creativity | null | null | 10/22/2010 03:44:20 | not a real question | Creative sorting algorithm?
===
I just wanted to know if there are any sorting algorithms that are as interesting as <a href="http://en.wikipedia.org/wiki/Bogosort">Bogosort</a> to sort a pack of cards.
Use your creativity.
For a change efficiency ain't important but being creative is :) | 1 |
10,499,005 | 05/08/2012 12:52:46 | 1,321,390 | 04/09/2012 07:26:58 | 6 | 0 | how to remove carriage return from a string | String ="SSR/DANGEROUS GOODS AS PER ATTACHED SHIPPERS
/DECLARATION 1 PACKAGE
NFY
/ACME CONSOLIDATORS"
how to strip the space between the "PACKAGE" and "NFY" ? | java | null | null | null | null | null | open | how to remove carriage return from a string
===
String ="SSR/DANGEROUS GOODS AS PER ATTACHED SHIPPERS
/DECLARATION 1 PACKAGE
NFY
/ACME CONSOLIDATORS"
how to strip the space between the "PACKAGE" and "NFY" ? | 0 |
7,294,016 | 09/03/2011 15:29:05 | 926,740 | 09/03/2011 15:23:08 | 1 | 1 | PuTTY (or any ssh-like): Opaque Text and Transparent Background | I know it was already asked here http://stackoverflow.com/questions/711181/putty-with-transparent-background-and-opaque-text BUT the post is really old.
KiTTY doesn't work with it anymore (althou the option is still there). Console 2 makes the whole window transparent even the text which isn't usable at all. Other versions of PuTTY with this feature enabled are really old and (for me) unsecure.
So, what is your solution for opaque text and transparent background on a shell for Windows? | windows | shell | transparency | putty | null | 09/04/2011 03:42:32 | off topic | PuTTY (or any ssh-like): Opaque Text and Transparent Background
===
I know it was already asked here http://stackoverflow.com/questions/711181/putty-with-transparent-background-and-opaque-text BUT the post is really old.
KiTTY doesn't work with it anymore (althou the option is still there). Console 2 makes the whole window transparent even the text which isn't usable at all. Other versions of PuTTY with this feature enabled are really old and (for me) unsecure.
So, what is your solution for opaque text and transparent background on a shell for Windows? | 2 |
6,543,861 | 07/01/2011 05:17:39 | 818,551 | 06/28/2011 05:22:57 | 1 | 0 | how to display result to textbox when click the button control in asp.net | I am newer one asp.net. I have one button and one textbox in my web application. I want when i click the button the result will be displayed in the text box. Can anyone help for that.
Thanx in advance.......
| c# | asp.net | null | null | null | 07/02/2011 02:53:21 | not a real question | how to display result to textbox when click the button control in asp.net
===
I am newer one asp.net. I have one button and one textbox in my web application. I want when i click the button the result will be displayed in the text box. Can anyone help for that.
Thanx in advance.......
| 1 |
3,665,031 | 09/08/2010 06:09:39 | 61,639 | 02/02/2009 19:03:45 | 1,631 | 74 | Does LINQ skip & take have decent performance? | We have a query for about 40 data fields related to customers. The query will often return a large amount of records, say up to 20,000. We only want to use say around the first 500 results. Then, we just want to be able to page through them 10 at a time.
Is LINQ skip and take a reasonable approach for this? Are there any potentnialy performance issues with using this approach vs doing it manually some other way? | linq | sql-server-2008 | ado.net | skip-take | null | null | open | Does LINQ skip & take have decent performance?
===
We have a query for about 40 data fields related to customers. The query will often return a large amount of records, say up to 20,000. We only want to use say around the first 500 results. Then, we just want to be able to page through them 10 at a time.
Is LINQ skip and take a reasonable approach for this? Are there any potentnialy performance issues with using this approach vs doing it manually some other way? | 0 |
8,392,472 | 12/05/2011 21:59:26 | 665,312 | 03/18/2011 00:45:46 | 61 | 3 | Custom Google Map | I'm wanting to create a custom google map which has 2 locations.
Have been googling for quite a bit and can't find anything decent.
Any information is greatly appreciated.
Thanks! | javascript | google | xhtml | null | null | 12/06/2011 02:52:15 | not a real question | Custom Google Map
===
I'm wanting to create a custom google map which has 2 locations.
Have been googling for quite a bit and can't find anything decent.
Any information is greatly appreciated.
Thanks! | 1 |
10,258,002 | 04/21/2012 10:09:08 | 1,172,635 | 01/27/2012 02:17:25 | 43 | 0 | ButtonDown and ButtonUp using boolean? | so basically I am using a custom controller for input, that sets a boolean value to true as long as a button is held, and false while the button is released.
I need to be able to make an event fire once when the button is first pressed and when it is released.
Does anyone have any advice?
P.S. I am using C# with the .Net Framework. | c# | events | input | controller | keypress | null | open | ButtonDown and ButtonUp using boolean?
===
so basically I am using a custom controller for input, that sets a boolean value to true as long as a button is held, and false while the button is released.
I need to be able to make an event fire once when the button is first pressed and when it is released.
Does anyone have any advice?
P.S. I am using C# with the .Net Framework. | 0 |
11,062,644 | 06/16/2012 10:27:04 | 777,092 | 05/31/2011 05:01:02 | 30 | 1 | store stored Procedure's value in variable | I've gotta problem, just looking for help from someone. here is my question
I have a task that when users sends a message to other user then the message (id, subject, and message body) is sent and credit for that message is deducted from senders account. if there is some problem neither of this done. so, what I've done so far is:
I have wrote a procedure which is used to send message to selected users, and if message sent successfully then it call deduct_credit procedure from the message's procedure, so i want to store deduct_credits result or response in variable, so that i can do ROLLBACK transaction if there is problem.
any help is welcome, and sorry for complexity (if you feel).
Thanks,
Gautam
| mysql | php5 | stored-procedures | mysqli | sqltransaction | 06/16/2012 12:08:27 | not a real question | store stored Procedure's value in variable
===
I've gotta problem, just looking for help from someone. here is my question
I have a task that when users sends a message to other user then the message (id, subject, and message body) is sent and credit for that message is deducted from senders account. if there is some problem neither of this done. so, what I've done so far is:
I have wrote a procedure which is used to send message to selected users, and if message sent successfully then it call deduct_credit procedure from the message's procedure, so i want to store deduct_credits result or response in variable, so that i can do ROLLBACK transaction if there is problem.
any help is welcome, and sorry for complexity (if you feel).
Thanks,
Gautam
| 1 |
10,228,449 | 04/19/2012 12:49:02 | 794,434 | 06/12/2011 02:33:14 | 895 | 78 | Google map integration with blackberry native app | I want to integrate Google map in my blackberry native application. In my screen half of the space will be used by map.
My requirements are:
- searching nearest location
- Pin the location on map
- Tapping on any pin, a small pop-up will be displayed where User can view detailed
description
I am a very beginner for google map with blackberry programming. While searching in stack overflow i got the below link.
http://stackoverflow.com/questions/1387688/use-google-map-in-blackberry-application
As I understand I have to make use of dynamic and interactive map. Guide me with the samples to achieve it.
| google-maps | blackberry | null | null | null | null | open | Google map integration with blackberry native app
===
I want to integrate Google map in my blackberry native application. In my screen half of the space will be used by map.
My requirements are:
- searching nearest location
- Pin the location on map
- Tapping on any pin, a small pop-up will be displayed where User can view detailed
description
I am a very beginner for google map with blackberry programming. While searching in stack overflow i got the below link.
http://stackoverflow.com/questions/1387688/use-google-map-in-blackberry-application
As I understand I have to make use of dynamic and interactive map. Guide me with the samples to achieve it.
| 0 |
10,313,219 | 04/25/2012 09:51:22 | 1,355,671 | 04/25/2012 08:43:58 | 1 | 0 | Runtime error "wrong name: applicationarbre / Main" | I want to run my java application from the command line c but gives me the following error:
`Exception in thread "main" java.lang.NoClassDefFoundError: Main (wrong name: applicationarbre/Main)
`
I searched the internet and tried several solutions but I'm still the same error.
I want to know if I have an application that contains several classes how I'm going to do to run from the command line?
Thank you in advance. | java | null | null | null | null | null | open | Runtime error "wrong name: applicationarbre / Main"
===
I want to run my java application from the command line c but gives me the following error:
`Exception in thread "main" java.lang.NoClassDefFoundError: Main (wrong name: applicationarbre/Main)
`
I searched the internet and tried several solutions but I'm still the same error.
I want to know if I have an application that contains several classes how I'm going to do to run from the command line?
Thank you in advance. | 0 |
993,238 | 06/14/2009 17:17:54 | 49,942 | 12/29/2008 19:30:22 | 10,529 | 534 | Entering data into a grid | A UI question: is there some consensus on the best (defined as "the one which end-users like best") or least-bad way to implement data entry into a grid?
I have a grid, with many rows. The grid's columns contain various types of properties, which the user can enter/edit. The "types" of properties include:
* Free text
* Numbers (numeric digits)
* Enum value (e.g. one of 'High', 'Medium', and 'Low')
* Others (e.g. date, duration)
The 'free text' type isn't difficult to design (so I won't ask about that), but what about the next two types?
**Numeric digits**
* When using a keyboard to enter a number, would you allow free-text entry, and then run a validate method on blur? Or, monitor each key-press to restrict the data entry to digits only?
* How do you tell the user (on a grid, not on a form) that the syntax of the data in some column is restricted to numeric-only? What do you do if the user presses a wrong (non-numeric) key?
* A 'spin' or 'spinner' control is a standard Windows control; is it appropriate to try to use one on a HTML-based grid as well?
**Enum values**
For entering or editing an enum value using the mouse, I guess that popping a little context menu on a mouse click is the thing to do.
* An alternative is to use the `<select>` input control (i.e. a combo box). I guess though that having a whole column-ful of combo boxes isn't as easy to read as having a column of text value (because the combo boxes add extra non-text ink)? What do you think of usually displaying plain text, but replacing that text with a combo box when the field gets the input focus (and then removing the combo box on blur)?
* Would you also pop that same menu on focus, when the focus changes as a result of the keyboard (i.e. the [Tab] key) instead of a result of the mouse (i.e. a click)? In other words, should tabbing to a field result in a popup menu? Incidentally, the CSS-based popup menus that I've seen respond to the mouse but not to the keyboard (e.g. to the [Up] and [Down] arrow keys). Do you know of any Intellisense-like data entry implementation that can run in a browser?
**For example?**
I'd also be interested in seeing anything you think is an exemplary example. I'm interested in desktop UI and/or in-browser answers. | validation | ime | user-interface | data-entry | null | null | open | Entering data into a grid
===
A UI question: is there some consensus on the best (defined as "the one which end-users like best") or least-bad way to implement data entry into a grid?
I have a grid, with many rows. The grid's columns contain various types of properties, which the user can enter/edit. The "types" of properties include:
* Free text
* Numbers (numeric digits)
* Enum value (e.g. one of 'High', 'Medium', and 'Low')
* Others (e.g. date, duration)
The 'free text' type isn't difficult to design (so I won't ask about that), but what about the next two types?
**Numeric digits**
* When using a keyboard to enter a number, would you allow free-text entry, and then run a validate method on blur? Or, monitor each key-press to restrict the data entry to digits only?
* How do you tell the user (on a grid, not on a form) that the syntax of the data in some column is restricted to numeric-only? What do you do if the user presses a wrong (non-numeric) key?
* A 'spin' or 'spinner' control is a standard Windows control; is it appropriate to try to use one on a HTML-based grid as well?
**Enum values**
For entering or editing an enum value using the mouse, I guess that popping a little context menu on a mouse click is the thing to do.
* An alternative is to use the `<select>` input control (i.e. a combo box). I guess though that having a whole column-ful of combo boxes isn't as easy to read as having a column of text value (because the combo boxes add extra non-text ink)? What do you think of usually displaying plain text, but replacing that text with a combo box when the field gets the input focus (and then removing the combo box on blur)?
* Would you also pop that same menu on focus, when the focus changes as a result of the keyboard (i.e. the [Tab] key) instead of a result of the mouse (i.e. a click)? In other words, should tabbing to a field result in a popup menu? Incidentally, the CSS-based popup menus that I've seen respond to the mouse but not to the keyboard (e.g. to the [Up] and [Down] arrow keys). Do you know of any Intellisense-like data entry implementation that can run in a browser?
**For example?**
I'd also be interested in seeing anything you think is an exemplary example. I'm interested in desktop UI and/or in-browser answers. | 0 |
2,984,257 | 06/06/2010 13:03:58 | 174,261 | 09/16/2009 10:28:26 | 152 | 5 | PHP - How to convert the YouTube URL with Regex | How can convert the below youtube urls
$url1 = http://www.youtube.com/watch?v=136pEZcb1Y0&feature=fvhl
$url2 = http://www.youtube.com/watch?feature=fvhl&v=136pEZcb1Y0
into
$url_embedded = http://www.youtube.com/watch/v=136pEZcb1Y0
using Regular Expressions?
| php | regex | url | youtube | null | null | open | PHP - How to convert the YouTube URL with Regex
===
How can convert the below youtube urls
$url1 = http://www.youtube.com/watch?v=136pEZcb1Y0&feature=fvhl
$url2 = http://www.youtube.com/watch?feature=fvhl&v=136pEZcb1Y0
into
$url_embedded = http://www.youtube.com/watch/v=136pEZcb1Y0
using Regular Expressions?
| 0 |
7,155,827 | 08/23/2011 02:54:11 | 494,074 | 10/23/2010 21:32:53 | 776 | 13 | How to know how long a process has been running? | I am interested in doing this purely using bash. | bash | null | null | null | null | 08/23/2011 02:57:46 | off topic | How to know how long a process has been running?
===
I am interested in doing this purely using bash. | 2 |
6,919,256 | 08/02/2011 22:03:11 | 794,243 | 06/11/2011 19:43:28 | 145 | 1 | Am I not doing correctly or understanding double buffering on Android? | I have a function
@Override
public void run() {
while(running && (!eof)){
if(surfaceHolder.getSurface().isValid()){
Canvas canvas = surfaceHolder.lockCanvas();
paint(canvas);
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
thread = null;
}
where paint(canvas) calls a bunch of other functions that draw a graph and text, for example
canvas.drawText("Time="+myRecord.getMyTime(), 100, 100, paint);
The problem I'm having is that the graph and the text, both of which should be constantly changing, don't get erased but instead keep drawing over themselves. Shouldn't my entire canvas get redrawn every time because that's how double buffering works with the lock() and unlock()? Am I not understanding this correctly? How am I supposed to do this? | java | android | doublebuffered | null | null | null | open | Am I not doing correctly or understanding double buffering on Android?
===
I have a function
@Override
public void run() {
while(running && (!eof)){
if(surfaceHolder.getSurface().isValid()){
Canvas canvas = surfaceHolder.lockCanvas();
paint(canvas);
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
thread = null;
}
where paint(canvas) calls a bunch of other functions that draw a graph and text, for example
canvas.drawText("Time="+myRecord.getMyTime(), 100, 100, paint);
The problem I'm having is that the graph and the text, both of which should be constantly changing, don't get erased but instead keep drawing over themselves. Shouldn't my entire canvas get redrawn every time because that's how double buffering works with the lock() and unlock()? Am I not understanding this correctly? How am I supposed to do this? | 0 |
17,020 | 08/19/2008 21:42:30 | 1,633 | 08/17/2008 17:30:24 | 76 | 16 | What is the best way to partition terabyte drive in a linux development machine? | I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation?
The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to small after a bit of use. Other partitions are probably to huge. The swap drive for example is currently 2GB (2x 1GB RAM), but it is almost never used (only once that I know of).
| linux | storage | partition | null | null | 11/30/2011 02:43:57 | off topic | What is the best way to partition terabyte drive in a linux development machine?
===
I have a new 1 TB drive coming in tomorrow. What is the best way to divide this space for a development workstation?
The biggest problem I think I'm going to have is that some partitions (probably /usr) will become to small after a bit of use. Other partitions are probably to huge. The swap drive for example is currently 2GB (2x 1GB RAM), but it is almost never used (only once that I know of).
| 2 |
8,954,308 | 01/21/2012 15:47:19 | 532,430 | 12/06/2010 14:49:09 | 1,405 | 65 | Is the HTTP package server safe to use in production? | Go implements [FastCGI][1], as well as a native [HTTP server][2] in its standard library.
Is it safe to use the server from the HTTP package in production (as an application server) or is it recommended to use the FastCGI interface to connect to a more robust solution like Apache in terms of security?
[1]: http://weekly.golang.org/pkg/net/http/fcgi/
[2]: http://weekly.golang.org/pkg/net/http/ | http | go | null | null | null | 01/23/2012 18:27:31 | not constructive | Is the HTTP package server safe to use in production?
===
Go implements [FastCGI][1], as well as a native [HTTP server][2] in its standard library.
Is it safe to use the server from the HTTP package in production (as an application server) or is it recommended to use the FastCGI interface to connect to a more robust solution like Apache in terms of security?
[1]: http://weekly.golang.org/pkg/net/http/fcgi/
[2]: http://weekly.golang.org/pkg/net/http/ | 4 |
11,574,601 | 07/20/2012 07:14:31 | 541,786 | 12/14/2010 10:27:01 | 2,882 | 165 | Dfference between emulator and AVD | I have just switch to android development and came across this doubt. How is **AVD** different from **emulator**?
Thanks,
Nitish | android | android-emulator | avd | null | null | 07/20/2012 17:26:46 | not constructive | Dfference between emulator and AVD
===
I have just switch to android development and came across this doubt. How is **AVD** different from **emulator**?
Thanks,
Nitish | 4 |
10,831,275 | 05/31/2012 09:53:51 | 1,428,051 | 05/31/2012 09:44:00 | 1 | 0 | Java Wicket - Calling javascript ( JQuery ) before AJAX | I got this thing i'm trying to solve:
I got a ListView created using Wicket ( 1.5 ) with a lot of elements and a scroll. When new items are available, the user is asked if he would like to refresh the list via a message backed by an AjaxLink:
public void onClick(AjaxRequestTarget ajaxTarget) {
/* do something ... */
ajaxTarget.addComponent(_list);
}
So on click the list gets reloaded and the scroll position is reset to zero. Is there any way i can call JavaScript before the list reloads the save the scroll position?
(I know how to get/save the scroll position ( .scrollTop() ) , i just don't know how to call a function right before AJAX ).
| java | javascript | ajax | wicket | null | null | open | Java Wicket - Calling javascript ( JQuery ) before AJAX
===
I got this thing i'm trying to solve:
I got a ListView created using Wicket ( 1.5 ) with a lot of elements and a scroll. When new items are available, the user is asked if he would like to refresh the list via a message backed by an AjaxLink:
public void onClick(AjaxRequestTarget ajaxTarget) {
/* do something ... */
ajaxTarget.addComponent(_list);
}
So on click the list gets reloaded and the scroll position is reset to zero. Is there any way i can call JavaScript before the list reloads the save the scroll position?
(I know how to get/save the scroll position ( .scrollTop() ) , i just don't know how to call a function right before AJAX ).
| 0 |
7,218,456 | 08/28/2011 01:14:44 | 642,317 | 03/03/2011 03:25:52 | 1 | 0 | best ways to start learning photoshop if I am an absolute beginner? | What are the best ways to teach an absolute beginner how to use photoshop? If they are trying to avoid entering into an academic setting to learn it-- are there ways that it can be self-taught? Are online tutorials a good option? If so, which ones are best to start with? | photoshop | null | null | null | null | 08/28/2011 01:39:45 | off topic | best ways to start learning photoshop if I am an absolute beginner?
===
What are the best ways to teach an absolute beginner how to use photoshop? If they are trying to avoid entering into an academic setting to learn it-- are there ways that it can be self-taught? Are online tutorials a good option? If so, which ones are best to start with? | 2 |
7,387,334 | 09/12/2011 11:47:04 | 940,468 | 09/12/2011 11:47:04 | 1 | 0 | how to encrypt /decrypt a video file using RSA algorithm? | i want to ask u something about DRM here.i want to encrypt/decrypt a file using RSA algorithm in java.can anyone send the sample code for this.any help is thankful..thanx in advance.. | java | encryption | null | null | null | 09/12/2011 11:54:30 | not a real question | how to encrypt /decrypt a video file using RSA algorithm?
===
i want to ask u something about DRM here.i want to encrypt/decrypt a file using RSA algorithm in java.can anyone send the sample code for this.any help is thankful..thanx in advance.. | 1 |
3,370,305 | 07/30/2010 09:40:52 | 364,971 | 06/11/2010 22:24:05 | 43 | 1 | Exception with connection in ADO.NET | I am trying to learn ADO.NET to connect with SQLServer ...
I install SQLserver with Visual studio ....
there is data base called "Northwind" as example with it ...
I am trying to read this data base , I wrote this code ...
using System;
using System.Data;
using System.Data.SqlClient;
namespace DataSetReaderFromSQL
{
class Program
{
static void Main(string[] args)
{
SqlConnection connection = new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;" + "Initial Catalog=Northwind");
connection.Open();
SqlCommand command = connection.CreateCommand();
command.CommandText = "Select CustomerID , CompanyName from Customers";
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
Console.WriteLine(reader["CustomerID"] +""+ reader["CompanyName"]);
reader.Close();
connection.Close();
}
}
}
when Application run , it's take a little of time then throw exception when it trys to open connection ...
the text of the exception :
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I am using Windows 7 as operating system , and I but username on my account ...
I am sure that SQL server was installed on my computer
where is my error ??
| c# | ado.net | null | null | null | null | open | Exception with connection in ADO.NET
===
I am trying to learn ADO.NET to connect with SQLServer ...
I install SQLserver with Visual studio ....
there is data base called "Northwind" as example with it ...
I am trying to read this data base , I wrote this code ...
using System;
using System.Data;
using System.Data.SqlClient;
namespace DataSetReaderFromSQL
{
class Program
{
static void Main(string[] args)
{
SqlConnection connection = new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;" + "Initial Catalog=Northwind");
connection.Open();
SqlCommand command = connection.CreateCommand();
command.CommandText = "Select CustomerID , CompanyName from Customers";
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
Console.WriteLine(reader["CustomerID"] +""+ reader["CompanyName"]);
reader.Close();
connection.Close();
}
}
}
when Application run , it's take a little of time then throw exception when it trys to open connection ...
the text of the exception :
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I am using Windows 7 as operating system , and I but username on my account ...
I am sure that SQL server was installed on my computer
where is my error ??
| 0 |
2,316,475 | 02/23/2010 07:46:47 | 100,572 | 05/04/2009 01:04:48 | 282 | 7 | How do I return early from a rake task? | I have a rake task where I do some checks at the beginning, if one of the checks fails I would like to return early from the rake task, I don't want to execute any of the remaining code.
I thought the solution would be to place a return where I wanted to return from the code but I get the following error
unexpected return | ruby-on-rails | rake | null | null | null | null | open | How do I return early from a rake task?
===
I have a rake task where I do some checks at the beginning, if one of the checks fails I would like to return early from the rake task, I don't want to execute any of the remaining code.
I thought the solution would be to place a return where I wanted to return from the code but I get the following error
unexpected return | 0 |
6,828,848 | 07/26/2011 10:45:27 | 448,413 | 06/09/2010 10:04:01 | 384 | 2 | How the given C code be interpretated by different Compiler | I have a code below and wanted to know what could be output.What i would like to see how different compiler would interpret this particular piece of code.
int main()
{
int i = -1, j = 2, k = 0, m;
m = ++i || ++j && ++k;
printf("\n %d %d %d %d \n", i, j, k, m);
return 0;
}
Now the question is while handling this code would compiler go by the rule which says
This expresion can be seen as
m = ++i || (++j && ++k); as && has higher precedence over || and the result would be -2 2 0 1
or
This expresion can be seen as
m = ++i || (++j && ++k);
but compiler still will try to short circuit. so it evaluates ++i, since it's 1,(++j&&++k) are not evaluated.so ans is -2 2 0 1 | c | null | null | null | null | 11/24/2011 22:22:43 | not a real question | How the given C code be interpretated by different Compiler
===
I have a code below and wanted to know what could be output.What i would like to see how different compiler would interpret this particular piece of code.
int main()
{
int i = -1, j = 2, k = 0, m;
m = ++i || ++j && ++k;
printf("\n %d %d %d %d \n", i, j, k, m);
return 0;
}
Now the question is while handling this code would compiler go by the rule which says
This expresion can be seen as
m = ++i || (++j && ++k); as && has higher precedence over || and the result would be -2 2 0 1
or
This expresion can be seen as
m = ++i || (++j && ++k);
but compiler still will try to short circuit. so it evaluates ++i, since it's 1,(++j&&++k) are not evaluated.so ans is -2 2 0 1 | 1 |
2,345,513 | 02/26/2010 23:27:04 | 149,458 | 08/03/2009 01:39:55 | 1,606 | 123 | Interview coding test how to approach the style aspect. | I have taken a couple of coding test lately all timed, but without a limit meaning I could take as long as I want, but they wanted to see how long it took me. Given this criteria i have opted to use the most straight forward style possible while refactoring little in order to solve the problem quickly. I have received a couple of offers so I guess I did good enough, but was curious as to how other approach coding tests. | interview-questions | null | null | null | null | 12/04/2011 02:19:06 | off topic | Interview coding test how to approach the style aspect.
===
I have taken a couple of coding test lately all timed, but without a limit meaning I could take as long as I want, but they wanted to see how long it took me. Given this criteria i have opted to use the most straight forward style possible while refactoring little in order to solve the problem quickly. I have received a couple of offers so I guess I did good enough, but was curious as to how other approach coding tests. | 2 |
8,274,582 | 11/25/2011 21:56:21 | 1,066,290 | 11/25/2011 21:54:36 | 1 | 0 | update mysql_query form cookie | hoi i think this shoot work in theory will it ?
$sql = "UPDATE users SET credtis = credits+1 WHERE id=echo .($_COOKIE['credits_id']!='');";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
}
| php | mysql | null | null | null | 11/25/2011 22:04:58 | not a real question | update mysql_query form cookie
===
hoi i think this shoot work in theory will it ?
$sql = "UPDATE users SET credtis = credits+1 WHERE id=echo .($_COOKIE['credits_id']!='');";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
}
| 1 |
6,019,680 | 05/16/2011 15:30:04 | 356,387 | 06/02/2010 11:44:16 | 2,037 | 25 | Thread syncronization | I have one thread that locks a mutex, writes a value to a variable, unlocks the mutex.
I do a print out here and the value has been changed. I set it to 1.
When I read the variables value in another thread using lock, unlock on the mutex and read the value, I get the old value of 0.
Why is this happening. I lock and unlock the same mutex correctly.
How do I sync threads? | multithreading | thread-safety | pthreads | null | null | null | open | Thread syncronization
===
I have one thread that locks a mutex, writes a value to a variable, unlocks the mutex.
I do a print out here and the value has been changed. I set it to 1.
When I read the variables value in another thread using lock, unlock on the mutex and read the value, I get the old value of 0.
Why is this happening. I lock and unlock the same mutex correctly.
How do I sync threads? | 0 |
9,489,669 | 02/28/2012 21:03:03 | 976,954 | 10/03/2011 15:26:38 | 24 | 0 | Updating a matplotlib bar graph? | I have a bar graph which retrieves its y values from a dict. Instead of showing several graphs with all the different values and me having to close every single one, I need it to update values on the same graph. Is there a solution for this?
| python | matplotlib | null | null | null | null | open | Updating a matplotlib bar graph?
===
I have a bar graph which retrieves its y values from a dict. Instead of showing several graphs with all the different values and me having to close every single one, I need it to update values on the same graph. Is there a solution for this?
| 0 |
10,562,186 | 05/12/2012 08:33:15 | 1,390,736 | 05/12/2012 07:10:34 | 1 | 0 | Notice: Undefined variable: basic html form | this is the code i am working on (it is part of this tutorial http://www.homeandlearn.co.uk/php/php4p9.html )
this works fine
` <html>
<head>
<title>A BASIC HTML FORM</title>
<?PHP
if (isset($_POST['Submit1'])) {
$username=$_POST['username'];
if($username=="ken"){
print("you the man");
}
else {
print("you are not supposed to be here");
}
}
else{
$username="";
}
?>
</head>
<body>
<FORM NAME ="form1" METHOD ="post" ACTION = "basicForm.php">
username: <INPUT TYPE = "TEXT" VALUE ="<?PHP print $username;?>"NAME="username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>`
But this does not
<html>
<head>
<title>A BASIC HTML FORM</title>
<?PHP
if (isset($_POST['Submit1'])) {
$username=$_POST['username'];
$nickname=$_POST['nickname'];
if($username=='ken'and$nickname=='hawk'){
print("you the man");
}
else {
print("you are not supposed to be here");
}
}
else{
$username=""and$nickname="";
}
?>
</head>
<body>
<FORM NAME ="form1" METHOD ="post" ACTION = "testformken.php">
nickname: <input type="text" VALUE ="<?PHP print $nickname;?>" name="nickname" /><br />
username: <input type="text" VALUE ="<?PHP print $username;?>" name="username" />
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>
I get this Notice: Undefined variable: nickname in C:\wamp\www\testformken.php on line 30 Call Stack #TimeMemoryFunctionLocation 10.1800367256{main}( )..\testformken.php:0 " name="nickname" />
I have messed with a few things and if i change
nickname: <input type="text" VALUE ="<?PHP print $nickname;?>" name="nickname" /><br />
to
nickname: <input type="text" VALUE ="<?PHPprint$nickname;?>" name="nickname" /><br />
I do not get a the undifined variable but it does not print the nickname either
if i change the value to
<?PHP print $username;?>
enter code here i do not get the undifined variable.
| php | html | null | null | null | 05/12/2012 10:50:53 | too localized | Notice: Undefined variable: basic html form
===
this is the code i am working on (it is part of this tutorial http://www.homeandlearn.co.uk/php/php4p9.html )
this works fine
` <html>
<head>
<title>A BASIC HTML FORM</title>
<?PHP
if (isset($_POST['Submit1'])) {
$username=$_POST['username'];
if($username=="ken"){
print("you the man");
}
else {
print("you are not supposed to be here");
}
}
else{
$username="";
}
?>
</head>
<body>
<FORM NAME ="form1" METHOD ="post" ACTION = "basicForm.php">
username: <INPUT TYPE = "TEXT" VALUE ="<?PHP print $username;?>"NAME="username">
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>`
But this does not
<html>
<head>
<title>A BASIC HTML FORM</title>
<?PHP
if (isset($_POST['Submit1'])) {
$username=$_POST['username'];
$nickname=$_POST['nickname'];
if($username=='ken'and$nickname=='hawk'){
print("you the man");
}
else {
print("you are not supposed to be here");
}
}
else{
$username=""and$nickname="";
}
?>
</head>
<body>
<FORM NAME ="form1" METHOD ="post" ACTION = "testformken.php">
nickname: <input type="text" VALUE ="<?PHP print $nickname;?>" name="nickname" /><br />
username: <input type="text" VALUE ="<?PHP print $username;?>" name="username" />
<INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Login">
</FORM>
</body>
</html>
I get this Notice: Undefined variable: nickname in C:\wamp\www\testformken.php on line 30 Call Stack #TimeMemoryFunctionLocation 10.1800367256{main}( )..\testformken.php:0 " name="nickname" />
I have messed with a few things and if i change
nickname: <input type="text" VALUE ="<?PHP print $nickname;?>" name="nickname" /><br />
to
nickname: <input type="text" VALUE ="<?PHPprint$nickname;?>" name="nickname" /><br />
I do not get a the undifined variable but it does not print the nickname either
if i change the value to
<?PHP print $username;?>
enter code here i do not get the undifined variable.
| 3 |
10,380,861 | 04/30/2012 08:51:44 | 532,875 | 12/06/2010 21:19:25 | 133 | 6 | Stretching the items of an ItemsControl | I'm bulding a small WPF app over here. It's all built strictly with MVVM, using nothing but DataTemplates linked to view model types.
I've seen alot of questions about how to stretch and clip the contents of `ListBox`es so that the items fill its parent. After alot of experimenting I managed to get my head around that but now I find myself in the same scenario with the `ItemsControl` but the same tricks doesn't seem to work.
Here's one of the `DataTemplate`s in use (a simple `TextBox`). Note how I tried setting the `HorizontalAlignment` ...
<DataTemplate DataType="{x:Type vm:OneOfMyViewModelTypes}">
<TextBox
Text="{Binding Path=Value}"
HorizontalAlignment="Stretch"
/>
</DataTemplate>
Here's the `ItemsControl` inside a `Grid` ...
<Grid Background="Gray">
<Grid.Margin>
<Thickness
Left="{StaticResource ConfigurationDefaultMargin}"
Right="{StaticResource ConfigurationDefaultMargin}"
Bottom="{StaticResource ConfigurationDefaultMargin}"
Top="{StaticResource ConfigurationDefaultMargin}"
/>
</Grid.Margin>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="_key" Width="Auto"/>
<ColumnDefinition SharedSizeGroup="_value" Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl
Background="DimGray"
Grid.IsSharedSizeScope="True"
ItemsSource="{Binding Path=Configuration, Mode=OneWay}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="_key"/>
<ColumnDefinition SharedSizeGroup="_value"/>
</Grid.ColumnDefinitions>
<TextBlock
Style="{StaticResource ExtensionConfigurationLabel}"
Grid.Column="0"
Margin="5,5,5,0"
Text="{Binding Path=Caption}"
/>
<ContentPresenter
Grid.Column="1"
HorizontalAlignment="Stretch"
Margin="5,5,5,0"
Content="{Binding}"
/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
I've used colors to see how the controls sizes. The `Grid` is gray and the `ItemsControl` is dark gray.
This is the result ...
![This is the result][1]
As you can see from the colors the containing `Grid` stretches while the `ItemsControl` does not. I did set its `HorizontalAlignment` property to `Stretch` but it seems it has no effect. Is there anything else I need do?
Thanks
[1]: http://i.stack.imgur.com/0RvU4.png | wpf | datatemplate | itemscontrol | null | null | null | open | Stretching the items of an ItemsControl
===
I'm bulding a small WPF app over here. It's all built strictly with MVVM, using nothing but DataTemplates linked to view model types.
I've seen alot of questions about how to stretch and clip the contents of `ListBox`es so that the items fill its parent. After alot of experimenting I managed to get my head around that but now I find myself in the same scenario with the `ItemsControl` but the same tricks doesn't seem to work.
Here's one of the `DataTemplate`s in use (a simple `TextBox`). Note how I tried setting the `HorizontalAlignment` ...
<DataTemplate DataType="{x:Type vm:OneOfMyViewModelTypes}">
<TextBox
Text="{Binding Path=Value}"
HorizontalAlignment="Stretch"
/>
</DataTemplate>
Here's the `ItemsControl` inside a `Grid` ...
<Grid Background="Gray">
<Grid.Margin>
<Thickness
Left="{StaticResource ConfigurationDefaultMargin}"
Right="{StaticResource ConfigurationDefaultMargin}"
Bottom="{StaticResource ConfigurationDefaultMargin}"
Top="{StaticResource ConfigurationDefaultMargin}"
/>
</Grid.Margin>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="_key" Width="Auto"/>
<ColumnDefinition SharedSizeGroup="_value" Width="*"/>
</Grid.ColumnDefinitions>
<ItemsControl
Background="DimGray"
Grid.IsSharedSizeScope="True"
ItemsSource="{Binding Path=Configuration, Mode=OneWay}"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition SharedSizeGroup="_key"/>
<ColumnDefinition SharedSizeGroup="_value"/>
</Grid.ColumnDefinitions>
<TextBlock
Style="{StaticResource ExtensionConfigurationLabel}"
Grid.Column="0"
Margin="5,5,5,0"
Text="{Binding Path=Caption}"
/>
<ContentPresenter
Grid.Column="1"
HorizontalAlignment="Stretch"
Margin="5,5,5,0"
Content="{Binding}"
/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
I've used colors to see how the controls sizes. The `Grid` is gray and the `ItemsControl` is dark gray.
This is the result ...
![This is the result][1]
As you can see from the colors the containing `Grid` stretches while the `ItemsControl` does not. I did set its `HorizontalAlignment` property to `Stretch` but it seems it has no effect. Is there anything else I need do?
Thanks
[1]: http://i.stack.imgur.com/0RvU4.png | 0 |
9,288,263 | 02/15/2012 05:22:37 | 1,210,448 | 02/15/2012 03:47:04 | 1 | 0 | jQuery Autocomplete like facebook current city and hometown | Is there anyone experience on producing autocomplete just like the shown in picture? it fix for one item / chosen one.
link for picture: http://i.stack.imgur.com/hKsY1.png
If there's a help, it would benificial to everyone
thanks | javascript | jquery | facebook | autocomplete | null | 02/16/2012 05:49:20 | not constructive | jQuery Autocomplete like facebook current city and hometown
===
Is there anyone experience on producing autocomplete just like the shown in picture? it fix for one item / chosen one.
link for picture: http://i.stack.imgur.com/hKsY1.png
If there's a help, it would benificial to everyone
thanks | 4 |
5,192,009 | 03/04/2011 09:38:05 | 636,075 | 02/27/2011 02:02:45 | 1 | 0 | PLZ PLZ HELP with a object oriented basic hangman game | Does anyone have a basic hangman object oriented program with a class and driver that would like to share. i have no idea what i am doing, i do not know oop and my instructor said that we are allowed to get any help that we can find. this it due saturday by midnight so please help asap
For this program, you are to create a Hangman class.The purpose of a Hangman object is to maintain the state of a hangman game. This object should provide a mechanism to store a word to be guessed,the letters that have already been guessed, and the current state of the word to be guessed. The game should also store the maximum number of misses allowed as well as provide a mechanism for determining whether the game is over and whether the game has been won.
using the following UML diagram
-maxMisses : int The Maximum nubmer of incorrect guesses allowed
-missCount : int The current number of incorrect guesses
-word : string The word to be guessed
-correct : String A string that displays dashes for the unguessed letter and letters where correctly guessed
-misses : String A string tht hold guessed letters that aren't in the word
+correct () : String Returns a string that displays dashes for each letter not guessed and letters where correctly guessed.
+gameOver () : boolean Returns true if the game is over, false otherwise. A game is over if the word has been guessed correctly or if the maximum number of allowable misses has been reached.
+gameWon () : boolean Returns true if the game has been won, false otherwise. A game is
won if the game is over and the word has been correctly guessed.
+guess (char c) Searches the word to be guessed for the presence of c. If present, replaces all the corresponding spaces in the correct word, if not present, increments miss count and adds c to the missed letters string.
+initialize (String word, int maxMisses) Takes a String that is the word to be guessed and an integer that
represents the maximum number of incorrect guesses allowed.
+lettersMissed () :String Returns a String containing all the letters guessed that are not in
the word to be guessed.
+maxMissesAllowed () : int Returns the maximum number of misses allowed
+misses () : int Returns the current number of misses.
+word () : String Returns the word to be guessed.
Implementation
Implement the Hangman class provided above. Your implementation must match the UML diagram given. Test your implementation by creating another class with a main method, create a Hangman object with a hard-‐coded word and write the code necessary to “guess” letters to make sure your Hangman object works properly. You may hard-‐code these guesses simply to test your implementation.
Some Examples
• The correct method returns a string composed of the same number of dashes as are letters in the word. For instance, if the word is “gobble” the following is returned from the correct method:
-‐-‐-‐-‐-‐-‐
• The player guesses a letter. If the letter is in the word, that letter replaces its corresponding locations in the correct string. For instance, if the player guesses ‘e’ the following is returned from the correct method:
-‐-‐-‐-‐-‐e
• If the letter is not in the word, it is added to the String of “misses.” For instance, if the player next
guesses ‘a’ the following is returned from the lettersMissed method:
a
• If there are multiple occurrences of a letter in the word, all occurrences are replaced. For instance, if the
player next guesses ‘b’ the following is returned from the correct method:
-‐-‐bb-‐e
• Guessing a letter that has already been guessed counts as a miss. For instance, if the player again guesses
‘b’ the following is returned from the lettersMissed method:
ab
| oop | class | null | null | null | 03/04/2011 23:48:34 | not a real question | PLZ PLZ HELP with a object oriented basic hangman game
===
Does anyone have a basic hangman object oriented program with a class and driver that would like to share. i have no idea what i am doing, i do not know oop and my instructor said that we are allowed to get any help that we can find. this it due saturday by midnight so please help asap
For this program, you are to create a Hangman class.The purpose of a Hangman object is to maintain the state of a hangman game. This object should provide a mechanism to store a word to be guessed,the letters that have already been guessed, and the current state of the word to be guessed. The game should also store the maximum number of misses allowed as well as provide a mechanism for determining whether the game is over and whether the game has been won.
using the following UML diagram
-maxMisses : int The Maximum nubmer of incorrect guesses allowed
-missCount : int The current number of incorrect guesses
-word : string The word to be guessed
-correct : String A string that displays dashes for the unguessed letter and letters where correctly guessed
-misses : String A string tht hold guessed letters that aren't in the word
+correct () : String Returns a string that displays dashes for each letter not guessed and letters where correctly guessed.
+gameOver () : boolean Returns true if the game is over, false otherwise. A game is over if the word has been guessed correctly or if the maximum number of allowable misses has been reached.
+gameWon () : boolean Returns true if the game has been won, false otherwise. A game is
won if the game is over and the word has been correctly guessed.
+guess (char c) Searches the word to be guessed for the presence of c. If present, replaces all the corresponding spaces in the correct word, if not present, increments miss count and adds c to the missed letters string.
+initialize (String word, int maxMisses) Takes a String that is the word to be guessed and an integer that
represents the maximum number of incorrect guesses allowed.
+lettersMissed () :String Returns a String containing all the letters guessed that are not in
the word to be guessed.
+maxMissesAllowed () : int Returns the maximum number of misses allowed
+misses () : int Returns the current number of misses.
+word () : String Returns the word to be guessed.
Implementation
Implement the Hangman class provided above. Your implementation must match the UML diagram given. Test your implementation by creating another class with a main method, create a Hangman object with a hard-‐coded word and write the code necessary to “guess” letters to make sure your Hangman object works properly. You may hard-‐code these guesses simply to test your implementation.
Some Examples
• The correct method returns a string composed of the same number of dashes as are letters in the word. For instance, if the word is “gobble” the following is returned from the correct method:
-‐-‐-‐-‐-‐-‐
• The player guesses a letter. If the letter is in the word, that letter replaces its corresponding locations in the correct string. For instance, if the player guesses ‘e’ the following is returned from the correct method:
-‐-‐-‐-‐-‐e
• If the letter is not in the word, it is added to the String of “misses.” For instance, if the player next
guesses ‘a’ the following is returned from the lettersMissed method:
a
• If there are multiple occurrences of a letter in the word, all occurrences are replaced. For instance, if the
player next guesses ‘b’ the following is returned from the correct method:
-‐-‐bb-‐e
• Guessing a letter that has already been guessed counts as a miss. For instance, if the player again guesses
‘b’ the following is returned from the lettersMissed method:
ab
| 1 |
10,151,362 | 04/14/2012 05:50:02 | 1,101,333 | 12/16/2011 05:58:58 | 1 | 0 | How to create a .tmx file "data"? | I am currently trying to create a random map using tileD but I couldn't manage to decode the "data" in the .tmx file. I read that the data is base64 encode and gzip compressed but none (of what I've searched) actually has got some useful results.
Has anyone successfully decoded the "data"? Can I have a full example of how the "data" looks like in xml?
If anyone knows what is the format for creating the "data" in XML can you share with us? | file | data | example | tmx | null | null | open | How to create a .tmx file "data"?
===
I am currently trying to create a random map using tileD but I couldn't manage to decode the "data" in the .tmx file. I read that the data is base64 encode and gzip compressed but none (of what I've searched) actually has got some useful results.
Has anyone successfully decoded the "data"? Can I have a full example of how the "data" looks like in xml?
If anyone knows what is the format for creating the "data" in XML can you share with us? | 0 |
6,262,558 | 06/07/2011 08:30:45 | 745,367 | 05/09/2011 14:58:36 | 8 | 0 | how to do slot machine in android | I want to do small gaming application like slot machine which is
Image1 Image2 Image3
Button
When i click on button then the three image are scroll like slot machine and then show random images.
So can any one send me the sample code of slot machine.
Thanks in advance
Best Regards. | android | null | null | null | null | 06/07/2011 08:46:08 | not a real question | how to do slot machine in android
===
I want to do small gaming application like slot machine which is
Image1 Image2 Image3
Button
When i click on button then the three image are scroll like slot machine and then show random images.
So can any one send me the sample code of slot machine.
Thanks in advance
Best Regards. | 1 |
9,235,591 | 02/10/2012 22:17:14 | 747,858 | 05/11/2011 01:24:39 | 662 | 27 | how to pick the right Javascript MVC framework? | I am new to javascript and trying to figure out a good JS MVC framework to use
I am trying to figure out how to compare and contrast the Javascript MVC frameworks that have been famous recently in the year 2011. I am trying to pick one for my application. My main aim is to pick one so that i can build a solid and well maintainable Js code, easy UI refresh, lesser manual DOM manipulation, faster UI refresh using ajax call to REST services etc..
I am weighing on ember.js, Backbone.js, Knockout.js and Spine.js .. backbone and spine claim as MVC and knockout.js as MVVM. How are they different? is there any other frameworks to be noted?
thanks a lot | javascript | backbone.js | knockout.js | spine.js | ember.js | 02/12/2012 17:55:34 | not constructive | how to pick the right Javascript MVC framework?
===
I am new to javascript and trying to figure out a good JS MVC framework to use
I am trying to figure out how to compare and contrast the Javascript MVC frameworks that have been famous recently in the year 2011. I am trying to pick one for my application. My main aim is to pick one so that i can build a solid and well maintainable Js code, easy UI refresh, lesser manual DOM manipulation, faster UI refresh using ajax call to REST services etc..
I am weighing on ember.js, Backbone.js, Knockout.js and Spine.js .. backbone and spine claim as MVC and knockout.js as MVVM. How are they different? is there any other frameworks to be noted?
thanks a lot | 4 |
5,958,513 | 05/11/2011 02:16:18 | 95,815 | 04/25/2009 02:31:23 | 255 | 14 | Trouble serializing vectors in a sub-class in AS3 | Hey there! I'm trying to serialize data in AS3 but am running into a frustrating problem. Here's a snippit of code:
registerClassAlias("myObjClass", myObjClass);
var bytes:ByteArray = new ByteArray();
bytes.writeObject(myObj);
bytes.position = 0;
myObj = Vector.<myObjClass>(bytes.readObject());
Originally I had problems with "myObjClass" not being convertable, but after I "registerClassAlias"'d it, it happened to come out just fine. Using this block of code everything works fine, and I'm able to pull values from the myObj vector.
Some time later, I added vectors to the myObjClass as well, of type "String" and "XML." eg:
var newObj:myObjClass = new myObjClass();
newObj.mySubXML = new Vector.<XML>();
newObj.mySubString = new Vector.<String>();
When I run my original block of code, I get these errors:
TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc11 to __AS3__.vec.Vector.<XML>.
TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc41 to __AS3__.vec.Vector.<String>.
This seemed familiar, as earlier I stumbled across this bug (which Adobe acknowledged and is working on):
https://bugs.adobe.com/jira/browse/FP-6693
The workaround was to:
registerClassAlias("String", String);
... Which worked fine back in the day. Now that I'm trying to register a class alias for a string that's in a vector in a vector, I don't know how to do it! this doesn't do the trick:
registerClassAlias("String", String);
registerClassAlias("XML", XML);
registerClassAlias("myObjClass", myObjClass);
var bytes:ByteArray = new ByteArray();
bytes.writeObject(myObj);
bytes.position = 0;
myObj = Vector.<myObjClass>(bytes.readObject());
I also tried to "RegisterclassAlias" within MyObjClass too but that didn't work. Help! | actionscript-3 | serialization | amf | null | null | null | open | Trouble serializing vectors in a sub-class in AS3
===
Hey there! I'm trying to serialize data in AS3 but am running into a frustrating problem. Here's a snippit of code:
registerClassAlias("myObjClass", myObjClass);
var bytes:ByteArray = new ByteArray();
bytes.writeObject(myObj);
bytes.position = 0;
myObj = Vector.<myObjClass>(bytes.readObject());
Originally I had problems with "myObjClass" not being convertable, but after I "registerClassAlias"'d it, it happened to come out just fine. Using this block of code everything works fine, and I'm able to pull values from the myObj vector.
Some time later, I added vectors to the myObjClass as well, of type "String" and "XML." eg:
var newObj:myObjClass = new myObjClass();
newObj.mySubXML = new Vector.<XML>();
newObj.mySubString = new Vector.<String>();
When I run my original block of code, I get these errors:
TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc11 to __AS3__.vec.Vector.<XML>.
TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc41 to __AS3__.vec.Vector.<String>.
This seemed familiar, as earlier I stumbled across this bug (which Adobe acknowledged and is working on):
https://bugs.adobe.com/jira/browse/FP-6693
The workaround was to:
registerClassAlias("String", String);
... Which worked fine back in the day. Now that I'm trying to register a class alias for a string that's in a vector in a vector, I don't know how to do it! this doesn't do the trick:
registerClassAlias("String", String);
registerClassAlias("XML", XML);
registerClassAlias("myObjClass", myObjClass);
var bytes:ByteArray = new ByteArray();
bytes.writeObject(myObj);
bytes.position = 0;
myObj = Vector.<myObjClass>(bytes.readObject());
I also tried to "RegisterclassAlias" within MyObjClass too but that didn't work. Help! | 0 |
9,990,810 | 04/03/2012 09:46:14 | 1,310,065 | 04/03/2012 09:40:28 | 1 | 0 | Very slow when fetching data from server | Amm using windows xp system, am fetching data from AS400 DB2 database through php. Am getting the result too late. I want to know the reason, i think my server is in italy, but working in India? Is it correct reason or wrong? If correct means please tell the idea to fetch the result fast... | php5 | null | null | null | null | 04/14/2012 12:43:31 | not a real question | Very slow when fetching data from server
===
Amm using windows xp system, am fetching data from AS400 DB2 database through php. Am getting the result too late. I want to know the reason, i think my server is in italy, but working in India? Is it correct reason or wrong? If correct means please tell the idea to fetch the result fast... | 1 |
10,226,890 | 04/19/2012 11:17:22 | 737,990 | 05/04/2011 12:40:54 | 31 | 0 | Howto split genericList items with delimiter? | I cant fugure out howto split items from my genericList to two seperate parts with delimiter option?
My data looks like this:
10.5 5.5
7.2 2.5
-0.1 3.0
-1.1 3.3
and so on .......... totaly 8760 rows in my List.
What I want to do is to split each row in 2 parts so I can count the min, max and average on thoose values.
Any help would be appreciated !!! Thanx | c# | string | arraylist | generic-list | null | 04/20/2012 12:25:19 | not a real question | Howto split genericList items with delimiter?
===
I cant fugure out howto split items from my genericList to two seperate parts with delimiter option?
My data looks like this:
10.5 5.5
7.2 2.5
-0.1 3.0
-1.1 3.3
and so on .......... totaly 8760 rows in my List.
What I want to do is to split each row in 2 parts so I can count the min, max and average on thoose values.
Any help would be appreciated !!! Thanx | 1 |
6,969,191 | 08/06/2011 21:57:54 | 706,628 | 04/13/2011 18:32:20 | 561 | 38 | What is a good "active installs" rate for a free Android app? | My free app has received many positive reviews and has a 4.5 star rating on the Android Market, but the active install rate is less than 40%, meaning more than half the people who download it uninstall it.
Is this normal? I would assume a highly-rated app would have closer to 100% install rate. | android | null | null | null | null | 08/07/2011 09:49:51 | off topic | What is a good "active installs" rate for a free Android app?
===
My free app has received many positive reviews and has a 4.5 star rating on the Android Market, but the active install rate is less than 40%, meaning more than half the people who download it uninstall it.
Is this normal? I would assume a highly-rated app would have closer to 100% install rate. | 2 |
8,765,921 | 01/06/2012 23:40:58 | 1,135,347 | 01/06/2012 23:33:35 | 1 | 0 | i am creating a slideshow with multiple images and want to be able to create a previous image button but am having trouble. using xcode | I am creating a slideshow with multiple images and want to be able to create a previous image button but am having trouble. The program I am using is using X code. | xcode | null | null | null | null | 01/08/2012 15:40:03 | not a real question | i am creating a slideshow with multiple images and want to be able to create a previous image button but am having trouble. using xcode
===
I am creating a slideshow with multiple images and want to be able to create a previous image button but am having trouble. The program I am using is using X code. | 1 |
11,296,958 | 07/02/2012 15:45:37 | 1,496,511 | 07/02/2012 15:41:39 | 1 | 0 | Making RMI call specific to individual server in clustered environment in WAS | I have a situation where i have to make individual RMI call to 4 websphere app servers to load files on those servers, but all servers are under clustered environment? Can anyone help | ejb | websphere | cluster-computing | null | null | 07/03/2012 11:51:02 | not a real question | Making RMI call specific to individual server in clustered environment in WAS
===
I have a situation where i have to make individual RMI call to 4 websphere app servers to load files on those servers, but all servers are under clustered environment? Can anyone help | 1 |
8,209,436 | 11/21/2011 09:04:56 | 490,118 | 10/28/2010 12:58:35 | 1 | 0 | PDFSharp or MigraDoc : loop through text contents and replace | please advise how to replace text line in PDF file ?
| pdfsharp | null | null | null | null | 11/21/2011 22:42:14 | not a real question | PDFSharp or MigraDoc : loop through text contents and replace
===
please advise how to replace text line in PDF file ?
| 1 |
2,800,199 | 05/10/2010 03:49:23 | 83,181 | 03/26/2009 15:24:53 | 134 | 3 | Understand Sql Server connectionstring for asp.net | I am trying to understand the differences between the following 2 connectionstrings.
one uses servername\instancename and the other one uses the server ip address.
Can I specify port number for "serverName\instanceName".
I know you can specify port number for ip address, something like '10.0.0.1,xxx'.
thanks,
Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True; | connectionstring | null | null | null | null | null | open | Understand Sql Server connectionstring for asp.net
===
I am trying to understand the differences between the following 2 connectionstrings.
one uses servername\instancename and the other one uses the server ip address.
Can I specify port number for "serverName\instanceName".
I know you can specify port number for ip address, something like '10.0.0.1,xxx'.
thanks,
Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True; | 0 |
10,189,057 | 04/17/2012 09:59:08 | 808,509 | 06/21/2011 13:19:24 | 6 | 0 | How I'll generate upcoming events of user's area? | All of events will come from API. I need to know user's location to pull data from API. But how I'll find out user's area for selecting upcoming events for their specific location? Is there any suitable php coding to do that? Please help. | php | j | null | null | null | 04/17/2012 17:14:34 | not a real question | How I'll generate upcoming events of user's area?
===
All of events will come from API. I need to know user's location to pull data from API. But how I'll find out user's area for selecting upcoming events for their specific location? Is there any suitable php coding to do that? Please help. | 1 |
11,408,184 | 07/10/2012 07:02:01 | 1,513,526 | 07/10/2012 02:49:30 | 1 | 0 | Input, manipultion, Output in C | I want to read in a file with 10 columns all numbers except 1.
I want to for each value in column 1 manipulate the value with a function.
Then print the value out along with the 9 other values in the program.
The input file to be read has 7000 lines.I have simplified the code to the relevant section.
Am I using the right functions?
The code is as follows:
Definitions are above here.
printf("\nEnter the name of your data file\n");
(void) scanf("%s", datafilename);
printf("%s\n",datafilename);
fo =fopen (datafilename, "rt"); /* open the file for reading*/
//Target file not found, will not open.
if ( fo == NULL )
{
fputs("Cannot open target file\n", stderr);
fclose(fo);
exit(EXIT_FAILURE);
}
fp =fopen ("Mydata.dat", "w"); /* open the file for reading*/
while (!feof (fo))
{
fscanf("%lf %lf %lf %s %lf %lf %lf %lf", &jd, &flux, &fluxerror, eventinfo, &info1, &info2, &info3, &info4);
//Manipulate jd
mjd = jd+2;
/* Print the results out
fprintf (fp, "%lf %lf %lf\n", mjd, flux, fluxerror);
}
fclose (fo);
fclose (fp);
exit(EXIT_SUCCESS);
} | c | null | null | null | null | 07/10/2012 07:31:08 | not a real question | Input, manipultion, Output in C
===
I want to read in a file with 10 columns all numbers except 1.
I want to for each value in column 1 manipulate the value with a function.
Then print the value out along with the 9 other values in the program.
The input file to be read has 7000 lines.I have simplified the code to the relevant section.
Am I using the right functions?
The code is as follows:
Definitions are above here.
printf("\nEnter the name of your data file\n");
(void) scanf("%s", datafilename);
printf("%s\n",datafilename);
fo =fopen (datafilename, "rt"); /* open the file for reading*/
//Target file not found, will not open.
if ( fo == NULL )
{
fputs("Cannot open target file\n", stderr);
fclose(fo);
exit(EXIT_FAILURE);
}
fp =fopen ("Mydata.dat", "w"); /* open the file for reading*/
while (!feof (fo))
{
fscanf("%lf %lf %lf %s %lf %lf %lf %lf", &jd, &flux, &fluxerror, eventinfo, &info1, &info2, &info3, &info4);
//Manipulate jd
mjd = jd+2;
/* Print the results out
fprintf (fp, "%lf %lf %lf\n", mjd, flux, fluxerror);
}
fclose (fo);
fclose (fp);
exit(EXIT_SUCCESS);
} | 1 |
6,229,643 | 06/03/2011 16:02:43 | 401,658 | 07/25/2010 17:27:43 | 100 | 1 | Django + nginx + gunicorn gives 502 error. very little log information. | I have my server configured like this (this is on a fresh install of ubuntu 10.10)
nginx + gunicorn + django + supervisord to run it
when I try to access my site, I get a 502 error. and this will show up in the error log:
2011/06/03 10:40:59 [error] 15066#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: [retracted], server: [retracted], request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:29000/", host: "[retracted]"
Here is my nginx.conf
http://pastebin.com/t0V2yFxr
Here is my supervisord.conf
http://pastebin.com/pqVqRLSk
and my gunicorn.conf
bind = "127.0.0.1:29000"
logfile = "/sites/[retracted]/logs/gunicorn.log"
workers = 3
when I run
sudo supervisordctl status
it returns nothing. So this makes me suspect that it is not properly running. However, there is no supervisord.log file (in /var/log/ or in /code/[]/logs/) or gunicorn.log showing errors.
So I cannot debug this at all. Any suggestions on how to get this takin care of?
| django | nginx | gunicorn | supervisord | null | 06/03/2011 17:10:42 | off topic | Django + nginx + gunicorn gives 502 error. very little log information.
===
I have my server configured like this (this is on a fresh install of ubuntu 10.10)
nginx + gunicorn + django + supervisord to run it
when I try to access my site, I get a 502 error. and this will show up in the error log:
2011/06/03 10:40:59 [error] 15066#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: [retracted], server: [retracted], request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:29000/", host: "[retracted]"
Here is my nginx.conf
http://pastebin.com/t0V2yFxr
Here is my supervisord.conf
http://pastebin.com/pqVqRLSk
and my gunicorn.conf
bind = "127.0.0.1:29000"
logfile = "/sites/[retracted]/logs/gunicorn.log"
workers = 3
when I run
sudo supervisordctl status
it returns nothing. So this makes me suspect that it is not properly running. However, there is no supervisord.log file (in /var/log/ or in /code/[]/logs/) or gunicorn.log showing errors.
So I cannot debug this at all. Any suggestions on how to get this takin care of?
| 2 |
4,864,135 | 02/01/2011 15:02:52 | 522,416 | 11/27/2010 17:30:37 | 1 | 0 | Hi everyone,can you recommend some p2p software to find the BitTorrent ? | can you recommend some p2p software to find the BitTorrent ?or some p2p website,like the emule software.I want to download some study material and video. | website | software-tools | null | null | null | 02/01/2011 15:05:11 | off topic | Hi everyone,can you recommend some p2p software to find the BitTorrent ?
===
can you recommend some p2p software to find the BitTorrent ?or some p2p website,like the emule software.I want to download some study material and video. | 2 |
4,811,646 | 01/27/2011 00:08:10 | 424,421 | 08/18/2010 18:56:37 | 1 | 2 | implement sound into shake???? | I am guessing that it would be a shake listener of some sort. but what I want to do is have the sound play when I shake the phone. could some one help? I know that there is a way I see them all the time. Any help is GREATLY appreciated. | android | sdk | shake | null | null | null | open | implement sound into shake????
===
I am guessing that it would be a shake listener of some sort. but what I want to do is have the sound play when I shake the phone. could some one help? I know that there is a way I see them all the time. Any help is GREATLY appreciated. | 0 |
11,681,169 | 07/27/2012 03:46:36 | 1,556,571 | 07/27/2012 03:41:40 | 1 | 0 | Smarty If .tpl for CSS classes | I am working on a template using Smarty and i would like to give a certain class for the navigation menu according to the active .tpl file.
Any help ?? | smarty | null | null | null | null | null | open | Smarty If .tpl for CSS classes
===
I am working on a template using Smarty and i would like to give a certain class for the navigation menu according to the active .tpl file.
Any help ?? | 0 |
10,529,943 | 05/10/2012 08:12:33 | 1,245,117 | 03/02/2012 13:02:05 | 1 | 0 | Can't install Xcode 3.2.6 | I'm having trouble installing Xcode 3.2.6. I try install Xcode on Mac OS 10.7.3, 10.6.8, 10.6.7. I download Xcode on developer.apple.com and always have some error:
The installation failed.
An unknown installation error occurred.
The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
[Error screenshot][1]
[1]: https://www.dropbox.com/s/qsaigz5h011ae9f/Xcode_3.2.6_install_error.jpg.jpg
| xcode | osx | apple | null | null | 05/11/2012 14:12:11 | off topic | Can't install Xcode 3.2.6
===
I'm having trouble installing Xcode 3.2.6. I try install Xcode on Mac OS 10.7.3, 10.6.8, 10.6.7. I download Xcode on developer.apple.com and always have some error:
The installation failed.
An unknown installation error occurred.
The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
[Error screenshot][1]
[1]: https://www.dropbox.com/s/qsaigz5h011ae9f/Xcode_3.2.6_install_error.jpg.jpg
| 2 |
9,429,817 | 02/24/2012 11:16:10 | 1,225,795 | 02/22/2012 12:18:38 | 60 | 5 | How to go back from second screen to first screen | I have probably easy question, how to swich layouts, but its little complicated for me. Firs I have a class Main where is onCreate (setContentView(R.layout.main);) and than I call, another class with command:
setContentView(secondClass);
In this clas i draw with Canvas and this work just fine and i also create button to go back in first "class" (R.layout.main), but i dont know how to do it.
Now my program is basic a graph shower. In first class you type your function and them second class draw it. But how to go back in first class to type another function. This "back" button or arrow witch every android phone have, send me out of program not back on insert part.
In secondClass I cant create onCreate method, but I also tryed and this didnt work:
- Intent abc = new Intent("bla.bla.bla.FIRSTCLASS");
startActivity(abc);
- Intent abc = new Intent(SecondClass.this,FirstClass.class);
startActivity(greNaPrvoOkno);
I know my English is bad. Hope you understand
Thank you | android | null | null | null | null | null | open | How to go back from second screen to first screen
===
I have probably easy question, how to swich layouts, but its little complicated for me. Firs I have a class Main where is onCreate (setContentView(R.layout.main);) and than I call, another class with command:
setContentView(secondClass);
In this clas i draw with Canvas and this work just fine and i also create button to go back in first "class" (R.layout.main), but i dont know how to do it.
Now my program is basic a graph shower. In first class you type your function and them second class draw it. But how to go back in first class to type another function. This "back" button or arrow witch every android phone have, send me out of program not back on insert part.
In secondClass I cant create onCreate method, but I also tryed and this didnt work:
- Intent abc = new Intent("bla.bla.bla.FIRSTCLASS");
startActivity(abc);
- Intent abc = new Intent(SecondClass.this,FirstClass.class);
startActivity(greNaPrvoOkno);
I know my English is bad. Hope you understand
Thank you | 0 |
7,620,329 | 10/01/2011 12:55:02 | 970,935 | 09/29/2011 10:38:59 | 3 | 0 | Is this the correct approach to design a shopping cart Android application? | I have a requirement to develop a shopping cart Android application.
The features should include
1. Ability for any customer to register
2. Ability to login with his credentials
3. Search and select products
4. View history about his previous purchases
5. Make payment to get the products delivered to his billing address.
I have done some analysis and below are my thoughts.
Server Side: Java web application
Client Side: Android application
1. Design Android application with an Activity to allow customers to register themselves.
2. Design another Activity to enable customers to login to the application (authenticate customer by sending his credentials through HttpClient to a Java servlet. Once the customer is authenticated successfully, generate a unique token id at the server end store it in the database and send it to the Android client app. Is this the correct approach to remember the customer (similar to session management) for his further interactions with the application?)
3. Provide customers the ability to search and select desired products (use above created unique token for further interaction with server).
4. Provide customers the ability to view his history of purchases.
5. Provide customers the ability to make payments. (Can i take customer PayPal credentials from Android app and use PayPal API to pragmatically make payments at server end? Is it correct approach?
Can someone please suggest me with correct approach / best practices and with sample code if possible?
Thanks,
| android | paypal | shopping-cart | payment | token | 10/01/2011 16:20:48 | not constructive | Is this the correct approach to design a shopping cart Android application?
===
I have a requirement to develop a shopping cart Android application.
The features should include
1. Ability for any customer to register
2. Ability to login with his credentials
3. Search and select products
4. View history about his previous purchases
5. Make payment to get the products delivered to his billing address.
I have done some analysis and below are my thoughts.
Server Side: Java web application
Client Side: Android application
1. Design Android application with an Activity to allow customers to register themselves.
2. Design another Activity to enable customers to login to the application (authenticate customer by sending his credentials through HttpClient to a Java servlet. Once the customer is authenticated successfully, generate a unique token id at the server end store it in the database and send it to the Android client app. Is this the correct approach to remember the customer (similar to session management) for his further interactions with the application?)
3. Provide customers the ability to search and select desired products (use above created unique token for further interaction with server).
4. Provide customers the ability to view his history of purchases.
5. Provide customers the ability to make payments. (Can i take customer PayPal credentials from Android app and use PayPal API to pragmatically make payments at server end? Is it correct approach?
Can someone please suggest me with correct approach / best practices and with sample code if possible?
Thanks,
| 4 |
6,846,813 | 07/27/2011 15:17:41 | 720,236 | 04/22/2011 07:53:12 | 21 | 3 | How to make sure at least one CheckBoxPreference is selected | I have a `PreferenceActivity` containing a number of `CheckBoxPreference` and I want to make sure that at least one of them is selected, any suggestion on how to do it?
Thanks | android | checkboxpreference | null | null | null | null | open | How to make sure at least one CheckBoxPreference is selected
===
I have a `PreferenceActivity` containing a number of `CheckBoxPreference` and I want to make sure that at least one of them is selected, any suggestion on how to do it?
Thanks | 0 |
214,500 | 10/18/2008 03:36:49 | 16,340 | 09/17/2008 16:21:05 | 178 | 16 | Which LINQ syntax do you prefer? Fluent or Query Expression | LINQ is one of the greatest improvements to .NET since generics and it saves me tons of time, and lines of code. However, the fluent syntax seems to come much more natural to me than the query expression syntax.
![LINQ Syntax Choice][1]
Which do you prefer and if you write standards for your company, do you enforce one over the other?
[1]: http://jvance.com/media/2008/10/18/LinqSyntax16.media | linq | c# | polls | null | null | 01/27/2012 21:39:11 | not constructive | Which LINQ syntax do you prefer? Fluent or Query Expression
===
LINQ is one of the greatest improvements to .NET since generics and it saves me tons of time, and lines of code. However, the fluent syntax seems to come much more natural to me than the query expression syntax.
![LINQ Syntax Choice][1]
Which do you prefer and if you write standards for your company, do you enforce one over the other?
[1]: http://jvance.com/media/2008/10/18/LinqSyntax16.media | 4 |
9,621,976 | 03/08/2012 17:24:09 | 343 | 08/04/2008 20:13:06 | 6,259 | 99 | Clipping window rendering to a region | I have a window that is 100x100, but I only want to draw 50x100 and leave the right-side transparent without using WS_EX_LAYERED. The Windows Taskbar appears to do this when auto-hide is enabled. The Taskbar is 40px tall according to GetWindowRect, but only 2px is visible. How is it possible to have a window that is larger than what is shown on the screen without making it a layered window? | winapi | null | null | null | null | null | open | Clipping window rendering to a region
===
I have a window that is 100x100, but I only want to draw 50x100 and leave the right-side transparent without using WS_EX_LAYERED. The Windows Taskbar appears to do this when auto-hide is enabled. The Taskbar is 40px tall according to GetWindowRect, but only 2px is visible. How is it possible to have a window that is larger than what is shown on the screen without making it a layered window? | 0 |
2,038,481 | 01/10/2010 20:26:27 | 2,147 | 08/20/2008 15:14:13 | 20,573 | 639 | What optimizations does Python do without the -O flags? | I had always assumed that the Python interpreter did no optimizations without a `-O` flag, but the following is a bit strange:
>>> def foo():
... print '%s' % 'Hello world'
...
>>> from dis import dis
>>> dis(foo)
2 0 LOAD_CONST 3 ('Hello world')
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
It appears as though the interpreter is doing some folding on the modulo of two string constants. If I add a variable in though, it gives an unoptimized result:
>>> def foo():
... s = 'Hello world!'
... print '%s' % s
...
>>> dis(foo)
2 0 LOAD_CONST 1 ('Hello world!')
3 STORE_FAST 0 (s)
3 6 LOAD_CONST 2 ('%s')
9 LOAD_FAST 0 (s)
12 BINARY_MODULO
13 PRINT_ITEM
14 PRINT_NEWLINE
15 LOAD_CONST 0 (None)
18 RETURN_VALUE
What optimizations does Python do without the -O flag? And is there any way to disable them? I'd like to see how unoptimized Python bytecode will look. I don't plan on doing this in any production type environment. | python | bytecode | optimization | null | null | null | open | What optimizations does Python do without the -O flags?
===
I had always assumed that the Python interpreter did no optimizations without a `-O` flag, but the following is a bit strange:
>>> def foo():
... print '%s' % 'Hello world'
...
>>> from dis import dis
>>> dis(foo)
2 0 LOAD_CONST 3 ('Hello world')
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
It appears as though the interpreter is doing some folding on the modulo of two string constants. If I add a variable in though, it gives an unoptimized result:
>>> def foo():
... s = 'Hello world!'
... print '%s' % s
...
>>> dis(foo)
2 0 LOAD_CONST 1 ('Hello world!')
3 STORE_FAST 0 (s)
3 6 LOAD_CONST 2 ('%s')
9 LOAD_FAST 0 (s)
12 BINARY_MODULO
13 PRINT_ITEM
14 PRINT_NEWLINE
15 LOAD_CONST 0 (None)
18 RETURN_VALUE
What optimizations does Python do without the -O flag? And is there any way to disable them? I'd like to see how unoptimized Python bytecode will look. I don't plan on doing this in any production type environment. | 0 |
6,864,190 | 07/28/2011 18:55:29 | 857,994 | 07/22/2011 13:21:38 | 165 | 12 | C/C++ Optimizations | So, I've been raised in a very OO manner when it comes to programming... which has unfortunately meant that hightly optimized code is not my forte. I'm fairly good at C now and can usually do things in reasonably intelligent ways, but I still have trouble thinking of the most optimized way to handle situations.
One example would be:
int strlen(const char* str)
{
char* s;
for (s=str; *s; ++s);
return s-str;
}
I would never have thought of that myself.
So, what are some good resources that expose you to optimized code like this? I'd like to find a place where I could read up on the theory behind it, what the compiler does in the background which makes it worthwhile, etc.
It would also be nice if some resources were noted for studying optimized data structures with application to real-life scenarios, but that's probably too much to ask.
Thanks in advance!
-w00te | c++ | c | compiler | null | null | 07/28/2011 19:08:49 | not constructive | C/C++ Optimizations
===
So, I've been raised in a very OO manner when it comes to programming... which has unfortunately meant that hightly optimized code is not my forte. I'm fairly good at C now and can usually do things in reasonably intelligent ways, but I still have trouble thinking of the most optimized way to handle situations.
One example would be:
int strlen(const char* str)
{
char* s;
for (s=str; *s; ++s);
return s-str;
}
I would never have thought of that myself.
So, what are some good resources that expose you to optimized code like this? I'd like to find a place where I could read up on the theory behind it, what the compiler does in the background which makes it worthwhile, etc.
It would also be nice if some resources were noted for studying optimized data structures with application to real-life scenarios, but that's probably too much to ask.
Thanks in advance!
-w00te | 4 |
1,854,755 | 12/06/2009 08:23:09 | 106,111 | 05/13/2009 08:59:24 | 168 | 2 | Javascript - How to change a new value on drop down | When we change the `name="quantity"` and the `$product['price']` value will changing too. Here will have dynamic quantity and price. How to do that using jquery/javascript.
<?php
$select = "SELECT * FROM `products` ORDER BY `id` DESC LIMIT 10";
$query = mysql_query($select) or die(mysql_error());
?>
<ul>
<?php while($product = mysql_fetch_array($query)) { ?>
<li>
<p><?php echo $product['name'];?></p>
<p> Quantity
<select name="quantity">
<?php for($i=1;$i<=$product['quantity'];$i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php } ?>
</select>
</p>
<p><?php echo $product['price'];?></p>
</li>
<?php $incr++; } ?>
</ul>
Let me know :) | jquery | javascript | php | null | null | null | open | Javascript - How to change a new value on drop down
===
When we change the `name="quantity"` and the `$product['price']` value will changing too. Here will have dynamic quantity and price. How to do that using jquery/javascript.
<?php
$select = "SELECT * FROM `products` ORDER BY `id` DESC LIMIT 10";
$query = mysql_query($select) or die(mysql_error());
?>
<ul>
<?php while($product = mysql_fetch_array($query)) { ?>
<li>
<p><?php echo $product['name'];?></p>
<p> Quantity
<select name="quantity">
<?php for($i=1;$i<=$product['quantity'];$i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
<?php } ?>
</select>
</p>
<p><?php echo $product['price'];?></p>
</li>
<?php $incr++; } ?>
</ul>
Let me know :) | 0 |
5,973,487 | 05/12/2011 05:03:10 | 749,891 | 05/12/2011 04:44:50 | 1 | 0 | Focus by default browser | I would like know if is possible disable "focus" which is set by default browser in input elements?
Sorry my English.
Thanks, | javascript | html | css | javascript-events | null | null | open | Focus by default browser
===
I would like know if is possible disable "focus" which is set by default browser in input elements?
Sorry my English.
Thanks, | 0 |
11,415,453 | 07/10/2012 14:24:04 | 1,412,319 | 05/23/2012 10:07:28 | 36 | 2 | Alfresco in Tomcat: OutOfMemory | I've recently installed Alfresco 4.0d, with the 32 bit executable.
Whenever someone accesses the application, I get OutOfMemory error.
I've googled it and saw that more memory needs to be added.
So, I've tried editing the setenv.bat file in Alfresco's tomcat, like this:
set JAVA_HOME=D:\Alfresco\java
set JAVA_OPTS=-server -Xss1024K -Xms1G -Xmx2G -XX:MaxPermSize=128M -XX:NewSize=512m
However, the error still occurs.
I notice in the task manager that tomcat6.exe doesn't use more than 960mb, so my options aren't applied to it?
Regards,
Nuno. | tomcat | memory | jvm | alfresco | null | null | open | Alfresco in Tomcat: OutOfMemory
===
I've recently installed Alfresco 4.0d, with the 32 bit executable.
Whenever someone accesses the application, I get OutOfMemory error.
I've googled it and saw that more memory needs to be added.
So, I've tried editing the setenv.bat file in Alfresco's tomcat, like this:
set JAVA_HOME=D:\Alfresco\java
set JAVA_OPTS=-server -Xss1024K -Xms1G -Xmx2G -XX:MaxPermSize=128M -XX:NewSize=512m
However, the error still occurs.
I notice in the task manager that tomcat6.exe doesn't use more than 960mb, so my options aren't applied to it?
Regards,
Nuno. | 0 |
3,259,993 | 07/15/2010 20:55:21 | 112,496 | 05/26/2009 10:37:15 | 1,034 | 74 | Application is not working under raw system. | I've an python GUI application, I use pyQt4.
I build binary with bbfreeze (before I was using py2exe but it didn't work with email module well).
On system where I build this app, everything works properly, but when I install it on raw windows (without all those vc_redist and set of python libraries) binary does not work.
Where should I start to find a solution, since I have no messages/exceptions/crashes, it simply ends immediately after i run it from command line.
I predict that if I'd install some of tools from "build system" I would run it.
Is this the only way?
I mean, if I would find the missing lib (if it's a lib problem), would adding this library to bbfreeze script would solve this problem?
cheers
P.
| python | windows | pyqt | py2exe | null | null | open | Application is not working under raw system.
===
I've an python GUI application, I use pyQt4.
I build binary with bbfreeze (before I was using py2exe but it didn't work with email module well).
On system where I build this app, everything works properly, but when I install it on raw windows (without all those vc_redist and set of python libraries) binary does not work.
Where should I start to find a solution, since I have no messages/exceptions/crashes, it simply ends immediately after i run it from command line.
I predict that if I'd install some of tools from "build system" I would run it.
Is this the only way?
I mean, if I would find the missing lib (if it's a lib problem), would adding this library to bbfreeze script would solve this problem?
cheers
P.
| 0 |
5,671,238 | 04/15/2011 00:35:04 | 675,065 | 03/24/2011 14:24:51 | 197 | 40 | CSS selector case insensitive for attributes | If I have an HTML element `<input type="submit" value="Search" />` a css selector needs to be case-sensitive:
`input[value='Search']` matches
`input[value='search']` does not match
**I need a solution where the case-insensitive approach works too.** I am using **Selenium 2** and **Jquery**, so answers for both are welcome. | jquery | css-selectors | case-insensitive | selenium2 | null | null | open | CSS selector case insensitive for attributes
===
If I have an HTML element `<input type="submit" value="Search" />` a css selector needs to be case-sensitive:
`input[value='Search']` matches
`input[value='search']` does not match
**I need a solution where the case-insensitive approach works too.** I am using **Selenium 2** and **Jquery**, so answers for both are welcome. | 0 |
9,507,126 | 02/29/2012 21:42:16 | 1,008,588 | 10/22/2011 13:31:34 | 17 | 2 | Translate a flow chart into if...else statements | I'm looking for a fast and easy way to transform a graphic flow chart into a statement like `if...else...` or `case...`.
I mean, from this chart ![simple flow chart from the web][1] the program/app should create automatically the following code:
if("Money in" greater than "money out")
{Healty;}
else
{Unhealty;}
I'd like to use that with php but it should be the same for several programming languages.
Thanks!
[1]: http://i.stack.imgur.com/HvpIm.png | php | if-statement | flowchart | null | null | 02/29/2012 21:48:17 | not a real question | Translate a flow chart into if...else statements
===
I'm looking for a fast and easy way to transform a graphic flow chart into a statement like `if...else...` or `case...`.
I mean, from this chart ![simple flow chart from the web][1] the program/app should create automatically the following code:
if("Money in" greater than "money out")
{Healty;}
else
{Unhealty;}
I'd like to use that with php but it should be the same for several programming languages.
Thanks!
[1]: http://i.stack.imgur.com/HvpIm.png | 1 |
9,653,379 | 03/11/2012 07:57:40 | 1,188,320 | 02/03/2012 19:37:49 | 51 | 0 | how do those in excel? | 1, there a line like this:
color
#01
#1b
#1b/613
#02
#18/613
#04
..........
.
there is one space before the content. eg: there is a space before `#01`.when i selected the column and used left justify, but the content don't go a space to the left.how to delete the space with a batch?
2, there is a line like this.
size
160
179
180
.....
i want to make all the line to 160 with a batch. how do i do?
thank you,
| excel | null | null | null | null | 03/11/2012 14:57:02 | off topic | how do those in excel?
===
1, there a line like this:
color
#01
#1b
#1b/613
#02
#18/613
#04
..........
.
there is one space before the content. eg: there is a space before `#01`.when i selected the column and used left justify, but the content don't go a space to the left.how to delete the space with a batch?
2, there is a line like this.
size
160
179
180
.....
i want to make all the line to 160 with a batch. how do i do?
thank you,
| 2 |
10,637,759 | 05/17/2012 14:33:01 | 1,357,051 | 04/25/2012 19:19:34 | 27 | 0 | Field Validations in MVC | I would like to enforce field validations on my Views in the MVC app that I am working on. For example -
- Limit the length of the field to 40
- Ensure only alphanumeric and special characters @#$%&*()-_+][';:?.,! can be entered.
I used the following to restrict the field length:
<div>
<%= Html.TextBoxFor(c => c.CompanyName, new { style = "width:300px", maxlength = "40" })%></div>
How do I ensure that only alphanumeric and special characters can be entered in the textboxes? | c# | jquery | asp.net-mvc | null | null | null | open | Field Validations in MVC
===
I would like to enforce field validations on my Views in the MVC app that I am working on. For example -
- Limit the length of the field to 40
- Ensure only alphanumeric and special characters @#$%&*()-_+][';:?.,! can be entered.
I used the following to restrict the field length:
<div>
<%= Html.TextBoxFor(c => c.CompanyName, new { style = "width:300px", maxlength = "40" })%></div>
How do I ensure that only alphanumeric and special characters can be entered in the textboxes? | 0 |
4,462,785 | 12/16/2010 16:07:44 | 220,804 | 11/29/2009 11:04:51 | 199 | 2 | Transactional: controller vs service | Consider I have a controller method get() which calls a few service methods working with database.
Is it correct to make the entire controller method transactional or just every service method?
It seems to me that we must make get() transactional because it performs associated operations.
Thanks!
| transactions | spring-mvc | null | null | null | null | open | Transactional: controller vs service
===
Consider I have a controller method get() which calls a few service methods working with database.
Is it correct to make the entire controller method transactional or just every service method?
It seems to me that we must make get() transactional because it performs associated operations.
Thanks!
| 0 |
6,174,183 | 05/30/2011 08:56:24 | 716,238 | 04/20/2011 00:56:56 | 17 | 0 | Feedjack problem in django | I'm trying to implement a feedaggator on my web and I think that feedjack is the right solution. But I install it with the latest version of Django 1.3. And it doesn't work.
Anybody use it with django 1.3? Any problem with feedjack_update.py? Other solutions?
Thanks for all. | python | django | feed | feedparser | null | 05/30/2011 14:43:53 | not a real question | Feedjack problem in django
===
I'm trying to implement a feedaggator on my web and I think that feedjack is the right solution. But I install it with the latest version of Django 1.3. And it doesn't work.
Anybody use it with django 1.3? Any problem with feedjack_update.py? Other solutions?
Thanks for all. | 1 |
10,140,520 | 04/13/2012 12:08:24 | 1,049,829 | 11/16/2011 14:12:33 | 6 | 1 | DatastoreService Batch Delete. What happens if an exception occurs | I perform batch delete operation on entity keys using DatastoreService.delete(Key... keys).
Each entity is a root entity, so operation is executed without transaction.
The batch size is hardcoded and the deletion is performed step by step. Each following operation firstly execute key-only get query to fetch entity keys using cursor received from previously executed get query and then performs batch delete query. Scheme seems to work fine,
but what if an exception occurs while delete query?
Is there any way to get a number of successfully deleted entites, or a cursor of the first
not deleted entity? And could you please clarify how this operation is performed in GAE on low-level. | google-app-engine | gae-datastore | null | null | null | null | open | DatastoreService Batch Delete. What happens if an exception occurs
===
I perform batch delete operation on entity keys using DatastoreService.delete(Key... keys).
Each entity is a root entity, so operation is executed without transaction.
The batch size is hardcoded and the deletion is performed step by step. Each following operation firstly execute key-only get query to fetch entity keys using cursor received from previously executed get query and then performs batch delete query. Scheme seems to work fine,
but what if an exception occurs while delete query?
Is there any way to get a number of successfully deleted entites, or a cursor of the first
not deleted entity? And could you please clarify how this operation is performed in GAE on low-level. | 0 |
10,976,808 | 06/11/2012 08:41:32 | 1,448,465 | 06/11/2012 08:29:23 | 1 | 0 | How to integrate STS Asterisk interface Library into IPhone? | i m new in iPhone and now a days i m making an app through that we can make free call and sms. I found abt that in much blogs but didn't get the proper answer. So, please can any one help me?
I came to know from one source that we can use STS Asterisk Library to make free call through VoIP but i dont know how to integrate it with my app to start my app.
Thanks in advance... | iphone | voip | asterisk | null | null | 06/12/2012 03:42:55 | not a real question | How to integrate STS Asterisk interface Library into IPhone?
===
i m new in iPhone and now a days i m making an app through that we can make free call and sms. I found abt that in much blogs but didn't get the proper answer. So, please can any one help me?
I came to know from one source that we can use STS Asterisk Library to make free call through VoIP but i dont know how to integrate it with my app to start my app.
Thanks in advance... | 1 |
1,687,387 | 11/06/2009 12:50:21 | 185,593 | 10/07/2009 12:17:02 | 1 | 1 | how to initialize a Simgleton? | Sometimes there is a need to initialize the singleton class with some helper values. But we can't "publish" a constructor for it. What is the walkaround for this?
For more clarity I provide a sample:
''' <summary>
''' Singleton class MyPainter
''' </summary>
Public Class MyPainter
Private Shared _pen As Pen
Private Shared _instance As MyPainter = Nothing
Private Sub New()
End Sub
''' <summary>
''' This method should be called only once, like a constructor!
''' </summary>
Public Shared Sub InitializeMyPainter(ByVal defaultPenColor As Color)
_pen = New Pen(defaultPenColor)
End Sub
Public Shared Function GetInstance() As MyPainter
If _instance Is Nothing Then
_instance = New MyPainter
End If
Return _instance
End Function
Public Sub DrawLine(ByVal g As Graphics, ByVal pointA As Point, ByVal pointB As Point)
g.DrawLine(_pen, pointA, pointB)
End Sub
End Class
Thanks. | .net | vb.net | singleton | null | null | null | open | how to initialize a Simgleton?
===
Sometimes there is a need to initialize the singleton class with some helper values. But we can't "publish" a constructor for it. What is the walkaround for this?
For more clarity I provide a sample:
''' <summary>
''' Singleton class MyPainter
''' </summary>
Public Class MyPainter
Private Shared _pen As Pen
Private Shared _instance As MyPainter = Nothing
Private Sub New()
End Sub
''' <summary>
''' This method should be called only once, like a constructor!
''' </summary>
Public Shared Sub InitializeMyPainter(ByVal defaultPenColor As Color)
_pen = New Pen(defaultPenColor)
End Sub
Public Shared Function GetInstance() As MyPainter
If _instance Is Nothing Then
_instance = New MyPainter
End If
Return _instance
End Function
Public Sub DrawLine(ByVal g As Graphics, ByVal pointA As Point, ByVal pointB As Point)
g.DrawLine(_pen, pointA, pointB)
End Sub
End Class
Thanks. | 0 |
6,168,218 | 05/29/2011 14:14:43 | 654,071 | 03/10/2011 18:12:54 | 72 | 4 | Perl, fork, semaphore. process | I'm new to perl. I need to create a program that would run 3 processes at the same time in random sequence from a list and lock those processes with semaphore one by one so to avoid duplicates; <br />
__e.g.__ You have a list of 3 programs: @array = ( 1,2,3);<br />
1) perl script.pl runs 2 at first;<br>2) By random tries to run 2 again and receive an error (because 2 is now locked with semaphore).<br />3) Runs 1.<br />4) Runs 3. <br />4) script.pl waits all of 1,2,3 to end work and then exit itselt.
#!/usr/bin/perl -w
use IPC::SysV qw(IPC_PRIVATE S_IRUSR S_IWUSR IPC_CREAT);
use IPC::Semaphore;
use Carp ();
print "Program started\n";
sub sem {
#semaphore lock code here
}
sub chooseProgram{
#initialise;
my $program1 = "./program1.pl";
my $program2 = "./program2.pl";
my $program3 = "./program3.pl";
my $ls = "ls";
my @programs = ( $ls, $program1, $program2, $program3 );
my $random = $programs[int rand($#programs+1)];
print $random."\n";
return $random;
}
#parent should fork child;
#child should run random processes;
#avoid process clones with semaphore;
sub main{
my $pid = fork();
if ($pid){
#parent here
}
elsif (defined($pid)){
#child here
print "$$ Child started:\n";
#simple cycle to launch and lock programs
for (my $i = 0; $i<10; $i++){
# semLock(system(chooseProgram()); #run in new terminal window
# so launched programs are locked and cannot be launched again
}
}
else {
die("Cannot fork: $!\n");
}
waitpid($pid, 0);
my $status = $?;
#print $status."\n";
}
main();
exit 0;
__Problems:__<br />
1) Need to lock file; (I don't know how to work with semaphore. Failed some attempts to lock files so excluded that code.) <br />
2) Child waits until first program ends before second start. How can i start three of programs at the same time with one child? (Is it possible or should i create one child for one program?)<br />
3) Programs are non-gui and should run in terminal. How to run a program in new terminal window(tab)?<br />
4) No correct check if all programs of @programs were launched yet. -- less important.
<br />
__P.S.__<br />
Sorry for my english. | perl | semaphore | null | null | null | null | open | Perl, fork, semaphore. process
===
I'm new to perl. I need to create a program that would run 3 processes at the same time in random sequence from a list and lock those processes with semaphore one by one so to avoid duplicates; <br />
__e.g.__ You have a list of 3 programs: @array = ( 1,2,3);<br />
1) perl script.pl runs 2 at first;<br>2) By random tries to run 2 again and receive an error (because 2 is now locked with semaphore).<br />3) Runs 1.<br />4) Runs 3. <br />4) script.pl waits all of 1,2,3 to end work and then exit itselt.
#!/usr/bin/perl -w
use IPC::SysV qw(IPC_PRIVATE S_IRUSR S_IWUSR IPC_CREAT);
use IPC::Semaphore;
use Carp ();
print "Program started\n";
sub sem {
#semaphore lock code here
}
sub chooseProgram{
#initialise;
my $program1 = "./program1.pl";
my $program2 = "./program2.pl";
my $program3 = "./program3.pl";
my $ls = "ls";
my @programs = ( $ls, $program1, $program2, $program3 );
my $random = $programs[int rand($#programs+1)];
print $random."\n";
return $random;
}
#parent should fork child;
#child should run random processes;
#avoid process clones with semaphore;
sub main{
my $pid = fork();
if ($pid){
#parent here
}
elsif (defined($pid)){
#child here
print "$$ Child started:\n";
#simple cycle to launch and lock programs
for (my $i = 0; $i<10; $i++){
# semLock(system(chooseProgram()); #run in new terminal window
# so launched programs are locked and cannot be launched again
}
}
else {
die("Cannot fork: $!\n");
}
waitpid($pid, 0);
my $status = $?;
#print $status."\n";
}
main();
exit 0;
__Problems:__<br />
1) Need to lock file; (I don't know how to work with semaphore. Failed some attempts to lock files so excluded that code.) <br />
2) Child waits until first program ends before second start. How can i start three of programs at the same time with one child? (Is it possible or should i create one child for one program?)<br />
3) Programs are non-gui and should run in terminal. How to run a program in new terminal window(tab)?<br />
4) No correct check if all programs of @programs were launched yet. -- less important.
<br />
__P.S.__<br />
Sorry for my english. | 0 |
1,123,324 | 07/14/2009 03:33:43 | 432,987 | 07/14/2009 03:33:27 | 1 | 0 | Is there any way of reading a timecode track of a uicktime movie with applescript | I want to extract the timecode from a quicktime movie in Applescript.
By using this script
tell application "QuickTime Player"
set themovie to open thefile
set thetracks to tracks of document 1
repeat with thetrack in thetracks
if the kind of thetrack is "Timecode" then
get the properties of thetrack
end if
end repeat
end tell
I can get the timecode track, the properties of the track are:
> {is audio variable rate:true, is video
> gray scale:false, audio sample size:0,
> class:track, audio sample rate:0.0,
> sound balance:0, preload:false,
> streaming bit rate:-1.0,
> duration:960300, language:"English",
> audio channel count:0, layer:0,
> contents:missing value, bass gain:0,
> start time:0, data format:"Timecode",
> treble gain:0, audio
> characteristic:false, sound volume:0,
> mask:missing value, video depth:0,
> position:{0, 0}, id:4, high
> quality:false, deinterlace
> fields:false, href:"", natural
> dimensions:{0, 0}, single field:false,
> kind:"Timecode", index:4, data
> size:38412, visual
> characteristic:false, data rate:100,
> never purge:false, transparency:49,
> chapterlist:{}, name:"Timecode Track",
> alternate:{}, operation color:{32768,
> 32768, 32768}, enabled:true,
> type:"tmcd", streaming quality:-1.0,
> transfer mode:transfer mode unknown,
> dimensions:{0, 0}, current
> matrix:{{1.0, 0.0, 0.0}, {0.0, 1.0,
> 0.0}, {0.0, 0.0, 1.0}}}
none of which seems to have anything to do with the timecode. Note that the contents property is "missing value"
If I try to get the current time of the movie it returns 0, even if the timecode doesn't start at 0.
I'm thinking by what I've found on the net so far that this is impossible. Please prove me wrong
TIA
-stib | quicktime | applescript | null | null | null | null | open | Is there any way of reading a timecode track of a uicktime movie with applescript
===
I want to extract the timecode from a quicktime movie in Applescript.
By using this script
tell application "QuickTime Player"
set themovie to open thefile
set thetracks to tracks of document 1
repeat with thetrack in thetracks
if the kind of thetrack is "Timecode" then
get the properties of thetrack
end if
end repeat
end tell
I can get the timecode track, the properties of the track are:
> {is audio variable rate:true, is video
> gray scale:false, audio sample size:0,
> class:track, audio sample rate:0.0,
> sound balance:0, preload:false,
> streaming bit rate:-1.0,
> duration:960300, language:"English",
> audio channel count:0, layer:0,
> contents:missing value, bass gain:0,
> start time:0, data format:"Timecode",
> treble gain:0, audio
> characteristic:false, sound volume:0,
> mask:missing value, video depth:0,
> position:{0, 0}, id:4, high
> quality:false, deinterlace
> fields:false, href:"", natural
> dimensions:{0, 0}, single field:false,
> kind:"Timecode", index:4, data
> size:38412, visual
> characteristic:false, data rate:100,
> never purge:false, transparency:49,
> chapterlist:{}, name:"Timecode Track",
> alternate:{}, operation color:{32768,
> 32768, 32768}, enabled:true,
> type:"tmcd", streaming quality:-1.0,
> transfer mode:transfer mode unknown,
> dimensions:{0, 0}, current
> matrix:{{1.0, 0.0, 0.0}, {0.0, 1.0,
> 0.0}, {0.0, 0.0, 1.0}}}
none of which seems to have anything to do with the timecode. Note that the contents property is "missing value"
If I try to get the current time of the movie it returns 0, even if the timecode doesn't start at 0.
I'm thinking by what I've found on the net so far that this is impossible. Please prove me wrong
TIA
-stib | 0 |
2,669,103 | 04/19/2010 16:28:12 | 38,522 | 11/18/2008 10:18:37 | 2,144 | 49 | Types from multiple assemblies and namespaces in nhibernate mapping files | You can specify the namespace and assembly to use types from at the top of HBM files:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="MyCorp.MyAssembly" namespace="MyCorp.MyAssembly.MyNamespace">
Can you use types from multiple assemblies / namespaces within the same mapping file, and if so what is the syntax for doing so?
| nhibernate | nhibernate-mapping | assemblies | namespaces | null | null | open | Types from multiple assemblies and namespaces in nhibernate mapping files
===
You can specify the namespace and assembly to use types from at the top of HBM files:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="MyCorp.MyAssembly" namespace="MyCorp.MyAssembly.MyNamespace">
Can you use types from multiple assemblies / namespaces within the same mapping file, and if so what is the syntax for doing so?
| 0 |
7,885,419 | 10/25/2011 06:24:49 | 377,381 | 06/27/2010 12:16:21 | 114 | 4 | resize files after being uploaded | im trying to resize files being uploaded all this with php,
here's the code that writes the images to the disk
if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
// Open temp file
$out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
if ($out) {
// Read binary input stream and append it to temp file
$in = fopen($_FILES['file']['tmp_name'], "rb");
if ($in) {
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
}
else
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
fclose($in);
fclose($out);
@unlink($_FILES['file']['tmp_name']);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
}
my resize function goes here:
if ($in) {
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
resize();
resizing does happen but the images are black
the resize function:
function resize(){
$dir="photos/".$_COOKIE["event_id"]."/";
$img= array_slice(scandir("photos/".$_COOKIE["event_id"]."/"),2);
foreach($img as $_img){
// echo $_img;
list($width, $height, $type, $attr) = getimagesize($dir.$_img);
//echo $width.'px <br />';
if($width > 630){
if($type=="2"){
$new_image= imagecreatefromjpeg($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($tmp,$dir.$_img,100);
}
if($type=="1"){
$new_image= imagecreatefromgif($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagegif($tmp,$dir.$_img);
}
if($type=="3"){
$new_image= imagecreatefrompng($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagepng($tmp,$dir.$_img,6);
}
}
}
}
}
| php | null | null | null | null | 02/29/2012 18:39:35 | not a real question | resize files after being uploaded
===
im trying to resize files being uploaded all this with php,
here's the code that writes the images to the disk
if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
// Open temp file
$out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? "wb" : "ab");
if ($out) {
// Read binary input stream and append it to temp file
$in = fopen($_FILES['file']['tmp_name'], "rb");
if ($in) {
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
}
else
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
fclose($in);
fclose($out);
@unlink($_FILES['file']['tmp_name']);
} else
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
}
my resize function goes here:
if ($in) {
while ($buff = fread($in, 4096)) {
fwrite($out, $buff);
}
resize();
resizing does happen but the images are black
the resize function:
function resize(){
$dir="photos/".$_COOKIE["event_id"]."/";
$img= array_slice(scandir("photos/".$_COOKIE["event_id"]."/"),2);
foreach($img as $_img){
// echo $_img;
list($width, $height, $type, $attr) = getimagesize($dir.$_img);
//echo $width.'px <br />';
if($width > 630){
if($type=="2"){
$new_image= imagecreatefromjpeg($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($tmp,$dir.$_img,100);
}
if($type=="1"){
$new_image= imagecreatefromgif($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagegif($tmp,$dir.$_img);
}
if($type=="3"){
$new_image= imagecreatefrompng($dir.$_img);
$newwidth=630;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$new_image,0,0,0,0,$newwidth,$newheight,$width,$height);
imagepng($tmp,$dir.$_img,6);
}
}
}
}
}
| 1 |
7,639,940 | 10/03/2011 19:50:40 | 975,917 | 10/03/2011 00:17:45 | 6 | 0 | using javascript to find size of DOM elements | How do I use javascript to find the size of a Dom element.
Thanks. | javascript | dom | null | null | null | 10/03/2011 21:58:41 | not a real question | using javascript to find size of DOM elements
===
How do I use javascript to find the size of a Dom element.
Thanks. | 1 |
116,519 | 09/22/2008 18:14:19 | 2,197 | 08/20/2008 20:58:04 | 51 | 8 | Best Resources for Learning JavaFX? | For those of us learning JavaFX, what are the best resources you've found so far?
(One of the difficulties in finding good JavaFX resources is that things written before July 2008 are often no longer valid because of changes made to the language)
I've found:
* [James Weaver's JavaFX Blog][1]
* [JavaFX in Action][2] by Manning Press
* [OpenJFX][3] on dev.java.net
What have you found that I might be missing?
[1]: http://learnjavafx.typepad.com/
[2]: http://www.manning.com/morris/
[3]: https://openjfx.dev.java.net/ | javafx | null | null | null | null | 06/10/2012 15:49:28 | not constructive | Best Resources for Learning JavaFX?
===
For those of us learning JavaFX, what are the best resources you've found so far?
(One of the difficulties in finding good JavaFX resources is that things written before July 2008 are often no longer valid because of changes made to the language)
I've found:
* [James Weaver's JavaFX Blog][1]
* [JavaFX in Action][2] by Manning Press
* [OpenJFX][3] on dev.java.net
What have you found that I might be missing?
[1]: http://learnjavafx.typepad.com/
[2]: http://www.manning.com/morris/
[3]: https://openjfx.dev.java.net/ | 4 |
3,064,075 | 06/17/2010 17:35:30 | 400,962 | 03/19/2010 11:25:56 | 35 | 0 | onchange event and auto grow textbox | i have made auto grow textarea.it's working fine but when copying and pasting using right click it's not working properly.if i use onchange event in this situation it won't work either because to fire this event we need press enter or tab. please help me to solve this problem | javascript | null | null | null | null | null | open | onchange event and auto grow textbox
===
i have made auto grow textarea.it's working fine but when copying and pasting using right click it's not working properly.if i use onchange event in this situation it won't work either because to fire this event we need press enter or tab. please help me to solve this problem | 0 |
10,183,820 | 04/17/2012 01:17:01 | 1,094,837 | 12/13/2011 01:17:21 | 313 | 7 | PHP never-repeating Random Number | I need to create a completely random number for each user on my website and insert it into a MySQL database. The numbers can never repeat and I don't want to use MySQL AutoIncrement because I need a specific range. Say from `111,111` to `999,999,999,999`. No higher or lower as of right now. I do have a specific reason for that range, incase you were wondering. I know I can use the `unique` feature on MySQL but that only prevents me from inserting duplicates. I was thinking of having 2 functions, one to generate the number, and another to check if that number is used. They would keep looping until they found a number that wasn't used. I know how inefficient that is and how long it may take once majority of those numbers have been taken so that is why I have come here, for a better answer. What do you suggest I do because I am all out of ideas. Thanks for any help! | php | mysql | random | numbers | null | 04/17/2012 13:39:49 | not a real question | PHP never-repeating Random Number
===
I need to create a completely random number for each user on my website and insert it into a MySQL database. The numbers can never repeat and I don't want to use MySQL AutoIncrement because I need a specific range. Say from `111,111` to `999,999,999,999`. No higher or lower as of right now. I do have a specific reason for that range, incase you were wondering. I know I can use the `unique` feature on MySQL but that only prevents me from inserting duplicates. I was thinking of having 2 functions, one to generate the number, and another to check if that number is used. They would keep looping until they found a number that wasn't used. I know how inefficient that is and how long it may take once majority of those numbers have been taken so that is why I have come here, for a better answer. What do you suggest I do because I am all out of ideas. Thanks for any help! | 1 |
7,629,682 | 10/02/2011 22:34:54 | 982,057 | 07/07/2011 17:35:29 | 10 | 0 | .htacess rewrite more SEO freindly | how can I rewrite
test.com/index.php?page=djs*&djID=1
into
test.com/djs/DJNAME
I need it to get the value of the second parameter djID=1 and use it the url.
Thanks :) | php | .htaccess | mod-rewrite | seo | null | 10/28/2011 11:12:40 | not a real question | .htacess rewrite more SEO freindly
===
how can I rewrite
test.com/index.php?page=djs*&djID=1
into
test.com/djs/DJNAME
I need it to get the value of the second parameter djID=1 and use it the url.
Thanks :) | 1 |
10,898,413 | 06/05/2012 13:39:57 | 1,272,077 | 03/15/2012 16:31:40 | 6 | 0 | Why sometimes there are multiple JSF life cycles invoked? | I connected a simple jsf lifecycle listener to my webbapp:
public class LifeCycleListener implements PhaseListener
{
@Override
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
@Override
public void beforePhase(PhaseEvent event) {
System.out.println("START PHASE " + event.getPhaseId());
}
@Override
public void afterPhase(PhaseEvent event) {
System.out.println("END PHASE " + event.getPhaseId());
}
}
On one of the pages I have smth like this:
<h:form>
<h:commandLink id="avdertAddedToMainPage" action="#{topView.showMainPage}">
Main Page
</h:commandLink>
</h:form>
where topView is simple bean configured in faces-config as request-scoped:
public class TopView {
public TopView() {
}
public String showAddAdvert()
{
return "addAdvert";
}
public String showMainPage()
{
return "itemList";
}
}
What makes me wonder is that, if I click the above link, everything seems to work properly, but according to LiceCycleListener's output every phase is run by 3 or 4 times before page loads up. Is this normal behaviour? If this indicates some kind of bug in my code, where I should look for it?
I use Mojarra 2.0.2 on Glassfish 3.0.1
| jsf | facelets | lifecycle | null | null | null | open | Why sometimes there are multiple JSF life cycles invoked?
===
I connected a simple jsf lifecycle listener to my webbapp:
public class LifeCycleListener implements PhaseListener
{
@Override
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
@Override
public void beforePhase(PhaseEvent event) {
System.out.println("START PHASE " + event.getPhaseId());
}
@Override
public void afterPhase(PhaseEvent event) {
System.out.println("END PHASE " + event.getPhaseId());
}
}
On one of the pages I have smth like this:
<h:form>
<h:commandLink id="avdertAddedToMainPage" action="#{topView.showMainPage}">
Main Page
</h:commandLink>
</h:form>
where topView is simple bean configured in faces-config as request-scoped:
public class TopView {
public TopView() {
}
public String showAddAdvert()
{
return "addAdvert";
}
public String showMainPage()
{
return "itemList";
}
}
What makes me wonder is that, if I click the above link, everything seems to work properly, but according to LiceCycleListener's output every phase is run by 3 or 4 times before page loads up. Is this normal behaviour? If this indicates some kind of bug in my code, where I should look for it?
I use Mojarra 2.0.2 on Glassfish 3.0.1
| 0 |
8,580,881 | 12/20/2011 19:32:50 | 244,026 | 01/05/2010 15:21:48 | 1,063 | 45 | How animate insert/delete items in StackPanel | I want to animate insert\delete the item in a StackPanel.
Eg: If new item inserted into collection all other items smoothly free space for new item and vice versa.
Can anyone suggest examples or ideas on this topic? | wpf | animation | stackpanel | null | null | null | open | How animate insert/delete items in StackPanel
===
I want to animate insert\delete the item in a StackPanel.
Eg: If new item inserted into collection all other items smoothly free space for new item and vice versa.
Can anyone suggest examples or ideas on this topic? | 0 |
8,995,972 | 01/24/2012 23:43:27 | 1,168,189 | 01/24/2012 23:18:39 | 1 | 0 | C#: Getting an RSS feed posted to Google Plus | I'm trying to use either the Google Plus API or GooglePlusLib for .NET to have entries from an RSS feed posted as a Google Plus post (or "activity"). I have all the info necessary (apikey, OAuth2.0 info, profile info) but am kind of clueless as to how to put it all together. I have done a lot of searching but can't seem to find what I'm looking for. This page seems the closest to what I need: http://www.eggheadcafe.com/tutorials/csharp/8c81f554-1028-40d6-bab0-604bb11153d6/googlepluslib-net-client-library-for-google-api.aspx
Ideally I'd want an XML document (app.config) to hold the info (apikey, OAuth key, RSS url) and then have a GooglePlusLib or just Google+ API command post to my Google+ profile. But I have looked through both references (through object browser) and can't find any commands that jump out as something that would help me. If it is not possible to post to Google+ from an RSS feed then what about posting results from a Google News search?
I'm using Visual Studio 2010 .NET, C# language.
If someone can give me some clues that would be great. Thank you. | c# | api | rss | google-plus | null | 01/26/2012 03:48:27 | not a real question | C#: Getting an RSS feed posted to Google Plus
===
I'm trying to use either the Google Plus API or GooglePlusLib for .NET to have entries from an RSS feed posted as a Google Plus post (or "activity"). I have all the info necessary (apikey, OAuth2.0 info, profile info) but am kind of clueless as to how to put it all together. I have done a lot of searching but can't seem to find what I'm looking for. This page seems the closest to what I need: http://www.eggheadcafe.com/tutorials/csharp/8c81f554-1028-40d6-bab0-604bb11153d6/googlepluslib-net-client-library-for-google-api.aspx
Ideally I'd want an XML document (app.config) to hold the info (apikey, OAuth key, RSS url) and then have a GooglePlusLib or just Google+ API command post to my Google+ profile. But I have looked through both references (through object browser) and can't find any commands that jump out as something that would help me. If it is not possible to post to Google+ from an RSS feed then what about posting results from a Google News search?
I'm using Visual Studio 2010 .NET, C# language.
If someone can give me some clues that would be great. Thank you. | 1 |
6,477,306 | 06/25/2011 10:58:53 | 815,243 | 06/25/2011 10:58:53 | 1 | 0 | Collision between 2 lines - Math | Alright, I'm doing some excersice.
The question is: I have distances of those 2 lines, I can also get the gradient if needed.
I need to write if there is collision between those lines, I need to know how am I doing it?
Thanks in advanced. | c# | null | null | null | null | 06/25/2011 11:07:30 | off topic | Collision between 2 lines - Math
===
Alright, I'm doing some excersice.
The question is: I have distances of those 2 lines, I can also get the gradient if needed.
I need to write if there is collision between those lines, I need to know how am I doing it?
Thanks in advanced. | 2 |
9,052,742 | 01/29/2012 11:14:02 | 1,153,116 | 01/17/2012 03:36:02 | 1 | 0 | MYSQL special Char | I have in my table this value ART(\'O\') in the field Subject.
How do I check if this subject exist?
I tried:
select * from table1 where Subject = 'ART(\'O\')';
select * from table1 where Subject = "ART(\'O\')";
Both failed at picking up the record.
How sholud I prhase the query so that the record containing ART(\'O\') will be picked?
Note: Please do not refer the query: select * from table1 where Subject like '%ART(%';
bec they may be other records such as ART(EX), ART(NA),etc... existing
Need to know how to use the Subject = '' method.
Thanks.
| mysql | sql | null | null | null | null | open | MYSQL special Char
===
I have in my table this value ART(\'O\') in the field Subject.
How do I check if this subject exist?
I tried:
select * from table1 where Subject = 'ART(\'O\')';
select * from table1 where Subject = "ART(\'O\')";
Both failed at picking up the record.
How sholud I prhase the query so that the record containing ART(\'O\') will be picked?
Note: Please do not refer the query: select * from table1 where Subject like '%ART(%';
bec they may be other records such as ART(EX), ART(NA),etc... existing
Need to know how to use the Subject = '' method.
Thanks.
| 0 |
10,548,847 | 05/11/2012 09:31:43 | 1,230,768 | 02/24/2012 12:35:34 | 18 | 6 | How to bind large amount of data in chart plotter control of D3 | i am working on a WCF application which is used to show real time sensor info which coming from database.For this i am using DynamicDataDisplay chart plotter.It works fine here for small amount of data.
Problem :
When i try to bind large amount of data then it take more time to respond.Before posting question here i have done some home work.I check all the facets which may be responsible for this late binding and i found for loop which is using to bind plotter.
**Xaml file :**
<d3:ChartPlotter Name="plotter" Margin="3,121,5,0" Grid.RowSpan="2" Height="373" VerticalAlignment="Top" VerticalContentAlignment="Stretch" LegendVisible="False">
<d3:ChartPlotter.HorizontalAxis>
<d3:HorizontalDateTimeAxis Name="dateAxis" />
</d3:ChartPlotter.HorizontalAxis>
<!--<d3:Header FontFamily="Georgia" Content="Readings"/>-->
<d3:VerticalAxisTitle FontFamily="Georgia" Content="Sensor Readings" />
<d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date" />
</d3:ChartPlotter>
.CS :
Dataset ds = "Contain data for selected sensors";
Color[] colors = ColorHelper.CreateRandomColors(SelectedSensorColumn.Count);
for (int i = 0; i < SelectedSensorColumn.Count; i++)
{
List<SensorInfo> Sensor = new List<SensorInfo>();
Sensor = LoadSensorRates(ds, SelectedSensorColumn[i]);
plotter.AddLineGraph(CreateSensorDataSource(Sensor), colors[i], 1, SelectedItems[i]);
}
Method :
private static List<SensorInfo> LoadSensorRates(DataSet ds, string column)
{
try
{
var res = new List<SensorInfo>(ds.Tables[0].Rows.Count - 1);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
if (ds.Tables[0].Rows[i][column].ToString() != "")
{
DateTime date = DateTime.Parse(ds.Tables[0].Rows[i][0].ToString());
double rate = Double.Parse(ds.Tables[0].Rows[i][column].ToString(), CultureInfo.InvariantCulture);
res.Add(new SensorInfo { Date = date, Rate = rate });
}
}
return res;
}
catch (Exception ex)
{
throw ex;
}
}
SensorInfo.cs :
class SensorInfo
{
/// <summary>
/// Gets or sets the date for which currency exchange rate is given.
/// </summary>
/// <value>The date.</value>
public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the currency exchange rate.
/// </summary>
/// <value>The rate.</value>
public double Rate { get; set; }
}
How i can replace
for (int i = 0; i < SelectedSensorColumn.Count; i++)
{
List<SensorInfo> Sensor = new List<SensorInfo>();
Sensor = LoadSensorRates(ds, SelectedSensorColumn[i]);
plotter.AddLineGraph(CreateSensorDataSource(Sensor), colors[i], 1, SelectedItems[i]);
code so that i can bind plotter with speed.
Thanks in advance.
| c# | wpf | charts | dynamic-data-display | null | 05/18/2012 14:58:54 | too localized | How to bind large amount of data in chart plotter control of D3
===
i am working on a WCF application which is used to show real time sensor info which coming from database.For this i am using DynamicDataDisplay chart plotter.It works fine here for small amount of data.
Problem :
When i try to bind large amount of data then it take more time to respond.Before posting question here i have done some home work.I check all the facets which may be responsible for this late binding and i found for loop which is using to bind plotter.
**Xaml file :**
<d3:ChartPlotter Name="plotter" Margin="3,121,5,0" Grid.RowSpan="2" Height="373" VerticalAlignment="Top" VerticalContentAlignment="Stretch" LegendVisible="False">
<d3:ChartPlotter.HorizontalAxis>
<d3:HorizontalDateTimeAxis Name="dateAxis" />
</d3:ChartPlotter.HorizontalAxis>
<!--<d3:Header FontFamily="Georgia" Content="Readings"/>-->
<d3:VerticalAxisTitle FontFamily="Georgia" Content="Sensor Readings" />
<d3:HorizontalAxisTitle FontFamily="Georgia" Content="Date" />
</d3:ChartPlotter>
.CS :
Dataset ds = "Contain data for selected sensors";
Color[] colors = ColorHelper.CreateRandomColors(SelectedSensorColumn.Count);
for (int i = 0; i < SelectedSensorColumn.Count; i++)
{
List<SensorInfo> Sensor = new List<SensorInfo>();
Sensor = LoadSensorRates(ds, SelectedSensorColumn[i]);
plotter.AddLineGraph(CreateSensorDataSource(Sensor), colors[i], 1, SelectedItems[i]);
}
Method :
private static List<SensorInfo> LoadSensorRates(DataSet ds, string column)
{
try
{
var res = new List<SensorInfo>(ds.Tables[0].Rows.Count - 1);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
if (ds.Tables[0].Rows[i][column].ToString() != "")
{
DateTime date = DateTime.Parse(ds.Tables[0].Rows[i][0].ToString());
double rate = Double.Parse(ds.Tables[0].Rows[i][column].ToString(), CultureInfo.InvariantCulture);
res.Add(new SensorInfo { Date = date, Rate = rate });
}
}
return res;
}
catch (Exception ex)
{
throw ex;
}
}
SensorInfo.cs :
class SensorInfo
{
/// <summary>
/// Gets or sets the date for which currency exchange rate is given.
/// </summary>
/// <value>The date.</value>
public DateTime Date { get; set; }
/// <summary>
/// Gets or sets the currency exchange rate.
/// </summary>
/// <value>The rate.</value>
public double Rate { get; set; }
}
How i can replace
for (int i = 0; i < SelectedSensorColumn.Count; i++)
{
List<SensorInfo> Sensor = new List<SensorInfo>();
Sensor = LoadSensorRates(ds, SelectedSensorColumn[i]);
plotter.AddLineGraph(CreateSensorDataSource(Sensor), colors[i], 1, SelectedItems[i]);
code so that i can bind plotter with speed.
Thanks in advance.
| 3 |
9,605,847 | 03/07/2012 16:55:17 | 833,864 | 07/07/2011 15:36:31 | 5 | 1 | Team Foundation Server Service Pack 1 Installation Error | When installing Service Pack 1 for TFS I get the following Error Code 643.
The log says..
[Info @20:53:36.151] ====================================================================
[Info @20:53:36.151] Team Foundation Server Administration Log
[Info @20:53:36.151] Version : 10.0.30319.1
[Info @20:53:36.151] DateTime : 03/05/2012 21:53:36
[Info @20:53:36.151] Type : Configuration
[Info @20:53:36.151] Activity : Servicing
[Info @20:53:36.151] Area : Unknown
[Info @20:53:36.151] User : DOMAIN\Administrator
[Info @20:53:36.151] Machine : COMPUTER
[Info @20:53:36.151] System : Microsoft Windows NT 6.1.7601 Service Pack 1 (AMD64)
[Info @20:53:36.151] ====================================================================
[Info @20:53:36.182] Starting application pool: ApplicationTier
[Info @20:53:36.182] ApplicationPoolHelper::GetApplicationPoolName
[Info @20:53:36.182] Application pool name: Microsoft Team Foundation Server Application Pool
[Info @20:53:36.198] Invoking operation Start on application pool: Microsoft Team Foundation Server Application Pool
[Error @20:53:36.214] Exception while invoking operation Start on application pool Microsoft Team Foundation Server Application Pool
[Error @20:53:36.245]
Exception Message: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
(type COMException)
Exception Stack Trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_NativeObject()
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)
can anyone help please? | service | update | tfs | installation | pack | 03/12/2012 13:30:12 | off topic | Team Foundation Server Service Pack 1 Installation Error
===
When installing Service Pack 1 for TFS I get the following Error Code 643.
The log says..
[Info @20:53:36.151] ====================================================================
[Info @20:53:36.151] Team Foundation Server Administration Log
[Info @20:53:36.151] Version : 10.0.30319.1
[Info @20:53:36.151] DateTime : 03/05/2012 21:53:36
[Info @20:53:36.151] Type : Configuration
[Info @20:53:36.151] Activity : Servicing
[Info @20:53:36.151] Area : Unknown
[Info @20:53:36.151] User : DOMAIN\Administrator
[Info @20:53:36.151] Machine : COMPUTER
[Info @20:53:36.151] System : Microsoft Windows NT 6.1.7601 Service Pack 1 (AMD64)
[Info @20:53:36.151] ====================================================================
[Info @20:53:36.182] Starting application pool: ApplicationTier
[Info @20:53:36.182] ApplicationPoolHelper::GetApplicationPoolName
[Info @20:53:36.182] Application pool name: Microsoft Team Foundation Server Application Pool
[Info @20:53:36.198] Invoking operation Start on application pool: Microsoft Team Foundation Server Application Pool
[Error @20:53:36.214] Exception while invoking operation Start on application pool Microsoft Team Foundation Server Application Pool
[Error @20:53:36.245]
Exception Message: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
(type COMException)
Exception Stack Trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_NativeObject()
at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args)
at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)
can anyone help please? | 2 |
2,958,224 | 06/02/2010 13:40:11 | 356,487 | 06/02/2010 13:40:11 | 1 | 0 | Why does my sharepoint web part event handler lose the sender value on postback? | I have a web part which is going to be a part of pair of connected web parts. For simplicity, I am just describing the consumer web part.
This web part has 10 link buttons on it. And they are rendered in the Render method instead ofCreateChildControls as this webpart will be receiving values based on input from the provider web part. Each Link Button has a text which is decided dynamically based on the input from provider web part.
When I click on any of the Link Buttons, the event handler is triggered but the text on the Link Button shows up as the one set in CreateChildControls. When I trace the code, I see that the CreateChildControls gets called before the event handler (and i think that resets my Link Buttons). How do I get the event handler to show me the dynamic text instead?
Here is the code...
public class consWebPart : Microsoft.SharePoint.WebPartPages.WebPart
{
private bool _error = false;
private LinkButton[] lkDocument = null;
public consWebPart()
{
this.ExportMode = WebPartExportMode.All;
}
protected override void CreateChildControls()
{
if (!_error)
{
try
{
base.CreateChildControls();
lkDocument = new LinkButton[101];
for (int i = 0; i < 10; i++)
{
lkDocument[i] = new LinkButton();
lkDocument[i].ID = "lkDocument" + i;
lkDocument[i].Text = "Initial Text";
lkDocument[i].Style.Add("margin", "10 10 10 10px");
this.Controls.Add(lkDocument[i]);
lkDocument[i].Click += new EventHandler(lkDocument_Click);
}
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<table><tr>");
for (int i = 0; i < 10; i++)
{
writer.Write("<tr>");
lkDocument[i].Text = "LinkButton" + i;
writer.Write("<td>");
lkDocument[i].RenderControl(writer);
writer.Write("</td>");
writer.Write("</tr>");
}
writer.Write("</table>");
}
protected void lkDocument_Click(object sender, EventArgs e)
{
string strsender = sender.ToString();
LinkButton lk = (LinkButton)sender;
}
protected override void OnLoad(EventArgs e)
{
if (!_error)
{
try
{
base.OnLoad(e);
this.EnsureChildControls();
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
private void HandleException(Exception ex)
{
this._error = true;
this.Controls.Clear();
this.Controls.Add(new LiteralControl(ex.Message));
}
}
| sharepoint | event-handling | part | null | null | null | open | Why does my sharepoint web part event handler lose the sender value on postback?
===
I have a web part which is going to be a part of pair of connected web parts. For simplicity, I am just describing the consumer web part.
This web part has 10 link buttons on it. And they are rendered in the Render method instead ofCreateChildControls as this webpart will be receiving values based on input from the provider web part. Each Link Button has a text which is decided dynamically based on the input from provider web part.
When I click on any of the Link Buttons, the event handler is triggered but the text on the Link Button shows up as the one set in CreateChildControls. When I trace the code, I see that the CreateChildControls gets called before the event handler (and i think that resets my Link Buttons). How do I get the event handler to show me the dynamic text instead?
Here is the code...
public class consWebPart : Microsoft.SharePoint.WebPartPages.WebPart
{
private bool _error = false;
private LinkButton[] lkDocument = null;
public consWebPart()
{
this.ExportMode = WebPartExportMode.All;
}
protected override void CreateChildControls()
{
if (!_error)
{
try
{
base.CreateChildControls();
lkDocument = new LinkButton[101];
for (int i = 0; i < 10; i++)
{
lkDocument[i] = new LinkButton();
lkDocument[i].ID = "lkDocument" + i;
lkDocument[i].Text = "Initial Text";
lkDocument[i].Style.Add("margin", "10 10 10 10px");
this.Controls.Add(lkDocument[i]);
lkDocument[i].Click += new EventHandler(lkDocument_Click);
}
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<table><tr>");
for (int i = 0; i < 10; i++)
{
writer.Write("<tr>");
lkDocument[i].Text = "LinkButton" + i;
writer.Write("<td>");
lkDocument[i].RenderControl(writer);
writer.Write("</td>");
writer.Write("</tr>");
}
writer.Write("</table>");
}
protected void lkDocument_Click(object sender, EventArgs e)
{
string strsender = sender.ToString();
LinkButton lk = (LinkButton)sender;
}
protected override void OnLoad(EventArgs e)
{
if (!_error)
{
try
{
base.OnLoad(e);
this.EnsureChildControls();
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
private void HandleException(Exception ex)
{
this._error = true;
this.Controls.Clear();
this.Controls.Add(new LiteralControl(ex.Message));
}
}
| 0 |
11,175,633 | 06/24/2012 07:11:29 | 296,516 | 03/18/2010 12:56:50 | 383 | 5 | Can i make money with my Android Engine or should I focus on game-making? | I have dedicated past few month to developing my own android 2d engine.
You can see its description, demo and tutorials here http://www.aboxengine.com/ ( jar files will be up in a day or two ).
While working on the engine I believed it to be better then most available alternatives ( such as andengine, etc. ) and that people would love to use it in their games and, hopefully, would give me some royalties.
Yet as I started posting about my engine on other forums, it start looking like people are only interested in free/opensource engines.
Based on your experience, what do you think, is there some way for me to make money with that engine or should I forget about selling it and more focus on making games with it myself?
Thanks!
![enter image description here][1]
[1]: http://i.stack.imgur.com/3uknv.png | android | engine | null | null | null | 06/24/2012 16:41:10 | off topic | Can i make money with my Android Engine or should I focus on game-making?
===
I have dedicated past few month to developing my own android 2d engine.
You can see its description, demo and tutorials here http://www.aboxengine.com/ ( jar files will be up in a day or two ).
While working on the engine I believed it to be better then most available alternatives ( such as andengine, etc. ) and that people would love to use it in their games and, hopefully, would give me some royalties.
Yet as I started posting about my engine on other forums, it start looking like people are only interested in free/opensource engines.
Based on your experience, what do you think, is there some way for me to make money with that engine or should I forget about selling it and more focus on making games with it myself?
Thanks!
![enter image description here][1]
[1]: http://i.stack.imgur.com/3uknv.png | 2 |
4,339,723 | 12/02/2010 20:52:04 | 528,569 | 12/02/2010 20:52:04 | 1 | 0 | Text-align:justify in IE8 - Text moves when clicked on or highlighted | I came with a problem with IE8 text displaying, that the justified text moves a little bit once I click on it or highlight it.
Exactly like this http://www.howtocreate.co.uk/ieBugs/floattext.html, except that my div has pixel width. It seems like an IE bug.
My question would be, has anybody ever come with this problem? How did you fix it?
Thanks!
| internet-explorer | text | alignment | justify | null | null | open | Text-align:justify in IE8 - Text moves when clicked on or highlighted
===
I came with a problem with IE8 text displaying, that the justified text moves a little bit once I click on it or highlight it.
Exactly like this http://www.howtocreate.co.uk/ieBugs/floattext.html, except that my div has pixel width. It seems like an IE bug.
My question would be, has anybody ever come with this problem? How did you fix it?
Thanks!
| 0 |
2,148,753 | 01/27/2010 16:56:48 | 51,649 | 01/05/2009 13:47:38 | 343 | 9 | Javascript - Grid of Checkboxes? | I am about to start a task where I will have a grid of checkboxes which will allow users to select all of the checkboxes, some of them or none of them. I will also add a few conditionals where you can select a checkbox if you have selected the one above it directly and deselect them if the checkbox above has been selected.
Before I write this I was wondering if there is something that is already out there than can do this or something similar? Or at the very least something I can build on. I have already bing'ed and Google'd - but nothing has come up for me.
I would also appreciate implementation advice as this I don't want this to be a messy job and I can already imagine myself getting into a mess!
I would really love it if there was something out there for JQuery as I already make use of this.
Thanks all | javascript | jquery | html | null | null | null | open | Javascript - Grid of Checkboxes?
===
I am about to start a task where I will have a grid of checkboxes which will allow users to select all of the checkboxes, some of them or none of them. I will also add a few conditionals where you can select a checkbox if you have selected the one above it directly and deselect them if the checkbox above has been selected.
Before I write this I was wondering if there is something that is already out there than can do this or something similar? Or at the very least something I can build on. I have already bing'ed and Google'd - but nothing has come up for me.
I would also appreciate implementation advice as this I don't want this to be a messy job and I can already imagine myself getting into a mess!
I would really love it if there was something out there for JQuery as I already make use of this.
Thanks all | 0 |
5,594,420 | 04/08/2011 11:33:28 | 153,399 | 08/09/2009 20:25:27 | 370 | 32 | Openlayers and events on multiple layers (OpenLayer.Layer.Vector) | Another day working with openlayers and another problem.
Namely - i have multiple vector layers on top of each other for different types of stuff (cars, trips from history and areas). They all have events that im trying to catch... But as [Niklas][1] found out (http://stackoverflow.com/questions/4728852/forcing-an-openlayers-markers-layer-to-draw-on-top-and-having-selectable-layers), when you activate events on one layer, it gets moved on top and events on layers below wont fire.
Is there a way to bypass this? Because when i move over area polygon i want event firing and displaying its name and when i move mouse over to car marker i want the event fire too. And no - i dont want to put them on same layer, cause i want it to be possible to turn them off or on fast and without looping through all the features and disabling them each.
Alan
[1]: http://stackoverflow.com/users/543368/niklas-ringdahl | events | openlayers | null | null | null | null | open | Openlayers and events on multiple layers (OpenLayer.Layer.Vector)
===
Another day working with openlayers and another problem.
Namely - i have multiple vector layers on top of each other for different types of stuff (cars, trips from history and areas). They all have events that im trying to catch... But as [Niklas][1] found out (http://stackoverflow.com/questions/4728852/forcing-an-openlayers-markers-layer-to-draw-on-top-and-having-selectable-layers), when you activate events on one layer, it gets moved on top and events on layers below wont fire.
Is there a way to bypass this? Because when i move over area polygon i want event firing and displaying its name and when i move mouse over to car marker i want the event fire too. And no - i dont want to put them on same layer, cause i want it to be possible to turn them off or on fast and without looping through all the features and disabling them each.
Alan
[1]: http://stackoverflow.com/users/543368/niklas-ringdahl | 0 |
9,104,178 | 02/01/2012 22:16:05 | 943,326 | 09/13/2011 20:09:59 | 10 | 0 | NullReferenceException when adding record to table | I am receiving a NullReferenceException when trying to add a record to a table using LINQ on WP7. I am relatively new to C#/LINQ so I have copied one of my existing methods which works OK, but now I cannot make it work for the new record. The code is below;
private ObservableCollection<DBControl.Categories> _category;
public ObservableCollection<DBControl.Categories> Category
{
get
{
return _category;
}
set
{
if (_category != value)
{
_category = value;
NotifyPropertyChanged("Category");
}
}
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string TestCategory = "Cars";
// Create a new to-do item based on the text box.
DBControl.Categories newCat = new DBControl.Categories { CategoryDesc = TestCategory };
//CategoryDesc
// Add a to-do item to the observable collection.
**Category.Add(newCat);**
// Add a to-do item to the local database.
BoughtItemDB.Category.InsertOnSubmit(newCat);
BoughtItemDB.SubmitChanges();
}
The line of code which is giving me the error is **Category.Add(newCat)**
As far as I can tell everything looks OK which probably means I've made a daft mistake (again).
Any help is much appreciated.
The table definition is below;
[Table(Name = "Categories")]
public class Categories : INotifyPropertyChanged, INotifyPropertyChanging
{
// Define ID: private field, public property and database column.
private int _categoryId;
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public int CategoryId
{
get
{
return _categoryId;
}
set
{
if (_categoryId != value)
{
NotifyPropertyChanging("CategoryId");
_categoryId = value;
NotifyPropertyChanged("CategoryId");
}
}
}
// Define item category: private field, public property and database column.
private string _categoryDesc;
[Column]
public string CategoryDesc
{
get
{
return _categoryDesc;
}
set
{
if (_categoryDesc != value)
{
NotifyPropertyChanging("CategoryDesc");
_categoryDesc = value;
NotifyPropertyChanged("CategoryDesc");
}
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
// Used to notify the page that a data context property changed
private void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion
#region INotifyPropertyChanging Members
public event PropertyChangingEventHandler PropertyChanging;
// Used to notify the data context that a data context property is about to change
private void NotifyPropertyChanging(string propertyName)
{
if (PropertyChanging != null)
{
PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
}
}
#endregion
} | c# | linq | windows-phone-7 | null | null | null | open | NullReferenceException when adding record to table
===
I am receiving a NullReferenceException when trying to add a record to a table using LINQ on WP7. I am relatively new to C#/LINQ so I have copied one of my existing methods which works OK, but now I cannot make it work for the new record. The code is below;
private ObservableCollection<DBControl.Categories> _category;
public ObservableCollection<DBControl.Categories> Category
{
get
{
return _category;
}
set
{
if (_category != value)
{
_category = value;
NotifyPropertyChanged("Category");
}
}
}
private void button1_Click(object sender, RoutedEventArgs e)
{
string TestCategory = "Cars";
// Create a new to-do item based on the text box.
DBControl.Categories newCat = new DBControl.Categories { CategoryDesc = TestCategory };
//CategoryDesc
// Add a to-do item to the observable collection.
**Category.Add(newCat);**
// Add a to-do item to the local database.
BoughtItemDB.Category.InsertOnSubmit(newCat);
BoughtItemDB.SubmitChanges();
}
The line of code which is giving me the error is **Category.Add(newCat)**
As far as I can tell everything looks OK which probably means I've made a daft mistake (again).
Any help is much appreciated.
The table definition is below;
[Table(Name = "Categories")]
public class Categories : INotifyPropertyChanged, INotifyPropertyChanging
{
// Define ID: private field, public property and database column.
private int _categoryId;
[Column(IsPrimaryKey = true, IsDbGenerated = true, DbType = "INT NOT NULL Identity", CanBeNull = false, AutoSync = AutoSync.OnInsert)]
public int CategoryId
{
get
{
return _categoryId;
}
set
{
if (_categoryId != value)
{
NotifyPropertyChanging("CategoryId");
_categoryId = value;
NotifyPropertyChanged("CategoryId");
}
}
}
// Define item category: private field, public property and database column.
private string _categoryDesc;
[Column]
public string CategoryDesc
{
get
{
return _categoryDesc;
}
set
{
if (_categoryDesc != value)
{
NotifyPropertyChanging("CategoryDesc");
_categoryDesc = value;
NotifyPropertyChanged("CategoryDesc");
}
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
// Used to notify the page that a data context property changed
private void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion
#region INotifyPropertyChanging Members
public event PropertyChangingEventHandler PropertyChanging;
// Used to notify the data context that a data context property is about to change
private void NotifyPropertyChanging(string propertyName)
{
if (PropertyChanging != null)
{
PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
}
}
#endregion
} | 0 |
10,925,218 | 06/07/2012 03:17:20 | 237,285 | 12/23/2009 00:35:53 | 565 | 12 | Is a Windows Azure worker role instance a whole VM? | When I run a worker role instance on Azure, is it a complete VM running in a shared host (like EC2)? Or is it running in a shared system (like Heroku)?
For example, what happens if my application starts requesting 100 GB of memory? Will it get killed off automatically for violation of limits (á la Google App Engine), or will it just exhaust the VM, so that the Azure fabric restarts it?
Do two roles ever run in the same system? | azure | null | null | null | null | null | open | Is a Windows Azure worker role instance a whole VM?
===
When I run a worker role instance on Azure, is it a complete VM running in a shared host (like EC2)? Or is it running in a shared system (like Heroku)?
For example, what happens if my application starts requesting 100 GB of memory? Will it get killed off automatically for violation of limits (á la Google App Engine), or will it just exhaust the VM, so that the Azure fabric restarts it?
Do two roles ever run in the same system? | 0 |
8,948,100 | 01/20/2012 21:31:00 | 1,005,942 | 10/20/2011 19:37:16 | 48 | 0 | Are Strings in .NET encoding agnostic? | My question is simple: Are strings in .net encoding agnostic?
I ask this because when I ingest an xml file that I know was encoded with some windows-1252 code page elements (i.e smart quotes), in the debugger viewing the string that is holding my xml seems to want to resolve the single "smart quote" to a triangle with a question mark in it. This makes me wonder if .NET is asserting that the string that is holding my XML is UTF8 and therefore cannot resolve the difference.
This is a problem, if so, because if the string gets converted then my webservice that is meant to scrub the windows smart quotes from my text will fail because it doesn't recognize the triangle/question-mark-thingy.
Please help. | c# | null | null | null | null | null | open | Are Strings in .NET encoding agnostic?
===
My question is simple: Are strings in .net encoding agnostic?
I ask this because when I ingest an xml file that I know was encoded with some windows-1252 code page elements (i.e smart quotes), in the debugger viewing the string that is holding my xml seems to want to resolve the single "smart quote" to a triangle with a question mark in it. This makes me wonder if .NET is asserting that the string that is holding my XML is UTF8 and therefore cannot resolve the difference.
This is a problem, if so, because if the string gets converted then my webservice that is meant to scrub the windows smart quotes from my text will fail because it doesn't recognize the triangle/question-mark-thingy.
Please help. | 0 |
2,229,184 | 02/09/2010 13:05:35 | 188,475 | 10/12/2009 14:25:20 | 319 | 45 | What are most beautiful Silverlight charts? | We need most handsome Silverlight controls now. It is very important for us to have sexy animated charts. Money does not matter.
Please, advise.
[Here is one we found.][1]
[1]: http://www.visifire.com/silverlight_charts_gallery.php | silverlight | .net | null | null | null | 02/10/2010 15:19:32 | not a real question | What are most beautiful Silverlight charts?
===
We need most handsome Silverlight controls now. It is very important for us to have sexy animated charts. Money does not matter.
Please, advise.
[Here is one we found.][1]
[1]: http://www.visifire.com/silverlight_charts_gallery.php | 1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.