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
8,579,389
12/20/2011 17:24:06
1,108,354
12/20/2011 17:12:23
1
0
How To Get All Elements Present In A Web Page Using Selenium Rc
CAN ANY ONE SUGGEST ME THE JAVA CODE TO GET ALL THE TEXT ELEMENTS PRESENT IN A WEB PAGE. For Eg: IF THE WEB PAGE HAS TWO TEXT FIELDS <input id="txtUserID"> <input id="txtPassword">
java
null
null
null
null
12/20/2011 18:01:45
not a real question
How To Get All Elements Present In A Web Page Using Selenium Rc === CAN ANY ONE SUGGEST ME THE JAVA CODE TO GET ALL THE TEXT ELEMENTS PRESENT IN A WEB PAGE. For Eg: IF THE WEB PAGE HAS TWO TEXT FIELDS <input id="txtUserID"> <input id="txtPassword">
1
8,307,634
11/29/2011 08:13:44
504,483
11/11/2010 12:16:24
133
2
What are the advantages of using urban airship over C2DM
the title pretty mush sums it up. What's the difference between those services in exact ? and what are the advantages of using one over another ? id like to know what's the difference between UA and APN of apple as well ?
android
android-c2dm
urbanairship.com
null
null
null
open
What are the advantages of using urban airship over C2DM === the title pretty mush sums it up. What's the difference between those services in exact ? and what are the advantages of using one over another ? id like to know what's the difference between UA and APN of apple as well ?
0
3,690,579
09/11/2010 10:14:21
445,037
09/11/2010 10:14:21
1
0
how i can convert days to year in google doc spreadsheet
how i can convert days to year in google doc spreadsheet
google
spreadsheet
doc
null
null
09/12/2010 00:01:00
off topic
how i can convert days to year in google doc spreadsheet === how i can convert days to year in google doc spreadsheet
2
5,811,485
04/27/2011 22:38:21
345,824
05/20/2010 07:21:03
58
3
What is the use of flash in the world today? is viable to create a control panel in flash?
Friends, I am developing a control panel for a web hosting company, I am considering using Adobe Flex 4 (Adobe Flash Builder), but I'm afraid that the staff are no longer using more flash in computers, especially with the growth of ipad, iphone without flash. This panel will be used by enterprise customers to manage their products. Do you think that the flash actually has a future? think it is reliable to use flash in such an application? Thanks
flash
flex4
null
null
null
04/29/2011 09:02:44
not constructive
What is the use of flash in the world today? is viable to create a control panel in flash? === Friends, I am developing a control panel for a web hosting company, I am considering using Adobe Flex 4 (Adobe Flash Builder), but I'm afraid that the staff are no longer using more flash in computers, especially with the growth of ipad, iphone without flash. This panel will be used by enterprise customers to manage their products. Do you think that the flash actually has a future? think it is reliable to use flash in such an application? Thanks
4
3,259,243
07/15/2010 19:32:39
143,191
07/22/2009 20:30:41
305
3
Query regarding using MSDN license
If I buy one of the available MSDN subscriptions from Professional, Premium, Ultimate and Test Professional then how many developers can download & use the products?
licensing
msdnsubscriptions
msdn-subscription
null
null
07/18/2010 08:44:31
off topic
Query regarding using MSDN license === If I buy one of the available MSDN subscriptions from Professional, Premium, Ultimate and Test Professional then how many developers can download & use the products?
2
8,809,086
01/10/2012 19:13:00
985,482
10/08/2011 15:19:54
105
5
Java neetworking
Hi I am a beginner Java programmer and for my first project I've built a simple player vs player Monopoly game. Now I wish to make the game to be played via the network and also add a chat to it. Can anyone tell me of some good resources that will help me understand what I need about networking in order to achive what I want?
java
null
null
null
null
01/10/2012 22:28:11
not a real question
Java neetworking === Hi I am a beginner Java programmer and for my first project I've built a simple player vs player Monopoly game. Now I wish to make the game to be played via the network and also add a chat to it. Can anyone tell me of some good resources that will help me understand what I need about networking in order to achive what I want?
1
7,656,501
10/05/2011 03:47:14
703,665
04/12/2011 08:38:14
1
1
How could i integrate my website with stackoverflow?
I am looking for the integration points to stackoverflow. What i mean here is if somebody ask a question on my webpage i should be able to post it here and may be via RSS feed could produce notifications back to my website is this possible?
stackoverflow
integrate
null
null
null
10/05/2011 04:10:15
off topic
How could i integrate my website with stackoverflow? === I am looking for the integration points to stackoverflow. What i mean here is if somebody ask a question on my webpage i should be able to post it here and may be via RSS feed could produce notifications back to my website is this possible?
2
10,626,848
05/16/2012 21:16:32
125,121
06/18/2009 14:01:58
138
4
Apache doesn't serve PHP files after CentOS 5.5 upgrade to PHP53
I just upgraded a CentOS 5.5 server (using Apache 2.2) to PHP53 (using the `php53u` set of packages). All of a sudden, Apache doesn't appear to recognize `.php` files. It's just delivering the source. Please help! I need to get this server back online as soon as possible.
php
apache
php5
centos
httpd
05/16/2012 23:05:07
off topic
Apache doesn't serve PHP files after CentOS 5.5 upgrade to PHP53 === I just upgraded a CentOS 5.5 server (using Apache 2.2) to PHP53 (using the `php53u` set of packages). All of a sudden, Apache doesn't appear to recognize `.php` files. It's just delivering the source. Please help! I need to get this server back online as soon as possible.
2
8,860,365
01/14/2012 05:29:26
236,924
12/22/2009 14:50:13
898
9
decipher this text in c/C++
I am trying to decipher this text in C/C++: E^@^@<a^R@^@@^FÌø<80>è^AÛ<80>è ^F \^DÔVn3Ï^@^@^@^@ ^B^VÐXâ^@^@^B^D^E´^D^B^H IQRÝ^@^@^@^@^A^C^C^GE^@^@<^@^@@^@@^F.^K<80>è ^F<80>è^AÛ^DÔ \»4³ÕVn3Р^R^V J ^@^@^B^D^E´^D^B^H ^@g<9f><86>IQRÝ^A^C^C^GE^@^@4a^S@^@@^FÌÿ<80>è^AÛ<80>è ^F \^DÔVn3л4³Ö<80>^P^@.<8f>F^@^@^A^A^H IQRÞ^@g<9f><86>E^@^A±,Q@^@@^F^@E<80>è ^F<80>è^AÛ^DÔ \»4³ÖVn3Ð<80>^X^@.^NU^@^@^A^A^H ^@g<9f><87>IQRÞ message E^@^@4,R@^@@^F^AÁ<80>è ^F<80>è^AÛ^DÔ \»4µSVn3Ð<80>^Q^@.<8d>Ç^@^@^A^A^H ^@g<9f><87>IQRÞE^@^@4a^T@^@@^FÌþ<80>è^AÛ<80>è ^F \^DÔVn3л4µS<80>^P^@6<8d>¿^@^@^A^A^H IQRß^@g<9f><87>E^@^@4a^U@^@@^FÌý<80>è^AÛ<80>è ^F \^DÔVn3л4µT<80>^Q^@6<8d>½^@^@^A^A^H IQRß^@g<9f><87>E^@^@4,S@^@@^F^AÀ<80>è ^F<80>è^AÛ^DÔ \»4µTVn3Ñ<80>^P^@.<8d>Å^@^@^A^A^H ^@g<9f><87>IQRß This follows the format of the layout of packets in the IP Protocol: RFC 791 http://www.ietf.org/rfc/rfc0791.txt Of particular interest is the position of the packets in the Internet Protocol header on page 11. Currently I am just reading it by character but it's not working. I think I have to read 4bits/ 8bits at a time but I dont know how to do that. Please help! This is my code right now: #include <stdio.h> /* required for file operations */ int main(int argc, char *argv[]){ int n; FILE *fr; unsigned char c; if (argc != 2) { perror("Usage: summary <FILE>"); return 1; } fr = fopen (argv[1], "r"); /* open the file for reading */ printf("%lu" , sizeof(c)); while (!feof(fr)){ fread(&c, sizeof(c), 1, fr); printf("%c", (char)c); } fclose(fr); /* close the file prior to exiting the routine */
c++
c
null
null
null
01/14/2012 05:57:36
not a real question
decipher this text in c/C++ === I am trying to decipher this text in C/C++: E^@^@<a^R@^@@^FÌø<80>è^AÛ<80>è ^F \^DÔVn3Ï^@^@^@^@ ^B^VÐXâ^@^@^B^D^E´^D^B^H IQRÝ^@^@^@^@^A^C^C^GE^@^@<^@^@@^@@^F.^K<80>è ^F<80>è^AÛ^DÔ \»4³ÕVn3Р^R^V J ^@^@^B^D^E´^D^B^H ^@g<9f><86>IQRÝ^A^C^C^GE^@^@4a^S@^@@^FÌÿ<80>è^AÛ<80>è ^F \^DÔVn3л4³Ö<80>^P^@.<8f>F^@^@^A^A^H IQRÞ^@g<9f><86>E^@^A±,Q@^@@^F^@E<80>è ^F<80>è^AÛ^DÔ \»4³ÖVn3Ð<80>^X^@.^NU^@^@^A^A^H ^@g<9f><87>IQRÞ message E^@^@4,R@^@@^F^AÁ<80>è ^F<80>è^AÛ^DÔ \»4µSVn3Ð<80>^Q^@.<8d>Ç^@^@^A^A^H ^@g<9f><87>IQRÞE^@^@4a^T@^@@^FÌþ<80>è^AÛ<80>è ^F \^DÔVn3л4µS<80>^P^@6<8d>¿^@^@^A^A^H IQRß^@g<9f><87>E^@^@4a^U@^@@^FÌý<80>è^AÛ<80>è ^F \^DÔVn3л4µT<80>^Q^@6<8d>½^@^@^A^A^H IQRß^@g<9f><87>E^@^@4,S@^@@^F^AÀ<80>è ^F<80>è^AÛ^DÔ \»4µTVn3Ñ<80>^P^@.<8d>Å^@^@^A^A^H ^@g<9f><87>IQRß This follows the format of the layout of packets in the IP Protocol: RFC 791 http://www.ietf.org/rfc/rfc0791.txt Of particular interest is the position of the packets in the Internet Protocol header on page 11. Currently I am just reading it by character but it's not working. I think I have to read 4bits/ 8bits at a time but I dont know how to do that. Please help! This is my code right now: #include <stdio.h> /* required for file operations */ int main(int argc, char *argv[]){ int n; FILE *fr; unsigned char c; if (argc != 2) { perror("Usage: summary <FILE>"); return 1; } fr = fopen (argv[1], "r"); /* open the file for reading */ printf("%lu" , sizeof(c)); while (!feof(fr)){ fread(&c, sizeof(c), 1, fr); printf("%c", (char)c); } fclose(fr); /* close the file prior to exiting the routine */
1
5,138,322
02/28/2011 04:53:14
593,318
01/28/2011 05:25:22
2
0
Routing Client to an IP in ASP
I need to extract Client IP address and his location. Based on his location I need to route client to specific IP adddress. I succeeded in getting client IP address and his location. Can anyone suggest me a way to route Client to specified IP. Also let me know a reliable web service which gives me accurate location based on IP address given. Thanking You.
asp.net
asp
ip
null
null
null
open
Routing Client to an IP in ASP === I need to extract Client IP address and his location. Based on his location I need to route client to specific IP adddress. I succeeded in getting client IP address and his location. Can anyone suggest me a way to route Client to specified IP. Also let me know a reliable web service which gives me accurate location based on IP address given. Thanking You.
0
8,193,503
11/19/2011 10:48:48
730,077
04/28/2011 20:40:27
99
0
Is there any reference for Nice-looking Dashboard?
I am developing an ASP.NET web application and now I am working on a dashboard. I googled to find a good reference where I can get some inspiration regarding the organization of the dashboard, but I could not be able to find anything. Please could you please provide me with some links for a nice-looking and well-organized dashboard which will help me in the page design of the dashboard that I am working on it right now?
asp.net
html
css
asp.net-charts
null
11/19/2011 14:09:22
off topic
Is there any reference for Nice-looking Dashboard? === I am developing an ASP.NET web application and now I am working on a dashboard. I googled to find a good reference where I can get some inspiration regarding the organization of the dashboard, but I could not be able to find anything. Please could you please provide me with some links for a nice-looking and well-organized dashboard which will help me in the page design of the dashboard that I am working on it right now?
2
5,605,067
04/09/2011 12:37:36
699,936
04/09/2011 12:27:28
1
0
c++:how to use it with switch statement ?!
Write an interactive program that computes the area of a rectangle (area= base * height) or a triangle (area=0.5 * base * height) after prompting the user to type the first character of the figure name (R or T ). Your program must display an error message to indicate that the user entered a character other than R or T.
c++
switch-statement
null
null
null
04/09/2011 18:38:31
not a real question
c++:how to use it with switch statement ?! === Write an interactive program that computes the area of a rectangle (area= base * height) or a triangle (area=0.5 * base * height) after prompting the user to type the first character of the figure name (R or T ). Your program must display an error message to indicate that the user entered a character other than R or T.
1
1,538,441
10/08/2009 15:08:22
161,628
08/23/2009 17:00:53
54
2
How good is this representation of a context free grammar for a parser?
i have shared the header file containing class definition of a Context Free grammar for a parser. Could you comment on the design. this code is for my lab assignment. may be we could get some good programming tips out of this code. is the class heirarchy good or too complicated. <code> #ifndef CFG_H #define CFG_H #include <iostream> #include <set> #include <list> using namespace std; class Terminal; class CfgSymbol { protected: char ch; set<Terminal*> first; set<Terminal*> follow; public: CfgSymbol() { ch = '\0'; } CfgSymbol(char c) : ch(c) { } virtual void computeFirst() = 0; }; class Terminal: public CfgSymbol { private: public: Terminal(): CfgSymbol() { } Terminal(char c) : CfgSymbol(c) { computeFirst(); } virtual void computeFirst() { first->insert(this); } }; class NonTerminal: public CfgSymbol { private: public: virtual void computeFirst(); virtual void computeFollow(); }; class SymbolString { public: CfgProduction* prd; list<CfgSymbol*> symstr; void computeFirst(); void computeFollow(); }; class CfgProduction { private: NonTerminal lhs; SymbolString rhs; public: int add_terminal(char t); int add_nonterminal(char n); int set_lhs(char c); }; class Cfg { public: vector<CfgProduction*> prdList; void addProduction(const CfgProduction& cfg); void computeFirst(); void computeFollow(); void computeFirstFollow(); }; #endif </code>
c++
parsing
software-engineering
null
null
null
open
How good is this representation of a context free grammar for a parser? === i have shared the header file containing class definition of a Context Free grammar for a parser. Could you comment on the design. this code is for my lab assignment. may be we could get some good programming tips out of this code. is the class heirarchy good or too complicated. <code> #ifndef CFG_H #define CFG_H #include <iostream> #include <set> #include <list> using namespace std; class Terminal; class CfgSymbol { protected: char ch; set<Terminal*> first; set<Terminal*> follow; public: CfgSymbol() { ch = '\0'; } CfgSymbol(char c) : ch(c) { } virtual void computeFirst() = 0; }; class Terminal: public CfgSymbol { private: public: Terminal(): CfgSymbol() { } Terminal(char c) : CfgSymbol(c) { computeFirst(); } virtual void computeFirst() { first->insert(this); } }; class NonTerminal: public CfgSymbol { private: public: virtual void computeFirst(); virtual void computeFollow(); }; class SymbolString { public: CfgProduction* prd; list<CfgSymbol*> symstr; void computeFirst(); void computeFollow(); }; class CfgProduction { private: NonTerminal lhs; SymbolString rhs; public: int add_terminal(char t); int add_nonterminal(char n); int set_lhs(char c); }; class Cfg { public: vector<CfgProduction*> prdList; void addProduction(const CfgProduction& cfg); void computeFirst(); void computeFollow(); void computeFirstFollow(); }; #endif </code>
0
7,204,572
08/26/2011 12:23:46
914,050
08/26/2011 12:23:46
1
0
collision detection in android for a simple game
i am making a game in which i have to check collision detection between a person which is moving vertically using touch event on button click and i have taken an array list to move multiple cars horizontally in a same lane. and I have used bitmaps to load images. how to check collision between both(person and car). Please suggest.
android
null
null
null
null
08/26/2011 21:56:22
not a real question
collision detection in android for a simple game === i am making a game in which i have to check collision detection between a person which is moving vertically using touch event on button click and i have taken an array list to move multiple cars horizontally in a same lane. and I have used bitmaps to load images. how to check collision between both(person and car). Please suggest.
1
11,152,343
06/22/2012 08:03:31
1,472,982
06/21/2012 18:14:09
8
0
cant put div below everything on page
my footer wont go to the bottom below everything. i dont want it fixed to the bottom of the browser [http://dl.dropbox.com/u/13722201/Dorset%20Designs/home.html][1] [1]: http://dl.dropbox.com/u/13722201/Dorset%20Designs/home.html
html
css
position
footer
null
null
open
cant put div below everything on page === my footer wont go to the bottom below everything. i dont want it fixed to the bottom of the browser [http://dl.dropbox.com/u/13722201/Dorset%20Designs/home.html][1] [1]: http://dl.dropbox.com/u/13722201/Dorset%20Designs/home.html
0
10,815,668
05/30/2012 11:47:04
1,225,602
02/22/2012 10:56:24
1
0
Amazon SES 3rd party software
i am looking for 3rd party software to manage campaigns, subscribers, track etc and all features of Amazon SES. I have found this one http://lin-pro.gigant.si/mpro/app-dashboard.php , but i cant see any statistics. anything familiar?
amazon
null
null
null
null
06/08/2012 14:22:52
not constructive
Amazon SES 3rd party software === i am looking for 3rd party software to manage campaigns, subscribers, track etc and all features of Amazon SES. I have found this one http://lin-pro.gigant.si/mpro/app-dashboard.php , but i cant see any statistics. anything familiar?
4
8,606,944
12/22/2011 16:34:41
205,103
11/06/2009 18:19:34
104
3
Git feature branches and minor code improvements
We just started using git for our production code, and we are running into a slight issue in our workflow. We need to figure out how to handle general code improvements / technical debt fixes that come up while working on a feature. The workflow we have adopted is to use 'develop' as the main integration branch and develop all features on feature branches off of 'develop'. When a feature is complete, the developer creates a pull request and everyone reviews it to provide comments before it is merged back into develop. This seems to be working very well. The issue we have is that during routine development on a feature, the developer may end up wanting to modify/refactor some common code to improve the system or clean up some technical debt. This change is valuable, but not directly tied to the feature under development. Based on our workflow, it should really be done on a different branch that goes through it's own pull request and code review before getting into develop. If we have them do this though, how can they get the change back over onto their feature branch in the meantime while they wait for the full code review to happen and the code to get merged into develop. The ideas we have are: 1) cherry-pick the changes from the 'refactorX' branch into our feature branch. Continue developing and let git (hopefully) figure out when we merge back to develop that it already has the change from the refactor branch. 2) Merge the 'refactorX' branch into our feature branch and continue development. (note: the branch off develop for 'refactorX' may have been later in the history of develop, so we think this may have problems) 3) Some other smarter option we don't know yet. :) What we are looking for is some best practice guidance on how to handle this part of the workflow. After talking about it more we know that it will come up frequently and we want to find a smooth and efficient way to handle it in our workflow. Any recommendations?
git
refactoring
workflow
branch
git-flow
null
open
Git feature branches and minor code improvements === We just started using git for our production code, and we are running into a slight issue in our workflow. We need to figure out how to handle general code improvements / technical debt fixes that come up while working on a feature. The workflow we have adopted is to use 'develop' as the main integration branch and develop all features on feature branches off of 'develop'. When a feature is complete, the developer creates a pull request and everyone reviews it to provide comments before it is merged back into develop. This seems to be working very well. The issue we have is that during routine development on a feature, the developer may end up wanting to modify/refactor some common code to improve the system or clean up some technical debt. This change is valuable, but not directly tied to the feature under development. Based on our workflow, it should really be done on a different branch that goes through it's own pull request and code review before getting into develop. If we have them do this though, how can they get the change back over onto their feature branch in the meantime while they wait for the full code review to happen and the code to get merged into develop. The ideas we have are: 1) cherry-pick the changes from the 'refactorX' branch into our feature branch. Continue developing and let git (hopefully) figure out when we merge back to develop that it already has the change from the refactor branch. 2) Merge the 'refactorX' branch into our feature branch and continue development. (note: the branch off develop for 'refactorX' may have been later in the history of develop, so we think this may have problems) 3) Some other smarter option we don't know yet. :) What we are looking for is some best practice guidance on how to handle this part of the workflow. After talking about it more we know that it will come up frequently and we want to find a smooth and efficient way to handle it in our workflow. Any recommendations?
0
6,513,483
06/28/2011 21:48:20
556,057
12/28/2010 14:05:07
8
2
How deleting a recorded video with ACTION_VIDEO_CAPTURE
I would like to remove a video that has been previously recorded using an Intent: Intent captureVideoIntent = new Intent( android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(captureVideoIntent, VIDEO_CAPTURED); The method onActivityResult() get the recorded video as Intent data. I try to obtain the recorded file and delete it. protected void onActivityResult(int requestCode, int resultCode, Intent data) { try { Uri uri = data.getData(); File file = new File(uri.toString()); file.delete(); } catch (Exception e) { e.printStackTrace(); } } No errors are shown in logcat but the file is not deleted. Does somebody know how can I get the path of the recorded video and delete it? Thanks in advance José
android
video
delete
android-intent
uri
null
open
How deleting a recorded video with ACTION_VIDEO_CAPTURE === I would like to remove a video that has been previously recorded using an Intent: Intent captureVideoIntent = new Intent( android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(captureVideoIntent, VIDEO_CAPTURED); The method onActivityResult() get the recorded video as Intent data. I try to obtain the recorded file and delete it. protected void onActivityResult(int requestCode, int resultCode, Intent data) { try { Uri uri = data.getData(); File file = new File(uri.toString()); file.delete(); } catch (Exception e) { e.printStackTrace(); } } No errors are shown in logcat but the file is not deleted. Does somebody know how can I get the path of the recorded video and delete it? Thanks in advance José
0
7,304,188
09/05/2011 05:34:11
905,230
07/05/2011 05:02:50
1
0
Android access files backed up in device through DDMS
How to access the files that are backed-up in Device, through DDMS? Thanks in Advance...
java
android
ddms
null
null
null
open
Android access files backed up in device through DDMS === How to access the files that are backed-up in Device, through DDMS? Thanks in Advance...
0
11,231,464
06/27/2012 17:02:37
937,365
09/09/2011 18:38:29
41
2
Is there a way to add microdata to an image referenced in CSS?
I am attempting to add itemprop="image" for a corporation's logo (as shown here: http://www.schema.org/Corporation), but I am using the Gantry Logo plugin from the Gantry framework for Wordpress. As a result, the image is actually loaded by a reference in CSS, and not using the HTML <img> tag. Unfortunately, it seems that the itemprop="image" can only be added to that tag, as that is where it grabs the URL from. Can anybody think of a way around this without attempting to hide a logo on the site and place the tag on it? (The site I am specifically referring to is http://www.bpsresolver.com for reference.)
css
html5
css3
microdata
schema.org
null
open
Is there a way to add microdata to an image referenced in CSS? === I am attempting to add itemprop="image" for a corporation's logo (as shown here: http://www.schema.org/Corporation), but I am using the Gantry Logo plugin from the Gantry framework for Wordpress. As a result, the image is actually loaded by a reference in CSS, and not using the HTML <img> tag. Unfortunately, it seems that the itemprop="image" can only be added to that tag, as that is where it grabs the URL from. Can anybody think of a way around this without attempting to hide a logo on the site and place the tag on it? (The site I am specifically referring to is http://www.bpsresolver.com for reference.)
0
4,664,929
01/12/2011 02:52:32
531,696
12/06/2010 03:18:20
1
0
Problem with accents in dynamic <select>
I have a form with a <select>, and I fill it with the result of a request in a database. My database, table and row format are UTF-8, and the browser too... But the accents appears like interrogation points... I don't understand why, could someone help me please ? Thanks!
php
mysql
html
character-encoding
null
null
open
Problem with accents in dynamic <select> === I have a form with a <select>, and I fill it with the result of a request in a database. My database, table and row format are UTF-8, and the browser too... But the accents appears like interrogation points... I don't understand why, could someone help me please ? Thanks!
0
11,127,393
06/20/2012 20:09:56
1,034,531
11/07/2011 21:08:24
13
0
LinkButton is not properly triggered
I'm going crazy about making this code to work. I got a simple link button that I add to a panel. When I click on the link, it's like something is trigger (whole page refresh and my link button disappear) but when I debug it, I never enter my DownloadItems function. LinkButton linkTest = new LinkButton(); linkTest.ID = "ID"; linkTest.Click += new EventHandler(DownloadItems); linkTest.Text = "Test"; In another page, everything is working great but I can't put my finger on it :s
asp.net
linkbutton
null
null
null
null
open
LinkButton is not properly triggered === I'm going crazy about making this code to work. I got a simple link button that I add to a panel. When I click on the link, it's like something is trigger (whole page refresh and my link button disappear) but when I debug it, I never enter my DownloadItems function. LinkButton linkTest = new LinkButton(); linkTest.ID = "ID"; linkTest.Click += new EventHandler(DownloadItems); linkTest.Text = "Test"; In another page, everything is working great but I can't put my finger on it :s
0
8,398,958
12/06/2011 11:11:38
34,537
11/05/2008 03:00:23
12,165
167
Trick Firefox into using pretty URLs?
In short, i am using an extension that depends on the page. I would like to use the extension for each board which means i need a board unique url. It currently looks like this http://phpbb-site.com/forum/viewforum.php?f=BOARDNUMBER I'd like to trick firefox into having BOARDNUMBER in the location part of the url. Then the extension will work and i wont have to tweak it. The problem is i cant think of any way i can have firefox use nice urls. I only need it to work on my computer and i dont own the site. What can i do? Can i use a proxy program? I was thinking maybe i can use write a quick asp.net program which essentially does a GET request on the said site and replace all link to include the boardnumber and ignore that part of the url when making the request. Its probably a bad idea bc i am sure lots can go wrong Any ideas?
firefox
hack
null
null
null
12/14/2011 20:41:16
not a real question
Trick Firefox into using pretty URLs? === In short, i am using an extension that depends on the page. I would like to use the extension for each board which means i need a board unique url. It currently looks like this http://phpbb-site.com/forum/viewforum.php?f=BOARDNUMBER I'd like to trick firefox into having BOARDNUMBER in the location part of the url. Then the extension will work and i wont have to tweak it. The problem is i cant think of any way i can have firefox use nice urls. I only need it to work on my computer and i dont own the site. What can i do? Can i use a proxy program? I was thinking maybe i can use write a quick asp.net program which essentially does a GET request on the said site and replace all link to include the boardnumber and ignore that part of the url when making the request. Its probably a bad idea bc i am sure lots can go wrong Any ideas?
1
9,870,780
03/26/2012 10:49:38
943,340
09/13/2011 20:19:04
1,085
3
Is W3C validation needed?
I wonder if W3C validation can assist better DOM rendering OR it is just a standard for html coding. I tried to validate major websites but all of them fail by serious errors. Here is typical examples: google.com **36 Errors, 2 warning(s)** facebook.com **42 Errors** youtube.com **91 Errors, 3 warning(s)** yahoo.com **212 Errors, 8 warning(s)** amazon.com **510 Errors, 138 warning(s)** When major websites do not see necessity to spending time for W3C validation, is it needed to spend time to do so for small and medium websites?
html
dom
w3c
w3c-validation
null
04/09/2012 19:55:14
not constructive
Is W3C validation needed? === I wonder if W3C validation can assist better DOM rendering OR it is just a standard for html coding. I tried to validate major websites but all of them fail by serious errors. Here is typical examples: google.com **36 Errors, 2 warning(s)** facebook.com **42 Errors** youtube.com **91 Errors, 3 warning(s)** yahoo.com **212 Errors, 8 warning(s)** amazon.com **510 Errors, 138 warning(s)** When major websites do not see necessity to spending time for W3C validation, is it needed to spend time to do so for small and medium websites?
4
8,550,277
12/18/2011 06:38:30
1,104,236
12/18/2011 06:24:38
1
0
What is the best iTunes U videos for new programers?
New programer, I know nothing about programing. I am starting watching iTunes U videos on Objective-Oriented before trying to learning Obective-C. No idea what I'm getting my self into just young and have some time to learn something that interests me. Looking for tips or suggestion on where to start.
iphone
objective-c
ios5
null
null
12/18/2011 07:26:44
not constructive
What is the best iTunes U videos for new programers? === New programer, I know nothing about programing. I am starting watching iTunes U videos on Objective-Oriented before trying to learning Obective-C. No idea what I'm getting my self into just young and have some time to learn something that interests me. Looking for tips or suggestion on where to start.
4
5,280,065
03/12/2011 01:01:05
66,580
02/15/2009 04:59:24
862
44
Javascript - Set timezone for script instance
In a flot graph depending on the viewers timezone setting the points may or may not fall on vertical grid bars. Actually, only when the local timezone is set to utc the points are on the date bars. This does make sense as the time the sample refers to is not the same clock-time in all timezones. However, for an application I want to turn this behavior off and display the same graph whatever the local machine's timezone is. For that I thought I might be somehow able to set the timezone for the script to UTC (not changing the setting in Windows. Is this possible?
javascript
date
timezone
flot
null
null
open
Javascript - Set timezone for script instance === In a flot graph depending on the viewers timezone setting the points may or may not fall on vertical grid bars. Actually, only when the local timezone is set to utc the points are on the date bars. This does make sense as the time the sample refers to is not the same clock-time in all timezones. However, for an application I want to turn this behavior off and display the same graph whatever the local machine's timezone is. For that I thought I might be somehow able to set the timezone for the script to UTC (not changing the setting in Windows. Is this possible?
0
11,625,252
07/24/2012 06:24:19
1,547,672
07/24/2012 05:44:21
1
0
ios send data to website and handle response
Ok, brand new to iPhone development, basically have done the Stanford ios course but that's it. Looking to try a useful app now. Was looking for ideas and my wife suggested doing something that would warn people there are Amber Alerts. Quick search reveals there is one already, but it is based on ios 2.0, before PUSH notification, so user has to check the app to know if there is an Amber Alert. So not very useful for the purpose, would like to update it and provide it to the Amber Alert people for free. Link to original app (with useful screenshots): http://itunes.apple.com/us/app/amber-alert/id305574085?mt=8 I am looking to extend the app beyond the original, but I like how it currently lets you view missing children. Looks like it uses this database: http://www.ncmec.org/missingkids/servlet/PubCaseSearchServlet I'm brand new to this, so it feels like I'm drinking from a firehose on trying to figure out how the user might have done this (there may be dozens). I don't have access to the server involved, and obviously no change is really needed since it works for the original app. Just looking for some possibilities on how I might send data to a web server that I don't control, with effectively form data, and take the response and filter it. High level responses are welcome, I'd like to research the details, just not sure where to start. Thanks!
iphone
ios
database
null
null
07/24/2012 11:57:24
not a real question
ios send data to website and handle response === Ok, brand new to iPhone development, basically have done the Stanford ios course but that's it. Looking to try a useful app now. Was looking for ideas and my wife suggested doing something that would warn people there are Amber Alerts. Quick search reveals there is one already, but it is based on ios 2.0, before PUSH notification, so user has to check the app to know if there is an Amber Alert. So not very useful for the purpose, would like to update it and provide it to the Amber Alert people for free. Link to original app (with useful screenshots): http://itunes.apple.com/us/app/amber-alert/id305574085?mt=8 I am looking to extend the app beyond the original, but I like how it currently lets you view missing children. Looks like it uses this database: http://www.ncmec.org/missingkids/servlet/PubCaseSearchServlet I'm brand new to this, so it feels like I'm drinking from a firehose on trying to figure out how the user might have done this (there may be dozens). I don't have access to the server involved, and obviously no change is really needed since it works for the original app. Just looking for some possibilities on how I might send data to a web server that I don't control, with effectively form data, and take the response and filter it. High level responses are welcome, I'd like to research the details, just not sure where to start. Thanks!
1
8,674,816
12/29/2011 23:46:35
1,108,913
12/21/2011 00:29:44
11
0
Proper programming procedure in relation to OO?
I am new to programming for the most part. I'm writing a practice IOS app. I have two objects right now. A character class and an enemy class. The user is the character class and the enemy is the computer. The programming is basically a combat program. What i am wondering is would it be best to handle all the combat related interactions between the two objects in the appdelegat.m file or try and create another class that handles that, or does it really matter?
ios
null
null
null
null
12/30/2011 00:59:58
not constructive
Proper programming procedure in relation to OO? === I am new to programming for the most part. I'm writing a practice IOS app. I have two objects right now. A character class and an enemy class. The user is the character class and the enemy is the computer. The programming is basically a combat program. What i am wondering is would it be best to handle all the combat related interactions between the two objects in the appdelegat.m file or try and create another class that handles that, or does it really matter?
4
8,793,553
01/09/2012 18:50:37
723,998
04/25/2011 16:32:59
139
3
What is the "elapsed time" in django-debug-toolbar?
What sort of stuff is going on in the "elapsed time" value in the Django Debug Toolbar? I assume CPU time is a part of it, but what else is going on? The more explicit you can be, the more it'll help!! Resource Value User CPU time 110.000 msec System CPU time 50.000 msec Total CPU time 160.000 msec Elapsed time 1855.731 msec Context switches 74 voluntary, 80 involuntary FYI: I've seen [this][1] but still don't really get what's going on. [1]: http://stackoverflow.com/questions/8232434/django-debug-toolbar-understanding-the-time-panel
django
performance
django-debug-toolbar
null
null
null
open
What is the "elapsed time" in django-debug-toolbar? === What sort of stuff is going on in the "elapsed time" value in the Django Debug Toolbar? I assume CPU time is a part of it, but what else is going on? The more explicit you can be, the more it'll help!! Resource Value User CPU time 110.000 msec System CPU time 50.000 msec Total CPU time 160.000 msec Elapsed time 1855.731 msec Context switches 74 voluntary, 80 involuntary FYI: I've seen [this][1] but still don't really get what's going on. [1]: http://stackoverflow.com/questions/8232434/django-debug-toolbar-understanding-the-time-panel
0
10,277,496
04/23/2012 08:55:20
985,869
10/08/2011 22:33:09
31
1
Multiple ListViews using android simpleCursorAdapter
I need to display multiple ListViews in one activity using data from a database query for each ListView, but I cannot get two ListViews to show at the same time using the following code, can some one please confirm if it is possible to use the SimpleCursorAdapter in this way and if so what is wrong with my code below: My XML: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" > <ListView android:id="@+id/symptomsList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible"> </ListView> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" > <ListView android:id="@+id/syndromesList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible"> </ListView> </LinearLayout> </LinearLayout> And the java: import android.app.Activity; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class TestActivity extends Activity { ListView symptomsList; ListView syndromesList; SimpleCursorAdapter adapter; SimpleCursorAdapter adapter2; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test); // Find views symptomsList = (ListView) findViewById(R.id.symptomsList); syndromesList = (ListView) findViewById(R.id.syndromesList); SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase(); Cursor cursor = db.rawQuery("SELECT _id, symname FROM tblsymptoms WHERE _id = 1", null); adapter = new SimpleCursorAdapter( this, R.layout.test_list_item, cursor, new String[] {"symname"}, new int[] {R.id.text1,}); symptomsList.setAdapter(adapter); Cursor cursor2 = db.rawQuery("SELECT tblsyndromes._id, tblsyndromes.synname FROM tblsyndromes WHERE _id = 1", null); adapter2 = new SimpleCursorAdapter( this, android.R.layout.simple_list_item_multiple_choice, cursor2, new String[] {"synname", "_id"}, new int[] {android.R.id.text1, android.R.id.text2}); symptomsList.setAdapter(adapter2); symptomsList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } }
android
listview
simplecursoradapter
null
null
null
open
Multiple ListViews using android simpleCursorAdapter === I need to display multiple ListViews in one activity using data from a database query for each ListView, but I cannot get two ListViews to show at the same time using the following code, can some one please confirm if it is possible to use the SimpleCursorAdapter in this way and if so what is wrong with my code below: My XML: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" > <ListView android:id="@+id/symptomsList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible"> </ListView> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" > <ListView android:id="@+id/syndromesList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="visible"> </ListView> </LinearLayout> </LinearLayout> And the java: import android.app.Activity; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class TestActivity extends Activity { ListView symptomsList; ListView syndromesList; SimpleCursorAdapter adapter; SimpleCursorAdapter adapter2; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test); // Find views symptomsList = (ListView) findViewById(R.id.symptomsList); syndromesList = (ListView) findViewById(R.id.syndromesList); SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase(); Cursor cursor = db.rawQuery("SELECT _id, symname FROM tblsymptoms WHERE _id = 1", null); adapter = new SimpleCursorAdapter( this, R.layout.test_list_item, cursor, new String[] {"symname"}, new int[] {R.id.text1,}); symptomsList.setAdapter(adapter); Cursor cursor2 = db.rawQuery("SELECT tblsyndromes._id, tblsyndromes.synname FROM tblsyndromes WHERE _id = 1", null); adapter2 = new SimpleCursorAdapter( this, android.R.layout.simple_list_item_multiple_choice, cursor2, new String[] {"synname", "_id"}, new int[] {android.R.id.text1, android.R.id.text2}); symptomsList.setAdapter(adapter2); symptomsList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } }
0
2,893,038
05/23/2010 19:08:00
224,386
12/03/2009 23:56:44
30
0
combobox inserting consecutive variables
I have a question about combobox.I use visual c# and I want to insert consecutive numbers (1 to 100) in combobox.How can I do this?
combobox
null
null
null
null
null
open
combobox inserting consecutive variables === I have a question about combobox.I use visual c# and I want to insert consecutive numbers (1 to 100) in combobox.How can I do this?
0
10,257,008
04/21/2012 07:03:31
949,995
09/17/2011 07:20:00
3
0
Unable to find uploaded file inside Update panel
aspx: <asp:UpdatePanel ID="updtEmpMaster" runat="server"> <ContentTemplate> <asp:FileUpload ID="tPhoto" Height="23px" runat="server" /> <asp:Button ID="Button1" CssClass="btnImage" runat="server" Text="OK" onclick="Button1_Click" /> </ContentTemplate> </asp:UpdatePanel> aspx.cs: protected void Button1_Click(object sender, EventArgs e) { if (tPhoto.HasFile) { …………………..; } else { …………………..; } } Here if condition is failing even after an image file is uploaded. No problem when using without Update panel. Update panel is also needed in current scenario. Any way I can have solution with Update panel. Any help will be highly appreciated. Thanks in advance :)
c#
asp.net
.net
updatepanel
null
null
open
Unable to find uploaded file inside Update panel === aspx: <asp:UpdatePanel ID="updtEmpMaster" runat="server"> <ContentTemplate> <asp:FileUpload ID="tPhoto" Height="23px" runat="server" /> <asp:Button ID="Button1" CssClass="btnImage" runat="server" Text="OK" onclick="Button1_Click" /> </ContentTemplate> </asp:UpdatePanel> aspx.cs: protected void Button1_Click(object sender, EventArgs e) { if (tPhoto.HasFile) { …………………..; } else { …………………..; } } Here if condition is failing even after an image file is uploaded. No problem when using without Update panel. Update panel is also needed in current scenario. Any way I can have solution with Update panel. Any help will be highly appreciated. Thanks in advance :)
0
7,114,313
08/18/2011 21:22:27
119,851
06/09/2009 13:47:58
166
11
Can SELECT but can't DELETE
I'm having difficulty deleting the desired rows from my table in MySQL. I'm using a rather complex subquery to select the rows, but for some reason I'm unable to delete them using a similar syntax. delete * from table1 as t1 where t1.col1 in (select y.col1 from table2 x join (select col1, col2 from table2 where col2 like "%- 2%") y on x.col2 = replace(y.col2, "- 2", "")); Again, I can select the exact rows I wanted deleted, but when I change the query to delete I get the following error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... Any help is greatly appreciated.
mysql
join
delete
subquery
null
null
open
Can SELECT but can't DELETE === I'm having difficulty deleting the desired rows from my table in MySQL. I'm using a rather complex subquery to select the rows, but for some reason I'm unable to delete them using a similar syntax. delete * from table1 as t1 where t1.col1 in (select y.col1 from table2 x join (select col1, col2 from table2 where col2 like "%- 2%") y on x.col2 = replace(y.col2, "- 2", "")); Again, I can select the exact rows I wanted deleted, but when I change the query to delete I get the following error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... Any help is greatly appreciated.
0
7,492,707
09/20/2011 22:46:48
24,126
10/01/2008 13:10:17
3,836
129
windows service (C#) - can you use WCF connection to get your connecting IP address?
I have a Windows Service (.NET 3.5/C#) which is connecting to a WCF service on a external server on the public internet. Can I use that WCF connection to get my computer's external IP address? The WCF service is hosted inside IIS on our application server. Can I do anything with that to get my external IP address?
.net
wcf
ip-address
null
null
null
open
windows service (C#) - can you use WCF connection to get your connecting IP address? === I have a Windows Service (.NET 3.5/C#) which is connecting to a WCF service on a external server on the public internet. Can I use that WCF connection to get my computer's external IP address? The WCF service is hosted inside IIS on our application server. Can I do anything with that to get my external IP address?
0
10,351,910
04/27/2012 13:51:20
1,263,516
03/12/2012 07:22:42
11
0
How to use output from a splited sms
How can l capture the output from a split and use it for example as an action or comparing with data in the database String myString = (msg.getText()); String[] a = myString.split("\\*"); for (String b : a) { System.out.println(b); the output is: pay merchant amount want to use pay as an action and amount to increase the amount of the merchant in the database
java
netbeans
sms
sms-gateway
null
04/27/2012 15:43:48
not a real question
How to use output from a splited sms === How can l capture the output from a split and use it for example as an action or comparing with data in the database String myString = (msg.getText()); String[] a = myString.split("\\*"); for (String b : a) { System.out.println(b); the output is: pay merchant amount want to use pay as an action and amount to increase the amount of the merchant in the database
1
8,146,830
11/16/2011 04:41:07
825,757
07/02/2011 04:22:41
515
21
When and If to upgrade jQuery?
I am running jQuery 1.5 on my site and I know that jQuery 1.7 is available. At what point is it advisable to upgrade the jQuery library? I know I can view the changes and see what new features are available or bugs are fixed etc but is there a general rule of thumb when upgrading? And should I always upgrade to the latest or wait a bit before upgrading?
jquery
upgrading
null
null
null
11/16/2011 04:57:30
not constructive
When and If to upgrade jQuery? === I am running jQuery 1.5 on my site and I know that jQuery 1.7 is available. At what point is it advisable to upgrade the jQuery library? I know I can view the changes and see what new features are available or bugs are fixed etc but is there a general rule of thumb when upgrading? And should I always upgrade to the latest or wait a bit before upgrading?
4
6,181,594
05/30/2011 23:29:37
391,104
07/14/2010 01:45:37
2,266
1
Are these checking on the pass-in parameters necessary?
I have listed five different scenarios that I think the null-checking is necessary in the product code. Although, most of the reference books I have checked do NOT make such checkings. It is reasonable to ignore those checking while the original reference tries to deliver the other important ideas. Here, I summarize all my concerns as follows and please correct me if there are errors. class Student { public string Name { get; set; } public Student(string name) { Name = name; } public Student() { } public override string ToString() { return string.Format("Name: {0}", Name); } } class StudentNameComparer : IComparer<Student> { public int Compare(Student x, Student y) { if ( (x == null) || (y == null) ) // <C1> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); } } //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; students.Sort(delegate(Student x, Student y) { if ( (x == null) || (y == null) ) // <C2> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; students.Sort( (x, y) => { if ( (x == null) || (y == null) ) // <C3-1> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); Or students.Sort( (Student x, Student y) => { if ( (x == null) || (y == null) ) // <C3-2> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; foreach (Student std in students.OrderBy(p => { if (p == null) // <C4> Should we check there? { throw new ArgumentNullException("..."); } return p.Name; })) { Console.WriteLine(std); }
c#
null
null
null
null
null
open
Are these checking on the pass-in parameters necessary? === I have listed five different scenarios that I think the null-checking is necessary in the product code. Although, most of the reference books I have checked do NOT make such checkings. It is reasonable to ignore those checking while the original reference tries to deliver the other important ideas. Here, I summarize all my concerns as follows and please correct me if there are errors. class Student { public string Name { get; set; } public Student(string name) { Name = name; } public Student() { } public override string ToString() { return string.Format("Name: {0}", Name); } } class StudentNameComparer : IComparer<Student> { public int Compare(Student x, Student y) { if ( (x == null) || (y == null) ) // <C1> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); } } //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; students.Sort(delegate(Student x, Student y) { if ( (x == null) || (y == null) ) // <C2> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; students.Sort( (x, y) => { if ( (x == null) || (y == null) ) // <C3-1> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); Or students.Sort( (Student x, Student y) => { if ( (x == null) || (y == null) ) // <C3-2> Should we check there? throw new ArugmentNullException("bla bla"); return x.Name.CompareTo(y.Name); }); //////////////////////////////////////////////////// List<Student> students = new List<Student> { new Student("s1"), new Student("s4"), new Student("s3"), new Student("s2") }; foreach (Student std in students.OrderBy(p => { if (p == null) // <C4> Should we check there? { throw new ArgumentNullException("..."); } return p.Name; })) { Console.WriteLine(std); }
0
7,044,469
08/12/2011 18:12:42
892,273
08/12/2011 18:12:42
1
0
Audio Description track or extra audio track
The only thing keeping me from using this on all websites right now is lack of Audio Description or second audio track support. (Federal Gov't websites are my focus). Love the player. Is there any chance of support for this being added?
audio
accessibility
null
null
null
08/12/2011 18:46:03
not a real question
Audio Description track or extra audio track === The only thing keeping me from using this on all websites right now is lack of Audio Description or second audio track support. (Federal Gov't websites are my focus). Love the player. Is there any chance of support for this being added?
1
11,396,155
07/09/2012 13:36:00
152,949
08/08/2009 11:22:21
1,270
83
Is my stack memory space bloated?
What warning signs are there that my stack memory space is bloated, and at what point should I start using heap memory? And, are there differences between processors, I'm thinking about stack size limitations?
c++
stack
heap
null
null
07/09/2012 17:13:50
not constructive
Is my stack memory space bloated? === What warning signs are there that my stack memory space is bloated, and at what point should I start using heap memory? And, are there differences between processors, I'm thinking about stack size limitations?
4
5,771,908
04/24/2011 17:00:17
150,978
08/05/2009 11:34:24
1,183
91
Computing a polygon that surrounds a multi-point line
I am trying to compute a polygon that surrounds a line connecting multiple points (e.g. a GPX track). The image below shows an example with the track as red line and the desired polygon in blue. ![Example of a track (red line) and a rough estimated polygon surrounding the track][1] As simplification the red points are denoted by x and y - not by latitude/longitude. How do I compute such an environment if I only have the list of the tree points specifying the path? Partial solutions (e.g. for only two points) or hints about mathematical libraries (in Java) that provide algorithms for such a computation would also bring me one step forward. [1]: http://i.stack.imgur.com/s0Np3.png
java
math
polygon
null
null
null
open
Computing a polygon that surrounds a multi-point line === I am trying to compute a polygon that surrounds a line connecting multiple points (e.g. a GPX track). The image below shows an example with the track as red line and the desired polygon in blue. ![Example of a track (red line) and a rough estimated polygon surrounding the track][1] As simplification the red points are denoted by x and y - not by latitude/longitude. How do I compute such an environment if I only have the list of the tree points specifying the path? Partial solutions (e.g. for only two points) or hints about mathematical libraries (in Java) that provide algorithms for such a computation would also bring me one step forward. [1]: http://i.stack.imgur.com/s0Np3.png
0
10,499,347
05/08/2012 13:13:52
992,808
10/13/2011 06:21:54
15
0
How to Add a spray painting gradient to half of the webpage?
I want to make a background spray painting gradient only on top half of my website's homepage. Something similar to background of [this website][1]. Can someone please help me to do this with cross browser support? [1]: http://taylorstitch.com/
html
css
null
null
null
null
open
How to Add a spray painting gradient to half of the webpage? === I want to make a background spray painting gradient only on top half of my website's homepage. Something similar to background of [this website][1]. Can someone please help me to do this with cross browser support? [1]: http://taylorstitch.com/
0
11,344,486
07/05/2012 12:36:26
1,463,701
06/18/2012 12:44:13
23
2
How to Bypass Cakephp Controller?
I am opening a website in my web frame in cakephp and it is opening fine but problem is when i try to click on any link on that website i get Missing Controller error on that web frame. Please Help.
cakephp
controller
frame
null
null
07/06/2012 10:41:46
not a real question
How to Bypass Cakephp Controller? === I am opening a website in my web frame in cakephp and it is opening fine but problem is when i try to click on any link on that website i get Missing Controller error on that web frame. Please Help.
1
7,780,767
10/15/2011 21:31:31
630,588
02/23/2011 16:38:34
879
30
Rails where with join, but return object of parent?
Suppose I have a class that represents a list of movies, belonging to a user: class User < ActiveRecord::Base has_one :movie_list end class MovieList < ActiveRecord::Base belongs_to :user has_many :movie_list_movie_relationships has_many :movies, :through => :movie_list_movie_relationships end class Movie < ActiveRecord::Base has_many :movie_list_movie_relationships has_many :movie_lists, :through => :movie_list_movie_relationships end class MovieListMovieRelationship < ActiveRecord::Base belongs_to :movie belongs_to :movie_list end Is there any way to have a method on MovieList that returns a MovieList containing only movies with, for example, a specific release year. I want something like: class MovieList < ActiveRecord::Base .... def for_year year movies.where(:year => year) end end EXCEPT that I want the result to be a MovieList itself, whereas this returns an array of Movies. So I could do, for example: list = User.first.movie_list.for_year(1999) list.id # would give the id of the MovieList = User.first.movie_list.id list.movies.first.id # would give the id of the first movie in list I have a feeling that I'm either a) faced with this problem because my design is bad, and it would be great if someone could explain how I *should* design this, or b) asking for something relatively mundane but I just don't know the right terminology. Thanks!
ruby-on-rails
join
null
null
null
null
open
Rails where with join, but return object of parent? === Suppose I have a class that represents a list of movies, belonging to a user: class User < ActiveRecord::Base has_one :movie_list end class MovieList < ActiveRecord::Base belongs_to :user has_many :movie_list_movie_relationships has_many :movies, :through => :movie_list_movie_relationships end class Movie < ActiveRecord::Base has_many :movie_list_movie_relationships has_many :movie_lists, :through => :movie_list_movie_relationships end class MovieListMovieRelationship < ActiveRecord::Base belongs_to :movie belongs_to :movie_list end Is there any way to have a method on MovieList that returns a MovieList containing only movies with, for example, a specific release year. I want something like: class MovieList < ActiveRecord::Base .... def for_year year movies.where(:year => year) end end EXCEPT that I want the result to be a MovieList itself, whereas this returns an array of Movies. So I could do, for example: list = User.first.movie_list.for_year(1999) list.id # would give the id of the MovieList = User.first.movie_list.id list.movies.first.id # would give the id of the first movie in list I have a feeling that I'm either a) faced with this problem because my design is bad, and it would be great if someone could explain how I *should* design this, or b) asking for something relatively mundane but I just don't know the right terminology. Thanks!
0
10,818,000
05/30/2012 14:09:46
1,326,441
04/11/2012 11:34:54
1
0
.serialize() an array of variables in Javascript
I have a list of variables available to me and I want to send it via $.ajax post. What format would I have to keep these in to use the function .serialize? I keep getting this error: Object 'blank' has no method 'serialize' I've tried to make them an array and I've tried jQuery.param(). I have a feeling this is simple but I can't seem to get it. Thanks! var $data = jQuery.makeArray(attachmentId = attachmentID, action = 'rename', oldName = filename, newName, bucketName, oldFolderName, newFolderName, projectId = PID, businessId = BID); var serializedData = $data.serializeArray(); //alert(theurl); $.ajax({ type: "post", url: theurl, data: serializedData, dataType: 'json', success: reCreateTree });
javascript
jquery-ajax
serialization
null
null
null
open
.serialize() an array of variables in Javascript === I have a list of variables available to me and I want to send it via $.ajax post. What format would I have to keep these in to use the function .serialize? I keep getting this error: Object 'blank' has no method 'serialize' I've tried to make them an array and I've tried jQuery.param(). I have a feeling this is simple but I can't seem to get it. Thanks! var $data = jQuery.makeArray(attachmentId = attachmentID, action = 'rename', oldName = filename, newName, bucketName, oldFolderName, newFolderName, projectId = PID, businessId = BID); var serializedData = $data.serializeArray(); //alert(theurl); $.ajax({ type: "post", url: theurl, data: serializedData, dataType: 'json', success: reCreateTree });
0
11,487,241
07/14/2012 20:39:14
1,306,067
04/01/2012 08:28:46
34
1
C/C++ Matrix Algorithm
I have a matrix that looks like this (the letters and numbers beside it are indexes): A B C 1 {2, 0, 2} 2 {1, 0, 1} A couple of terms that will be used in the problem: A ***pair*** is a pair of a letter and a number. The number always comes first. Each pair is basically an index to an element. (e.g. **1A** = 2, **2B** = 0, **1C** = 2, etc.). A ***command*** is a pair of two pairs. The "syntax" is [*sourcePair*][*destinationPair*]. **The *sourcePair* always has to be a non-zero value while the *destinationPair* always has to be a zero value. This of course also prevents you from using the same pair as the *sourcePair* and the *destinationPair*.** It works like this: whatever value is in the *sourcePair* (either 1 or 2) will be moved into the *destinationPair* and then the *sourcePair* will be set to 0 (it will modify the matrix). (e.g. **1A1B** -> 1B = 2, 1A = 0; **1C2B** -> 2B = 2, 1C = 0; etc.). A ***key*** is a set of 16 commands (64 characters in total). ***GOAL***: To find all of the possible combinations for the key that will make the matrix look like this: A B C 1 {1, 0, 1} 2 {2, 0, 2} The rows of the matrix are basically swapped. The algorithm doesn't have to be super-efficient as I will only be printing the key when the user presses a button. Also the key has to be **exactly** 16 commands long (64 characters). It doesn't matter if you for example use the first x commands to do something just to occupy some space and then use y commands to do the actual thing. Thanks for reading, Tuntuni.
c++
c
algorithm
matrix
null
07/16/2012 00:23:55
not a real question
C/C++ Matrix Algorithm === I have a matrix that looks like this (the letters and numbers beside it are indexes): A B C 1 {2, 0, 2} 2 {1, 0, 1} A couple of terms that will be used in the problem: A ***pair*** is a pair of a letter and a number. The number always comes first. Each pair is basically an index to an element. (e.g. **1A** = 2, **2B** = 0, **1C** = 2, etc.). A ***command*** is a pair of two pairs. The "syntax" is [*sourcePair*][*destinationPair*]. **The *sourcePair* always has to be a non-zero value while the *destinationPair* always has to be a zero value. This of course also prevents you from using the same pair as the *sourcePair* and the *destinationPair*.** It works like this: whatever value is in the *sourcePair* (either 1 or 2) will be moved into the *destinationPair* and then the *sourcePair* will be set to 0 (it will modify the matrix). (e.g. **1A1B** -> 1B = 2, 1A = 0; **1C2B** -> 2B = 2, 1C = 0; etc.). A ***key*** is a set of 16 commands (64 characters in total). ***GOAL***: To find all of the possible combinations for the key that will make the matrix look like this: A B C 1 {1, 0, 1} 2 {2, 0, 2} The rows of the matrix are basically swapped. The algorithm doesn't have to be super-efficient as I will only be printing the key when the user presses a button. Also the key has to be **exactly** 16 commands long (64 characters). It doesn't matter if you for example use the first x commands to do something just to occupy some space and then use y commands to do the actual thing. Thanks for reading, Tuntuni.
1
11,288,185
07/02/2012 05:30:19
1,343,543
04/19/2012 09:17:54
1
0
How to overcome slow xml parse on remote server using simplexml
I am using simpleXML lib to parser different XML using xpath ( followed: http://www.w3schools.com/php/func_simplexml_xpath.asp ), i.e. golden deals and groupon. The Golden deals XML parsing is taking time in few seconds while the groupon XML is taking time in hours. What could be the problem and what shall i do to overcome this problem. Any other suggestions? If you say I may send you both XML's through email. Thanks.
xml
xpath
simplexml
null
null
07/03/2012 20:34:29
too localized
How to overcome slow xml parse on remote server using simplexml === I am using simpleXML lib to parser different XML using xpath ( followed: http://www.w3schools.com/php/func_simplexml_xpath.asp ), i.e. golden deals and groupon. The Golden deals XML parsing is taking time in few seconds while the groupon XML is taking time in hours. What could be the problem and what shall i do to overcome this problem. Any other suggestions? If you say I may send you both XML's through email. Thanks.
3
10,967,060
06/10/2012 07:36:28
261,521
01/29/2010 02:52:21
441
7
What's a better way to organise the object's prototype [Javascript]?
This is how i attempt to organise the prototypes: However I have to write an additional "methods" properties to access prototype's function is rather inefficient. var Gallery = function(name) { this.name = name; } Gallery.prototype.methods = { activeCnt: 0, inc: function() { this.activeCnt++; }, dec: function() { this.activeCnt--; }, talk: function() { alert(this.activeCnt); } } var artGallery = new Gallery('art'); var carGallery = new Gallery('car'); artGallery.methods.inc(); artGallery.methods.talk(); carGallery.methods.talk();​
javascript
null
null
null
null
06/10/2012 10:12:58
not a real question
What's a better way to organise the object's prototype [Javascript]? === This is how i attempt to organise the prototypes: However I have to write an additional "methods" properties to access prototype's function is rather inefficient. var Gallery = function(name) { this.name = name; } Gallery.prototype.methods = { activeCnt: 0, inc: function() { this.activeCnt++; }, dec: function() { this.activeCnt--; }, talk: function() { alert(this.activeCnt); } } var artGallery = new Gallery('art'); var carGallery = new Gallery('car'); artGallery.methods.inc(); artGallery.methods.talk(); carGallery.methods.talk();​
1
7,454,018
09/17/2011 10:15:41
755,405
05/16/2011 09:14:15
11
2
Using AndroidAnnotations with Scala and Gradle
Is it possible to use AndroidAnnotations with the Scala programming language and the Gradle build system? When I try to integrate AndroidAnnotations into my existing Android/Scala/Gradle project, then compilation fails because the generated underscore classes (e.g. MyActivity_) can not be found.
android
scala
annotations
gradle
null
null
open
Using AndroidAnnotations with Scala and Gradle === Is it possible to use AndroidAnnotations with the Scala programming language and the Gradle build system? When I try to integrate AndroidAnnotations into my existing Android/Scala/Gradle project, then compilation fails because the generated underscore classes (e.g. MyActivity_) can not be found.
0
3,721,138
09/15/2010 19:33:39
106,403
05/13/2009 15:27:44
3,871
194
Changed Background Color of Element when Disabled
How would I change the background color of a TextBox Control in the Default Style Xaml to be a different color when the control is either Disabled or ReadOnly ?
c#
silverlight
xaml
null
null
null
open
Changed Background Color of Element when Disabled === How would I change the background color of a TextBox Control in the Default Style Xaml to be a different color when the control is either Disabled or ReadOnly ?
0
5,180,187
03/03/2011 11:35:50
642,866
03/03/2011 11:14:47
1
0
Andriod Accelerometer
hey guys i am trying to build a app for reading the values from the accelerometer on my phone which supports anroid2.1 only!.. can someone help me and provide the code.. really in fix here!
accelerometer
null
null
null
null
null
open
Andriod Accelerometer === hey guys i am trying to build a app for reading the values from the accelerometer on my phone which supports anroid2.1 only!.. can someone help me and provide the code.. really in fix here!
0
9,118,619
02/02/2012 19:26:11
1,185,834
02/02/2012 18:10:18
1
0
What is the best way to populate an ember object with JSON data coming from an AJAX call (XHR request)?
We have an ember object, which we want to populate with data coming from an AJAX call: window.App = Ember.Application.create( { rootElement: '#container' } ); App.WindowDetail = Ember.Object.create({ ID: "", Title: "", InteriorFinishesDescription: "" }); Currently, we are getting JSON data via an AJAX call in this manner: $(window).load(function () { //Call the page method $.ajax({ type: "POST", url: "TestController.aspx", //contentType: "application/json; charset=utf-8", data: "asaw", dataType: "json", success: function (r) { App.WindowDetail.InteriorFinishesDescription = r.InteriorFinishesDescription; alert(App.WindowDetail.InteriorFinishesDescription); } }); }); In this sample, the JSON data comes back fine -- "App.WindowDetail.InteriorFinishesDescription" gets populated. The problem is that the template doesn't get populated. And, I don't think this is exactly the correct way to get JSON data back when using Ember JS. Here's a sample of what the handlebars template looks like: <script type="text/x-handlebars"> <div class="two columns"> {{App.WindowDetail.InteriorFinishesDescription}} </div> </script>
emberjs
null
null
null
null
null
open
What is the best way to populate an ember object with JSON data coming from an AJAX call (XHR request)? === We have an ember object, which we want to populate with data coming from an AJAX call: window.App = Ember.Application.create( { rootElement: '#container' } ); App.WindowDetail = Ember.Object.create({ ID: "", Title: "", InteriorFinishesDescription: "" }); Currently, we are getting JSON data via an AJAX call in this manner: $(window).load(function () { //Call the page method $.ajax({ type: "POST", url: "TestController.aspx", //contentType: "application/json; charset=utf-8", data: "asaw", dataType: "json", success: function (r) { App.WindowDetail.InteriorFinishesDescription = r.InteriorFinishesDescription; alert(App.WindowDetail.InteriorFinishesDescription); } }); }); In this sample, the JSON data comes back fine -- "App.WindowDetail.InteriorFinishesDescription" gets populated. The problem is that the template doesn't get populated. And, I don't think this is exactly the correct way to get JSON data back when using Ember JS. Here's a sample of what the handlebars template looks like: <script type="text/x-handlebars"> <div class="two columns"> {{App.WindowDetail.InteriorFinishesDescription}} </div> </script>
0
10,700,119
05/22/2012 10:21:19
1,087,130
12/08/2011 05:58:06
21
1
.htaccess mod_rewrite with various URL depth
.htaccess mod_rewrite with various URL depth I am new to mod_rewrite and trying to make a single mode_rewrite command to cover all possible url depths and show the index page. the max of length: loader.php?lang=en&cat0=products&cat1=books&cat2=cooking&pageid=pudding /en/products/books/cooking/pudding.php loader.php?lang=en&cat0=products&pageid=index /en/products/index.php the urls always start with 'lang' and ends with the 'pageid' but the depth in the middle can vary.
apache
.htaccess
mod-rewrite
null
null
null
open
.htaccess mod_rewrite with various URL depth === .htaccess mod_rewrite with various URL depth I am new to mod_rewrite and trying to make a single mode_rewrite command to cover all possible url depths and show the index page. the max of length: loader.php?lang=en&cat0=products&cat1=books&cat2=cooking&pageid=pudding /en/products/books/cooking/pudding.php loader.php?lang=en&cat0=products&pageid=index /en/products/index.php the urls always start with 'lang' and ends with the 'pageid' but the depth in the middle can vary.
0
11,241,391
06/28/2012 09:09:30
1,488,002
06/28/2012 08:58:26
1
0
sql statement retuns walue in wrong order from oracle 11g
I need to get some data from an oracle database.In the database there's three columns, city, number and date. The problem is that for every city in the database, except one, the data is in the correct order, orderd by date. For this specific city, the last two have changed place. I use the statement SELECT date FROM data_table WHERE city='city_name' I have tried the 'order by' statement too, but it's not helping. Have anybond had a similar problem or does someone know what the problem might be? Thanks in advance /Arvid Example how it looks (correct): 1. New York 100 2012-01-19 2. New York 103 2012-02-04 3. New York 108 2012-03-27 4. New York 111 2012-04-14 Example how the one city that doesn't work looks 1. New York 100 2012-01-19 2. New York 103 2012-02-04 3. New York 111 2012-04-14 4. New York 108 2012-03-27
sql
oracle11g
null
null
null
06/28/2012 10:29:51
too localized
sql statement retuns walue in wrong order from oracle 11g === I need to get some data from an oracle database.In the database there's three columns, city, number and date. The problem is that for every city in the database, except one, the data is in the correct order, orderd by date. For this specific city, the last two have changed place. I use the statement SELECT date FROM data_table WHERE city='city_name' I have tried the 'order by' statement too, but it's not helping. Have anybond had a similar problem or does someone know what the problem might be? Thanks in advance /Arvid Example how it looks (correct): 1. New York 100 2012-01-19 2. New York 103 2012-02-04 3. New York 108 2012-03-27 4. New York 111 2012-04-14 Example how the one city that doesn't work looks 1. New York 100 2012-01-19 2. New York 103 2012-02-04 3. New York 111 2012-04-14 4. New York 108 2012-03-27
3
5,643,421
04/13/2011 01:19:05
699,978
04/09/2011 13:31:54
294
26
Is there a way to try out Windows Azure for free?
I've already seen [this question][1] but it's been asked over a year ago. Perhaps things have changed in this time span. I'm mainly a **Windows Forms** developer with some dabbling in Ruby in my pet projects. I'd like to start poking around cloud based technology and see what things are like on the other side. Thing is, since I'm a .NET developer I would feel **much** more comfortable using something in the Microsoft stack. Is there some way for me to try out Azure and see what it's all about? I live in Bolivia so I don't have a credit card. [1]: http://stackoverflow.com/questions/2222332/is-there-a-way-to-try-out-windows-azure
c#
.net
azure
null
null
04/13/2011 02:45:32
off topic
Is there a way to try out Windows Azure for free? === I've already seen [this question][1] but it's been asked over a year ago. Perhaps things have changed in this time span. I'm mainly a **Windows Forms** developer with some dabbling in Ruby in my pet projects. I'd like to start poking around cloud based technology and see what things are like on the other side. Thing is, since I'm a .NET developer I would feel **much** more comfortable using something in the Microsoft stack. Is there some way for me to try out Azure and see what it's all about? I live in Bolivia so I don't have a credit card. [1]: http://stackoverflow.com/questions/2222332/is-there-a-way-to-try-out-windows-azure
2
5,981,904
05/12/2011 17:24:15
219,187
11/26/2009 07:23:27
269
10
Why all that fuzz about the virtual keyword?
When reading the documentation of one or another boost library, I encountered some statements giving a hint that the ``virtual`` keyword is kind of evil. See http://www.boost.org/doc/libs/1_46_1/libs/msm/doc/HTML/ch03s05.html, for example: > It will not be said that MSM forces the virtual keyword down your throat! According to http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.4, the virtual keyword is really not that bad, and my feeling about it is the same. Why do some of the boost people regard virtual function calls as the worst thing ever? I have the impression that the boost guys are really **the** experts on C++, so there must be something about it.
c++
performance
boost
virtual
null
05/12/2011 21:08:55
not a real question
Why all that fuzz about the virtual keyword? === When reading the documentation of one or another boost library, I encountered some statements giving a hint that the ``virtual`` keyword is kind of evil. See http://www.boost.org/doc/libs/1_46_1/libs/msm/doc/HTML/ch03s05.html, for example: > It will not be said that MSM forces the virtual keyword down your throat! According to http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.4, the virtual keyword is really not that bad, and my feeling about it is the same. Why do some of the boost people regard virtual function calls as the worst thing ever? I have the impression that the boost guys are really **the** experts on C++, so there must be something about it.
1
9,616,894
03/08/2012 11:24:04
1,246,744
03/03/2012 11:17:31
1
0
Oauth code for accesing UserProfile
I just started using Oauth. Using this code am able to get access tokens and even response but the output am getting is "Response:200 ok" but what am expecting is the user details like firstname lastname profile pic etc.., what modifications should i do to this code OAuthConsumer consumer = new DefaultOAuthConsumer( "consumer_Key", "consumer_secret, SignatureMethod.HMAC_SHA1); String scope = "https://www.googleapis.com/auth/userinfo.profile"; OAuthProvider provider = new DefaultOAuthProvider(consumer, "https://www.google.com/accounts/OAuthGetRequestToken?scope=" + URLEncoder.encode(scope, "utf-8"), "https://www.google.com/accounts/OAuthGetAccessToken", "https://www.google.com/accounts/OAuthAuthorizeToken?hd=default"); System.out.println("Fetching request token..."); String authUrl = provider.retrieveRequestToken(OAuth.OUT_OF_BAND); System.out.println("Request token: " + consumer.getToken()); System.out.println("Token secret: " + consumer.getTokenSecret()); System.out.println("Now visit:\n" + authUrl + "\n... and grant this app authorization"); System.out.println("Enter the verification code and hit ENTER when you're done:"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String verificationCode = br.readLine(); System.out.println("Fetching access token..."); provider.retrieveAccessToken(verificationCode.trim()); System.out.println("Access token: " + consumer.getToken()); System.out.println("Token secret: " + consumer.getTokenSecret()); URL url = new URL("https://www.googleapis.com/oauth2/v1/userinfo?alt=json"); HttpURLConnection request = (HttpURLConnection) url.openConnection(); consumer.sign(request); System.out.println("Sending request..."); request.connect(); System.out.println("Response: " + request.getResponseCode() + " " + request.getResponseMessage());
oauth
null
null
null
null
null
open
Oauth code for accesing UserProfile === I just started using Oauth. Using this code am able to get access tokens and even response but the output am getting is "Response:200 ok" but what am expecting is the user details like firstname lastname profile pic etc.., what modifications should i do to this code OAuthConsumer consumer = new DefaultOAuthConsumer( "consumer_Key", "consumer_secret, SignatureMethod.HMAC_SHA1); String scope = "https://www.googleapis.com/auth/userinfo.profile"; OAuthProvider provider = new DefaultOAuthProvider(consumer, "https://www.google.com/accounts/OAuthGetRequestToken?scope=" + URLEncoder.encode(scope, "utf-8"), "https://www.google.com/accounts/OAuthGetAccessToken", "https://www.google.com/accounts/OAuthAuthorizeToken?hd=default"); System.out.println("Fetching request token..."); String authUrl = provider.retrieveRequestToken(OAuth.OUT_OF_BAND); System.out.println("Request token: " + consumer.getToken()); System.out.println("Token secret: " + consumer.getTokenSecret()); System.out.println("Now visit:\n" + authUrl + "\n... and grant this app authorization"); System.out.println("Enter the verification code and hit ENTER when you're done:"); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String verificationCode = br.readLine(); System.out.println("Fetching access token..."); provider.retrieveAccessToken(verificationCode.trim()); System.out.println("Access token: " + consumer.getToken()); System.out.println("Token secret: " + consumer.getTokenSecret()); URL url = new URL("https://www.googleapis.com/oauth2/v1/userinfo?alt=json"); HttpURLConnection request = (HttpURLConnection) url.openConnection(); consumer.sign(request); System.out.println("Sending request..."); request.connect(); System.out.println("Response: " + request.getResponseCode() + " " + request.getResponseMessage());
0
2,104,638
01/20/2010 20:19:22
191,474
10/16/2009 21:40:04
77
2
Perl keeps reading from same file, even though I'm closed it
I'm writing this perl script that gets two command line arguments: a directory and a year. In this directory is a ton of text files or html files(depending on the year). Lets say for instance it's the year 2010 which contains files that look like this <number>rank.html with the number ranging from 2001 to 2212. I want it to open each file individually and take a part of the title in the html file and print it to a text file. However, when I run my code it just prints the first files title to the text file. It seems that it only ever opens the first file 2001rank.html and no others. I'll post the code below and thanks to anyone that helps. my $directory = shift or "Must supply directory\n"; my $year = shift or "Must supply year\n"; unless (-d $directory) { die "Error: Directory must be a directory\n"; } unless ($directory =~ m/\/$/) { $directory = "$directory/"; } open COLUMNS, "> columns$year.txt" or die "Can't open columns file"; my $column_name; for (my $i = 2001; $i <= 2212; $i++) { if ($year >= 2009) { my $html_file = $directory.$i."rank.html"; open FILE, $html_file; #check if opened correctly, if not, skip it unless (defined fileno(FILE)) { print "skipping $html_file\n"; next; } $/ = "\n"; my $line = <FILE>; if (defined $line) { $column_name = ""; $_ = <FILE> until m{</title>}; $_ =~ m{<title>CIA - The World Factbook -- Country Comparison :: (.+)</title>}i; $column_name = $1; } else { close FILE; next; } close FILE; } else { my $text_file = $directory.$i."rank.txt"; open FILE, $text_file; unless (defined fileno(FILE)) { print "skipping $text_file\n"; next; } $/ = "\r"; my $line = <FILE>; if (defined $line) { $column_name = ""; $_ = <FILE> until /Rank/i; $_ =~ /Rank(\s+)Country(\s+)(.+)(\s+)Date/i; $column_name = $3; } else { close FILE; next; } close FILE; } print "Adding $column_name to text file\n"; print COLUMNS "$column_name\n"; } close COLUMNS; In other words $column_name gets set equal to the same thing every pass in the loop, even though I know the html files are different.
perl
file
null
null
null
null
open
Perl keeps reading from same file, even though I'm closed it === I'm writing this perl script that gets two command line arguments: a directory and a year. In this directory is a ton of text files or html files(depending on the year). Lets say for instance it's the year 2010 which contains files that look like this <number>rank.html with the number ranging from 2001 to 2212. I want it to open each file individually and take a part of the title in the html file and print it to a text file. However, when I run my code it just prints the first files title to the text file. It seems that it only ever opens the first file 2001rank.html and no others. I'll post the code below and thanks to anyone that helps. my $directory = shift or "Must supply directory\n"; my $year = shift or "Must supply year\n"; unless (-d $directory) { die "Error: Directory must be a directory\n"; } unless ($directory =~ m/\/$/) { $directory = "$directory/"; } open COLUMNS, "> columns$year.txt" or die "Can't open columns file"; my $column_name; for (my $i = 2001; $i <= 2212; $i++) { if ($year >= 2009) { my $html_file = $directory.$i."rank.html"; open FILE, $html_file; #check if opened correctly, if not, skip it unless (defined fileno(FILE)) { print "skipping $html_file\n"; next; } $/ = "\n"; my $line = <FILE>; if (defined $line) { $column_name = ""; $_ = <FILE> until m{</title>}; $_ =~ m{<title>CIA - The World Factbook -- Country Comparison :: (.+)</title>}i; $column_name = $1; } else { close FILE; next; } close FILE; } else { my $text_file = $directory.$i."rank.txt"; open FILE, $text_file; unless (defined fileno(FILE)) { print "skipping $text_file\n"; next; } $/ = "\r"; my $line = <FILE>; if (defined $line) { $column_name = ""; $_ = <FILE> until /Rank/i; $_ =~ /Rank(\s+)Country(\s+)(.+)(\s+)Date/i; $column_name = $3; } else { close FILE; next; } close FILE; } print "Adding $column_name to text file\n"; print COLUMNS "$column_name\n"; } close COLUMNS; In other words $column_name gets set equal to the same thing every pass in the loop, even though I know the html files are different.
0
5,814,377
04/28/2011 06:12:17
552,186
12/23/2010 09:14:30
33
0
grep -f alternative sed?awk?
file1 = 95000 file2 = 4500000 I want to filter out file1 entries from file2. egrep -f file1 file2 takes ages to complete. Is there an alternative ? sed? awk? Thanks
sed
awk
grep
null
null
null
open
grep -f alternative sed?awk? === file1 = 95000 file2 = 4500000 I want to filter out file1 entries from file2. egrep -f file1 file2 takes ages to complete. Is there an alternative ? sed? awk? Thanks
0
10,978,172
06/11/2012 10:13:17
250,955
01/14/2010 17:58:01
1
0
how to play video file in MAC OSX developemnt through url (Not in IOS)
I am new in MAC OSX development and i need help to play video file in macos development.I am having URL from which i have to play that file over my MAC osX project. Every one help is appreciable. Thanks
osx
null
null
null
null
06/12/2012 08:04:19
not a real question
how to play video file in MAC OSX developemnt through url (Not in IOS) === I am new in MAC OSX development and i need help to play video file in macos development.I am having URL from which i have to play that file over my MAC osX project. Every one help is appreciable. Thanks
1
946,457
06/03/2009 18:46:01
24,908
10/03/2008 16:36:25
1,319
62
How do I export an ActiveReport to XLS in an ASP.Net MVC app?
I am unsure how to go about exporting my ActiveReports report document to XLS in my asp.net mvc app. My concept so far is to have a dropdown of export types and a submit button that submits that value to my controller. When I'm on the controller, I regenerate the report and pass it to my Export method. I'm not sure what to have this Export method return. I'm also getting an out of range error on the actual xlsExport.Export method. Below is my Export method. private ActionResult Export(ReportBase reportBase) { Response.ClearContent(); Response.ClearHeaders(); var exportType = Request.Form["exportType"]; switch (exportType) { case "RTF": Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=report.rtf"); var rtfExport = new RtfExport(); rtfExport.Export(reportBase.Report.Document, Response.OutputStream); break; case "TIFF": Response.ContentType = "image/tiff"; Response.AddHeader("Content-Disposition", "attachment;filename=report.tif"); var tiffExport = new TiffExport(); var filePath = System.IO.Path.GetTempFileName(); tiffExport.Export(reportBase.Report.Document, filePath); var fileStream = System.IO.File.Open(filePath, System.IO.FileMode.Open); var bufferLength = (int)fileStream.Length; var output = new byte[bufferLength]; var bytesRead = fileStream.Read(output, 0, bufferLength); Response.OutputStream.Write(output, 0, bytesRead); System.IO.File.Delete(filePath); break; case "XLS": Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=report.xls"); var xlsExport = new XlsExport(); xlsExport.Export(reportBase.Report.Document, Response.OutputStream); break; } Response.Flush(); Response.End(); return View("Display", reportBase); }
asp.net-mvc
activereports
export
null
null
null
open
How do I export an ActiveReport to XLS in an ASP.Net MVC app? === I am unsure how to go about exporting my ActiveReports report document to XLS in my asp.net mvc app. My concept so far is to have a dropdown of export types and a submit button that submits that value to my controller. When I'm on the controller, I regenerate the report and pass it to my Export method. I'm not sure what to have this Export method return. I'm also getting an out of range error on the actual xlsExport.Export method. Below is my Export method. private ActionResult Export(ReportBase reportBase) { Response.ClearContent(); Response.ClearHeaders(); var exportType = Request.Form["exportType"]; switch (exportType) { case "RTF": Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=report.rtf"); var rtfExport = new RtfExport(); rtfExport.Export(reportBase.Report.Document, Response.OutputStream); break; case "TIFF": Response.ContentType = "image/tiff"; Response.AddHeader("Content-Disposition", "attachment;filename=report.tif"); var tiffExport = new TiffExport(); var filePath = System.IO.Path.GetTempFileName(); tiffExport.Export(reportBase.Report.Document, filePath); var fileStream = System.IO.File.Open(filePath, System.IO.FileMode.Open); var bufferLength = (int)fileStream.Length; var output = new byte[bufferLength]; var bytesRead = fileStream.Read(output, 0, bufferLength); Response.OutputStream.Write(output, 0, bytesRead); System.IO.File.Delete(filePath); break; case "XLS": Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", "attachment;filename=report.xls"); var xlsExport = new XlsExport(); xlsExport.Export(reportBase.Report.Document, Response.OutputStream); break; } Response.Flush(); Response.End(); return View("Display", reportBase); }
0
10,380,986
04/30/2012 09:02:39
976,627
10/03/2011 11:59:11
100
3
MVC or Web Forms?
I have quite general question. When i want to develop some new web project (not simple page-something bigger and quite complex) what technology should i choose- MVC or Web Forms? I've tried to find it myself but there are many diffrent opinions about that topic. Is any general rule or methodology which can help me decide?
asp.net
asp.net-mvc
asp.net-webforms
null
null
04/30/2012 16:08:57
not constructive
MVC or Web Forms? === I have quite general question. When i want to develop some new web project (not simple page-something bigger and quite complex) what technology should i choose- MVC or Web Forms? I've tried to find it myself but there are many diffrent opinions about that topic. Is any general rule or methodology which can help me decide?
4
6,606,051
07/07/2011 05:08:47
733,798
05/02/2011 00:49:59
6,316
411
Override an external applications maximize command
Using C#, I am looking to hook into the Windows API (I'm not sure which one) to capture which windows are being sent a maximize command. I want to then override that command to tell the window what the bound of the maximized window should be. For example, when a user maximizes Notepad on an 800x600 screen, I want to specify the size that the window actually expands to. I might tell Notepad to "maximize" to 600x600 starting at position 200,0. For this solution, it isn't necessary that the window actually believe it is maximized, I just want to control the window so it doesn't maximize to the whole screen (or that it restores itself automatically to the size I want if that is the best I can do). As I stated, I want to control external applications (Notepad, Word, etc.) not my own application. I would prefer to write this application in C#. The actions I need to perform are: - Capture maximize (or resize) events - Readjust the changed window's size
c#
.net
api
null
null
null
open
Override an external applications maximize command === Using C#, I am looking to hook into the Windows API (I'm not sure which one) to capture which windows are being sent a maximize command. I want to then override that command to tell the window what the bound of the maximized window should be. For example, when a user maximizes Notepad on an 800x600 screen, I want to specify the size that the window actually expands to. I might tell Notepad to "maximize" to 600x600 starting at position 200,0. For this solution, it isn't necessary that the window actually believe it is maximized, I just want to control the window so it doesn't maximize to the whole screen (or that it restores itself automatically to the size I want if that is the best I can do). As I stated, I want to control external applications (Notepad, Word, etc.) not my own application. I would prefer to write this application in C#. The actions I need to perform are: - Capture maximize (or resize) events - Readjust the changed window's size
0
3,769,874
09/22/2010 13:46:42
323,129
04/22/2010 10:00:52
117
2
Eclipse memory allocation problem
I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a ``-Xmx2g`` (or ``-Xmx2048m``) I get an error "Failed to create the Java Virtual Machine". 1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the standalone MAT analyser and it works with -Xmx1024m, not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM This is the eclipse error: ![alt text][1] This is the MAT error: ![alt text][2] (I reckon they are the same, this is just so you can see an example with MAT) My current eclipse.ini (working) is: -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx384m Anybody figures this out? thanks! f. [1]: http://i.stack.imgur.com/NyMLS.jpg [2]: http://i.stack.imgur.com/Y1K1c.jpg
eclipse
memory
jvm
heap-dump
null
null
open
Eclipse memory allocation problem === I'm trying to analyse a ~800mb heap dump, which requires a bigger heap than the standard for my eclipse. however, when I go to the eclipse.ini file and set a ``-Xmx2g`` (or ``-Xmx2048m``) I get an error "Failed to create the Java Virtual Machine". 1) yes, I have enough memory. 2) I can change it up to exactly -Xmx976m. 3) I've tried the standalone MAT analyser and it works with -Xmx1024m, not a byte more. 4) No, 1gb is not enough to analyse that heap, I get a OOM This is the eclipse error: ![alt text][1] This is the MAT error: ![alt text][2] (I reckon they are the same, this is just so you can see an example with MAT) My current eclipse.ini (working) is: -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx384m Anybody figures this out? thanks! f. [1]: http://i.stack.imgur.com/NyMLS.jpg [2]: http://i.stack.imgur.com/Y1K1c.jpg
0
10,482,853
05/07/2012 13:20:43
1,027,396
11/03/2011 10:07:27
52
0
Rails: rake db:create:all (could not connect to server)
follow the screencasts <http://railscasts.com/episodes/342-migrating-to-postgresql?autoplay=true> up to the steps of **"rake db:create:all"** and get error: > could not connect to server: No such file or directory Is the server > running locally and accepting connections on Unix domain socket > "/tmp/.s.PGSQL.5432"? refer the question on <http://stackoverflow.com/questions/10263821/rails-rake-dbcreateall-fails-to-connect-to-postgresql-database> but still unable to resolve it. Not sure what is the problem. ![enter image description here][1] [1]: http://i.stack.imgur.com/obk0p.png
ruby-on-rails
ruby
postgresql
rails-migrations
rails-postgresql
null
open
Rails: rake db:create:all (could not connect to server) === follow the screencasts <http://railscasts.com/episodes/342-migrating-to-postgresql?autoplay=true> up to the steps of **"rake db:create:all"** and get error: > could not connect to server: No such file or directory Is the server > running locally and accepting connections on Unix domain socket > "/tmp/.s.PGSQL.5432"? refer the question on <http://stackoverflow.com/questions/10263821/rails-rake-dbcreateall-fails-to-connect-to-postgresql-database> but still unable to resolve it. Not sure what is the problem. ![enter image description here][1] [1]: http://i.stack.imgur.com/obk0p.png
0
580,385
02/24/2009 03:40:33
26,938
10/10/2008 19:33:56
290
17
How to break bad news to high-ups in other non-IS departments?
Recently we added a couple web service machines, and they couldn't successfully email out. We (IS) did not notice this, and the exceptions were being swallowed up and logged, but no-one noticed for about a month. Needless to say, many purchase orders, and retraction of purchase orders, were never sent out for the past month. While this isn't any one person's fault really, is there any GOOD way to break this to someone non-technical that is higher up in the company than you? Thanks in advance for any advise, I'm freaking out just a bit. :) ***** Edit: Reading this over, I'm more asking for tips on how to break the news. I understand there isn't a GOOD way, just maybe successful tips that have worked for you in the past.
crash
null
null
null
null
06/18/2012 15:09:46
off topic
How to break bad news to high-ups in other non-IS departments? === Recently we added a couple web service machines, and they couldn't successfully email out. We (IS) did not notice this, and the exceptions were being swallowed up and logged, but no-one noticed for about a month. Needless to say, many purchase orders, and retraction of purchase orders, were never sent out for the past month. While this isn't any one person's fault really, is there any GOOD way to break this to someone non-technical that is higher up in the company than you? Thanks in advance for any advise, I'm freaking out just a bit. :) ***** Edit: Reading this over, I'm more asking for tips on how to break the news. I understand there isn't a GOOD way, just maybe successful tips that have worked for you in the past.
2
7,589,756
09/28/2011 21:21:16
553,482
12/24/2010 18:01:17
3
0
How to find average without using group by statement in sql
I want to know if its possible to get the functionality of group by with using it. I need to find average without using group by. basically i am looking for alternative for the below simple query without using "Group by". select avg(salary), g.emp_id from #emp e,#salary d where e.emp_id=d.emp_id group by e.emp_id Thanks and Regards, -Tushar
sql
null
null
null
null
null
open
How to find average without using group by statement in sql === I want to know if its possible to get the functionality of group by with using it. I need to find average without using group by. basically i am looking for alternative for the below simple query without using "Group by". select avg(salary), g.emp_id from #emp e,#salary d where e.emp_id=d.emp_id group by e.emp_id Thanks and Regards, -Tushar
0
7,333,407
09/07/2011 11:50:50
327,813
04/28/2010 11:57:35
100
3
How page expire or session expire works on refresh or back button?
Can anyone please explain how can we make a page expire when click on back button? If we put response header as noCache does this work? I have seen many online banking sites where session gets expired when trying to refresh a page or when trying to perform another action before getting the response for previous action or use back button. How this can be achieved in easiest way? Thanks
java
web-applications
java-ee
null
null
null
open
How page expire or session expire works on refresh or back button? === Can anyone please explain how can we make a page expire when click on back button? If we put response header as noCache does this work? I have seen many online banking sites where session gets expired when trying to refresh a page or when trying to perform another action before getting the response for previous action or use back button. How this can be achieved in easiest way? Thanks
0
3,131,576
06/28/2010 10:23:26
244,835
01/06/2010 15:44:16
412
22
SilverlightSpy alternative tool
Can you suggest other tools similar to SilverlightSpy? I am just curious what alternatives exists out there. What tool you use and why do you prefer it ?
silverlight
null
null
null
null
null
open
SilverlightSpy alternative tool === Can you suggest other tools similar to SilverlightSpy? I am just curious what alternatives exists out there. What tool you use and why do you prefer it ?
0
10,058,966
04/07/2012 22:42:04
1,307,098
04/02/2012 02:01:06
10
0
Android: Date/Time Verify
I need a little help,I created a datepicker and a time picker that apply the date and time in EditText field. now I need to do a check, Check that the date and time inserted are forward in time than the current date. need accept only the date and time that go into the future... how do? thanks in advance
java
android
date
datepicker
timepicker
04/08/2012 13:44:32
not a real question
Android: Date/Time Verify === I need a little help,I created a datepicker and a time picker that apply the date and time in EditText field. now I need to do a check, Check that the date and time inserted are forward in time than the current date. need accept only the date and time that go into the future... how do? thanks in advance
1
5,937,860
05/09/2011 13:54:40
690,766
04/04/2011 08:33:41
27
0
Identifying duplicate combinations for n-field data table on Oracle
I managed to make up sql query to update duplicate rows containing combinations to null value for 2-field table. However, I am stuck with more than 2-field table. <br> My 2-field solution is:<br> *Inserting test data for combinations' table:*<br> <code> create table combinations as <br> select 1 col1, 2 col2 from dual --*row1* <br> union all <br> select 2, 1 from dual --*row2*<br> union all <br> select 1, 3 from dual --*row3*<br> union all <br> select 1,4 from dual; --*row4*</code><br> From combinations' table row1 and row2 are duplicate because ordering of elements doesn't matter. </code><br> *Updating duplicate combinations to null for 2 fields (updating row2 to null):* <code><br> update combinations <br>set col1=null, col2=null <br> where rowid IN(<br> select x.rid from (<br> select <br> rowid rid, <br> col1, <br> col2, <br> row_number() over (partition by least(col1,col2), greatest(col1,col2) order by rownum) duplicate_row <br> from combinations) x <br> where duplicate_row > 1);<br> </code><br> My code above depends on least(,) and greatest(,) functions and that's why it works neatly. Any ideas to adjusting this code to 3-field table?<br> *Inserting test data for combinations2' table (3-fields)*<br> <code>create table combinations2 as<br> select 1 col1, 2 col2, 3 col3 from dual --*row1*<br> union all<br> select 2, 1, 3 from dual --*row2*<br> union all<br> select 1, 3, 2 from dual --*row3*; </code><br> Combinations2 table with 3-fields has row1, row2, row3 which are equal. My goal is to update row2 and row3 to null.
sql
oracle
combinations
null
null
null
open
Identifying duplicate combinations for n-field data table on Oracle === I managed to make up sql query to update duplicate rows containing combinations to null value for 2-field table. However, I am stuck with more than 2-field table. <br> My 2-field solution is:<br> *Inserting test data for combinations' table:*<br> <code> create table combinations as <br> select 1 col1, 2 col2 from dual --*row1* <br> union all <br> select 2, 1 from dual --*row2*<br> union all <br> select 1, 3 from dual --*row3*<br> union all <br> select 1,4 from dual; --*row4*</code><br> From combinations' table row1 and row2 are duplicate because ordering of elements doesn't matter. </code><br> *Updating duplicate combinations to null for 2 fields (updating row2 to null):* <code><br> update combinations <br>set col1=null, col2=null <br> where rowid IN(<br> select x.rid from (<br> select <br> rowid rid, <br> col1, <br> col2, <br> row_number() over (partition by least(col1,col2), greatest(col1,col2) order by rownum) duplicate_row <br> from combinations) x <br> where duplicate_row > 1);<br> </code><br> My code above depends on least(,) and greatest(,) functions and that's why it works neatly. Any ideas to adjusting this code to 3-field table?<br> *Inserting test data for combinations2' table (3-fields)*<br> <code>create table combinations2 as<br> select 1 col1, 2 col2, 3 col3 from dual --*row1*<br> union all<br> select 2, 1, 3 from dual --*row2*<br> union all<br> select 1, 3, 2 from dual --*row3*; </code><br> Combinations2 table with 3-fields has row1, row2, row3 which are equal. My goal is to update row2 and row3 to null.
0
9,554,495
03/04/2012 11:26:32
133,392
07/05/2009 16:42:32
401
10
convert this php regex to javascript
I'm wondering how to change this exact php regex feature into javascript? $ismatch= preg_match('|She is a <span><b>(.*)</b></span>|si', $sentence, $matchresult); if($ismatch) { $gender= $matchresult[1]; } else{ //do other thing }
php
javascript
regex
converter
null
03/04/2012 21:09:17
too localized
convert this php regex to javascript === I'm wondering how to change this exact php regex feature into javascript? $ismatch= preg_match('|She is a <span><b>(.*)</b></span>|si', $sentence, $matchresult); if($ismatch) { $gender= $matchresult[1]; } else{ //do other thing }
3
8,550,860
12/18/2011 09:32:57
132,239
07/02/2009 11:40:53
96
2
HTML 5 Video Players Issues with Visual Studio
This is about HTML 5 Video Players What are the **usual issues** you have encountered during installations of **Web HTML Video Players** specially targeted **.Net framework and Visual Studio** *As a beginning I start my problem description :* I was playing around with lots of them and I encounter some strange behavior against this objective I'm not a professional of adding extra functions to JQuery but mostly I go through the builders suggested procedures I tried different browsers , different formats ,... e.g in **jMediaElement** It was working in one project after adding a user control it didn't work ! or after adding a panel it stopped working ! After copying between projects It works/Not work !
jquery
asp.net
visual-studio
html5
html5-video
null
open
HTML 5 Video Players Issues with Visual Studio === This is about HTML 5 Video Players What are the **usual issues** you have encountered during installations of **Web HTML Video Players** specially targeted **.Net framework and Visual Studio** *As a beginning I start my problem description :* I was playing around with lots of them and I encounter some strange behavior against this objective I'm not a professional of adding extra functions to JQuery but mostly I go through the builders suggested procedures I tried different browsers , different formats ,... e.g in **jMediaElement** It was working in one project after adding a user control it didn't work ! or after adding a panel it stopped working ! After copying between projects It works/Not work !
0
9,040,716
01/27/2012 22:08:08
618,355
02/15/2011 18:28:59
246
3
PHP Parse Host+IP to IP Address only
I'm trying to get this: `46-121-31-23.example.net` To be parsed to this: `46.121.31.23` Replacing the hyphens and removing the characters using REGEX wouldn't be enough, since the result of this would be `46.121.31.23..`
php
regex
null
null
null
01/28/2012 20:33:54
too localized
PHP Parse Host+IP to IP Address only === I'm trying to get this: `46-121-31-23.example.net` To be parsed to this: `46.121.31.23` Replacing the hyphens and removing the characters using REGEX wouldn't be enough, since the result of this would be `46.121.31.23..`
3
3,445,654
08/10/2010 02:36:44
339,038
05/12/2010 07:20:29
169
0
How to use this virtual camera driver ?
If you download the vcam [here][1] will see inside `/Bin` directory it's `VCamD.ax` and `VCam.ax` How are these files supposed to run? The link is from an answer from my previous question [here][2] [1]: http://tmhare.mvps.org/downloads/vcam.zip [2]: http://stackoverflow.com/questions/3445414/is-there-anyhow-i-can-make-pc-camera-concurrently-accessible-on-windows/3445430#3445430
c++
camera
directshow
null
null
08/17/2010 10:17:23
off topic
How to use this virtual camera driver ? === If you download the vcam [here][1] will see inside `/Bin` directory it's `VCamD.ax` and `VCam.ax` How are these files supposed to run? The link is from an answer from my previous question [here][2] [1]: http://tmhare.mvps.org/downloads/vcam.zip [2]: http://stackoverflow.com/questions/3445414/is-there-anyhow-i-can-make-pc-camera-concurrently-accessible-on-windows/3445430#3445430
2
840,386
05/08/2009 15:26:44
25
08/01/2008 12:15:23
2,309
63
generate hexadecimal MD5 hash for iphone?
I'd like to use [gravitar][1] in my iphone application. Anyway to generate a hexadecimal MD5 hash in Objective-C for iphone? Using openssl on iphone is a no-go. [1]: http://en.gravatar.com/site/implement/url
iphone
md5
hash
objective-c
null
null
open
generate hexadecimal MD5 hash for iphone? === I'd like to use [gravitar][1] in my iphone application. Anyway to generate a hexadecimal MD5 hash in Objective-C for iphone? Using openssl on iphone is a no-go. [1]: http://en.gravatar.com/site/implement/url
0
9,072,472
01/30/2012 23:45:48
9,859
09/15/2008 20:13:55
19,945
397
is setTimeout/clearTimeout expensive?
I have something like the following: var myTimeout; function delayStuffUntil( when ){ if( myTimeout) clearTimeout( myTimeout ); myTimeout = setTimeout( stuff, when - Date.now() ); } `delayStuffUntil` is going to get called a good deal, and it's likely that it will get called with the same value of `when` several times in a row. Is `setTimeout`/`clearTimeout` expensive enough that I should bother checking the current `when` against my last value of `when` (and only change timers if different)? I thought about doing it, but the truth is that `when` is a bit more fiddly to compare, and I figured premature optimization is the root of all evil, so I might be making work when I didn't need to.
javascript
null
null
null
null
null
open
is setTimeout/clearTimeout expensive? === I have something like the following: var myTimeout; function delayStuffUntil( when ){ if( myTimeout) clearTimeout( myTimeout ); myTimeout = setTimeout( stuff, when - Date.now() ); } `delayStuffUntil` is going to get called a good deal, and it's likely that it will get called with the same value of `when` several times in a row. Is `setTimeout`/`clearTimeout` expensive enough that I should bother checking the current `when` against my last value of `when` (and only change timers if different)? I thought about doing it, but the truth is that `when` is a bit more fiddly to compare, and I figured premature optimization is the root of all evil, so I might be making work when I didn't need to.
0
11,181,179
06/24/2012 21:04:10
6,345
09/14/2008 14:40:17
7,136
230
How can unit testing make parameter validation redundant?
We have a convention to validate all parameters of constructors and public functions/methods. For mandatory parameters of reference type, we mainly check for non-null and that's the chief validation in constructors, where we set up mandatory dependencies of the type. The number one reason why we do this is to catch that error early and not get a null reference exception a few hours down the line without knowing where or when the faulty parameter was introduced. As we start transitioning to more and more TDD, some team members feel the validation is redundant. Uncle Bob, who is a vocal advocate of TDD, strongly advices against doing parameter validation. His main argument seems to be *"I have a suite of unit tests that makes sure everything works"*. But I can for the life of it just not see in what way unit tests can prevent our developers from calling these methods with bad parameters in **production** code. Please, unit testers out there, if you could explain this to me in a rational way with concrete examples, I'd be more than happy to seize this parameter validation!
c#
c++
unit-testing
null
null
null
open
How can unit testing make parameter validation redundant? === We have a convention to validate all parameters of constructors and public functions/methods. For mandatory parameters of reference type, we mainly check for non-null and that's the chief validation in constructors, where we set up mandatory dependencies of the type. The number one reason why we do this is to catch that error early and not get a null reference exception a few hours down the line without knowing where or when the faulty parameter was introduced. As we start transitioning to more and more TDD, some team members feel the validation is redundant. Uncle Bob, who is a vocal advocate of TDD, strongly advices against doing parameter validation. His main argument seems to be *"I have a suite of unit tests that makes sure everything works"*. But I can for the life of it just not see in what way unit tests can prevent our developers from calling these methods with bad parameters in **production** code. Please, unit testers out there, if you could explain this to me in a rational way with concrete examples, I'd be more than happy to seize this parameter validation!
0
1,024,973
06/21/2009 23:07:39
112,101
05/25/2009 13:07:32
23
0
Drawit vs Pixel
if you have to choose between two image application on a mac [Drawit][1] ($38) or [Pixel][2] ($46). Drawit is similar to Adobe fireworks while Pixel is like PhotoShop. Which will you choose and why. thanks in advance. [1]: http://www.bohemiancoding.com/drawit/index.html [2]: http://www.kanzelsberger.com/pixel/?page_id=5
image
osx
null
null
null
06/22/2009 07:19:27
off topic
Drawit vs Pixel === if you have to choose between two image application on a mac [Drawit][1] ($38) or [Pixel][2] ($46). Drawit is similar to Adobe fireworks while Pixel is like PhotoShop. Which will you choose and why. thanks in advance. [1]: http://www.bohemiancoding.com/drawit/index.html [2]: http://www.kanzelsberger.com/pixel/?page_id=5
2
11,730,505
07/30/2012 22:17:38
1,106,160
12/19/2011 15:10:31
74
19
Oracle VM VirtualBox Static IP - Fedora
I created a Virtual Machine (Linux Fedora) using Oracle VM VirtualBox . The ip address changes every now and then. I want to make it static in the VM. Any ideas? Thanks
linux
ip
virtualbox
fedora
fedora12
07/30/2012 23:49:20
off topic
Oracle VM VirtualBox Static IP - Fedora === I created a Virtual Machine (Linux Fedora) using Oracle VM VirtualBox . The ip address changes every now and then. I want to make it static in the VM. Any ideas? Thanks
2
7,494,759
09/21/2011 04:51:54
591,016
01/26/2011 17:28:14
209
2
HTML Container not expanding to inner-content height absolute positioning
So, <div id="page-wrap"> <div id="main-content> <div id="main-content-inner"> </div> </div> </div> main-content has a relative positioning, page-wrap has default positioning, main-content-inner has absolute positioning. The problem is page-wrap height is not expanding to the height of main-content-inner. main-content-inner displays just fine, but it is displaying outside the bounds of page-wrap. So if i set overflow to hidden on page wrap my main-content-inner gets cut off. How do I make it so my page-wrap height expands to the tallest height of its children containers? #page-wrap { width:100%; min-height:100%; height:auto; height:100%; margin-bottom:-20px; overflow:hidden; }
html
css
null
null
null
null
open
HTML Container not expanding to inner-content height absolute positioning === So, <div id="page-wrap"> <div id="main-content> <div id="main-content-inner"> </div> </div> </div> main-content has a relative positioning, page-wrap has default positioning, main-content-inner has absolute positioning. The problem is page-wrap height is not expanding to the height of main-content-inner. main-content-inner displays just fine, but it is displaying outside the bounds of page-wrap. So if i set overflow to hidden on page wrap my main-content-inner gets cut off. How do I make it so my page-wrap height expands to the tallest height of its children containers? #page-wrap { width:100%; min-height:100%; height:auto; height:100%; margin-bottom:-20px; overflow:hidden; }
0
5,146,155
02/28/2011 18:43:35
30,394
10/22/2008 14:48:19
677
26
How to create c# console application to cosume the .net webservice
I am looking to create C# console application, which will use my desired webservice (http://localhost/MyService/MyService.asmx). My Console application will consume above webservice and will call web methods inside it, I would prefer to pass the values from console window as arguments, say if there is web method from name "MyDetails", so from console application if I pass "admin" and its "password" then it will give the results on my console window. For example if I try to run from console window as below: run>> myconsoleservice.exe MyDetails admin password Thanks. Best Regards,
c#
null
null
null
null
02/28/2011 20:29:47
not a real question
How to create c# console application to cosume the .net webservice === I am looking to create C# console application, which will use my desired webservice (http://localhost/MyService/MyService.asmx). My Console application will consume above webservice and will call web methods inside it, I would prefer to pass the values from console window as arguments, say if there is web method from name "MyDetails", so from console application if I pass "admin" and its "password" then it will give the results on my console window. For example if I try to run from console window as below: run>> myconsoleservice.exe MyDetails admin password Thanks. Best Regards,
1
4,371,061
12/06/2010 21:18:43
244,005
01/05/2010 15:00:18
319
3
problem with overriding virtual c# method (CORRECTED)
I have the following situation public interface IFoo { void Bar(); } public class Parent : IFoo { public virtual void Bar(){} } public class Child : Parent, IFoo { public override void Bar(){} } IFoo test = new Child(); test.Bar(); test.Bar() always calls parent method! Any help would be greatly appreciated!!
c#
inheritance
interface
override
virtual
12/06/2010 22:22:59
not a real question
problem with overriding virtual c# method (CORRECTED) === I have the following situation public interface IFoo { void Bar(); } public class Parent : IFoo { public virtual void Bar(){} } public class Child : Parent, IFoo { public override void Bar(){} } IFoo test = new Child(); test.Bar(); test.Bar() always calls parent method! Any help would be greatly appreciated!!
1
11,650,523
07/25/2012 13:13:33
960,537
09/23/2011 06:35:39
46
0
How to track a request,if it coming from my company or from out my company
I am designing an application where i need to redirect my company user without asking them to Login and if an external person is trying to use the website, i need to ask them Userid and password. How can this be implemented using c# and MVC3.
javascript
asp.net-mvc-3
c#-4.0
asp.net-web-api
null
07/28/2012 10:56:07
not a real question
How to track a request,if it coming from my company or from out my company === I am designing an application where i need to redirect my company user without asking them to Login and if an external person is trying to use the website, i need to ask them Userid and password. How can this be implemented using c# and MVC3.
1
6,639,047
07/10/2011 03:48:58
366,853
06/15/2010 02:33:03
138
5
Rails 3 advice: Create new Admin User class or use CanCan?
I've got a rails 3 app in beta right now that uses Devise for authentication for users, and need some advice. I want to add an admin-user that has some additional abilities, but I will be the only admin user (or admin users can be created via terminal - ie people cannot sign up to be admin users). All regular users have the same abilities. I was just about to use cancan to separate abilities based on user roles. Then it occurred to me that using cancan may just be overkill. does it make sense to just create a different class of user instead? Am I giving anything up by doing this? I can foresee in the future that if this app is successful, there may be different roles for users (a free versus paid account, etc). Even in that case, does it make sense to NOT have an admin user via devise? Thoughts? Thanks!!
ruby-on-rails-3
devise
cancan
null
null
null
open
Rails 3 advice: Create new Admin User class or use CanCan? === I've got a rails 3 app in beta right now that uses Devise for authentication for users, and need some advice. I want to add an admin-user that has some additional abilities, but I will be the only admin user (or admin users can be created via terminal - ie people cannot sign up to be admin users). All regular users have the same abilities. I was just about to use cancan to separate abilities based on user roles. Then it occurred to me that using cancan may just be overkill. does it make sense to just create a different class of user instead? Am I giving anything up by doing this? I can foresee in the future that if this app is successful, there may be different roles for users (a free versus paid account, etc). Even in that case, does it make sense to NOT have an admin user via devise? Thoughts? Thanks!!
0
10,094,023
04/10/2012 18:04:33
156,011
08/13/2009 18:35:51
1,753
94
Rails: Modeling Straightforward Data Using has_many :through
I have a pretty simple set of data requirements to do with pets and veterinarians. - An `owner` can have many `pets` - A `pet` can have one `owner` - A `pet` can be treated by (belongs_to) many `veterinarians` - A `veterinarian` can treat (have_many) `pets` `Owner` and `Veterinarian` are both subclasses of `User` using STI. Here's some code: class Owner < User has_many :pets has_many :veterinarians, :through => :pets end class Veterinarian < User attr_accessible :clinic_name has_many :pets has_many :owners, :through => :pets end class Pet < ActiveRecord::Base attr_accessible :name, :date_of_birth, :species, :breed, :gender, :neutered belongs_to :owner belongs_to :veterinarian end And here is the spec that is failing: it "has various veterinarians" do o = Owner.make!(:email => 'owner1@gmail.com') v1 = Veterinarian.make!(:email => 'vet_1@gmail.com') v2 = Veterinarian.make!(:email => 'vet_2@gmail.com') p = Pet.make!(:name => 'fluffy') o.pets << p v1.pets << p v2.pets << p o.pets.should have(2).records o.veterinarians.should have(2).records end The `make!` stuff is to do with using machinist fixture replacement. It just factory creates the objects. The failure occurs on the last line. It turns out that o.veterinarians only has 1 record. I understand that a `pet` is not a join table in the traditional sense, inasmuch as I don't want to create a whole new pet each time I create a relationship between an owner and a veterinarian. Should I be using a schema more like `Owner` has_many `Pet`s, `Pet` belongs_to :owner and `Pet` has_and_belongs_to_many `Veterinarian`s? Thanks!
ruby-on-rails
data-modeling
has-many-through
null
null
null
open
Rails: Modeling Straightforward Data Using has_many :through === I have a pretty simple set of data requirements to do with pets and veterinarians. - An `owner` can have many `pets` - A `pet` can have one `owner` - A `pet` can be treated by (belongs_to) many `veterinarians` - A `veterinarian` can treat (have_many) `pets` `Owner` and `Veterinarian` are both subclasses of `User` using STI. Here's some code: class Owner < User has_many :pets has_many :veterinarians, :through => :pets end class Veterinarian < User attr_accessible :clinic_name has_many :pets has_many :owners, :through => :pets end class Pet < ActiveRecord::Base attr_accessible :name, :date_of_birth, :species, :breed, :gender, :neutered belongs_to :owner belongs_to :veterinarian end And here is the spec that is failing: it "has various veterinarians" do o = Owner.make!(:email => 'owner1@gmail.com') v1 = Veterinarian.make!(:email => 'vet_1@gmail.com') v2 = Veterinarian.make!(:email => 'vet_2@gmail.com') p = Pet.make!(:name => 'fluffy') o.pets << p v1.pets << p v2.pets << p o.pets.should have(2).records o.veterinarians.should have(2).records end The `make!` stuff is to do with using machinist fixture replacement. It just factory creates the objects. The failure occurs on the last line. It turns out that o.veterinarians only has 1 record. I understand that a `pet` is not a join table in the traditional sense, inasmuch as I don't want to create a whole new pet each time I create a relationship between an owner and a veterinarian. Should I be using a schema more like `Owner` has_many `Pet`s, `Pet` belongs_to :owner and `Pet` has_and_belongs_to_many `Veterinarian`s? Thanks!
0
7,139,130
08/21/2011 15:17:23
904,671
08/21/2011 15:17:23
1
0
What is the byte[] memory leak here? teach me :)
I have a memory leak with byte[] and I would like to learn more about this and prevent it from happening any other time. Here is my java code: http://pastebin.com/swCJz9wX
memory
byte
leak
null
null
null
open
What is the byte[] memory leak here? teach me :) === I have a memory leak with byte[] and I would like to learn more about this and prevent it from happening any other time. Here is my java code: http://pastebin.com/swCJz9wX
0
11,274,048
06/30/2012 12:24:46
1,470,127
06/20/2012 18:15:54
6
0
Postie and All in one SEO Pack hack
I recently tried to automate my blog using Postie plugin. It works great and it does post via email quickly. Now, i also have ALL in ONE SEO Pack installed in my site. How can i set the TITLE,DESCIRPTION AND TAGS fields of SEO plugin via Postie ? I tried to search for the right place but was not able to find any. Kindly, help me in this regard.
wordpress
null
null
null
null
null
open
Postie and All in one SEO Pack hack === I recently tried to automate my blog using Postie plugin. It works great and it does post via email quickly. Now, i also have ALL in ONE SEO Pack installed in my site. How can i set the TITLE,DESCIRPTION AND TAGS fields of SEO plugin via Postie ? I tried to search for the right place but was not able to find any. Kindly, help me in this regard.
0
5,048,014
02/19/2011 00:34:02
40,149
11/23/2008 23:31:00
797
49
uWSGI vhost problem
uWSGI config [uwsgi] socket = /tmp/uwsgi.sock chmod-socket = 666 processes = 1 master = true vhost = true no-site = true Nginx config server { listen 80; server_name www.site1.com; location / { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; uwsgi_param UWSGI_PYHOME /var/virtualenvs/site1; uwsgi_param UWSGI_CHDIR /var/www/site1; uwsgi_param UWSGI_SCRIPT wsgi; } } server { listen 80; server_name www.site2.com; location / { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; uwsgi_param UWSGI_PYHOME /var/virtualenvs/site2; uwsgi_param UWSGI_CHDIR /var/www/site2; uwsgi_param UWSGI_SCRIPT wsgi; } } Whatever site I hit first is the one it is stuck displaying, so if I goto site2 first I can't ever see site1. Any thoughts on why the uWSGI vhost setting seems not to be workin?
python
nginx
wsgi
uwsgi
null
null
open
uWSGI vhost problem === uWSGI config [uwsgi] socket = /tmp/uwsgi.sock chmod-socket = 666 processes = 1 master = true vhost = true no-site = true Nginx config server { listen 80; server_name www.site1.com; location / { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; uwsgi_param UWSGI_PYHOME /var/virtualenvs/site1; uwsgi_param UWSGI_CHDIR /var/www/site1; uwsgi_param UWSGI_SCRIPT wsgi; } } server { listen 80; server_name www.site2.com; location / { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi.sock; uwsgi_param UWSGI_PYHOME /var/virtualenvs/site2; uwsgi_param UWSGI_CHDIR /var/www/site2; uwsgi_param UWSGI_SCRIPT wsgi; } } Whatever site I hit first is the one it is stuck displaying, so if I goto site2 first I can't ever see site1. Any thoughts on why the uWSGI vhost setting seems not to be workin?
0
7,311,854
09/05/2011 19:00:37
929,429
09/05/2011 18:58:46
1
0
Can i change meesage on FB.Connect.logout
I use FB.Connect.logout to log out from the facebook but every time facebook pop up says "You are logging out of both this site and Facebook" . Is there any way i can change this message?
facebook
message
logout
null
null
null
open
Can i change meesage on FB.Connect.logout === I use FB.Connect.logout to log out from the facebook but every time facebook pop up says "You are logging out of both this site and Facebook" . Is there any way i can change this message?
0
8,191,234
11/19/2011 01:48:33
645,460
03/04/2011 21:38:53
1,704
100
Uniquely identify albums and songs in Windows Phone media library
I am importing a songs collection from an `Album` object that is obtained from querying `MediaLibrary` on Windows Phone Mango. Is there a unique identifier provided by the platform, by which I could be identifying different songs and albums? I need something that will remain the same for the same albums if I re-query the `MediaLibrary` next time my app is ran. I have seen a "handle" property in the debugger, but it doesn't appear in any of the Album class documentation.
windows-phone-7
media-library
null
null
null
null
open
Uniquely identify albums and songs in Windows Phone media library === I am importing a songs collection from an `Album` object that is obtained from querying `MediaLibrary` on Windows Phone Mango. Is there a unique identifier provided by the platform, by which I could be identifying different songs and albums? I need something that will remain the same for the same albums if I re-query the `MediaLibrary` next time my app is ran. I have seen a "handle" property in the debugger, but it doesn't appear in any of the Album class documentation.
0
9,945,150
03/30/2012 14:40:58
1,080,126
12/04/2011 14:19:45
59
0
use deployJava.js to call java methods in javascript
I want to call java methods in javascript and Andrew Thompson suggested to use the deployJava.js library for this. I followed these instructions: http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html Here is explained how to use the java class in javascript, but I would like to call the java methods from within the javascript. (This is because I want to import a .owl file in java en export the information in json-format to my code written in javascript.) Does anybody know how to do this with the deployJava library? This is my code to import the java file: var attributes = {codebase:'../sesame', code:'applet_test', width:0, height:0} ; var parameters = {fontSize:16} ; var version = '1.6' ; deployJava.runApplet(attributes, parameters, version); and this is the java file itself: package sesame; import java.awt.*; import java.applet.*; import javax.script.*; public class applet_test extends Applet { public int getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; } public int getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; } }
java
javascript
html5
applet
null
null
open
use deployJava.js to call java methods in javascript === I want to call java methods in javascript and Andrew Thompson suggested to use the deployJava.js library for this. I followed these instructions: http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html Here is explained how to use the java class in javascript, but I would like to call the java methods from within the javascript. (This is because I want to import a .owl file in java en export the information in json-format to my code written in javascript.) Does anybody know how to do this with the deployJava library? This is my code to import the java file: var attributes = {codebase:'../sesame', code:'applet_test', width:0, height:0} ; var parameters = {fontSize:16} ; var version = '1.6' ; deployJava.runApplet(attributes, parameters, version); and this is the java file itself: package sesame; import java.awt.*; import java.applet.*; import javax.script.*; public class applet_test extends Applet { public int getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; } public int getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; } }
0
9,681,350
03/13/2012 09:27:11
422,481
08/17/2010 05:59:46
29
1
Load rows from sql faster
I use > VS2010 and > Sql2005 . In my database one of tables has 25660 rows. when I wanna load this rows in a form it takes a long to load about 8 seconds. How can I reduce it time?
c#
sql
null
null
null
03/13/2012 09:41:49
not a real question
Load rows from sql faster === I use > VS2010 and > Sql2005 . In my database one of tables has 25660 rows. when I wanna load this rows in a form it takes a long to load about 8 seconds. How can I reduce it time?
1
8,572,977
12/20/2011 09:04:07
1,101,334
12/16/2011 06:01:00
15
4
Beginner books of ebooks for mobile web jQuery
I am new to the jQuery programming. Please suggest me some books and tutorial links so that i can equip myself well with the technology. Additionally, I would appreciate the material to start with scratch, as I am entirely new to the technology
jquery
web-applications
jquery-mobile
null
null
12/21/2011 02:24:23
not constructive
Beginner books of ebooks for mobile web jQuery === I am new to the jQuery programming. Please suggest me some books and tutorial links so that i can equip myself well with the technology. Additionally, I would appreciate the material to start with scratch, as I am entirely new to the technology
4
3,777,422
09/23/2010 10:28:35
442,708
09/08/2010 18:07:20
6
1
cache-money requires Ruby version >= 1.8.7. any wayout to work with 1.8.6
I am having performance issue in my application I want to use memcache I am using ruby version 1.8.6. Can anyone suggest me best way out. I want something similar to cache-money or any wayout using 1.8.6 I can use cache-money
ruby-on-rails
memcached
null
null
null
null
open
cache-money requires Ruby version >= 1.8.7. any wayout to work with 1.8.6 === I am having performance issue in my application I want to use memcache I am using ruby version 1.8.6. Can anyone suggest me best way out. I want something similar to cache-money or any wayout using 1.8.6 I can use cache-money
0
1,265,255
08/12/2009 09:51:19
151,344
08/05/2009 20:38:13
21
2
Putting each attribute on a new line during xml serialization
Lets say I have a DOM object (or a string containing xml). Is it in any way possible to serialize the xml in such a way that each attribute appears on a new line? This is the output I want: <parent> <anElement attrOne="1" attrTwo="2" attrThree="3" /> </parent> Preferred if the solution a part of the standard java api, but I suspect such a feature is not available in there, or am I wrong? I found a property for a serializer in the .NET Framework, called <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlwritersettings.newlineonattributes.aspx">NewLineOnAttributes</a>. What I am searching for is something equivalent, but in java.
pretty-print
xml
xml-serialization
java
null
null
open
Putting each attribute on a new line during xml serialization === Lets say I have a DOM object (or a string containing xml). Is it in any way possible to serialize the xml in such a way that each attribute appears on a new line? This is the output I want: <parent> <anElement attrOne="1" attrTwo="2" attrThree="3" /> </parent> Preferred if the solution a part of the standard java api, but I suspect such a feature is not available in there, or am I wrong? I found a property for a serializer in the .NET Framework, called <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlwritersettings.newlineonattributes.aspx">NewLineOnAttributes</a>. What I am searching for is something equivalent, but in java.
0
10,735,966
05/24/2012 10:47:44
1,149,180
10/01/2009 10:48:29
587
17
Titanium Appcelerator Android fails to build with exception
I have a fully working project which is perfectly running on Android and iPhone devices. But when I put `<property name="ti.android.compilejs" type="bool">true</property>` in `TiApp.xml` and performs build, it tries to compile each and every js file, that is okay to me and even in these files we don't have any error but suddenly we encounter **Exception** and build fails. I don't know why this exception occurs, I have googled about this but go no solution online. Please let me know how to resolve this issue. I need `ti.android.compilejs` as `true`. This all I am doing because I need to distribute an app on market place and I also need to perform certificate signing for security purpose. Please let me know if there is any other solution. Another thing is that, we are having few errors which are debugging related, like, **"Something not defined on line no.... &lt;Kill&gt; or &lt;Continue&gt;"** in alert kind of box. I need to suppress such errors on distribution package.
android
titanium-mobile
null
null
null
null
open
Titanium Appcelerator Android fails to build with exception === I have a fully working project which is perfectly running on Android and iPhone devices. But when I put `<property name="ti.android.compilejs" type="bool">true</property>` in `TiApp.xml` and performs build, it tries to compile each and every js file, that is okay to me and even in these files we don't have any error but suddenly we encounter **Exception** and build fails. I don't know why this exception occurs, I have googled about this but go no solution online. Please let me know how to resolve this issue. I need `ti.android.compilejs` as `true`. This all I am doing because I need to distribute an app on market place and I also need to perform certificate signing for security purpose. Please let me know if there is any other solution. Another thing is that, we are having few errors which are debugging related, like, **"Something not defined on line no.... &lt;Kill&gt; or &lt;Continue&gt;"** in alert kind of box. I need to suppress such errors on distribution package.
0
10,773,805
05/27/2012 11:57:56
648,284
03/07/2011 14:18:39
18
0
Blog on Google App Engine
Hi i'm trying to host my blog on Google App Engine (Google quality & free ...) i looked everywhere for a solution. I love [jekyll project][1] but since it's developed with ruby i can't host it on appengine. I found [hyde project][2] ( which kind of python implemented version of [jekyll][3]) i'm thinking to use it on appengine but i'm not sure how ? Can you help me. [1]: http://jekyllrb.com/ [2]: http://hyde.github.com/ [3]: http://jekyllrb.com/
python
google-app-engine
blogs
jekyll
hyde
05/27/2012 13:00:28
off topic
Blog on Google App Engine === Hi i'm trying to host my blog on Google App Engine (Google quality & free ...) i looked everywhere for a solution. I love [jekyll project][1] but since it's developed with ruby i can't host it on appengine. I found [hyde project][2] ( which kind of python implemented version of [jekyll][3]) i'm thinking to use it on appengine but i'm not sure how ? Can you help me. [1]: http://jekyllrb.com/ [2]: http://hyde.github.com/ [3]: http://jekyllrb.com/
2
4,920,114
02/07/2011 10:20:04
391,455
07/14/2010 10:41:15
150
1
GUID / UUID for this scenario? Or compound key? Or other..
I'm currently working on a system that in some cases will need to run on a local database during the day, and then replicated to a central server during the night. It *cannot* all run from one central database as the local sites are out of contact with it periodically. The data at the central server is for viewing and reporting only at head office, so nothing needs to be reverse replicated back to the site. Each "site" is given a text based unique key (human generated). However, the thought of making every table in the database design reference the site key is not appealing. Here's an example of a very cut back version of the schema *without* worrying about remote replication (which will work fine for the majority of clients) : - (I'll only show the history table for the Area table, to keep things short) : [Site] SiteKey [PK] (Gauranteed 100% unique across all sites text based key) [User] SiteKey [FK -> Site] UserID [PK] [Area] SiteKey [FK -> Site] AreaID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [AreaHistory] Site [FK -> Site] AreaID [FK -> Area] Description UpdatedDtm UpdatedUserID [FK -> User] AuditedDtm [Location] AreaID [FK -> Area] LocationID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [Sensor] LocationID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserID [FK -> User] [Reading] LocationID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Which is fine, until I come to "merge" the database with the database at the central server. I'm obviously going to get clashes in the Location table because I'm mixing data with ID's generated at other sites. The first way I thought around this problem was to do this: gs short) : [Location] SiteKey [FK -> Location, FK -> User] ** ADDED THIS AreaID [FK -> Area] LocationID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [Sensor] SiteKey [FK -> Location, FK -> User] ** ADDED THIS LocationID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserID [FK -> User] [Reading] SiteKey [FK -> Sensor] ** ADDED THIS LocationID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Basically, every table gets a SiteKey making each row unique to the site. An alternative is this (using UUIDs in some places) : - [User] SiteKey [FK -> Site] UserUUID [PK] [Area] SiteKey [FK -> Site] AreaUUID [PK] Description UpdatedDtm UpdatedUserUUID [FK -> User] [AreaHistory] Site [FK -> Site] AreaUUID [FK -> Area] Description UpdatedDtm UpdatedUserUUID [FK -> User] AuditedDtm [Location] AreaUUID [FK -> Area] LocationUUID [PK] Description UpdatedDtm UpdatedUserUUID [FK -> User] [Sensor] LocationUUID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserUUID [FK -> User] [Reading] LocationUUID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Remember this is cut down, but it illustrates the problem. Are there any alternatives I may be missing? I thought about ID remapping but that seemed to introduce new even worse nightmares. The annoying part of this is that it's a very small number of cases that use this scenario, the rest are happy with one database serving many sites. However, the client wanting this scenario is the biggest ;-) I thought maybe I could use UUID just for them, but that means creating exceptions everywhere so may as well just use them throughout (where neccessary) if I'm going to use them. If it makes any difference, I'm using PostgreSQL. PS, [this][1] discussion may be relevant to this case. I just keep wondering if there's another way considering I have a nice gauranteed unique SiteKey. [1]: http://stackoverflow.com/questions/45399/advantages-and-disadvantages-of-guid-uuid-database-keys
sql
database
database-design
postgresql
relational-database
null
open
GUID / UUID for this scenario? Or compound key? Or other.. === I'm currently working on a system that in some cases will need to run on a local database during the day, and then replicated to a central server during the night. It *cannot* all run from one central database as the local sites are out of contact with it periodically. The data at the central server is for viewing and reporting only at head office, so nothing needs to be reverse replicated back to the site. Each "site" is given a text based unique key (human generated). However, the thought of making every table in the database design reference the site key is not appealing. Here's an example of a very cut back version of the schema *without* worrying about remote replication (which will work fine for the majority of clients) : - (I'll only show the history table for the Area table, to keep things short) : [Site] SiteKey [PK] (Gauranteed 100% unique across all sites text based key) [User] SiteKey [FK -> Site] UserID [PK] [Area] SiteKey [FK -> Site] AreaID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [AreaHistory] Site [FK -> Site] AreaID [FK -> Area] Description UpdatedDtm UpdatedUserID [FK -> User] AuditedDtm [Location] AreaID [FK -> Area] LocationID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [Sensor] LocationID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserID [FK -> User] [Reading] LocationID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Which is fine, until I come to "merge" the database with the database at the central server. I'm obviously going to get clashes in the Location table because I'm mixing data with ID's generated at other sites. The first way I thought around this problem was to do this: gs short) : [Location] SiteKey [FK -> Location, FK -> User] ** ADDED THIS AreaID [FK -> Area] LocationID [PK] Description UpdatedDtm UpdatedUserID [FK -> User] [Sensor] SiteKey [FK -> Location, FK -> User] ** ADDED THIS LocationID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserID [FK -> User] [Reading] SiteKey [FK -> Sensor] ** ADDED THIS LocationID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Basically, every table gets a SiteKey making each row unique to the site. An alternative is this (using UUIDs in some places) : - [User] SiteKey [FK -> Site] UserUUID [PK] [Area] SiteKey [FK -> Site] AreaUUID [PK] Description UpdatedDtm UpdatedUserUUID [FK -> User] [AreaHistory] Site [FK -> Site] AreaUUID [FK -> Area] Description UpdatedDtm UpdatedUserUUID [FK -> User] AuditedDtm [Location] AreaUUID [FK -> Area] LocationUUID [PK] Description UpdatedDtm UpdatedUserUUID [FK -> User] [Sensor] LocationUUID [PK / FK -> Location] SensorNo [PK] UpdatedDtm UpdatedUserUUID [FK -> User] [Reading] LocationUUID [PK / FK -> Sensor] SensorNo [PK / FK -> Sensor] ReadingDtm [PK] Remember this is cut down, but it illustrates the problem. Are there any alternatives I may be missing? I thought about ID remapping but that seemed to introduce new even worse nightmares. The annoying part of this is that it's a very small number of cases that use this scenario, the rest are happy with one database serving many sites. However, the client wanting this scenario is the biggest ;-) I thought maybe I could use UUID just for them, but that means creating exceptions everywhere so may as well just use them throughout (where neccessary) if I'm going to use them. If it makes any difference, I'm using PostgreSQL. PS, [this][1] discussion may be relevant to this case. I just keep wondering if there's another way considering I have a nice gauranteed unique SiteKey. [1]: http://stackoverflow.com/questions/45399/advantages-and-disadvantages-of-guid-uuid-database-keys
0
11,452,604
07/12/2012 13:12:12
1,495,756
07/02/2012 10:18:01
42
1
Application, installed using setup project cannot take access to folder
I have .net application, it is compiled, everything is ok, it saves image file to its folder. When I use Ctrl+F5 in Visual Stuio, or when I copy exe-file to some folder it is ok. But when I make setup project I have an `System.UnauthorizedAccessException`, on line `image.Save(....);`. How to get access for my application
c#
.net
setup-project
file-access
null
null
open
Application, installed using setup project cannot take access to folder === I have .net application, it is compiled, everything is ok, it saves image file to its folder. When I use Ctrl+F5 in Visual Stuio, or when I copy exe-file to some folder it is ok. But when I make setup project I have an `System.UnauthorizedAccessException`, on line `image.Save(....);`. How to get access for my application
0
6,259,445
06/07/2011 00:12:15
194,076
10/21/2009 19:48:10
300
20
Good example of asp.net application?
I'm looking for source code of small projects in asp.net probably asp.net MVC and ado.net Most interested in web-applications which uses asp.net controls and database. Just need to see how good programmers write code using asp.net
asp.net
code-examples
null
null
null
06/07/2011 02:39:23
not a real question
Good example of asp.net application? === I'm looking for source code of small projects in asp.net probably asp.net MVC and ado.net Most interested in web-applications which uses asp.net controls and database. Just need to see how good programmers write code using asp.net
1