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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,431,003 | 08/07/2010 15:41:25 | 257,635 | 01/24/2010 01:11:32 | 53 | 4 | What's your way of learning a language? | I have just started learning Java (referring Head-First book).
I just wanted to know what's the best way of learning any language?
How to get most out of the book?
Should one have to study the book's matter and then try that code later on computer or do that simultaneously? (learning concept and try that on the computer at the same moment)
In my case I am referring the book and taking help of the forums. Also I want to know when to start answering here on Stack Overflow :) Since I am new to the language so I don't know much.
(I just read other's answers here regularly)
| java | howto | beginners-guide | beginner | null | 03/06/2012 03:18:45 | not constructive | What's your way of learning a language?
===
I have just started learning Java (referring Head-First book).
I just wanted to know what's the best way of learning any language?
How to get most out of the book?
Should one have to study the book's matter and then try that code later on computer or do that simultaneously? (learning concept and try that on the computer at the same moment)
In my case I am referring the book and taking help of the forums. Also I want to know when to start answering here on Stack Overflow :) Since I am new to the language so I don't know much.
(I just read other's answers here regularly)
| 4 |
3,325,632 | 07/24/2010 15:23:02 | 32,484 | 10/29/2008 17:48:46 | 4,833 | 119 | Good practises (ettiquette) when working in a dev team | In a software dev team, what habits make a good team player?
For example, I have learnt that you don't modify another person's code if you see something wrong with it but don't have authority to do so (regardless of how bad the flaw is), do one task at a time and don't get sidetracked into fixing something else which you weren't even asked to do, anyway.
Along these lines, are there any rules to follow? Apart from comments etc.
| learning | career-development | development-teams | null | null | 07/28/2010 16:48:53 | off topic | Good practises (ettiquette) when working in a dev team
===
In a software dev team, what habits make a good team player?
For example, I have learnt that you don't modify another person's code if you see something wrong with it but don't have authority to do so (regardless of how bad the flaw is), do one task at a time and don't get sidetracked into fixing something else which you weren't even asked to do, anyway.
Along these lines, are there any rules to follow? Apart from comments etc.
| 2 |
3,468,028 | 08/12/2010 13:18:07 | 388,350 | 07/10/2010 07:54:46 | 524 | 29 | Is there any language which is just "perfect" for web scraping? | I have used 3 languages for Web Scraping - Ruby, PHP and Python and honestly none of them seems to perfect for the task.
Ruby has an excellent mechanize and XML parsing library but the spreadsheet support is very poor.
PHP has excellent spreadsheet and HTML parsing library but it does not have an equivalent of WWW:Mechanize.
Python has a very poor Mechanize library. I had many problems with it and still unable to solve them. Its spreadsheet library also is more or less decent since it unable to create XLSX files.
Is there anything which is just perfect for webscraping.
PS: I am working on windows platform. | web-scraping | null | null | null | null | 07/29/2012 13:52:00 | not constructive | Is there any language which is just "perfect" for web scraping?
===
I have used 3 languages for Web Scraping - Ruby, PHP and Python and honestly none of them seems to perfect for the task.
Ruby has an excellent mechanize and XML parsing library but the spreadsheet support is very poor.
PHP has excellent spreadsheet and HTML parsing library but it does not have an equivalent of WWW:Mechanize.
Python has a very poor Mechanize library. I had many problems with it and still unable to solve them. Its spreadsheet library also is more or less decent since it unable to create XLSX files.
Is there anything which is just perfect for webscraping.
PS: I am working on windows platform. | 4 |
9,329,194 | 02/17/2012 13:35:14 | 414,967 | 08/09/2010 10:37:30 | 167 | 1 | java web application ui framework | any idea what kind of UI framework have been used for the following website?
[https://www.paytm.com/][1]
I prefer to use such UI framework in java web application. If you are familiar, please let me know.
| java | jquery-ui | user-interface | wicket | null | 02/17/2012 13:42:42 | too localized | java web application ui framework
===
any idea what kind of UI framework have been used for the following website?
[https://www.paytm.com/][1]
I prefer to use such UI framework in java web application. If you are familiar, please let me know.
| 3 |
3,941,460 | 10/15/2010 10:40:03 | 436,222 | 08/31/2010 17:53:19 | 1 | 2 | Cannot attach physical drive while creating virtual machine on windows 7 | ## Shared Drive Name is not accessible. You might not have permissions to use this resource. ##
Attaching the hostmachines drive (D:) to the virtual machine with 'settings' throws error:
Shared Drive Name is not accessible. You might not have permissions to use this resource."
Other vm's have a link to that drive and are working.
(running as admin on windows 7 x64)
Any idea's? | virtual-machine | windows-7-x64 | cddvd | null | null | null | open | Cannot attach physical drive while creating virtual machine on windows 7
===
## Shared Drive Name is not accessible. You might not have permissions to use this resource. ##
Attaching the hostmachines drive (D:) to the virtual machine with 'settings' throws error:
Shared Drive Name is not accessible. You might not have permissions to use this resource."
Other vm's have a link to that drive and are working.
(running as admin on windows 7 x64)
Any idea's? | 0 |
7,103,837 | 08/18/2011 07:29:11 | 900,048 | 08/18/2011 06:56:05 | 1 | 0 | How and which NoSQL to use? | As a hobby I'm building a web application for my radio show and I thought it might be a good chance to learn NoSQL. I'm very got at PHP,MySQL and JS but I have never used NoSQL before.
I have my song archive of approx. 700 rows x 13 columns (cols = features like runtime, tempo, etc.) in Google Spreadsheets.
At day one, these shall be fetched through PHP Zend and placed in a NoSQL database.
With a JS-driven XHTML interface I wish to interact with this NoSQL database in real-time and accomplish the following:
READ:
- Do multiple queries to produce a suggested song list (approx. 30 songs)
- For manual song replace: Do auto-complete searches against the db to suggest another song
- For auto song replace: Fetch songs that fit a runtime span, organize them in ascending order based on last played and number of times played and store them in a JS array.
WRITE:
- Loop through the song list and save an entry for each song with the current date. That way I can keep track on how often songs are played and when they were last played.
Also, can someone point me in the right direction as to which info should be stored in a JS array to be accessed instantly (like the auto-completion search perhaps?) and which should only be in the NoSQL db and accessed through queries? | javascript | nosql | null | null | null | 08/18/2011 09:23:17 | not constructive | How and which NoSQL to use?
===
As a hobby I'm building a web application for my radio show and I thought it might be a good chance to learn NoSQL. I'm very got at PHP,MySQL and JS but I have never used NoSQL before.
I have my song archive of approx. 700 rows x 13 columns (cols = features like runtime, tempo, etc.) in Google Spreadsheets.
At day one, these shall be fetched through PHP Zend and placed in a NoSQL database.
With a JS-driven XHTML interface I wish to interact with this NoSQL database in real-time and accomplish the following:
READ:
- Do multiple queries to produce a suggested song list (approx. 30 songs)
- For manual song replace: Do auto-complete searches against the db to suggest another song
- For auto song replace: Fetch songs that fit a runtime span, organize them in ascending order based on last played and number of times played and store them in a JS array.
WRITE:
- Loop through the song list and save an entry for each song with the current date. That way I can keep track on how often songs are played and when they were last played.
Also, can someone point me in the right direction as to which info should be stored in a JS array to be accessed instantly (like the auto-completion search perhaps?) and which should only be in the NoSQL db and accessed through queries? | 4 |
10,562,689 | 05/12/2012 09:56:39 | 581,335 | 01/18/2011 20:11:03 | 533 | 3 | How to fetch image of the screen from video memory? | Which library may I use to do it? You can think of it as getting the screenshot.
Note: I'm talking about PC. I don't specify OS since I hope that the library is supposed to do it in a cross-platform way. If that's not possible then I will be fine with the Windows only solution. | image | memory | video | screen | fetch | null | open | How to fetch image of the screen from video memory?
===
Which library may I use to do it? You can think of it as getting the screenshot.
Note: I'm talking about PC. I don't specify OS since I hope that the library is supposed to do it in a cross-platform way. If that's not possible then I will be fine with the Windows only solution. | 0 |
10,030,463 | 04/05/2012 14:24:18 | 1,315,530 | 04/05/2012 14:19:48 | 1 | 0 | empty response when trying to curl an SSLv3 url | The following URL works in a web browser:
https://calicojack.armstrong.edu/PROD/bwckctlg.p_disp_listcrse?term_in=201208&subj_in=AASU&crse_in=1100&schd_in=
However, when I try to use curl to fetch it, I get no response. I understand that their server required SSLv3 so I use the following command:
curl --sslv3 -k -v ...
The last output I see
curl: (52) Empty reply from server
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
What is the way to properly curl a (what appears to be) broken/old SSL implementation on the server? | ssl | curl | null | null | null | 04/09/2012 17:50:02 | off topic | empty response when trying to curl an SSLv3 url
===
The following URL works in a web browser:
https://calicojack.armstrong.edu/PROD/bwckctlg.p_disp_listcrse?term_in=201208&subj_in=AASU&crse_in=1100&schd_in=
However, when I try to use curl to fetch it, I get no response. I understand that their server required SSLv3 so I use the following command:
curl --sslv3 -k -v ...
The last output I see
curl: (52) Empty reply from server
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
What is the way to properly curl a (what appears to be) broken/old SSL implementation on the server? | 2 |
4,283,876 | 11/26/2010 09:08:34 | 62,237 | 02/04/2009 03:28:10 | 1,497 | 53 | How to import part of a module in python? | I need to use a python module (available in some library). The module looks like this:
class A:
def f1():
...
print "Done"
...
I need only the functionality of class A. However, when I import the module, the code at bottom (print and others) gets executed. Is there a way to avoid that? Essentially I need to import part of a module: "from module1 import A" which should import only A. Is it possible?
| python | module | import | null | null | null | open | How to import part of a module in python?
===
I need to use a python module (available in some library). The module looks like this:
class A:
def f1():
...
print "Done"
...
I need only the functionality of class A. However, when I import the module, the code at bottom (print and others) gets executed. Is there a way to avoid that? Essentially I need to import part of a module: "from module1 import A" which should import only A. Is it possible?
| 0 |
4,323,885 | 12/01/2010 11:32:52 | 478,144 | 10/16/2010 20:24:18 | 1,033 | 69 | When do you call yourself a programmer | "A programmer, computer programmer or coder is someone who writes computer software" from Wikipedia
If you do frontend development using jQuery/CSS/HTML do you call yourself a programmer? If you develop PHP applications that deal with databases, do you call yourself a programmer?
Are you only a programmer if you write applications for desktops and mobiles? Is the web a place where the line between developer and programmer stops?
I imagine this question might be closed off or moved but if you look at the most viewed question on Stack Overflow its a question about Free C Learning material :) | programming-languages | null | null | null | null | 12/01/2010 11:42:27 | off topic | When do you call yourself a programmer
===
"A programmer, computer programmer or coder is someone who writes computer software" from Wikipedia
If you do frontend development using jQuery/CSS/HTML do you call yourself a programmer? If you develop PHP applications that deal with databases, do you call yourself a programmer?
Are you only a programmer if you write applications for desktops and mobiles? Is the web a place where the line between developer and programmer stops?
I imagine this question might be closed off or moved but if you look at the most viewed question on Stack Overflow its a question about Free C Learning material :) | 2 |
2,375,934 | 03/03/2010 23:47:54 | 432 | 08/05/2008 17:18:46 | 2,489 | 61 | How Insert my Code Between Zoom Text and Windows? | I am writing an application whose users will use [ZoomText][1] and a tablet PC. ZoomText is screen magnification software. However ZoomText has a bug that prevents tablet tracking from working correctly, meaning finger and pen interaction with the screen is incorrect. When you zoom in on a rectangle in the screen and tap on something, you are actually tapping on the absolute coordinates, as if ZoomText was not running.
I am trying to write a program that will correct this behavior. ZoomText has a COM API which allows me to know the zoom amount and location. This means that if I were able to get between ZoomText and the operating system, I could intercept the pen/touch input, translate the coordinates taking into account ZoomText's zoom and location, and then pass the input back to the operating system.
Where should I begin? I don't even know where to start looking for how to implement this.
[1]: http://www.aisquared.com/zoomtext/ | windows | com | null | null | null | null | open | How Insert my Code Between Zoom Text and Windows?
===
I am writing an application whose users will use [ZoomText][1] and a tablet PC. ZoomText is screen magnification software. However ZoomText has a bug that prevents tablet tracking from working correctly, meaning finger and pen interaction with the screen is incorrect. When you zoom in on a rectangle in the screen and tap on something, you are actually tapping on the absolute coordinates, as if ZoomText was not running.
I am trying to write a program that will correct this behavior. ZoomText has a COM API which allows me to know the zoom amount and location. This means that if I were able to get between ZoomText and the operating system, I could intercept the pen/touch input, translate the coordinates taking into account ZoomText's zoom and location, and then pass the input back to the operating system.
Where should I begin? I don't even know where to start looking for how to implement this.
[1]: http://www.aisquared.com/zoomtext/ | 0 |
10,603,766 | 05/15/2012 15:14:31 | 1,078,232 | 12/02/2011 20:53:38 | 117 | 2 | Why am I getting a 404 error when accessing a controller method in Ajax? | I have a controller `ValidationController` and it has a method called `EmailExist`
I have an ajax call
`$.ajax({`
`type: "POST",`
`url: "/Validation/EmailExist",`
`data: { 'Email': $('#Email').val() },`
`success: function (result) {`
`if (result == true) {`
`alert("true");`
`}`
`else {`
`alert("false");`
`}`
`},`
`error: function (error) {`
`alert(error.responseText);`
`}`
I get a 404 error and I have no clue why? Any suggestions or suggestions on how to debug this? | jquery | ajax | asp.net-mvc | jquery-ajax | asp.net-mvc-controller | 05/18/2012 15:45:12 | too localized | Why am I getting a 404 error when accessing a controller method in Ajax?
===
I have a controller `ValidationController` and it has a method called `EmailExist`
I have an ajax call
`$.ajax({`
`type: "POST",`
`url: "/Validation/EmailExist",`
`data: { 'Email': $('#Email').val() },`
`success: function (result) {`
`if (result == true) {`
`alert("true");`
`}`
`else {`
`alert("false");`
`}`
`},`
`error: function (error) {`
`alert(error.responseText);`
`}`
I get a 404 error and I have no clue why? Any suggestions or suggestions on how to debug this? | 3 |
7,568,300 | 09/27/2011 11:24:25 | 966,909 | 09/27/2011 11:18:05 | 1 | 0 | Array to CSV drupal 7 | I am a new in drupal 7,
I need a module for Drupal 7 that can export CSV when given an array of values? | php | arrays | csv | drupal-7 | null | 04/21/2012 13:49:42 | off topic | Array to CSV drupal 7
===
I am a new in drupal 7,
I need a module for Drupal 7 that can export CSV when given an array of values? | 2 |
7,995,675 | 11/03/2011 13:26:21 | 793,878 | 06/11/2011 10:43:47 | 26 | 11 | how to write a web browser from stratch use c | These days I'm aware of the powerful web browser. In order to know what happend behind the screen. I want to write a simple web browser. But When I try to find document about that. Nothing find! Any one konw how to write a simple web browser or know where is the book will be useful. Please tell me !
Thank you very much! | c | browser | null | null | null | 11/03/2011 13:53:58 | not a real question | how to write a web browser from stratch use c
===
These days I'm aware of the powerful web browser. In order to know what happend behind the screen. I want to write a simple web browser. But When I try to find document about that. Nothing find! Any one konw how to write a simple web browser or know where is the book will be useful. Please tell me !
Thank you very much! | 1 |
5,094,665 | 02/23/2011 17:39:38 | 630,675 | 02/23/2011 17:29:15 | 1 | 0 | what is wrong with my C++ templates | I defined a template getsetter to set and get a vector set of values and derived a class (float type) from that template, works in unix but not red hat linux. Why?
can someoen help? Thanks a lot
------------------------------------------------------------------------
1 #ifndef _GETSET_H
2 #define _GETSET_H
3
4 #include <iostream.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <vector>
10 using namespace std;
11
12 template <typename T>
13 class getSet
14 {
15 protected:
16 vector<T> value;
17 typename::vector<T>::iterator itr;
18
19 char a_flVal[100];
20 bool flFlag;
21
22 public:
23
24 getSet()
25 {
26 flFlag = false;
27 }
28
29 getSet(T p_val)
30 {
31 value.push_back(p_val);
32 }
33
34 bool clear()
35 {
36 if( flFlag )
37 {
38 memset(a_flVal, 0, sizeof(a_flVal));
39 }
40 else if( !value.empty() )
41 {
42 value.clear();
43 }
44 return(true);
45 }
46
47 bool empty()
48 {
49 bool retval = false;
50 if( flFlag )
51 {
52 //if(a_flVal[0] == NULL)
53 if (a_flVal[0] == '\0')
54 {
55 retval = true;
56 }
57 else
58 {
59 retval = isZero( a_flVal );
60 }
61 }
62 else if( value.size() == 0 )
63 {
64 retval = true;
65 }
66
67 return(retval);
68 }
69
70 bool set(T p_val)
71 {
72 if( value.size() == 0 )
73 {
74 value.push_back(p_val);
75 }
76 else
77 {
78 itr = value.begin();
78 itr = value.begin();
79 *itr = p_val;
80 }
81 return(true);
82 }
83
84 virtual bool add(T p_val)
85 {
86 if( value.empty() )
87 {
88 value.push_back(p_val);
89 }
90 else
91 {
92 itr = value.begin();
93 *itr = *itr + p_val;
94 }
95 return(true);
96 }
97
98 virtual string getString() throw (string)
99 {
100 throw string("Sorry, you cant call getString "
101 "from the parent class");
102 return(string(""));
103 }
104 T get()
105 {
106 itr = value.begin();
107 return(*itr);
108 }
109
110
111
112 }; // end class getSet
114 class getSetFloat : getSet<float>
115 {
116 private:
117 string storeEqua;
118
119 public:
120 getSetFloat() : getSet()
121 {
122 flFlag = true;
123
124 }
125
126 bool set(float p_val)
127 {
128 if( value.empty() )
129 {
130 value.push_back(0);
131 }
132 memset(a_flVal, 0, sizeof(a_flVal));
133 sprintf(a_flVal, "%.2f", p_val);
134 return(true);
135 }
136
137
138 string get() throw (string)
139 {
140 return( string(a_flVal) );
141 }
142
143
144 bool add(string p_val)
145 {
146 add(atof(p_val.c_str()));
147 return(true);
148 }
149
150 bool add(float p_val)
151 {
152 if( value.empty() )
152 if( value.empty() )
153 {
154 value.push_back(0);
155 memset(a_flVal, 0, sizeof(a_flVal));
156 sprintf(a_flVal, "%.2f", p_val);
157 }
158 else
159 {
160 char buf[100];
161 memset(buf, 0, sizeof(buf));
162 sprintf(buf, "%.2f", atof(a_flVal) + p_val);
163 memset(a_flVal, 0, sizeof(a_flVal));
164 strcpy(a_flVal, buf);
165 }
166 return(true);
167 }
168
169 }; // end getSetFloat
170
171 #endif
| c++ | null | null | null | null | 02/23/2011 18:40:45 | not a real question | what is wrong with my C++ templates
===
I defined a template getsetter to set and get a vector set of values and derived a class (float type) from that template, works in unix but not red hat linux. Why?
can someoen help? Thanks a lot
------------------------------------------------------------------------
1 #ifndef _GETSET_H
2 #define _GETSET_H
3
4 #include <iostream.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <vector>
10 using namespace std;
11
12 template <typename T>
13 class getSet
14 {
15 protected:
16 vector<T> value;
17 typename::vector<T>::iterator itr;
18
19 char a_flVal[100];
20 bool flFlag;
21
22 public:
23
24 getSet()
25 {
26 flFlag = false;
27 }
28
29 getSet(T p_val)
30 {
31 value.push_back(p_val);
32 }
33
34 bool clear()
35 {
36 if( flFlag )
37 {
38 memset(a_flVal, 0, sizeof(a_flVal));
39 }
40 else if( !value.empty() )
41 {
42 value.clear();
43 }
44 return(true);
45 }
46
47 bool empty()
48 {
49 bool retval = false;
50 if( flFlag )
51 {
52 //if(a_flVal[0] == NULL)
53 if (a_flVal[0] == '\0')
54 {
55 retval = true;
56 }
57 else
58 {
59 retval = isZero( a_flVal );
60 }
61 }
62 else if( value.size() == 0 )
63 {
64 retval = true;
65 }
66
67 return(retval);
68 }
69
70 bool set(T p_val)
71 {
72 if( value.size() == 0 )
73 {
74 value.push_back(p_val);
75 }
76 else
77 {
78 itr = value.begin();
78 itr = value.begin();
79 *itr = p_val;
80 }
81 return(true);
82 }
83
84 virtual bool add(T p_val)
85 {
86 if( value.empty() )
87 {
88 value.push_back(p_val);
89 }
90 else
91 {
92 itr = value.begin();
93 *itr = *itr + p_val;
94 }
95 return(true);
96 }
97
98 virtual string getString() throw (string)
99 {
100 throw string("Sorry, you cant call getString "
101 "from the parent class");
102 return(string(""));
103 }
104 T get()
105 {
106 itr = value.begin();
107 return(*itr);
108 }
109
110
111
112 }; // end class getSet
114 class getSetFloat : getSet<float>
115 {
116 private:
117 string storeEqua;
118
119 public:
120 getSetFloat() : getSet()
121 {
122 flFlag = true;
123
124 }
125
126 bool set(float p_val)
127 {
128 if( value.empty() )
129 {
130 value.push_back(0);
131 }
132 memset(a_flVal, 0, sizeof(a_flVal));
133 sprintf(a_flVal, "%.2f", p_val);
134 return(true);
135 }
136
137
138 string get() throw (string)
139 {
140 return( string(a_flVal) );
141 }
142
143
144 bool add(string p_val)
145 {
146 add(atof(p_val.c_str()));
147 return(true);
148 }
149
150 bool add(float p_val)
151 {
152 if( value.empty() )
152 if( value.empty() )
153 {
154 value.push_back(0);
155 memset(a_flVal, 0, sizeof(a_flVal));
156 sprintf(a_flVal, "%.2f", p_val);
157 }
158 else
159 {
160 char buf[100];
161 memset(buf, 0, sizeof(buf));
162 sprintf(buf, "%.2f", atof(a_flVal) + p_val);
163 memset(a_flVal, 0, sizeof(a_flVal));
164 strcpy(a_flVal, buf);
165 }
166 return(true);
167 }
168
169 }; // end getSetFloat
170
171 #endif
| 1 |
9,569,038 | 03/05/2012 15:15:53 | 1,129,909 | 01/04/2012 12:25:18 | 42 | 2 | Regular expression: multiple occurences of a word, replace only last occurence | I have an URL like this:
http://site.com/galleries/galleryname/imageID123/lightbox/
and using a script to replace the lightbox URL with nothing (when lightbox overlay is closed):
document.URL.replace('lightbox/', '')
Things get messy when user has a gallery also named "lightbox", then the URL is:
http://site.com/galleries/lightbox/imageID123/lightbox/
I need to make sure that docment.URL.replace will replace only the last occurrence of the word. | javascript | regex | replace | null | null | null | open | Regular expression: multiple occurences of a word, replace only last occurence
===
I have an URL like this:
http://site.com/galleries/galleryname/imageID123/lightbox/
and using a script to replace the lightbox URL with nothing (when lightbox overlay is closed):
document.URL.replace('lightbox/', '')
Things get messy when user has a gallery also named "lightbox", then the URL is:
http://site.com/galleries/lightbox/imageID123/lightbox/
I need to make sure that docment.URL.replace will replace only the last occurrence of the word. | 0 |
8,785,465 | 01/09/2012 08:13:06 | 426,260 | 02/08/2010 12:48:01 | 81 | 0 | How to store the categories to an array variable in Wordpress? | How can I store the categories names and IDs into an array in Wordpress? | php | wordpress | null | null | null | null | open | How to store the categories to an array variable in Wordpress?
===
How can I store the categories names and IDs into an array in Wordpress? | 0 |
10,858,037 | 06/01/2012 22:22:15 | 1,000,514 | 10/18/2011 06:31:16 | 5 | 0 | html relative positioned elements being rendered differently in firefox and chrome | I have some html elements (span, divs) that are behaving differently in Firefox (12) and Chrome (18) and cannot understand why. Some elements are positioned relatively and some absolutely. However the discrepancy is present in both cases. Any idea of why and how to resolve? | html | css | firefox | google-chrome | null | 06/04/2012 16:38:38 | not a real question | html relative positioned elements being rendered differently in firefox and chrome
===
I have some html elements (span, divs) that are behaving differently in Firefox (12) and Chrome (18) and cannot understand why. Some elements are positioned relatively and some absolutely. However the discrepancy is present in both cases. Any idea of why and how to resolve? | 1 |
3,559,713 | 08/24/2010 18:24:44 | 429,902 | 08/24/2010 18:24:44 | 1 | 0 | Update with a Min in the the table | I want to update a Column in a Table, based on the minimum of another column of the same table.
eg.
JobPositonId | JobPositonName | JobDescriptionId | ContactId
1 | 1 | 1 | 1
2 | 1 | 1 | 0
3 | 1 | 1 | 0
I want to update ContactId to be 1, if it is 0 and where JobPositionId is the lowest.
Any help will be appreciated
Thanks
Robert | sql | query | update | min | null | null | open | Update with a Min in the the table
===
I want to update a Column in a Table, based on the minimum of another column of the same table.
eg.
JobPositonId | JobPositonName | JobDescriptionId | ContactId
1 | 1 | 1 | 1
2 | 1 | 1 | 0
3 | 1 | 1 | 0
I want to update ContactId to be 1, if it is 0 and where JobPositionId is the lowest.
Any help will be appreciated
Thanks
Robert | 0 |
4,336,466 | 12/02/2010 15:13:40 | 520,326 | 11/25/2010 15:11:38 | 11 | 0 | Lazy loading problem with one to one mapping | I have 2 very simple POJOs and i have just one to one mapping between them.
1. contact.java
2. comment.java -- it has foreign key column to the contact.java
the code i have written is below.
contact.java
-------------
@OneToOne(optional= false,cascade = CascadeType.ALL, mappedBy="contact", fetch=FetchType.LAZY)
@org.hibernate.annotations.LazyToOne(org.hibernate.annotations.LazyToOneOption.NO_PROXY)
private Comment mComment;
comment.java
------------
@OneToOne(fetch = FetchType.LAZY,cascade=CascadeType.ALL )
@JoinColumn(name="EW_CNTC_ID")
private Contact contact;
i am setting comment into contact pojo and finally i am saving contact.java
if i keep @OneToOne(optional= false, i am getting dataintegrityexception, constraintvoilationexception
if i changed @OneToOne(optional= true, then it is working.
i think that if optional is false, it is trying to insert contact, it find comment it is trying to insert comment, but it has reference to contact it has to set the foreign key without inserting contact it cannot keep foreign key ..
if optional true the contact can be inserted without comment and PK generated for contact and tat is set in the foreign key column of the contact.--- anyway this issue is solved.
one more thing i am loading contacts i need to lazy load the comments, it is no where working can some one help on this, i strictly need lazy loading of comment because of performance problm.
Thanks in advance. | jpa | null | null | null | null | null | open | Lazy loading problem with one to one mapping
===
I have 2 very simple POJOs and i have just one to one mapping between them.
1. contact.java
2. comment.java -- it has foreign key column to the contact.java
the code i have written is below.
contact.java
-------------
@OneToOne(optional= false,cascade = CascadeType.ALL, mappedBy="contact", fetch=FetchType.LAZY)
@org.hibernate.annotations.LazyToOne(org.hibernate.annotations.LazyToOneOption.NO_PROXY)
private Comment mComment;
comment.java
------------
@OneToOne(fetch = FetchType.LAZY,cascade=CascadeType.ALL )
@JoinColumn(name="EW_CNTC_ID")
private Contact contact;
i am setting comment into contact pojo and finally i am saving contact.java
if i keep @OneToOne(optional= false, i am getting dataintegrityexception, constraintvoilationexception
if i changed @OneToOne(optional= true, then it is working.
i think that if optional is false, it is trying to insert contact, it find comment it is trying to insert comment, but it has reference to contact it has to set the foreign key without inserting contact it cannot keep foreign key ..
if optional true the contact can be inserted without comment and PK generated for contact and tat is set in the foreign key column of the contact.--- anyway this issue is solved.
one more thing i am loading contacts i need to lazy load the comments, it is no where working can some one help on this, i strictly need lazy loading of comment because of performance problm.
Thanks in advance. | 0 |
1,538,374 | 10/08/2009 14:57:52 | 163,086 | 08/25/2009 21:02:39 | 1 | 0 | Boost.Regex oddity | Does anyone have any idea why the following code would output "no match"?
boost::regex r(".*\\.");
std::string s("app.test");
if (boost::regex_match(s, r))
std::cout << "match" << std::endl;
else
std::cout << "no match" << std::endl; | c++ | boost-regex | boost | regex | null | null | open | Boost.Regex oddity
===
Does anyone have any idea why the following code would output "no match"?
boost::regex r(".*\\.");
std::string s("app.test");
if (boost::regex_match(s, r))
std::cout << "match" << std::endl;
else
std::cout << "no match" << std::endl; | 0 |
11,328,315 | 07/04/2012 11:35:06 | 1,320,540 | 04/08/2012 16:54:19 | 407 | 0 | open file on a specific block in Linux | For debugging purposes, I want to open a file on a specific predefined block. For instance, if I suspect a specific block is damaged, I want to write and read from it, and I'd rather do that in user mode, while the partition is mounted.
Is there a way to tell Linux, "hey! open this new file on block 4579 if it's free".
Generic answers are welcomed, but even answer for the ext filesystems families is good enough. | linux | filesystems | ext4 | null | null | null | open | open file on a specific block in Linux
===
For debugging purposes, I want to open a file on a specific predefined block. For instance, if I suspect a specific block is damaged, I want to write and read from it, and I'd rather do that in user mode, while the partition is mounted.
Is there a way to tell Linux, "hey! open this new file on block 4579 if it's free".
Generic answers are welcomed, but even answer for the ext filesystems families is good enough. | 0 |
6,473,522 | 06/24/2011 20:38:32 | 814,732 | 06/24/2011 20:38:32 | 1 | 0 | JS/jQuery Styled Scrollbar | I search here for a good-styled scrollbar, but nothing... Can u offer me something, because I can't place the famous from Internet. I want a simple scrollbar, just a line or smth like that. Please give the example in a whole HTML page (with <head>, <body> etc. tags).
**Thanks previously!** | javascript | jquery | scrollbar | null | null | null | open | JS/jQuery Styled Scrollbar
===
I search here for a good-styled scrollbar, but nothing... Can u offer me something, because I can't place the famous from Internet. I want a simple scrollbar, just a line or smth like that. Please give the example in a whole HTML page (with <head>, <body> etc. tags).
**Thanks previously!** | 0 |
5,688,386 | 04/16/2011 17:47:16 | 382,818 | 07/03/2010 19:08:55 | 4,349 | 196 | Where can I find good AREL documentation? | I'm trying to learn as much as I can about AREL. But I'm not sure what to look at.
It looks like [this on github][1] is the project for AREL, but isn't AREL a part of ActiveRecord now?
I found some [documentation on rubydoc][2], but it doesn't seem very good in terms of showing what all are the public/accessible things I can do. For example, I could not find any information on the "includes" method.
So, how exactly to learn most of what AREL has to offer? (i.e. without delving into the source code)
[1]: https://github.com/rails/arel
[2]: http://rubydoc.info/github/rails/arel/master/frames | ruby-on-rails-3 | documentation | arel | null | null | null | open | Where can I find good AREL documentation?
===
I'm trying to learn as much as I can about AREL. But I'm not sure what to look at.
It looks like [this on github][1] is the project for AREL, but isn't AREL a part of ActiveRecord now?
I found some [documentation on rubydoc][2], but it doesn't seem very good in terms of showing what all are the public/accessible things I can do. For example, I could not find any information on the "includes" method.
So, how exactly to learn most of what AREL has to offer? (i.e. without delving into the source code)
[1]: https://github.com/rails/arel
[2]: http://rubydoc.info/github/rails/arel/master/frames | 0 |
11,239,521 | 06/28/2012 06:59:36 | 1,417,253 | 05/25/2012 11:18:55 | 4 | 0 | What is the point of using Class in interface and Interface In Class? | I am not able to clear the concept that What is need of using Interface in Class and Class in Interface. | java | class | interface | null | null | 06/28/2012 19:35:55 | not a real question | What is the point of using Class in interface and Interface In Class?
===
I am not able to clear the concept that What is need of using Interface in Class and Class in Interface. | 1 |
3,670,044 | 09/08/2010 16:50:33 | 333,757 | 05/05/2010 18:45:56 | 11 | 1 | Possible JavaScript Error? | My QA specialist is getting this following bug:
**Opening & closing the Country dropdown along with other dropdowns: Toggle opening Country & Phone Type drops.
Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.**
Is this an issue with the JavaScript. And if so I have debugged it and can't pinpoint the issue. | javascript | error-message | null | null | null | 09/08/2010 17:24:11 | not a real question | Possible JavaScript Error?
===
My QA specialist is getting this following bug:
**Opening & closing the Country dropdown along with other dropdowns: Toggle opening Country & Phone Type drops.
Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus.**
Is this an issue with the JavaScript. And if so I have debugged it and can't pinpoint the issue. | 1 |
11,540,072 | 07/18/2012 11:16:35 | 1,534,558 | 07/18/2012 11:10:21 | 1 | 0 | ipv6 host address in wampserver | as in ipv4 we use mysql_connect("localhost","root",""); or mysql_connect(server ip,"root","");
this is done after adding the ipv4 address in the privileges.
how can I do the same thing using ipv6?? I want to add server ipv6 address | ipv6 | null | null | null | null | 07/19/2012 13:49:14 | not a real question | ipv6 host address in wampserver
===
as in ipv4 we use mysql_connect("localhost","root",""); or mysql_connect(server ip,"root","");
this is done after adding the ipv4 address in the privileges.
how can I do the same thing using ipv6?? I want to add server ipv6 address | 1 |
11,671,370 | 07/26/2012 14:20:34 | 1,326,104 | 04/11/2012 08:45:00 | 82 | 9 | Perl not executing command when in debugger or as a Win32::Daemon | Synopsis
---
I execute a shell command from Perl and when run from the command line it works, but when run in the debugger it does not work. Running it as a Win32::Daemon shows the same behaviour.
The Source Code
------
I execute a command either with backticks
print `$cmd`
or like this:
open FH, "$cmd |" or die "Couldn't execute $cmd: $!\n";
while(defined(my $line = <FH>)) {
chomp($line);
print "$line\n";
}
close FH;
The command reads like this:
$cmd = '"C:\path\to\sscep.exe" getca -f "C:\path\to\config\capi_sscep.cnf"'
Even creating a small test script that just executes this command does only work if run from command line.
The System
-----
- Windows x64
- Active Perl v5.16.0, MSWin32-x64-multi-thread
- Eclipse Juno 20120614-1722
What works
----
I works to open an administrator prompt (necessary for script execution) and to:
perl script.pl
Output gets printed to screen, `$?` is `0`.
What does not work
-----
Starting Eclipse and running a debug session with the same `perl script.pl` call.
Also not working is adding a service and executing the command (created with Win32::Daemon). The daemon itself is working perfectly fine and starting the perl script as expected. Only the command does not get executed. `$?` is `13568`, no output gets printed.
Further Details
------
The tool I am calling is called _sscep_ and is extended by me. It uses the OpenSSL API and loads the capi engine (Windows CryptoAPI). But the command itself does at least print output before any serious action starts. I can happily provide the source code for this, but I doubt it will help.
Any ideas where this problem might originate from or how I can possibly **narrow** it down? | eclipse | perl | activeperl | epic | null | null | open | Perl not executing command when in debugger or as a Win32::Daemon
===
Synopsis
---
I execute a shell command from Perl and when run from the command line it works, but when run in the debugger it does not work. Running it as a Win32::Daemon shows the same behaviour.
The Source Code
------
I execute a command either with backticks
print `$cmd`
or like this:
open FH, "$cmd |" or die "Couldn't execute $cmd: $!\n";
while(defined(my $line = <FH>)) {
chomp($line);
print "$line\n";
}
close FH;
The command reads like this:
$cmd = '"C:\path\to\sscep.exe" getca -f "C:\path\to\config\capi_sscep.cnf"'
Even creating a small test script that just executes this command does only work if run from command line.
The System
-----
- Windows x64
- Active Perl v5.16.0, MSWin32-x64-multi-thread
- Eclipse Juno 20120614-1722
What works
----
I works to open an administrator prompt (necessary for script execution) and to:
perl script.pl
Output gets printed to screen, `$?` is `0`.
What does not work
-----
Starting Eclipse and running a debug session with the same `perl script.pl` call.
Also not working is adding a service and executing the command (created with Win32::Daemon). The daemon itself is working perfectly fine and starting the perl script as expected. Only the command does not get executed. `$?` is `13568`, no output gets printed.
Further Details
------
The tool I am calling is called _sscep_ and is extended by me. It uses the OpenSSL API and loads the capi engine (Windows CryptoAPI). But the command itself does at least print output before any serious action starts. I can happily provide the source code for this, but I doubt it will help.
Any ideas where this problem might originate from or how I can possibly **narrow** it down? | 0 |
1,111,700 | 07/10/2009 20:05:24 | 33,264 | 11/01/2008 02:18:32 | 1,604 | 124 | How to prevent HTTP GET for ASP.NET events? or How to check for Request.Type on all events? | With the help of fiddler, I did this "replay attack" with the following HTTP GET request
http://svr/Default.aspx?**__EVENTTARGET=LinkButton1**&__EVENTARGUMENT=&__VIEWSTATE=%2snipg%3D%3D&__EVENTVALIDATION=%2snip
To my surprise, it works as long as there is valid viewstate and event validation. The following stops GET on my click event, but...
protected void BtnUploadClick(object sender, EventArgs e)
{
if(Request.RequestType == "GET") throw new HttpException(405, "GET not allowed for this.");
}
I have events *all* over my code. Is there a way to globally add this behavior to events that are normally postback events?
| asp.net | c# | null | null | null | null | open | How to prevent HTTP GET for ASP.NET events? or How to check for Request.Type on all events?
===
With the help of fiddler, I did this "replay attack" with the following HTTP GET request
http://svr/Default.aspx?**__EVENTTARGET=LinkButton1**&__EVENTARGUMENT=&__VIEWSTATE=%2snipg%3D%3D&__EVENTVALIDATION=%2snip
To my surprise, it works as long as there is valid viewstate and event validation. The following stops GET on my click event, but...
protected void BtnUploadClick(object sender, EventArgs e)
{
if(Request.RequestType == "GET") throw new HttpException(405, "GET not allowed for this.");
}
I have events *all* over my code. Is there a way to globally add this behavior to events that are normally postback events?
| 0 |
11,660,409 | 07/25/2012 23:52:38 | 1,553,060 | 07/25/2012 23:11:44 | 1 | 0 | Microsoft SQL Server Client Statistics - Client vs total processing time | I am trying to better understand the relationship between client processing time and total processing time. I've always worked with the thought of reducing all the numbers. I have recently run into a situation where I can reduce the total processing time but the client processing time is greater. Is it better or worse to have the client do the work? If one can push processing to the client, wouldn't that be favorable to having the server do it? Providing all other stats ( bytes/packets/round trips/total processing time ) stays the same or is lower.
| sql-server | sql-server-2008 | tsql | sql-server-2005 | null | 07/27/2012 00:25:39 | off topic | Microsoft SQL Server Client Statistics - Client vs total processing time
===
I am trying to better understand the relationship between client processing time and total processing time. I've always worked with the thought of reducing all the numbers. I have recently run into a situation where I can reduce the total processing time but the client processing time is greater. Is it better or worse to have the client do the work? If one can push processing to the client, wouldn't that be favorable to having the server do it? Providing all other stats ( bytes/packets/round trips/total processing time ) stays the same or is lower.
| 2 |
10,606,211 | 05/15/2012 17:54:40 | 1,301,158 | 03/29/2012 15:09:46 | 1 | 0 | using c# to write sql query in Visual studio | I have a database in sql server. I am looking to create a WPF app with visual studio in order to run the sql code there. How do I do this? I am just needing to run a simple select statement based off of three joined tables | sql | wpf | visual-studio-2010 | sql-server-2008 | null | 05/16/2012 00:58:38 | not constructive | using c# to write sql query in Visual studio
===
I have a database in sql server. I am looking to create a WPF app with visual studio in order to run the sql code there. How do I do this? I am just needing to run a simple select statement based off of three joined tables | 4 |
5,483,877 | 03/30/2011 08:31:51 | 46,297 | 12/15/2008 08:14:52 | 5,077 | 150 | SimpleXML - Cannot get attributes of first tag | I am trying to read the attributes of the first tag of an XML.
Here's the XML structure
<myxml timestamp="1301467801">
<tag1>value1</tag1>
<tag2>value2</tag2>
…
</myxml>
And here's how I try to get the **timestamp** attribute (tried 2 approaches, listing them both here, none works)
$timestamp = $xml->myxml->attributes()->timestamp; //gives Node no longer exists warning
if($xml->myxml && $xml->myxml->attributes()){ //Doesn't enter this loop
$arr = $xml->myxml->attributes();
$timestamp = $arr['timestamp'];
}
Can someone please let me know how I can get the attribute's value? Thanks. | php | simplexml | null | null | null | null | open | SimpleXML - Cannot get attributes of first tag
===
I am trying to read the attributes of the first tag of an XML.
Here's the XML structure
<myxml timestamp="1301467801">
<tag1>value1</tag1>
<tag2>value2</tag2>
…
</myxml>
And here's how I try to get the **timestamp** attribute (tried 2 approaches, listing them both here, none works)
$timestamp = $xml->myxml->attributes()->timestamp; //gives Node no longer exists warning
if($xml->myxml && $xml->myxml->attributes()){ //Doesn't enter this loop
$arr = $xml->myxml->attributes();
$timestamp = $arr['timestamp'];
}
Can someone please let me know how I can get the attribute's value? Thanks. | 0 |
5,820,433 | 04/28/2011 14:44:36 | 284,560 | 03/02/2010 16:18:00 | 204 | 15 | Custom Membership Provider Error | I have a custom asp.net membership class I am building where I have a helper function that the
GetUser() method uses to convert the values from my database into a System.Web.Security.MembershipUser object.
private MembershipUser _converToMembershipUser(MembershipDBModel member)
{
System.Web.Security.MembershipUser membershipUser = new System.Web.Security.MembershipUser(
this.Name,
member.UserName,
member.UserID.ToString(),
member.Email,
member.PasswordQuestion,
member.Comment,
member.IsApproved,
member.IsLockedOut,
member.CreationDate,
member.LastLoginDate,
member.LastActivityDate,
member.LastPasswordChangedDate,
member.LastLockedOutDate);
return membershipUser;
}
----------
This is the error that I keep getting when the above method is being called. I have not idea how to get around this so any suggestion is very welcome.
--------------------------------
System.IO.FileLoadException was caught
Message=The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Source=System.Web
StackTrace:
at System.Web.Security.Membership.Initialize()
at System.Web.Security.MembershipAdapter.get_Providers()
at System.Web.Security.MembershipUser..ctor(String providerName, String name, Object providerUserKey, String email, String passwordQuestion, String comment, Boolean isApproved, Boolean isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate)
at TMTechMembershipProvider.MembershipProvider._converToMembershipUser(MembershipDBModel member) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 1005
at TMTechMembershipProvider.MembershipProvider.GetUser(String username) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 965
at TMTechMembershipProvider.MembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 435
InnerException:
System.Web.Security.MembershipAdapter.get_Providers() Initialize() The given assembly name or codebase was invalid.
| asp.net-membership | null | null | null | null | null | open | Custom Membership Provider Error
===
I have a custom asp.net membership class I am building where I have a helper function that the
GetUser() method uses to convert the values from my database into a System.Web.Security.MembershipUser object.
private MembershipUser _converToMembershipUser(MembershipDBModel member)
{
System.Web.Security.MembershipUser membershipUser = new System.Web.Security.MembershipUser(
this.Name,
member.UserName,
member.UserID.ToString(),
member.Email,
member.PasswordQuestion,
member.Comment,
member.IsApproved,
member.IsLockedOut,
member.CreationDate,
member.LastLoginDate,
member.LastActivityDate,
member.LastPasswordChangedDate,
member.LastLockedOutDate);
return membershipUser;
}
----------
This is the error that I keep getting when the above method is being called. I have not idea how to get around this so any suggestion is very welcome.
--------------------------------
System.IO.FileLoadException was caught
Message=The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Source=System.Web
StackTrace:
at System.Web.Security.Membership.Initialize()
at System.Web.Security.MembershipAdapter.get_Providers()
at System.Web.Security.MembershipUser..ctor(String providerName, String name, Object providerUserKey, String email, String passwordQuestion, String comment, Boolean isApproved, Boolean isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate)
at TMTechMembershipProvider.MembershipProvider._converToMembershipUser(MembershipDBModel member) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 1005
at TMTechMembershipProvider.MembershipProvider.GetUser(String username) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 965
at TMTechMembershipProvider.MembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) in d:\Visual Studio 2010\Projects\TMTechMembershipProvider\TMTechMembershipProvider\TMTechMembershipProvider.cs:line 435
InnerException:
System.Web.Security.MembershipAdapter.get_Providers() Initialize() The given assembly name or codebase was invalid.
| 0 |
7,440,822 | 09/16/2011 06:11:19 | 948,228 | 09/16/2011 06:09:43 | 1 | 0 | Extjs - How to select combobox in bold some options? | There are five options assume a combobox, to highlight the last 2 tags ? | extjs | combobox | highlight | null | null | 09/16/2011 20:42:30 | not a real question | Extjs - How to select combobox in bold some options?
===
There are five options assume a combobox, to highlight the last 2 tags ? | 1 |
3,291,941 | 07/20/2010 16:00:05 | 175,562 | 09/18/2009 14:01:34 | 115 | 3 | Best free registration process to avoid spammers/scammers | AT the moment, the site I look over sends an activation email to new members which have a link they must click to activate their account. While this seems like a good idea, it has many faults such as occasionally the email lands in their spam/junk folder and its yet another step the user has to do.
I was try to make it easier for users to join and activation seems to be the biggest hurdle. We have put this in place to avoid spammers and scammers and it does work. I don't want to go for the 'moderation' method either.
Any suggestions? | process | user | usability | registration | signup | null | open | Best free registration process to avoid spammers/scammers
===
AT the moment, the site I look over sends an activation email to new members which have a link they must click to activate their account. While this seems like a good idea, it has many faults such as occasionally the email lands in their spam/junk folder and its yet another step the user has to do.
I was try to make it easier for users to join and activation seems to be the biggest hurdle. We have put this in place to avoid spammers and scammers and it does work. I don't want to go for the 'moderation' method either.
Any suggestions? | 0 |
8,610,234 | 12/22/2011 22:04:38 | 1,112,388 | 12/22/2011 19:51:37 | 1 | 0 | Is there a way to insert "wsmp:" in to the soap method request in c#? | I have need to build a c# web client that can consume an existing java weblogic web service that uses wsse security. Changing the existing java weblogic web service to work with C# is not an option. I have hopes a solution is easily found.
For the client, I am using c# with Microsoft.Web.Services3 in VisualStudio 2010. I know Web.Services3 has been deprecated, but I am unable to find a WCF solution that works where I can add the needed wsse:Security tags, and in the order the required by the web service.
Using Web.Service3, the generated soap request does not include the needed soap attribute tags in the soap body. Using soapUI to test, the only difference between the working and non-working request is the missing "wsmp:" tag in the soap body. If I can find a way to insert "wsmp:" into the method tag of the soap body, the c# request will work.
In the soap body, it is missing the web service defined soap header tags "wsmp:". Is there a way to insert this tag in to the client request in c#?
This is the body that is generated, sorry had to remove the < and > on the tags in order to post the text in this message.
getForm xmlns="http://mydomain/wsmpServices/1.0"
This is the body that is needed, note the wsmp:getForm tag instead of getForm:
wsmp:getForm xmlns:wsmp="http://mydomain/wsmpServices/1.0"
Any help or pointers on how to go from what is generated to what is needed?
| c# | soap | null | null | null | null | open | Is there a way to insert "wsmp:" in to the soap method request in c#?
===
I have need to build a c# web client that can consume an existing java weblogic web service that uses wsse security. Changing the existing java weblogic web service to work with C# is not an option. I have hopes a solution is easily found.
For the client, I am using c# with Microsoft.Web.Services3 in VisualStudio 2010. I know Web.Services3 has been deprecated, but I am unable to find a WCF solution that works where I can add the needed wsse:Security tags, and in the order the required by the web service.
Using Web.Service3, the generated soap request does not include the needed soap attribute tags in the soap body. Using soapUI to test, the only difference between the working and non-working request is the missing "wsmp:" tag in the soap body. If I can find a way to insert "wsmp:" into the method tag of the soap body, the c# request will work.
In the soap body, it is missing the web service defined soap header tags "wsmp:". Is there a way to insert this tag in to the client request in c#?
This is the body that is generated, sorry had to remove the < and > on the tags in order to post the text in this message.
getForm xmlns="http://mydomain/wsmpServices/1.0"
This is the body that is needed, note the wsmp:getForm tag instead of getForm:
wsmp:getForm xmlns:wsmp="http://mydomain/wsmpServices/1.0"
Any help or pointers on how to go from what is generated to what is needed?
| 0 |
2,255,157 | 02/12/2010 21:13:57 | 259,712 | 01/27/2010 01:36:31 | 298 | 7 | NSIS script - download .NET framework, DirectX | Can a NSIS script download .NET and DirectX from microsoft, then install it?
I don't want to include the installers in my installer because they are huge. | nsis | .net | directx | null | null | null | open | NSIS script - download .NET framework, DirectX
===
Can a NSIS script download .NET and DirectX from microsoft, then install it?
I don't want to include the installers in my installer because they are huge. | 0 |
5,098,536 | 02/23/2011 23:17:01 | 374,977 | 06/24/2010 07:11:10 | 35 | 2 | Google Custom Search does not return structured data which I entered using PageMap | here is the page map that I added as a comment in the HEAD section
<!--<PageMap>
<DataObject type="document">
<Attribute name="id">2067</Attribute>
<Attribute name="title">Empowering the Middle and Creating Workforce Readiness</Attribute>
<Attribute name="urlTitle">Empowering-the-Middle-and-Creating-Workforce-Readiness</Attribute>
<Attribute name="category">Business</Attribute>
<Attribute name="briefDescription">Join Stacey Harris and Stacia Garr as they share recent Bersin & Associates’ findings regarding the impact of…</Attribute>
<Attribute name="description">Have you given enough thought to how you are empowering the middle of your organization? The market has been focused on leveraging top talent, investing in high potentials and preparing executives. But in the midst of all this segmentation, have you thought about the engine of your workforce — your middle management and consistent performers? Over the past several years, companies have asked their employees to do more with less, increase innovation, collaborate and work globally. However, many have failed to give the middle of the organization the support it needs to succeed in today’s modern work environment. <br /><br />Join Stacey Harris and Stacia Garr as they share recent Bersin & Associates’ findings regarding the impact of increasing the capabilities of line managers and the value of motivating and empowering middle performers. The discussion will include examples of how leading organizations are developing leaders from the bottom up, providing tools to help middle performers do their jobs more effectively and improving enterprise career management strategies. Specific case studies will be included in the presentation.<br /><br /></Attribute>
<Attribute name="startTime">2011-02-22 11:00:00</Attribute><Attribute name="presenter1">Stacey Harris</Attribute><Attribute name="presenter2">Stacia Garr</Attribute><Attribute name="host1">TM</Attribute>
</DataObject>
</PageMap>
-->
When I use the rich snippets testing tool......i get the following error : **"Insufficient data to generate the preview."**
Could anyone help me understand why it is not returning this info as part of the response XML | search | google | map | page | null | null | open | Google Custom Search does not return structured data which I entered using PageMap
===
here is the page map that I added as a comment in the HEAD section
<!--<PageMap>
<DataObject type="document">
<Attribute name="id">2067</Attribute>
<Attribute name="title">Empowering the Middle and Creating Workforce Readiness</Attribute>
<Attribute name="urlTitle">Empowering-the-Middle-and-Creating-Workforce-Readiness</Attribute>
<Attribute name="category">Business</Attribute>
<Attribute name="briefDescription">Join Stacey Harris and Stacia Garr as they share recent Bersin & Associates’ findings regarding the impact of…</Attribute>
<Attribute name="description">Have you given enough thought to how you are empowering the middle of your organization? The market has been focused on leveraging top talent, investing in high potentials and preparing executives. But in the midst of all this segmentation, have you thought about the engine of your workforce — your middle management and consistent performers? Over the past several years, companies have asked their employees to do more with less, increase innovation, collaborate and work globally. However, many have failed to give the middle of the organization the support it needs to succeed in today’s modern work environment. <br /><br />Join Stacey Harris and Stacia Garr as they share recent Bersin & Associates’ findings regarding the impact of increasing the capabilities of line managers and the value of motivating and empowering middle performers. The discussion will include examples of how leading organizations are developing leaders from the bottom up, providing tools to help middle performers do their jobs more effectively and improving enterprise career management strategies. Specific case studies will be included in the presentation.<br /><br /></Attribute>
<Attribute name="startTime">2011-02-22 11:00:00</Attribute><Attribute name="presenter1">Stacey Harris</Attribute><Attribute name="presenter2">Stacia Garr</Attribute><Attribute name="host1">TM</Attribute>
</DataObject>
</PageMap>
-->
When I use the rich snippets testing tool......i get the following error : **"Insufficient data to generate the preview."**
Could anyone help me understand why it is not returning this info as part of the response XML | 0 |
2,423,805 | 03/11/2010 09:28:10 | 276,439 | 02/18/2010 20:10:24 | 10 | 0 | Core data select objects from an array - iPhone | I was wondering if I could select objects based on a predicate with an array... for example
Code:
[NSPredicate predicateWithFormat:@"id=%@", arrayOfID];
Will it work? If no, how can I do it?
Best | iphone | core-data | query | database | objective-c | null | open | Core data select objects from an array - iPhone
===
I was wondering if I could select objects based on a predicate with an array... for example
Code:
[NSPredicate predicateWithFormat:@"id=%@", arrayOfID];
Will it work? If no, how can I do it?
Best | 0 |
8,055,503 | 11/08/2011 18:42:19 | 724,882 | 04/26/2011 06:41:28 | 54 | 0 | Traffic filtering in Chrome without WebRequest | I am interested in filtering traffic comming into Chrome. I've seen WebRequest API and ignoring the fact that it's experimental it seems that you can't stop traffic since events are asynchronous.
I was also exploring the NPAPI plugins for filtering but it seems that they are plugins that need to be registered for particular content type.
Is there any other way for filtering and blocking incoming HTTP traffic in Chrome? | google-chrome | google-chrome-extension | filtering | null | null | null | open | Traffic filtering in Chrome without WebRequest
===
I am interested in filtering traffic comming into Chrome. I've seen WebRequest API and ignoring the fact that it's experimental it seems that you can't stop traffic since events are asynchronous.
I was also exploring the NPAPI plugins for filtering but it seems that they are plugins that need to be registered for particular content type.
Is there any other way for filtering and blocking incoming HTTP traffic in Chrome? | 0 |
4,934,403 | 02/08/2011 14:43:37 | 345,157 | 02/19/2010 13:44:46 | 138 | 0 | Is there a JQuery / JS plugin to do a map similar to google maps? | Of course, the map would not be of a city, so I cannot use a Google Maps plugin. What I need, more or less, is this:
- Use my own image as a map
- The map will have hotspots that must be responsive to hover and clicks.
- To drag the map with the mouse, as in Google Maps.
Does anyone know of a plugin like this?
| jquery | plugins | maps | null | null | null | open | Is there a JQuery / JS plugin to do a map similar to google maps?
===
Of course, the map would not be of a city, so I cannot use a Google Maps plugin. What I need, more or less, is this:
- Use my own image as a map
- The map will have hotspots that must be responsive to hover and clicks.
- To drag the map with the mouse, as in Google Maps.
Does anyone know of a plugin like this?
| 0 |
10,648,653 | 05/18/2012 07:42:34 | 832,442 | 07/06/2011 21:30:33 | 26 | 0 | Do I need to know web application development to make mobile apps? | So I am looking to learn both web application development and mobile app development, and I was wondering is there is an overlap between the two. More specifically, is the knowledge of developing web apps essential or even helpful when building mobile apps?
I was under the impression that one had to know basic web app development first (at least server side programming) before being able to develop mobile apps that use the internet (since I assumed a mobile app is just a different client side that would ultimately have to talk to a web application on a server somewhere). However, Googling this brings up discussions about mobile web apps vs. native mobile apps, and this has me confused (for example is Shazaam a native or a web app?).
Please help me understand. | android | iphone | web-applications | mobile-application | null | 05/18/2012 14:15:05 | not a real question | Do I need to know web application development to make mobile apps?
===
So I am looking to learn both web application development and mobile app development, and I was wondering is there is an overlap between the two. More specifically, is the knowledge of developing web apps essential or even helpful when building mobile apps?
I was under the impression that one had to know basic web app development first (at least server side programming) before being able to develop mobile apps that use the internet (since I assumed a mobile app is just a different client side that would ultimately have to talk to a web application on a server somewhere). However, Googling this brings up discussions about mobile web apps vs. native mobile apps, and this has me confused (for example is Shazaam a native or a web app?).
Please help me understand. | 1 |
9,163,352 | 02/06/2012 16:20:19 | 778,658 | 06/01/2011 02:54:27 | 30 | 1 | app crushes when runs in small and large screens in android | I have been developing an app which should support multiple screens.In this,it works fine when i run that app in medium size screen(nexus 3.7),but if i run the same code using a small or large screen,the app crushes.Can anyone tell me how to solve this issue.
"
02-06 21:05:38.384: E/AndroidRuntime(331): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.deepak.alice/com.android.deepak.alice.SwipeOfLetters}: android.view.InflateException: Binary XML file line #17: Error inflating class <unknown>
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class <unknown>
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: java.lang.reflect.InvocationTargetException
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
"
These are the reasons for the crush to occur..but i havnot able to solve these pblms.... | android | null | null | null | null | null | open | app crushes when runs in small and large screens in android
===
I have been developing an app which should support multiple screens.In this,it works fine when i run that app in medium size screen(nexus 3.7),but if i run the same code using a small or large screen,the app crushes.Can anyone tell me how to solve this issue.
"
02-06 21:05:38.384: E/AndroidRuntime(331): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.deepak.alice/com.android.deepak.alice.SwipeOfLetters}: android.view.InflateException: Binary XML file line #17: Error inflating class <unknown>
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class <unknown>
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: java.lang.reflect.InvocationTargetException
02-06 21:05:38.384: E/AndroidRuntime(331): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
"
These are the reasons for the crush to occur..but i havnot able to solve these pblms.... | 0 |
10,629,814 | 05/17/2012 04:26:13 | 295,189 | 03/16/2010 21:44:33 | 1,634 | 21 | I am trying to create a table from a jsfiddle example but its not working ANGULAR.JS | I am trying to create a table that I found here
http://jsfiddle.net/m3j8k/6/
but I have to integrate it to my solutions and code and when I do that, I get these wonky chracters but no error.
my code is here
![enter image description here][1]
http://jsfiddle.net/Ug57r/3/
please see the image below.
I am trying to have this
![enter image description here][2]
[1]: http://i.stack.imgur.com/fk0fY.png
[2]: http://i.stack.imgur.com/iZvpL.png | javascript | angularjs | angular | null | null | null | open | I am trying to create a table from a jsfiddle example but its not working ANGULAR.JS
===
I am trying to create a table that I found here
http://jsfiddle.net/m3j8k/6/
but I have to integrate it to my solutions and code and when I do that, I get these wonky chracters but no error.
my code is here
![enter image description here][1]
http://jsfiddle.net/Ug57r/3/
please see the image below.
I am trying to have this
![enter image description here][2]
[1]: http://i.stack.imgur.com/fk0fY.png
[2]: http://i.stack.imgur.com/iZvpL.png | 0 |
4,362,926 | 12/06/2010 03:24:57 | 404,409 | 07/28/2010 11:03:33 | 112 | 0 | Java: Threads, how to make them all do something | I am trying to implement nodes talking to each other in Java. I am doing this by creating a new thread for every node that wants to talk to the server.
When the given number of nodes, i.e. that many threads have been created, have connected to the server I want each thread to execute their next bit of code after adding to the "sharedCounter".
I think I need to use 'locks' on the shared variable, and something like signalAll() or notifyAll() to get all the threads going, but I can't seem to make clear sense of exactly how this works or to implement it.
<BR />
Any help explaining these Java concepts would be greatly appreciated :D
<BR />
Below is roughly the structure of my code:
import java.net.*;
import java.io.*;
public class Node {
public static void main(String[] args) {
...
// Chooses server or client launchers depend on parameters.
...
}
}
class sharedResource {
private int sharedCounter;
public sharedResource(int i) {
sharedCounter = i;
}
public synchronized void incSharedCounter() {
sharedCounter--;
if (sharedCounter == 0)
// Get all threads to do something
}
}
class Server {
...
for (int i = 0; i < numberOfThreads; i++) {
new serverThread(serverSocket.accept()).start();
}
...
sharedResource threadCount = new sharedResource(numberOfThreads);
...
}
class serverThread extends Thread {
...
//some code
Server.threadCount.incSharedCounter();
// Some more code to run when sharedCounte == 0
...
}
class Client {
...
} | java | multithreading | locking | null | null | null | open | Java: Threads, how to make them all do something
===
I am trying to implement nodes talking to each other in Java. I am doing this by creating a new thread for every node that wants to talk to the server.
When the given number of nodes, i.e. that many threads have been created, have connected to the server I want each thread to execute their next bit of code after adding to the "sharedCounter".
I think I need to use 'locks' on the shared variable, and something like signalAll() or notifyAll() to get all the threads going, but I can't seem to make clear sense of exactly how this works or to implement it.
<BR />
Any help explaining these Java concepts would be greatly appreciated :D
<BR />
Below is roughly the structure of my code:
import java.net.*;
import java.io.*;
public class Node {
public static void main(String[] args) {
...
// Chooses server or client launchers depend on parameters.
...
}
}
class sharedResource {
private int sharedCounter;
public sharedResource(int i) {
sharedCounter = i;
}
public synchronized void incSharedCounter() {
sharedCounter--;
if (sharedCounter == 0)
// Get all threads to do something
}
}
class Server {
...
for (int i = 0; i < numberOfThreads; i++) {
new serverThread(serverSocket.accept()).start();
}
...
sharedResource threadCount = new sharedResource(numberOfThreads);
...
}
class serverThread extends Thread {
...
//some code
Server.threadCount.incSharedCounter();
// Some more code to run when sharedCounte == 0
...
}
class Client {
...
} | 0 |
1,502,874 | 10/01/2009 09:22:40 | 1,116 | 08/12/2008 13:25:41 | 7,664 | 322 | Web Methods works with html button but not asp:button | I'm am looking at the code in [this][1] article on Web methods and I've tried to implement it.
The article works as designed but when I swap the HTML button for an asp:button I get different results.
CODE behind:
[WebMethod]
public static string GetCurrentDate()
{
return DateTime.Now.ToString();
}
Aspx page:
js:
<script type="text/javascript">
function UpdateTime() {
$get('Label6').innerHTML = PageMethods.GetCurrentDate(OnSucceeded,
OnFailed);
}
function OnSucceeded(result, userContext, methodName) {
$get('Label6').innerHTML = result;
}
function OnFailed(error, userContext, methodName) {
$get('Label6').innerHTML = "An error occured.";
}
</script>
and other markup
<form id="form1" runat="server">
<asp:ScriptManager EnablePageMethods="true"
ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<div id="usingWebMethods">
<asp:Label runat="server"
Text="Using WebMethods"
ID="Label5" />
<br />
<asp:Label
runat="server"
Text="Web Method Update!"
ID="Label6" />
<asp:Button ID="Button3"
runat="server"
Text="Postback Update"
OnClientClick="UpdateTime();"
UseSubmitBehavior="False" />
<input type="button"
id="Button4"
value="Web Method Update"
onclick="UpdateTime();" />
</div>
</form>
[1]: http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/
I've noticed 2 things with the button. The button returns an error occurred and even though the label changes the viewstate is not updated.
Why do these 2 issues occur and what can I do to resolve them? | asp.net | webmethods | viewstate | page-lifecycle | null | null | open | Web Methods works with html button but not asp:button
===
I'm am looking at the code in [this][1] article on Web methods and I've tried to implement it.
The article works as designed but when I swap the HTML button for an asp:button I get different results.
CODE behind:
[WebMethod]
public static string GetCurrentDate()
{
return DateTime.Now.ToString();
}
Aspx page:
js:
<script type="text/javascript">
function UpdateTime() {
$get('Label6').innerHTML = PageMethods.GetCurrentDate(OnSucceeded,
OnFailed);
}
function OnSucceeded(result, userContext, methodName) {
$get('Label6').innerHTML = result;
}
function OnFailed(error, userContext, methodName) {
$get('Label6').innerHTML = "An error occured.";
}
</script>
and other markup
<form id="form1" runat="server">
<asp:ScriptManager EnablePageMethods="true"
ID="ScriptManager2" runat="server">
</asp:ScriptManager>
<div id="usingWebMethods">
<asp:Label runat="server"
Text="Using WebMethods"
ID="Label5" />
<br />
<asp:Label
runat="server"
Text="Web Method Update!"
ID="Label6" />
<asp:Button ID="Button3"
runat="server"
Text="Postback Update"
OnClientClick="UpdateTime();"
UseSubmitBehavior="False" />
<input type="button"
id="Button4"
value="Web Method Update"
onclick="UpdateTime();" />
</div>
</form>
[1]: http://encosia.com/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/
I've noticed 2 things with the button. The button returns an error occurred and even though the label changes the viewstate is not updated.
Why do these 2 issues occur and what can I do to resolve them? | 0 |
10,425,332 | 05/03/2012 04:53:56 | 676,582 | 03/25/2011 11:08:48 | 1 | 0 | how to create a C# wrapper class from the C++ tesseract library? | Please guide me on how to create a C# wrapper to access the methods of the tesseract library which is in C++. | c# | c++ | wrapper | dllimport | tesseract | 05/10/2012 08:44:44 | not a real question | how to create a C# wrapper class from the C++ tesseract library?
===
Please guide me on how to create a C# wrapper to access the methods of the tesseract library which is in C++. | 1 |
3,759,987 | 09/21/2010 11:50:21 | 413,170 | 08/06/2010 14:45:08 | 45 | 6 | PHP SOAP tutorial? | I need to write a SOAP client using PHP 5.3. The WSDL for the service is reasonably complicated.
I can't find a PHP SOAP tutorial anywhere that walks through how to do this - I haven't found any that use the 5.3 SoapClient and explain how to construct SoapVars and SoapParams for complex data types.
Is this the best library to use? I'm assuming it must be for speed. I've seen a lot of references to nusoap which I'm assuming was the library most people used before PHP got its own native libraries.
Does anyone know where I can find a tutorial to help please?
Thanks | php | soap | soap-client | php-soapclient | null | 07/13/2012 13:38:31 | not constructive | PHP SOAP tutorial?
===
I need to write a SOAP client using PHP 5.3. The WSDL for the service is reasonably complicated.
I can't find a PHP SOAP tutorial anywhere that walks through how to do this - I haven't found any that use the 5.3 SoapClient and explain how to construct SoapVars and SoapParams for complex data types.
Is this the best library to use? I'm assuming it must be for speed. I've seen a lot of references to nusoap which I'm assuming was the library most people used before PHP got its own native libraries.
Does anyone know where I can find a tutorial to help please?
Thanks | 4 |
7,295,378 | 09/03/2011 19:29:27 | 95,245 | 04/23/2009 23:49:55 | 2,571 | 120 | mock datareader failing on second call | In the test below, the mocked datareader returns the desired value the first time, but then returns the same value when the index should be 1.
Am I misusing the dataReader or Rhino stub syntax? What is the fix?
Cheers,
Berryl
failing test
===========
[Test]
public void NullSafeGet_GetsBothProperties()
{
var sessionImplementor = MockRepository.GenerateStub<ISessionImplementor>();
var userType = new DateRangeUserType();
var reader = MockRepository.GenerateStub<IDataReader>();
var start = new DateTime(2011, 6, 1);
var end = new DateTime(2011, 7, 1);
reader.Stub(x => x[0]).Return(start);
reader.Stub(x => x[1]).Return(end); ***<==== returns Jun 1 instead of Jul1
var result = userType.NullSafeGet(reader, userType.PropertyNames, sessionImplementor, null);
Assert.That(result, Is.EqualTo(new DateRange(start, end, DateRange.MaxSupportedPrecision)));
}
Expected: <6/1/2011 12:00 AM - 7/1/2011 12:00 AM>
But was: <6/1/2011 12:00 AM - 6/1/2011 12:00 AM>
SUT (NHib CompositeUserType method)
======
public override object NullSafeGet(IDataReader dr, string[] names, ISessionImplementor session, object owner)
{
if (dr == null) return null;
var foundStart = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, names[0], session, owner);
var foundEnd = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, names[1], session, owner);
var precision = DateRange.MaxSupportedPrecision;
var startDp = _getDatePoint(foundStart, precision);
var endDp = _getDatePoint(foundEnd, precision);
return new DateRange(startDp, endDp, precision);
}
| unit-testing | nhibernate | mocking | rhino-mocks | null | null | open | mock datareader failing on second call
===
In the test below, the mocked datareader returns the desired value the first time, but then returns the same value when the index should be 1.
Am I misusing the dataReader or Rhino stub syntax? What is the fix?
Cheers,
Berryl
failing test
===========
[Test]
public void NullSafeGet_GetsBothProperties()
{
var sessionImplementor = MockRepository.GenerateStub<ISessionImplementor>();
var userType = new DateRangeUserType();
var reader = MockRepository.GenerateStub<IDataReader>();
var start = new DateTime(2011, 6, 1);
var end = new DateTime(2011, 7, 1);
reader.Stub(x => x[0]).Return(start);
reader.Stub(x => x[1]).Return(end); ***<==== returns Jun 1 instead of Jul1
var result = userType.NullSafeGet(reader, userType.PropertyNames, sessionImplementor, null);
Assert.That(result, Is.EqualTo(new DateRange(start, end, DateRange.MaxSupportedPrecision)));
}
Expected: <6/1/2011 12:00 AM - 7/1/2011 12:00 AM>
But was: <6/1/2011 12:00 AM - 6/1/2011 12:00 AM>
SUT (NHib CompositeUserType method)
======
public override object NullSafeGet(IDataReader dr, string[] names, ISessionImplementor session, object owner)
{
if (dr == null) return null;
var foundStart = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, names[0], session, owner);
var foundEnd = (DateTime) NHibernateUtil.DateTime.NullSafeGet(dr, names[1], session, owner);
var precision = DateRange.MaxSupportedPrecision;
var startDp = _getDatePoint(foundStart, precision);
var endDp = _getDatePoint(foundEnd, precision);
return new DateRange(startDp, endDp, precision);
}
| 0 |
6,740,349 | 07/18/2011 22:50:55 | 848,927 | 07/17/2011 18:04:30 | 1 | 0 | Detecting non-english character based languages | I am looking for solution in php.
I want to detect the presence of languages like Chinese, Japanese, Arabic, Hindi in text.
| php | language-agnostic | null | null | null | 07/19/2011 04:23:51 | not a real question | Detecting non-english character based languages
===
I am looking for solution in php.
I want to detect the presence of languages like Chinese, Japanese, Arabic, Hindi in text.
| 1 |
3,539,013 | 08/21/2010 21:14:10 | 427,303 | 08/21/2010 21:05:00 | 1 | 1 | I need CRC Reverse Code for my CRC64 Checksum Coding | Can someone please code me the CRC64 Reverse Algorithm in C#? I am unable to code it, can't understand anything. Thanks,
I have copied the CRC64 Checksum code from C++ and converted it into C# .NET. The entire code is displayed below:
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CRC64
{
public class cCRC64
{
public UInt64[] crc64_table = {
0x0000000000000000, 0x42F0E1EBA9EA3693,
0x85E1C3D753D46D26, 0xC711223CFA3E5BB5,
0x493366450E42ECDF, 0x0BC387AEA7A8DA4C,
0xCCD2A5925D9681F9, 0x8E224479F47CB76A,
0x9266CC8A1C85D9BE, 0xD0962D61B56FEF2D,
0x17870F5D4F51B498, 0x5577EEB6E6BB820B,
0xDB55AACF12C73561, 0x99A54B24BB2D03F2,
0x5EB4691841135847, 0x1C4488F3E8F96ED4,
0x663D78FF90E185EF, 0x24CD9914390BB37C,
0xE3DCBB28C335E8C9, 0xA12C5AC36ADFDE5A,
0x2F0E1EBA9EA36930, 0x6DFEFF5137495FA3,
0xAAEFDD6DCD770416, 0xE81F3C86649D3285,
0xF45BB4758C645C51, 0xB6AB559E258E6AC2,
0x71BA77A2DFB03177, 0x334A9649765A07E4,
0xBD68D2308226B08E, 0xFF9833DB2BCC861D,
0x388911E7D1F2DDA8, 0x7A79F00C7818EB3B,
0xCC7AF1FF21C30BDE, 0x8E8A101488293D4D,
0x499B3228721766F8, 0x0B6BD3C3DBFD506B,
0x854997BA2F81E701, 0xC7B97651866BD192,
0x00A8546D7C558A27, 0x4258B586D5BFBCB4,
0x5E1C3D753D46D260, 0x1CECDC9E94ACE4F3,
0xDBFDFEA26E92BF46, 0x990D1F49C77889D5,
0x172F5B3033043EBF, 0x55DFBADB9AEE082C,
0x92CE98E760D05399, 0xD03E790CC93A650A,
0xAA478900B1228E31, 0xE8B768EB18C8B8A2,
0x2FA64AD7E2F6E317, 0x6D56AB3C4B1CD584,
0xE374EF45BF6062EE, 0xA1840EAE168A547D,
0x66952C92ECB40FC8, 0x2465CD79455E395B,
0x3821458AADA7578F, 0x7AD1A461044D611C,
0xBDC0865DFE733AA9, 0xFF3067B657990C3A,
0x711223CFA3E5BB50, 0x33E2C2240A0F8DC3,
0xF4F3E018F031D676, 0xB60301F359DBE0E5,
0xDA050215EA6C212F, 0x98F5E3FE438617BC,
0x5FE4C1C2B9B84C09, 0x1D14202910527A9A,
0x93366450E42ECDF0, 0xD1C685BB4DC4FB63,
0x16D7A787B7FAA0D6, 0x5427466C1E109645,
0x4863CE9FF6E9F891, 0x0A932F745F03CE02,
0xCD820D48A53D95B7, 0x8F72ECA30CD7A324,
0x0150A8DAF8AB144E, 0x43A04931514122DD,
0x84B16B0DAB7F7968, 0xC6418AE602954FFB,
0xBC387AEA7A8DA4C0, 0xFEC89B01D3679253,
0x39D9B93D2959C9E6, 0x7B2958D680B3FF75,
0xF50B1CAF74CF481F, 0xB7FBFD44DD257E8C,
0x70EADF78271B2539, 0x321A3E938EF113AA,
0x2E5EB66066087D7E, 0x6CAE578BCFE24BED,
0xABBF75B735DC1058, 0xE94F945C9C3626CB,
0x676DD025684A91A1, 0x259D31CEC1A0A732,
0xE28C13F23B9EFC87, 0xA07CF2199274CA14,
0x167FF3EACBAF2AF1, 0x548F120162451C62,
0x939E303D987B47D7, 0xD16ED1D631917144,
0x5F4C95AFC5EDC62E, 0x1DBC74446C07F0BD,
0xDAAD56789639AB08, 0x985DB7933FD39D9B,
0x84193F60D72AF34F, 0xC6E9DE8B7EC0C5DC,
0x01F8FCB784FE9E69, 0x43081D5C2D14A8FA,
0xCD2A5925D9681F90, 0x8FDAB8CE70822903,
0x48CB9AF28ABC72B6, 0x0A3B7B1923564425,
0x70428B155B4EAF1E, 0x32B26AFEF2A4998D,
0xF5A348C2089AC238, 0xB753A929A170F4AB,
0x3971ED50550C43C1, 0x7B810CBBFCE67552,
0xBC902E8706D82EE7, 0xFE60CF6CAF321874,
0xE224479F47CB76A0, 0xA0D4A674EE214033,
0x67C58448141F1B86, 0x253565A3BDF52D15,
0xAB1721DA49899A7F, 0xE9E7C031E063ACEC,
0x2EF6E20D1A5DF759, 0x6C0603E6B3B7C1CA,
0xF6FAE5C07D3274CD, 0xB40A042BD4D8425E,
0x731B26172EE619EB, 0x31EBC7FC870C2F78,
0xBFC9838573709812, 0xFD39626EDA9AAE81,
0x3A28405220A4F534, 0x78D8A1B9894EC3A7,
0x649C294A61B7AD73, 0x266CC8A1C85D9BE0,
0xE17DEA9D3263C055, 0xA38D0B769B89F6C6,
0x2DAF4F0F6FF541AC, 0x6F5FAEE4C61F773F,
0xA84E8CD83C212C8A, 0xEABE6D3395CB1A19,
0x90C79D3FEDD3F122, 0xD2377CD44439C7B1,
0x15265EE8BE079C04, 0x57D6BF0317EDAA97,
0xD9F4FB7AE3911DFD, 0x9B041A914A7B2B6E,
0x5C1538ADB04570DB, 0x1EE5D94619AF4648,
0x02A151B5F156289C, 0x4051B05E58BC1E0F,
0x87409262A28245BA, 0xC5B073890B687329,
0x4B9237F0FF14C443, 0x0962D61B56FEF2D0,
0xCE73F427ACC0A965, 0x8C8315CC052A9FF6,
0x3A80143F5CF17F13, 0x7870F5D4F51B4980,
0xBF61D7E80F251235, 0xFD913603A6CF24A6,
0x73B3727A52B393CC, 0x31439391FB59A55F,
0xF652B1AD0167FEEA, 0xB4A25046A88DC879,
0xA8E6D8B54074A6AD, 0xEA16395EE99E903E,
0x2D071B6213A0CB8B, 0x6FF7FA89BA4AFD18,
0xE1D5BEF04E364A72, 0xA3255F1BE7DC7CE1,
0x64347D271DE22754, 0x26C49CCCB40811C7,
0x5CBD6CC0CC10FAFC, 0x1E4D8D2B65FACC6F,
0xD95CAF179FC497DA, 0x9BAC4EFC362EA149,
0x158E0A85C2521623, 0x577EEB6E6BB820B0,
0x906FC95291867B05, 0xD29F28B9386C4D96,
0xCEDBA04AD0952342, 0x8C2B41A1797F15D1,
0x4B3A639D83414E64, 0x09CA82762AAB78F7,
0x87E8C60FDED7CF9D, 0xC51827E4773DF90E,
0x020905D88D03A2BB, 0x40F9E43324E99428,
0x2CFFE7D5975E55E2, 0x6E0F063E3EB46371,
0xA91E2402C48A38C4, 0xEBEEC5E96D600E57,
0x65CC8190991CB93D, 0x273C607B30F68FAE,
0xE02D4247CAC8D41B, 0xA2DDA3AC6322E288,
0xBE992B5F8BDB8C5C, 0xFC69CAB42231BACF,
0x3B78E888D80FE17A, 0x7988096371E5D7E9,
0xF7AA4D1A85996083, 0xB55AACF12C735610,
0x724B8ECDD64D0DA5, 0x30BB6F267FA73B36,
0x4AC29F2A07BFD00D, 0x08327EC1AE55E69E,
0xCF235CFD546BBD2B, 0x8DD3BD16FD818BB8,
0x03F1F96F09FD3CD2, 0x41011884A0170A41,
0x86103AB85A2951F4, 0xC4E0DB53F3C36767,
0xD8A453A01B3A09B3, 0x9A54B24BB2D03F20,
0x5D45907748EE6495, 0x1FB5719CE1045206,
0x919735E51578E56C, 0xD367D40EBC92D3FF,
0x1476F63246AC884A, 0x568617D9EF46BED9,
0xE085162AB69D5E3C, 0xA275F7C11F7768AF,
0x6564D5FDE549331A, 0x279434164CA30589,
0xA9B6706FB8DFB2E3, 0xEB46918411358470,
0x2C57B3B8EB0BDFC5, 0x6EA7525342E1E956,
0x72E3DAA0AA188782, 0x30133B4B03F2B111,
0xF7021977F9CCEAA4, 0xB5F2F89C5026DC37,
0x3BD0BCE5A45A6B5D, 0x79205D0E0DB05DCE,
0xBE317F32F78E067B, 0xFCC19ED95E6430E8,
0x86B86ED5267CDBD3, 0xC4488F3E8F96ED40,
0x0359AD0275A8B6F5, 0x41A94CE9DC428066,
0xCF8B0890283E370C, 0x8D7BE97B81D4019F,
0x4A6ACB477BEA5A2A, 0x089A2AACD2006CB9,
0x14DEA25F3AF9026D, 0x562E43B4931334FE,
0x913F6188692D6F4B, 0xD3CF8063C0C759D8,
0x5DEDC41A34BBEEB2, 0x1F1D25F19D51D821,
0xD80C07CD676F8394, 0x9AFCE626CE85B507
};
/* Initialize a CRC accumulator */
public void Init_crc(UInt64 crc)
{
crc = 0xffffffffffffffff;
}
/* Finish a CRC calculation */
public void Fin_crc(UInt64 crc)
{
crc ^= 0xffffffffffffffff;
}
/* Accumulate some (more) bytes into a CRC */
public void Calc_crc(ref UInt64 crc, Byte[] pbData, uint len)
{
/* Constant table for CRC calculation */
uint __len = len;
uint pos = 0;
byte byteInput = 0;
while (__len-- > 0)
{
uint __tab_index = ((uint)(crc >> 56) ^ pbData[pos++]) & 0xFF;
crc = crc64_table[__tab_index] ^ (crc << 8);
}
}
}
}
</code>
Waiting for help! | c# | algorithm | 64bit | crc | crc32 | 08/21/2010 22:02:49 | not a real question | I need CRC Reverse Code for my CRC64 Checksum Coding
===
Can someone please code me the CRC64 Reverse Algorithm in C#? I am unable to code it, can't understand anything. Thanks,
I have copied the CRC64 Checksum code from C++ and converted it into C# .NET. The entire code is displayed below:
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CRC64
{
public class cCRC64
{
public UInt64[] crc64_table = {
0x0000000000000000, 0x42F0E1EBA9EA3693,
0x85E1C3D753D46D26, 0xC711223CFA3E5BB5,
0x493366450E42ECDF, 0x0BC387AEA7A8DA4C,
0xCCD2A5925D9681F9, 0x8E224479F47CB76A,
0x9266CC8A1C85D9BE, 0xD0962D61B56FEF2D,
0x17870F5D4F51B498, 0x5577EEB6E6BB820B,
0xDB55AACF12C73561, 0x99A54B24BB2D03F2,
0x5EB4691841135847, 0x1C4488F3E8F96ED4,
0x663D78FF90E185EF, 0x24CD9914390BB37C,
0xE3DCBB28C335E8C9, 0xA12C5AC36ADFDE5A,
0x2F0E1EBA9EA36930, 0x6DFEFF5137495FA3,
0xAAEFDD6DCD770416, 0xE81F3C86649D3285,
0xF45BB4758C645C51, 0xB6AB559E258E6AC2,
0x71BA77A2DFB03177, 0x334A9649765A07E4,
0xBD68D2308226B08E, 0xFF9833DB2BCC861D,
0x388911E7D1F2DDA8, 0x7A79F00C7818EB3B,
0xCC7AF1FF21C30BDE, 0x8E8A101488293D4D,
0x499B3228721766F8, 0x0B6BD3C3DBFD506B,
0x854997BA2F81E701, 0xC7B97651866BD192,
0x00A8546D7C558A27, 0x4258B586D5BFBCB4,
0x5E1C3D753D46D260, 0x1CECDC9E94ACE4F3,
0xDBFDFEA26E92BF46, 0x990D1F49C77889D5,
0x172F5B3033043EBF, 0x55DFBADB9AEE082C,
0x92CE98E760D05399, 0xD03E790CC93A650A,
0xAA478900B1228E31, 0xE8B768EB18C8B8A2,
0x2FA64AD7E2F6E317, 0x6D56AB3C4B1CD584,
0xE374EF45BF6062EE, 0xA1840EAE168A547D,
0x66952C92ECB40FC8, 0x2465CD79455E395B,
0x3821458AADA7578F, 0x7AD1A461044D611C,
0xBDC0865DFE733AA9, 0xFF3067B657990C3A,
0x711223CFA3E5BB50, 0x33E2C2240A0F8DC3,
0xF4F3E018F031D676, 0xB60301F359DBE0E5,
0xDA050215EA6C212F, 0x98F5E3FE438617BC,
0x5FE4C1C2B9B84C09, 0x1D14202910527A9A,
0x93366450E42ECDF0, 0xD1C685BB4DC4FB63,
0x16D7A787B7FAA0D6, 0x5427466C1E109645,
0x4863CE9FF6E9F891, 0x0A932F745F03CE02,
0xCD820D48A53D95B7, 0x8F72ECA30CD7A324,
0x0150A8DAF8AB144E, 0x43A04931514122DD,
0x84B16B0DAB7F7968, 0xC6418AE602954FFB,
0xBC387AEA7A8DA4C0, 0xFEC89B01D3679253,
0x39D9B93D2959C9E6, 0x7B2958D680B3FF75,
0xF50B1CAF74CF481F, 0xB7FBFD44DD257E8C,
0x70EADF78271B2539, 0x321A3E938EF113AA,
0x2E5EB66066087D7E, 0x6CAE578BCFE24BED,
0xABBF75B735DC1058, 0xE94F945C9C3626CB,
0x676DD025684A91A1, 0x259D31CEC1A0A732,
0xE28C13F23B9EFC87, 0xA07CF2199274CA14,
0x167FF3EACBAF2AF1, 0x548F120162451C62,
0x939E303D987B47D7, 0xD16ED1D631917144,
0x5F4C95AFC5EDC62E, 0x1DBC74446C07F0BD,
0xDAAD56789639AB08, 0x985DB7933FD39D9B,
0x84193F60D72AF34F, 0xC6E9DE8B7EC0C5DC,
0x01F8FCB784FE9E69, 0x43081D5C2D14A8FA,
0xCD2A5925D9681F90, 0x8FDAB8CE70822903,
0x48CB9AF28ABC72B6, 0x0A3B7B1923564425,
0x70428B155B4EAF1E, 0x32B26AFEF2A4998D,
0xF5A348C2089AC238, 0xB753A929A170F4AB,
0x3971ED50550C43C1, 0x7B810CBBFCE67552,
0xBC902E8706D82EE7, 0xFE60CF6CAF321874,
0xE224479F47CB76A0, 0xA0D4A674EE214033,
0x67C58448141F1B86, 0x253565A3BDF52D15,
0xAB1721DA49899A7F, 0xE9E7C031E063ACEC,
0x2EF6E20D1A5DF759, 0x6C0603E6B3B7C1CA,
0xF6FAE5C07D3274CD, 0xB40A042BD4D8425E,
0x731B26172EE619EB, 0x31EBC7FC870C2F78,
0xBFC9838573709812, 0xFD39626EDA9AAE81,
0x3A28405220A4F534, 0x78D8A1B9894EC3A7,
0x649C294A61B7AD73, 0x266CC8A1C85D9BE0,
0xE17DEA9D3263C055, 0xA38D0B769B89F6C6,
0x2DAF4F0F6FF541AC, 0x6F5FAEE4C61F773F,
0xA84E8CD83C212C8A, 0xEABE6D3395CB1A19,
0x90C79D3FEDD3F122, 0xD2377CD44439C7B1,
0x15265EE8BE079C04, 0x57D6BF0317EDAA97,
0xD9F4FB7AE3911DFD, 0x9B041A914A7B2B6E,
0x5C1538ADB04570DB, 0x1EE5D94619AF4648,
0x02A151B5F156289C, 0x4051B05E58BC1E0F,
0x87409262A28245BA, 0xC5B073890B687329,
0x4B9237F0FF14C443, 0x0962D61B56FEF2D0,
0xCE73F427ACC0A965, 0x8C8315CC052A9FF6,
0x3A80143F5CF17F13, 0x7870F5D4F51B4980,
0xBF61D7E80F251235, 0xFD913603A6CF24A6,
0x73B3727A52B393CC, 0x31439391FB59A55F,
0xF652B1AD0167FEEA, 0xB4A25046A88DC879,
0xA8E6D8B54074A6AD, 0xEA16395EE99E903E,
0x2D071B6213A0CB8B, 0x6FF7FA89BA4AFD18,
0xE1D5BEF04E364A72, 0xA3255F1BE7DC7CE1,
0x64347D271DE22754, 0x26C49CCCB40811C7,
0x5CBD6CC0CC10FAFC, 0x1E4D8D2B65FACC6F,
0xD95CAF179FC497DA, 0x9BAC4EFC362EA149,
0x158E0A85C2521623, 0x577EEB6E6BB820B0,
0x906FC95291867B05, 0xD29F28B9386C4D96,
0xCEDBA04AD0952342, 0x8C2B41A1797F15D1,
0x4B3A639D83414E64, 0x09CA82762AAB78F7,
0x87E8C60FDED7CF9D, 0xC51827E4773DF90E,
0x020905D88D03A2BB, 0x40F9E43324E99428,
0x2CFFE7D5975E55E2, 0x6E0F063E3EB46371,
0xA91E2402C48A38C4, 0xEBEEC5E96D600E57,
0x65CC8190991CB93D, 0x273C607B30F68FAE,
0xE02D4247CAC8D41B, 0xA2DDA3AC6322E288,
0xBE992B5F8BDB8C5C, 0xFC69CAB42231BACF,
0x3B78E888D80FE17A, 0x7988096371E5D7E9,
0xF7AA4D1A85996083, 0xB55AACF12C735610,
0x724B8ECDD64D0DA5, 0x30BB6F267FA73B36,
0x4AC29F2A07BFD00D, 0x08327EC1AE55E69E,
0xCF235CFD546BBD2B, 0x8DD3BD16FD818BB8,
0x03F1F96F09FD3CD2, 0x41011884A0170A41,
0x86103AB85A2951F4, 0xC4E0DB53F3C36767,
0xD8A453A01B3A09B3, 0x9A54B24BB2D03F20,
0x5D45907748EE6495, 0x1FB5719CE1045206,
0x919735E51578E56C, 0xD367D40EBC92D3FF,
0x1476F63246AC884A, 0x568617D9EF46BED9,
0xE085162AB69D5E3C, 0xA275F7C11F7768AF,
0x6564D5FDE549331A, 0x279434164CA30589,
0xA9B6706FB8DFB2E3, 0xEB46918411358470,
0x2C57B3B8EB0BDFC5, 0x6EA7525342E1E956,
0x72E3DAA0AA188782, 0x30133B4B03F2B111,
0xF7021977F9CCEAA4, 0xB5F2F89C5026DC37,
0x3BD0BCE5A45A6B5D, 0x79205D0E0DB05DCE,
0xBE317F32F78E067B, 0xFCC19ED95E6430E8,
0x86B86ED5267CDBD3, 0xC4488F3E8F96ED40,
0x0359AD0275A8B6F5, 0x41A94CE9DC428066,
0xCF8B0890283E370C, 0x8D7BE97B81D4019F,
0x4A6ACB477BEA5A2A, 0x089A2AACD2006CB9,
0x14DEA25F3AF9026D, 0x562E43B4931334FE,
0x913F6188692D6F4B, 0xD3CF8063C0C759D8,
0x5DEDC41A34BBEEB2, 0x1F1D25F19D51D821,
0xD80C07CD676F8394, 0x9AFCE626CE85B507
};
/* Initialize a CRC accumulator */
public void Init_crc(UInt64 crc)
{
crc = 0xffffffffffffffff;
}
/* Finish a CRC calculation */
public void Fin_crc(UInt64 crc)
{
crc ^= 0xffffffffffffffff;
}
/* Accumulate some (more) bytes into a CRC */
public void Calc_crc(ref UInt64 crc, Byte[] pbData, uint len)
{
/* Constant table for CRC calculation */
uint __len = len;
uint pos = 0;
byte byteInput = 0;
while (__len-- > 0)
{
uint __tab_index = ((uint)(crc >> 56) ^ pbData[pos++]) & 0xFF;
crc = crc64_table[__tab_index] ^ (crc << 8);
}
}
}
}
</code>
Waiting for help! | 1 |
3,806,355 | 09/27/2010 17:39:08 | 400,371 | 07/23/2010 15:02:01 | 45 | 1 | C++ map declaration under g++ | I have such declaraition
using namespace std;
map < string, string> attr;
if i write it in class or in global namespace it is compiled ok, but if I write it inside function it doesn't. Why? How can I solve it ? | c++ | map | g++ | null | null | 09/27/2010 18:16:28 | not a real question | C++ map declaration under g++
===
I have such declaraition
using namespace std;
map < string, string> attr;
if i write it in class or in global namespace it is compiled ok, but if I write it inside function it doesn't. Why? How can I solve it ? | 1 |
11,570,965 | 07/19/2012 23:49:20 | 1,371,314 | 05/03/2012 00:32:17 | 11 | 2 | How to detect Azure/Amazon VM | Is there any way to detect, in general, if your code is executing on an Azure or Amazon virtual machine. I am not referring to some sort of web or worker role in particular, I mean given any executable, is there anything that resolves that machine to a cloud VM - for example under Azure there is no domain so i cannot simply rely on a domain name. | azure | amazon | vm | null | null | null | open | How to detect Azure/Amazon VM
===
Is there any way to detect, in general, if your code is executing on an Azure or Amazon virtual machine. I am not referring to some sort of web or worker role in particular, I mean given any executable, is there anything that resolves that machine to a cloud VM - for example under Azure there is no domain so i cannot simply rely on a domain name. | 0 |
8,816,024 | 01/11/2012 08:05:57 | 265,103 | 01/16/2010 09:00:37 | 642 | 10 | How to impersonate using silverlight client object model? | I am developing silverlight web part for sharepoint 2010 in C#.In silverlight client object model the sharepoint 2010 takes the current user credential by using the following statement
ClientContext clientContext = ClientContext.Current;
Now I want to login programatically with different user name and password. So that it can access only that particular user data. But I found that there is no clientContext.Credentials in silverlight client object. How can I login with different user name and password programatically so that I can access that particular user data ? If there is any way to do that please tell me. Can we do it through web services ? Can you please provide me any code or link through which I can resolve the above issue ? | c# | silverlight | sharepoint2010 | impersonation | client-object-model | null | open | How to impersonate using silverlight client object model?
===
I am developing silverlight web part for sharepoint 2010 in C#.In silverlight client object model the sharepoint 2010 takes the current user credential by using the following statement
ClientContext clientContext = ClientContext.Current;
Now I want to login programatically with different user name and password. So that it can access only that particular user data. But I found that there is no clientContext.Credentials in silverlight client object. How can I login with different user name and password programatically so that I can access that particular user data ? If there is any way to do that please tell me. Can we do it through web services ? Can you please provide me any code or link through which I can resolve the above issue ? | 0 |
9,576,128 | 03/06/2012 00:16:01 | 154,688 | 08/11/2009 21:51:10 | 872 | 8 | How is a rolling-release linux distribution implemented? | I've been looking on implementing my own rolling release linux distro, have looked at Arch and Gentoo, but was wondering, what's their secret? Where can I find out?
| linux | architecture | system | null | null | 03/07/2012 18:24:07 | off topic | How is a rolling-release linux distribution implemented?
===
I've been looking on implementing my own rolling release linux distro, have looked at Arch and Gentoo, but was wondering, what's their secret? Where can I find out?
| 2 |
2,430,894 | 03/12/2010 06:22:21 | 272,769 | 02/14/2010 13:18:48 | 6 | 0 | Drag and drop into a browser application | We have a browser based application written in PHP in which I want to drag-n-drop files from the windows explorer or directly email attachments(this would be very cool). On dropping the files in the browser application, it should save it on a particular folder on the server. Any help on how this can be achieved would be really appreciated. | browser | drag-and-drop | null | null | null | null | open | Drag and drop into a browser application
===
We have a browser based application written in PHP in which I want to drag-n-drop files from the windows explorer or directly email attachments(this would be very cool). On dropping the files in the browser application, it should save it on a particular folder on the server. Any help on how this can be achieved would be really appreciated. | 0 |
8,521,065 | 12/15/2011 13:46:13 | 67,727 | 02/18/2009 06:58:28 | 57 | 5 | Validate domain user/password in Installshield setup | I have domain,username,password as inputs. Any idea on how i can validate that the username exists and the password is valid via custom action in a Installshield setup. I am using a Basic MSI setup. I could not find any resources in the web regarding this. | authentication | installshield | null | null | null | null | open | Validate domain user/password in Installshield setup
===
I have domain,username,password as inputs. Any idea on how i can validate that the username exists and the password is valid via custom action in a Installshield setup. I am using a Basic MSI setup. I could not find any resources in the web regarding this. | 0 |
11,587,842 | 07/20/2012 22:40:28 | 1,493,742 | 07/01/2012 01:40:01 | 23 | 0 | Cloning css style - google+ | I don t know if it is the right place to ask this question. Is there any tutorial to mimic the css style of the vertical nav bar of google+, with this nice inlaid effect?
Best,
Mehdi | google | null | null | null | null | 07/31/2012 13:36:16 | not a real question | Cloning css style - google+
===
I don t know if it is the right place to ask this question. Is there any tutorial to mimic the css style of the vertical nav bar of google+, with this nice inlaid effect?
Best,
Mehdi | 1 |
2,427,399 | 03/11/2010 17:58:19 | 106,020 | 05/13/2009 06:39:58 | 20 | 4 | MPICH vs OpenMPI | Can someone elaborate between the OpenMPI and MPICH implementations of MPI ?
Which of the two is a better implementation ? | hpc | openmp | mpi | null | null | null | open | MPICH vs OpenMPI
===
Can someone elaborate between the OpenMPI and MPICH implementations of MPI ?
Which of the two is a better implementation ? | 0 |
7,568,657 | 09/27/2011 11:53:54 | 857,500 | 07/17/2011 01:02:46 | 8 | 1 | jquery animate slider onClick event | I am creating a slider using jquery animate function. The first image is moving to left and is working fine.But the next image is not quickly following the first image. It displays a blank screen for a while. This is what I have tried so far:
$('.next').live('click',function() {
$('.ac_bgimage').animate({
left:"-80em"
}, 1500 , function(){
test();
});
});
function test() {
$('.ac_bgimage').attr('src','images/2.jpg');
$('.ac_bgimage').css('left','0em');
}
I am stuck at this point. Please help. Thanks in advance. | jquery | image | slider | null | null | null | open | jquery animate slider onClick event
===
I am creating a slider using jquery animate function. The first image is moving to left and is working fine.But the next image is not quickly following the first image. It displays a blank screen for a while. This is what I have tried so far:
$('.next').live('click',function() {
$('.ac_bgimage').animate({
left:"-80em"
}, 1500 , function(){
test();
});
});
function test() {
$('.ac_bgimage').attr('src','images/2.jpg');
$('.ac_bgimage').css('left','0em');
}
I am stuck at this point. Please help. Thanks in advance. | 0 |
3,413,055 | 08/05/2010 08:43:45 | 413,023 | 07/03/2010 06:34:03 | 12 | 0 | how to run rails application | i installed rails gem on my machine
gem install rails-0.9.2.gem
nd i got message like Successfully installed rails, version 0.9.2
now try to run a command like rail amit
but nothing happened not even a single message??? | ruby-on-rails | null | null | null | null | null | open | how to run rails application
===
i installed rails gem on my machine
gem install rails-0.9.2.gem
nd i got message like Successfully installed rails, version 0.9.2
now try to run a command like rail amit
but nothing happened not even a single message??? | 0 |
4,826,359 | 01/28/2011 08:48:38 | 398,398 | 07/21/2010 19:36:38 | 686 | 14 | What are the pros and cons of learning programming C++ on Linux? | I really want to know some expert C++ options. Any feedback would be greatly appreciated!
As a novice, I will go first.
**Pros**
- Building software from source sometimes is fun.
- Using vim and terminal are super fast.
- Explore some cool libraries.
**Cons**
- Sometimes it takes forever to build something.
- Learning require a great amount of time.
- Auto-complete is horrible ( even for vim )
- Gdb debugger is painful.
- Managing large project is a bit difficult ( comparing with Visual Studio )
- Writing Makefile is tiring.
- It's hard to ask newbie questions. I realized that most Linux-programmers are very strict on these. They always ask me to try harder ^_^!
I'm using Ubuntu.
Thanks,
Chan
| c++ | linux | null | null | null | 01/28/2011 08:53:38 | not constructive | What are the pros and cons of learning programming C++ on Linux?
===
I really want to know some expert C++ options. Any feedback would be greatly appreciated!
As a novice, I will go first.
**Pros**
- Building software from source sometimes is fun.
- Using vim and terminal are super fast.
- Explore some cool libraries.
**Cons**
- Sometimes it takes forever to build something.
- Learning require a great amount of time.
- Auto-complete is horrible ( even for vim )
- Gdb debugger is painful.
- Managing large project is a bit difficult ( comparing with Visual Studio )
- Writing Makefile is tiring.
- It's hard to ask newbie questions. I realized that most Linux-programmers are very strict on these. They always ask me to try harder ^_^!
I'm using Ubuntu.
Thanks,
Chan
| 4 |
9,725,705 | 03/15/2012 18:15:52 | 868,372 | 07/28/2011 21:43:15 | 87 | 11 | How to create a commercial library with template using in C++? | I'm a noob in C++ meta programming and I understand that I must place implementation of class in header file for convention. But when you want to purchase an package you need to separate the header and the implementation.
Now, Is there a way to do this?
Note: I know about 'export' keyword and read this [page][1]!
[1]: http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13 | c++ | template-meta-programming | null | null | null | null | open | How to create a commercial library with template using in C++?
===
I'm a noob in C++ meta programming and I understand that I must place implementation of class in header file for convention. But when you want to purchase an package you need to separate the header and the implementation.
Now, Is there a way to do this?
Note: I know about 'export' keyword and read this [page][1]!
[1]: http://www.parashift.com/c++-faq-lite/templates.html#faq-35.13 | 0 |
234,721 | 10/24/2008 18:18:46 | 25,012 | 10/03/2008 22:15:44 | 516 | 28 | Obligatory Python Vs Ruby Question | Since this doesn't seem to be directly addressed in any previous question.
Which language do you think is a better overall package, meaning: Including libraries, frameworks, job prospects, Python or Ruby?
I've been learning Ruby but...
It seems that a lot of pretty smart people really like python, what's the draw?
Objective answers encourage, religious answers not. | ruby | python | programming-languages | polls | null | 07/26/2012 13:23:18 | not constructive | Obligatory Python Vs Ruby Question
===
Since this doesn't seem to be directly addressed in any previous question.
Which language do you think is a better overall package, meaning: Including libraries, frameworks, job prospects, Python or Ruby?
I've been learning Ruby but...
It seems that a lot of pretty smart people really like python, what's the draw?
Objective answers encourage, religious answers not. | 4 |
4,276,548 | 11/25/2010 11:32:36 | 520,065 | 11/25/2010 11:32:36 | 1 | 0 | How to append after selection | I am trying to append some code after my current selection, lets say I have this:
<div id="test">
</div>
and want to append <br /> after closing div, like this
<div id="test">
</div>
<br />
Is there a way to do this? | jquery | append | null | null | null | null | open | How to append after selection
===
I am trying to append some code after my current selection, lets say I have this:
<div id="test">
</div>
and want to append <br /> after closing div, like this
<div id="test">
</div>
<br />
Is there a way to do this? | 0 |
7,794,757 | 10/17/2011 13:49:34 | 166,168 | 08/31/2009 18:46:14 | 98 | 1 | Change the picture onhover position along with the text | ![enter image description here][1]
I listed categories in my website on my home page. I want the image to change to the blue version of it onhover position. I also want that picture to change to the blue version when Computer Services heading is onhover in onhover position. I coded one way but it looks like is not working properly because I went inside of the image it changed then it went back several times. Is there anybody can help me with this ?
Here is the coding I made for this;
http://jsfiddle.net/4M2sr/
Note: I don`t want that black text to change the color of heading or picture.
[1]: http://i.stack.imgur.com/qj4GY.jpg | css | mouseover | null | null | null | null | open | Change the picture onhover position along with the text
===
![enter image description here][1]
I listed categories in my website on my home page. I want the image to change to the blue version of it onhover position. I also want that picture to change to the blue version when Computer Services heading is onhover in onhover position. I coded one way but it looks like is not working properly because I went inside of the image it changed then it went back several times. Is there anybody can help me with this ?
Here is the coding I made for this;
http://jsfiddle.net/4M2sr/
Note: I don`t want that black text to change the color of heading or picture.
[1]: http://i.stack.imgur.com/qj4GY.jpg | 0 |
7,884,759 | 10/25/2011 04:35:51 | 702,432 | 04/11/2011 15:15:31 | 180 | 0 | Subset delimited file by subset of one column | I have a text file (call it `infile.txt`) where the columns have headers and are delimited by semicolons. A subset of it is reproduced below:
SCHCD; SCHNAME
13110208001; GOVT MIDSCHOOL
10110208002; GOVT HIGHSCHOOL
21110208101; MATRIC
21110208102; UPPER SECONDARY
13110208201; SECONDARY
I want a subset of the file where the first two characters of "SCHCD" is "13". So my subset (call it `outfile.txt`) should look like:
SCHCD; SCHNAME
13110208001; GOVT MIDSCHOOL
13110208201; SECONDARY
Thanks in advance. | unix | null | null | null | null | null | open | Subset delimited file by subset of one column
===
I have a text file (call it `infile.txt`) where the columns have headers and are delimited by semicolons. A subset of it is reproduced below:
SCHCD; SCHNAME
13110208001; GOVT MIDSCHOOL
10110208002; GOVT HIGHSCHOOL
21110208101; MATRIC
21110208102; UPPER SECONDARY
13110208201; SECONDARY
I want a subset of the file where the first two characters of "SCHCD" is "13". So my subset (call it `outfile.txt`) should look like:
SCHCD; SCHNAME
13110208001; GOVT MIDSCHOOL
13110208201; SECONDARY
Thanks in advance. | 0 |
10,208,632 | 04/18/2012 11:44:12 | 1,227,830 | 02/23/2012 08:28:59 | 6 | 0 | GWT html files Internationalization | GWT has a nice docs: https://developers.google.com/web-toolkit/doc/latest/DevGuideI18nLocale
I've localized almost all cases, except html files.
Is it possible to localize html files in GWT's project ?
For example, how to localize simple html title container, using GWT's i18n possibilities:
...
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Text that should be localized :)</title>
</head>
...
| java | gwt | null | null | null | 06/12/2012 11:42:05 | not a real question | GWT html files Internationalization
===
GWT has a nice docs: https://developers.google.com/web-toolkit/doc/latest/DevGuideI18nLocale
I've localized almost all cases, except html files.
Is it possible to localize html files in GWT's project ?
For example, how to localize simple html title container, using GWT's i18n possibilities:
...
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Text that should be localized :)</title>
</head>
...
| 1 |
9,272,542 | 02/14/2012 06:15:53 | 1,208,435 | 02/14/2012 06:06:55 | 1 | 0 | Need to change the c++ code | <pre>
I wrote this code for date validation.. It works fine.. but i need to send a string and should get in this function and validate the string and return it back. how i can change the code...
if i remove static and use prototype variables i am not getting desired output.. for ex..
main()
{
dobvalidation(b);
}
void dobvalidation(string b)
{
//validates
}
i need in above format.. this is my code
#include <iostream>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <ctime>
using namespace std;
void checkFormat();
void dobValidation();
static string input;
int main()
{
cout<<"Enter date of birth (dd-mm-yyyy)\n";
getline(cin,input,'\n');
checkFormat();
dobValidation();
return 0;
}
void checkFormat()
{
//check the length of the string
int len=input.size();
if(len!=10)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
char * val;
val = const_cast<char*>((input.substr(2,1)).c_str());
//check for the dashes in dob
if(strcmp(val,"-")!=0)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
val = const_cast<char*>((input.substr(5,1)).c_str());
if(strcmp(val,"-")!=0)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
//check for digits
//extract date from string
char * date;
date = const_cast<char*>((input.substr(0,2)).c_str());
//check char by char for numeric
char c;
for(int i=0;i<2;i++)
{
c = date[i];
if(!isdigit(c))
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
//extract month from string
char * month;
month = const_cast<char*>((input.substr(3,2)).c_str());
//check char by char for numeric
for(int i=0;i<2;i++)
{
c = month[i];
if(!isdigit(c))
{
cout<<c;
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
//extract year from string
char * year;
year = const_cast<char*>((input.substr(6,4)).c_str());
//check char by char for numeric
for(int i=0;i<4;i++)
{
c = year[i];
if(!isdigit(c))
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
return;
}
void dobValidation()
{
// cout<<dob;
//date
char * date1;
date1 = const_cast<char*>((input.substr(0,2)).c_str());
int dd=atoi(date1);
//month
char * month1;
month1 = const_cast<char*>((input.substr(3,2)).c_str());
int mm=atoi(month1);
//year
char * year1;
year1 = const_cast<char*>((input.substr(6,4)).c_str());
int yyyy=atoi(year1);
//cout<<dd<<mm<<yyyy;
int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int max_no_of_day = days[mm-1];
//check for leap year
if((yyyy%400 ==0 || (yyyy%100 != 0 && yyyy%4 == 0) ) && mm==1)
{
max_no_of_day=29;
}
// check date doesnt cross the max limit
if(dd > max_no_of_day || dd<1)
{
// cout<<"max"<<max_no_of_day<<endl;
// cout<<dd<<mm<<yyyy;
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
// month validation
if(mm >12 || mm<1)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
//year verification
time_t t = time(0); // get time now
struct tm * now = localtime( & t ); //convert to local time
int current_year = (now->tm_year + 1900);
int current_month = (now->tm_mon + 1);
int current_date = (now->tm_mday);
// date should not exceed current date
if(yyyy==current_year && mm>current_month)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
if(yyyy==current_year && mm==current_month && dd>current_date)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
//check whether year crossed current year
if(yyyy>current_year || yyyy<1900)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
return;
}
</pre>
| c++ | null | null | null | null | 02/16/2012 00:53:35 | not a real question | Need to change the c++ code
===
<pre>
I wrote this code for date validation.. It works fine.. but i need to send a string and should get in this function and validate the string and return it back. how i can change the code...
if i remove static and use prototype variables i am not getting desired output.. for ex..
main()
{
dobvalidation(b);
}
void dobvalidation(string b)
{
//validates
}
i need in above format.. this is my code
#include <iostream>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <ctime>
using namespace std;
void checkFormat();
void dobValidation();
static string input;
int main()
{
cout<<"Enter date of birth (dd-mm-yyyy)\n";
getline(cin,input,'\n');
checkFormat();
dobValidation();
return 0;
}
void checkFormat()
{
//check the length of the string
int len=input.size();
if(len!=10)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
char * val;
val = const_cast<char*>((input.substr(2,1)).c_str());
//check for the dashes in dob
if(strcmp(val,"-")!=0)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
val = const_cast<char*>((input.substr(5,1)).c_str());
if(strcmp(val,"-")!=0)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
//check for digits
//extract date from string
char * date;
date = const_cast<char*>((input.substr(0,2)).c_str());
//check char by char for numeric
char c;
for(int i=0;i<2;i++)
{
c = date[i];
if(!isdigit(c))
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
//extract month from string
char * month;
month = const_cast<char*>((input.substr(3,2)).c_str());
//check char by char for numeric
for(int i=0;i<2;i++)
{
c = month[i];
if(!isdigit(c))
{
cout<<c;
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
//extract year from string
char * year;
year = const_cast<char*>((input.substr(6,4)).c_str());
//check char by char for numeric
for(int i=0;i<4;i++)
{
c = year[i];
if(!isdigit(c))
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
checkFormat();
return;
}
}
return;
}
void dobValidation()
{
// cout<<dob;
//date
char * date1;
date1 = const_cast<char*>((input.substr(0,2)).c_str());
int dd=atoi(date1);
//month
char * month1;
month1 = const_cast<char*>((input.substr(3,2)).c_str());
int mm=atoi(month1);
//year
char * year1;
year1 = const_cast<char*>((input.substr(6,4)).c_str());
int yyyy=atoi(year1);
//cout<<dd<<mm<<yyyy;
int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
int max_no_of_day = days[mm-1];
//check for leap year
if((yyyy%400 ==0 || (yyyy%100 != 0 && yyyy%4 == 0) ) && mm==1)
{
max_no_of_day=29;
}
// check date doesnt cross the max limit
if(dd > max_no_of_day || dd<1)
{
// cout<<"max"<<max_no_of_day<<endl;
// cout<<dd<<mm<<yyyy;
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
// month validation
if(mm >12 || mm<1)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
//year verification
time_t t = time(0); // get time now
struct tm * now = localtime( & t ); //convert to local time
int current_year = (now->tm_year + 1900);
int current_month = (now->tm_mon + 1);
int current_date = (now->tm_mday);
// date should not exceed current date
if(yyyy==current_year && mm>current_month)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
if(yyyy==current_year && mm==current_month && dd>current_date)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
//check whether year crossed current year
if(yyyy>current_year || yyyy<1900)
{
cout<<"\nPlease enter a valid Date of Birth\n";
cin>>input;
dobValidation();
return;
}
return;
}
</pre>
| 1 |
5,106,882 | 02/24/2011 15:43:17 | 450,782 | 09/17/2010 16:22:13 | 213 | 7 | C#/Winforms App freezing/lagging | I have an Application in C#/Winforms that is basically used to run test for customers accounts in a specific order/setup. They are all tests run in browsers and so I built it so it would automate the process since there are about 10-12 tests that need to be ran everytime a customer account is pulled up.
Basically what happens is you input the account number then it runs the tests.
Here's a sample code.
public void startTestProcess()
{
if (!cancelTests)
{
testRunning = true;
var tabPage = createTabPage(banToRun, Convert.ToInt32(banToRun));
loadingBox.Visible = true;
mainTabControl.TabPages.Insert(0, tabPage);
mainTabControl.SelectedTab = mainTabControl.TabPages[0];
runTest(tabPage, banToRun);
loadingBox.Visible = false;
}
}
private void runTest(TabPage t, string ban)
{
if (!cancelTests && !cancelCurrentOnly)
{
var tC = createInitialTabControl();
t.Controls.Add(tC);
int[] theTests = profileInfo.getSetList;
for (int i = 0; i < theTests.Length; i++)
{
if (!cancelTests && !cancelCurrentOnly)
{
var newTab = createTabPage(urlStrings.getName(theTests[i]), theTests[i]);
tC.TabPages.Add(newTab);
var webBrowser = createBrowser(urlStrings.getUrl(theTests[i], ban));
newTab.Controls.Add(webBrowser);
if (theTests[i] != 0 && theTests[i] != 1 && theTests[i] != 6
&& theTests[i] != 11 && theTests[i] != 12)
{
if (!webBrowser.IsDisposed)
{
try
{
while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
}
catch
{
//Do Nothing
}
}
}
IntPtr pHandle = GetCurrentProcess();
SetProcessWorkingSetSize(pHandle, -1, -1);
}
}
}
if (cancelCurrentOnly)
{
cancelCurrentOnly = false;
}
banToRun = string.Empty;
testRunning = false;
}
So basically my question is, how can I optimize what I have in order to
A. Reduce lag/freezing - Note: Already implemented a way of forcing garbage collection after each test is run.
B. Improve performance of the WebBrowser controls possibly? - Already tried some webbrowser alternatives like WebKit for C# Wrapper (does not work on all tests due to some ajax based coding i believe)
C. Maybe implement multi-threaded operations. Not sure how i'd go about this without having cross-threaded exceptions thrown.
Thanks for your assistance. If you have any other questions feel free to ask. | c# | winforms | freeze | cross-threading | lag | null | open | C#/Winforms App freezing/lagging
===
I have an Application in C#/Winforms that is basically used to run test for customers accounts in a specific order/setup. They are all tests run in browsers and so I built it so it would automate the process since there are about 10-12 tests that need to be ran everytime a customer account is pulled up.
Basically what happens is you input the account number then it runs the tests.
Here's a sample code.
public void startTestProcess()
{
if (!cancelTests)
{
testRunning = true;
var tabPage = createTabPage(banToRun, Convert.ToInt32(banToRun));
loadingBox.Visible = true;
mainTabControl.TabPages.Insert(0, tabPage);
mainTabControl.SelectedTab = mainTabControl.TabPages[0];
runTest(tabPage, banToRun);
loadingBox.Visible = false;
}
}
private void runTest(TabPage t, string ban)
{
if (!cancelTests && !cancelCurrentOnly)
{
var tC = createInitialTabControl();
t.Controls.Add(tC);
int[] theTests = profileInfo.getSetList;
for (int i = 0; i < theTests.Length; i++)
{
if (!cancelTests && !cancelCurrentOnly)
{
var newTab = createTabPage(urlStrings.getName(theTests[i]), theTests[i]);
tC.TabPages.Add(newTab);
var webBrowser = createBrowser(urlStrings.getUrl(theTests[i], ban));
newTab.Controls.Add(webBrowser);
if (theTests[i] != 0 && theTests[i] != 1 && theTests[i] != 6
&& theTests[i] != 11 && theTests[i] != 12)
{
if (!webBrowser.IsDisposed)
{
try
{
while (webBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
}
catch
{
//Do Nothing
}
}
}
IntPtr pHandle = GetCurrentProcess();
SetProcessWorkingSetSize(pHandle, -1, -1);
}
}
}
if (cancelCurrentOnly)
{
cancelCurrentOnly = false;
}
banToRun = string.Empty;
testRunning = false;
}
So basically my question is, how can I optimize what I have in order to
A. Reduce lag/freezing - Note: Already implemented a way of forcing garbage collection after each test is run.
B. Improve performance of the WebBrowser controls possibly? - Already tried some webbrowser alternatives like WebKit for C# Wrapper (does not work on all tests due to some ajax based coding i believe)
C. Maybe implement multi-threaded operations. Not sure how i'd go about this without having cross-threaded exceptions thrown.
Thanks for your assistance. If you have any other questions feel free to ask. | 0 |
2,387,952 | 03/05/2010 15:46:54 | 92,040 | 04/17/2009 09:12:31 | 381 | 18 | Using Framset with Treeviews in ASP.Net | Afternoon, I am trying have an HTML file containing a frameset which contains two frames. I have populated the left Frame with a URL containing a TreeView with URL's for the nodes.
I would like the to be able to select a URL from the treeview in the left hand frame, and have it set the src of the right hand frame to be that URL.
Is that possible?
Thanks | asp.net | vb.net | c# | framset | null | null | open | Using Framset with Treeviews in ASP.Net
===
Afternoon, I am trying have an HTML file containing a frameset which contains two frames. I have populated the left Frame with a URL containing a TreeView with URL's for the nodes.
I would like the to be able to select a URL from the treeview in the left hand frame, and have it set the src of the right hand frame to be that URL.
Is that possible?
Thanks | 0 |
10,620,866 | 05/16/2012 14:37:36 | 1,398,866 | 05/16/2012 14:24:30 | 1 | 0 | Can an Android UI completely designed in Photoshop (using only invisible buttons in xml) work without compatibility issues on different resolutions? | I wanted to spice up the design for my application's UI so I was wondering if I could completely design it in Photoshop. I figured if I just designed the whole thing in Photoshop, I could set an image as a background for each activity, and then use invisible buttons and images etc (i.e.clickable items and placeholders for the empty spaces...or I could just position it using dip). It would be so much easier and fun this way but I don't think I've ever seen it before (except maybe Astro File Manager's opening screen?) and I don't understand why. So what's wrong with the idea (Opinions are welcome as well, apart from the facts ;D )? Will it work across all the different resolutions? Compatibility issues maybe? | android | design | application | user-interface | resolution | 05/17/2012 02:18:57 | not constructive | Can an Android UI completely designed in Photoshop (using only invisible buttons in xml) work without compatibility issues on different resolutions?
===
I wanted to spice up the design for my application's UI so I was wondering if I could completely design it in Photoshop. I figured if I just designed the whole thing in Photoshop, I could set an image as a background for each activity, and then use invisible buttons and images etc (i.e.clickable items and placeholders for the empty spaces...or I could just position it using dip). It would be so much easier and fun this way but I don't think I've ever seen it before (except maybe Astro File Manager's opening screen?) and I don't understand why. So what's wrong with the idea (Opinions are welcome as well, apart from the facts ;D )? Will it work across all the different resolutions? Compatibility issues maybe? | 4 |
4,765,972 | 01/22/2011 03:23:12 | 492,460 | 10/30/2010 23:04:53 | 1 | 0 | Why RadioButton/CheckboxButton don't have a VALUE attribute ? | Why RadioButton/CheckboxButton don't have a VALUE attribute ?
The HTML input radio have a VALUE attribute, why the RadioButton/CheckboxButton don't? That's a real error Microsoft! Why that?
Now, imagine a situation:
You need a list of cars from Database, the user need to choose only one, you put a list of radioButton with TEXT attribute with the name of the car AND the correct is to save the ID of register from Database in a VALUE attribute. The user will choose one register and i will get the value of that input and save in database.
But with Microsoft RadioButton that's is not possible by default, I'll should get the name of the car in TEXT attribute, find a register by the name of the car ( WHERE name = 'volvo' //THATS WRONG ) and get the ID of the register and then save to database.
Another way is verify if the radioButton is checked and put Manually ID of register to save in database if radioButton2 is checked.
THAT'S DEFINELY WRONG. | .net | asp.net | webforms | asp.net-webforms | asp.net-webcontrol | 01/22/2011 10:27:46 | not constructive | Why RadioButton/CheckboxButton don't have a VALUE attribute ?
===
Why RadioButton/CheckboxButton don't have a VALUE attribute ?
The HTML input radio have a VALUE attribute, why the RadioButton/CheckboxButton don't? That's a real error Microsoft! Why that?
Now, imagine a situation:
You need a list of cars from Database, the user need to choose only one, you put a list of radioButton with TEXT attribute with the name of the car AND the correct is to save the ID of register from Database in a VALUE attribute. The user will choose one register and i will get the value of that input and save in database.
But with Microsoft RadioButton that's is not possible by default, I'll should get the name of the car in TEXT attribute, find a register by the name of the car ( WHERE name = 'volvo' //THATS WRONG ) and get the ID of the register and then save to database.
Another way is verify if the radioButton is checked and put Manually ID of register to save in database if radioButton2 is checked.
THAT'S DEFINELY WRONG. | 4 |
4,951,679 | 02/09/2011 23:08:54 | 610,574 | 02/09/2011 23:08:54 | 1 | 0 | Adding "intelligence" into game | I am doing the exercises from this website:
http://www.env3d.org/beta/node/79
All the code is there and everything. I'm working on question 3, but have come up with nothing. I have no idea what to try next. Any ideas? | java | simulation | null | null | null | 02/10/2011 01:48:24 | not a real question | Adding "intelligence" into game
===
I am doing the exercises from this website:
http://www.env3d.org/beta/node/79
All the code is there and everything. I'm working on question 3, but have come up with nothing. I have no idea what to try next. Any ideas? | 1 |
6,004,700 | 05/14/2011 20:49:21 | 111,665 | 05/05/2009 19:48:19 | 2,178 | 41 | Paypal's Instant Payment Notification | I'm trying out PayPal's Instant Payment Notification, and it is sending me two (2) transactions instead of one.
Any reason why?
| paypal | null | null | null | null | 05/15/2011 07:17:48 | off topic | Paypal's Instant Payment Notification
===
I'm trying out PayPal's Instant Payment Notification, and it is sending me two (2) transactions instead of one.
Any reason why?
| 2 |
8,876,848 | 01/16/2012 07:23:25 | 158,032 | 08/17/2009 21:05:26 | 27 | 1 | Play Framework: Entity not having primary key column named id | I want to use existing database. Entity table has a column named code to be used as primary key.
Probably a simple annotation but I am new to Play Framework and JPA.
Thank you | jpa | playback | null | null | null | 01/16/2012 15:18:18 | not a real question | Play Framework: Entity not having primary key column named id
===
I want to use existing database. Entity table has a column named code to be used as primary key.
Probably a simple annotation but I am new to Play Framework and JPA.
Thank you | 1 |
6,919,494 | 08/02/2011 22:31:17 | 139,559 | 07/16/2009 14:53:55 | 214 | 10 | When will Java 7 be pushed out to users as an update? | Has Oracle announced a schedule for when Java 7 will be pushed out via Java Update to end-users?
75% of our applet's users are generally at the auto-update level, so that is a critical date for us for having any Java 7 kinks worked out. | java | oracle | java-7 | null | null | 08/02/2011 22:47:16 | off topic | When will Java 7 be pushed out to users as an update?
===
Has Oracle announced a schedule for when Java 7 will be pushed out via Java Update to end-users?
75% of our applet's users are generally at the auto-update level, so that is a critical date for us for having any Java 7 kinks worked out. | 2 |
8,631,582 | 12/25/2011 21:07:02 | 709,635 | 04/15/2011 10:21:53 | 488 | 17 | best way to build an image service in node.js | So I've got this server application running on Google AppEngine that I want to migrate to node.js.
My main concern is building an API similar to the powerfull GAE's blobstore/imageservice combinaison to host and serve the users uploaded pictures.
I'm really new to node.js and I've only read some documentations, viewed some video and fiddle with node so far. I'd like to have some insight on what would be the best solutions to:
- host the pictures
- serve them through an efficient cache system
At the moment, I'm leaning toward redis to store the pictures, I haven't looked at all the node modules yet (there are quite a lot!).
What would be your architecture of choice for such an application? | node.js | null | null | null | null | 12/26/2011 22:11:31 | not a real question | best way to build an image service in node.js
===
So I've got this server application running on Google AppEngine that I want to migrate to node.js.
My main concern is building an API similar to the powerfull GAE's blobstore/imageservice combinaison to host and serve the users uploaded pictures.
I'm really new to node.js and I've only read some documentations, viewed some video and fiddle with node so far. I'd like to have some insight on what would be the best solutions to:
- host the pictures
- serve them through an efficient cache system
At the moment, I'm leaning toward redis to store the pictures, I haven't looked at all the node modules yet (there are quite a lot!).
What would be your architecture of choice for such an application? | 1 |
7,091,620 | 08/17/2011 10:54:27 | 896,940 | 08/16/2011 15:03:45 | 1 | 0 | Input string was not in a correct format | I am getting the following error on below code.
Input string was not in a correct format.
private void RefreshListType(bool forExport)
{
grdListItems.DataSource = ListType.GetListTypes(Convert.ToInt16(cboListType.SelectedValue));
grdListItems.DataBind();
lblCount.InnerText = "LookUps: " + grdListItems.Rows.Count.ToString();
}
please help me. | c# | null | null | null | null | 08/17/2011 11:20:10 | not a real question | Input string was not in a correct format
===
I am getting the following error on below code.
Input string was not in a correct format.
private void RefreshListType(bool forExport)
{
grdListItems.DataSource = ListType.GetListTypes(Convert.ToInt16(cboListType.SelectedValue));
grdListItems.DataBind();
lblCount.InnerText = "LookUps: " + grdListItems.Rows.Count.ToString();
}
please help me. | 1 |
4,327,359 | 12/01/2010 17:51:53 | 352,432 | 05/27/2010 22:36:57 | 16 | 2 | How to cache filterAttribute | How could I use caching to maybe help this attribute along? Mainly not having to make a lot of calls to container.GetService and getting the user. could I put some caching into place that would cache the identity as the key and the planner as the value and just look it up?
public class AdminsAndProgramManagersOnlyAttribute : FilterAttribute, IAuthorizationFilter
{
public AdminsAndProgramManagersOnlyAttribute()
{
Order = 1; //Must come AFTER AuthenticateAttribute
}
public void OnAuthorization(AuthorizationContext filterContext)
{
var userRepository = GlobalApplication.container.GetService<IRepository<ProjectPlannerInfo>>();
var identity = filterContext.HttpContext.User.Identity;
var planner = userRepository.GetAll().WhereEmailIs(identity.Name);
if (!planner.IsInRole("Db Admin") || planner.ProgramManager == 1)
{
filterContext.Result = new RedirectToRouteResult("error", new RouteValueDictionary(new { controller = "Error", action = "InsufficientPrivileges", reason = "Contract" }));
}
}
}
| c# | caching | filterattribute | null | null | null | open | How to cache filterAttribute
===
How could I use caching to maybe help this attribute along? Mainly not having to make a lot of calls to container.GetService and getting the user. could I put some caching into place that would cache the identity as the key and the planner as the value and just look it up?
public class AdminsAndProgramManagersOnlyAttribute : FilterAttribute, IAuthorizationFilter
{
public AdminsAndProgramManagersOnlyAttribute()
{
Order = 1; //Must come AFTER AuthenticateAttribute
}
public void OnAuthorization(AuthorizationContext filterContext)
{
var userRepository = GlobalApplication.container.GetService<IRepository<ProjectPlannerInfo>>();
var identity = filterContext.HttpContext.User.Identity;
var planner = userRepository.GetAll().WhereEmailIs(identity.Name);
if (!planner.IsInRole("Db Admin") || planner.ProgramManager == 1)
{
filterContext.Result = new RedirectToRouteResult("error", new RouteValueDictionary(new { controller = "Error", action = "InsufficientPrivileges", reason = "Contract" }));
}
}
}
| 0 |
11,392,493 | 07/09/2012 09:38:57 | 1,504,480 | 07/05/2012 15:27:45 | 1 | 0 | How does the Airdroid application works, what are the things needed? | The AirDroid application for Android phones allows you to browse the contents of your phone by using a web browser on your PC.
How does it work? | android | ftp | null | null | null | 07/09/2012 19:24:24 | not a real question | How does the Airdroid application works, what are the things needed?
===
The AirDroid application for Android phones allows you to browse the contents of your phone by using a web browser on your PC.
How does it work? | 1 |
11,208,276 | 06/26/2012 13:23:55 | 874,620 | 08/02/2011 12:37:57 | 1 | 1 | when opened with winrar, Zip file obtained through Cakephp MediaViews reports Unexpected end of archive | What i am trying to achieve:
Force download a zip file that contains user opted pdf files.
What i did in controller to achieve this:
1. Generate pdf reports in folder APP.WEBROOT_DIR.DS."package_files" (i used MPDF library)
*it generates correct readable pdf
2. With Zip feature of php, Generate package.zip (which consists pdf files from above specified folder)
*it generates correct zip file, when downloaded from server it opens as valid zip file in windows.
3. Set the controller viewClass to Media and set parameters to force download as zip file,
Issue:
When i run i get zip file but when opened with winrar, Zip file obtained reports Unexpected end of archive.
I am not getting any usefull articles to get through this issue...
Thanks
My controller code:
<code>
/** before this code i generate pdf files and have no issue **/
/** now scan through the directory and add all the pdf files to a zip archive **/
$dir = new Folder("".APP.WEBROOT_DIR.DS."package_files");
$files = $dir->find('.*\.pdf');
$zip = new ZipArchive();
foreach ($files as $file) {
$file_path = $dir->pwd() . DS . $file;
//$file = new File($dir->pwd() . DS . $file);
//use the zip compression method
$filename = $dir->pwd() . DS ."package.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFile($file_path,$file);
}
$zip->close();
/** now render the action to download the generated zip file **/
$this->viewClass = 'Media';
$params = array(
'id' => 'package.zip',
'name' => 'packaged_file',
'download' => true,
'extension' => 'zip',
'path' => APP . WEBROOT_DIR.DS.'package_files' . DS
);
$this->set($params);
$this->render();
</code> | cakephp | download | zip | cakephp-2.0 | null | null | open | when opened with winrar, Zip file obtained through Cakephp MediaViews reports Unexpected end of archive
===
What i am trying to achieve:
Force download a zip file that contains user opted pdf files.
What i did in controller to achieve this:
1. Generate pdf reports in folder APP.WEBROOT_DIR.DS."package_files" (i used MPDF library)
*it generates correct readable pdf
2. With Zip feature of php, Generate package.zip (which consists pdf files from above specified folder)
*it generates correct zip file, when downloaded from server it opens as valid zip file in windows.
3. Set the controller viewClass to Media and set parameters to force download as zip file,
Issue:
When i run i get zip file but when opened with winrar, Zip file obtained reports Unexpected end of archive.
I am not getting any usefull articles to get through this issue...
Thanks
My controller code:
<code>
/** before this code i generate pdf files and have no issue **/
/** now scan through the directory and add all the pdf files to a zip archive **/
$dir = new Folder("".APP.WEBROOT_DIR.DS."package_files");
$files = $dir->find('.*\.pdf');
$zip = new ZipArchive();
foreach ($files as $file) {
$file_path = $dir->pwd() . DS . $file;
//$file = new File($dir->pwd() . DS . $file);
//use the zip compression method
$filename = $dir->pwd() . DS ."package.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFile($file_path,$file);
}
$zip->close();
/** now render the action to download the generated zip file **/
$this->viewClass = 'Media';
$params = array(
'id' => 'package.zip',
'name' => 'packaged_file',
'download' => true,
'extension' => 'zip',
'path' => APP . WEBROOT_DIR.DS.'package_files' . DS
);
$this->set($params);
$this->render();
</code> | 0 |
7,722,158 | 10/11/2011 06:30:13 | 683,311 | 03/30/2011 05:16:12 | 129 | 9 | Audio Units Set up to get a particular sound system in IOS | Currently working on audio units to create a sound system a game . What i exactly want is
- i have to play 3 sounds simultaneously
- Should be able to control pitch and volume for each sound individually
- then playback this sound combination in mixer accordingly..
Any one have any idea with audio units can guide me in right direction...what structure of AUGRAPH should i follow ?
Thanks
| iphone | ipad | audio | core-audio | audiounit | null | open | Audio Units Set up to get a particular sound system in IOS
===
Currently working on audio units to create a sound system a game . What i exactly want is
- i have to play 3 sounds simultaneously
- Should be able to control pitch and volume for each sound individually
- then playback this sound combination in mixer accordingly..
Any one have any idea with audio units can guide me in right direction...what structure of AUGRAPH should i follow ?
Thanks
| 0 |
11,275,075 | 06/30/2012 14:56:03 | 1,492,967 | 06/30/2012 12:07:31 | 8 | 0 | How to change color of empty rows in a DataGridView? | I'm trying to change color of empty rows in a DataGridView
foreach (DataGridViewRow r in dgv1.Rows)
if (r.Value.ToString() == "")
//if (r.Cells.Value.ToString() == "") - also trying
r.DefaultCellStyle.BackColor = Color.WhiteSmoke;
but Row has no definiton for Value, and Cells need to be specified by Column.
How can I do this, please ? | c# | winforms | datagridview | null | null | null | open | How to change color of empty rows in a DataGridView?
===
I'm trying to change color of empty rows in a DataGridView
foreach (DataGridViewRow r in dgv1.Rows)
if (r.Value.ToString() == "")
//if (r.Cells.Value.ToString() == "") - also trying
r.DefaultCellStyle.BackColor = Color.WhiteSmoke;
but Row has no definiton for Value, and Cells need to be specified by Column.
How can I do this, please ? | 0 |
3,926,851 | 10/13/2010 18:36:18 | 442,477 | 09/08/2010 13:34:49 | 40 | 2 | Ms sql keys and foreign keys | If I have a primary key in table A and in table B of the same database(table B has its own primary key) I create a relationship with the primary key in table A so that a column in table B is the foreign key, does it mean that the primary key data created in the primary key column of table A will also be added to table B by virtue of it being a foreign key column or do I have to code that relationship, and if so how do I go about that? | sql | foreign-keys | primary-key | ms | null | null | open | Ms sql keys and foreign keys
===
If I have a primary key in table A and in table B of the same database(table B has its own primary key) I create a relationship with the primary key in table A so that a column in table B is the foreign key, does it mean that the primary key data created in the primary key column of table A will also be added to table B by virtue of it being a foreign key column or do I have to code that relationship, and if so how do I go about that? | 0 |
4,947,323 | 02/09/2011 16:02:09 | 26,130 | 10/08/2008 13:05:48 | 1,433 | 32 | need to display background image of link inline with text links correctly | I want to display the facebook-footer-rect.png as the link, and provide wording in the link tag for screen readers.
<a href="http://facebook.com/ourpage" title="Join us on Facebook" rel="external" class="facebook-footer">Join us on Facebook</a>
Example html of the links:
<div class="footer-links">
<p>
<a href="link">Link 1</a>
<a href="link">Link 2</a>
<a href="link">Link 3</a>
<a href="link">Link 3</a>
<a href="http://facebook.com/ourpage" title="Join us on Facebook" rel="external" class="facebook-footer">Join us on Facebook</a>
</p>
</div>
CSS for footer-links and facebook-footer
.footer-links { line-height:1.9em; text-align:center; margin: 0; }
.footer-links a:visited, .footer-links a:link { display:block; padding:7px; background-color:#216e4f; text-decoration:none; display:inline; }
.footer-links p {
margin:0 0 10px 0;
}
.footer-links a:hover { background-color:#337a5d; text-decoration:none; display:inline; }
.footer-links a.facebook-footer:link,
.footer-links a.facebook-footer:visited {
background: url('/images/uploads/images/facebook-footer-rect.png') no-repeat left top;
height:28px;
width:81px;
display: inline;
text-decoration: none;
overflow: auto;
text-indent: -10000px;
font-size: 0px;
line-height: 0px;
}
Screenshot of what it looks like:
w/ facebook-footer display: block; http://cl.ly/4TBY
w/ facebook-footer display:inline; http://cl.ly/4Twi
this is what I want it to look like: http://cl.ly/4TVX (photoshopped this) | html | css | null | null | null | null | open | need to display background image of link inline with text links correctly
===
I want to display the facebook-footer-rect.png as the link, and provide wording in the link tag for screen readers.
<a href="http://facebook.com/ourpage" title="Join us on Facebook" rel="external" class="facebook-footer">Join us on Facebook</a>
Example html of the links:
<div class="footer-links">
<p>
<a href="link">Link 1</a>
<a href="link">Link 2</a>
<a href="link">Link 3</a>
<a href="link">Link 3</a>
<a href="http://facebook.com/ourpage" title="Join us on Facebook" rel="external" class="facebook-footer">Join us on Facebook</a>
</p>
</div>
CSS for footer-links and facebook-footer
.footer-links { line-height:1.9em; text-align:center; margin: 0; }
.footer-links a:visited, .footer-links a:link { display:block; padding:7px; background-color:#216e4f; text-decoration:none; display:inline; }
.footer-links p {
margin:0 0 10px 0;
}
.footer-links a:hover { background-color:#337a5d; text-decoration:none; display:inline; }
.footer-links a.facebook-footer:link,
.footer-links a.facebook-footer:visited {
background: url('/images/uploads/images/facebook-footer-rect.png') no-repeat left top;
height:28px;
width:81px;
display: inline;
text-decoration: none;
overflow: auto;
text-indent: -10000px;
font-size: 0px;
line-height: 0px;
}
Screenshot of what it looks like:
w/ facebook-footer display: block; http://cl.ly/4TBY
w/ facebook-footer display:inline; http://cl.ly/4Twi
this is what I want it to look like: http://cl.ly/4TVX (photoshopped this) | 0 |
10,027,093 | 04/05/2012 10:42:41 | 1,256,852 | 03/08/2012 11:10:54 | 8 | 0 | Run PHP every 15 seconds and notify user when database changes | I'm building an app with JQuery Mobile. I have a page called list.php which gets data from server with PHP. I need the script to run every 15 seconds and notify user if there are changes in database. I am beginner with PHP and Javascript so I have no idea how to do this or if it is even possible.
This is the code I'm currently using.
<?php
$number = $_GET['number'] ;
mysql_connect('localhost','username','password');
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
//specify database
mysql_select_db("database") or die("Unable to select database");
// Build SQL Query
$query = "select * from table where tablenumber = \"$number\" and state = 0
order by time";
$result = mysql_query($query) or die("Couldn't execute query");
?>
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" >
<h1>Transpanel</h1>
</div>
<div data-role="content">
<div data-role="collapsible-set">
<?php
// display the results returned
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<div data-role="collapsible" data-theme="b" data-content-theme="d">
<h3><?= $row["OSO"] ?></h3>
<p><?=$row["AIKA"]?><p>
</div>
<?php } ?>
</div>
</div><!-- /content -->
</body>
</html> | php | jquery | database | mobile | null | null | open | Run PHP every 15 seconds and notify user when database changes
===
I'm building an app with JQuery Mobile. I have a page called list.php which gets data from server with PHP. I need the script to run every 15 seconds and notify user if there are changes in database. I am beginner with PHP and Javascript so I have no idea how to do this or if it is even possible.
This is the code I'm currently using.
<?php
$number = $_GET['number'] ;
mysql_connect('localhost','username','password');
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
//specify database
mysql_select_db("database") or die("Unable to select database");
// Build SQL Query
$query = "select * from table where tablenumber = \"$number\" and state = 0
order by time";
$result = mysql_query($query) or die("Couldn't execute query");
?>
<!DOCTYPE html>
<html>
<head>
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" >
<h1>Transpanel</h1>
</div>
<div data-role="content">
<div data-role="collapsible-set">
<?php
// display the results returned
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<div data-role="collapsible" data-theme="b" data-content-theme="d">
<h3><?= $row["OSO"] ?></h3>
<p><?=$row["AIKA"]?><p>
</div>
<?php } ?>
</div>
</div><!-- /content -->
</body>
</html> | 0 |
11,689,335 | 07/27/2012 14:00:04 | 1,557,848 | 07/27/2012 13:42:57 | 1 | 0 | I need send post do Facebook with tag friends in Android SDK | I need post message into Facebook wall with Android SDK. The post was successfully with params below:
Bundle parameters = new Bundle();
parameters.putString("message", comment);
parameters.putString("name", name);
parameters.putString("description", message);
parameters.putString("picture", url_image);
mFacebook.request("me");
String response1 = mFacebook.request("me/feed", parameters, "POST");
JSONObject json = Util.parseJson(response1);
final String objectId = json.getString("id");
The objectId return number the post successfull. But when add fields for tag friends in post, return was error:
got response: {"error":{"message":"An unknown error has ocurred.", "type":"OAuthException","code":1}}
The fields below add in bundle:
parameters.putString("place", facebookID);
parameters.putString("tags", friendsTag);
I dont know get the place and send facebookID user. The friendsTag is field facebookID.
Thanks...
Eurico Junior | android | facebook | tags | wall | friends | null | open | I need send post do Facebook with tag friends in Android SDK
===
I need post message into Facebook wall with Android SDK. The post was successfully with params below:
Bundle parameters = new Bundle();
parameters.putString("message", comment);
parameters.putString("name", name);
parameters.putString("description", message);
parameters.putString("picture", url_image);
mFacebook.request("me");
String response1 = mFacebook.request("me/feed", parameters, "POST");
JSONObject json = Util.parseJson(response1);
final String objectId = json.getString("id");
The objectId return number the post successfull. But when add fields for tag friends in post, return was error:
got response: {"error":{"message":"An unknown error has ocurred.", "type":"OAuthException","code":1}}
The fields below add in bundle:
parameters.putString("place", facebookID);
parameters.putString("tags", friendsTag);
I dont know get the place and send facebookID user. The friendsTag is field facebookID.
Thanks...
Eurico Junior | 0 |
2,963,927 | 06/03/2010 07:10:00 | 357,188 | 06/03/2010 07:10:00 | 1 | 0 | TabContainer in BorderContainer not showing correctly | I am using a borderContainer with a fix width and centering in the center of my page (Use of a div around the bordercontainer).
Everything works fine until i add a TabContainer. All of a sudden i can not see my Tab's anymore. This goes as wel for IE as FF.
Is this a bug or something else? How could i work around this?
I'm using the latest release of dojo 1.4.3.
I've tried using borderContainer in borderContainer with no result.
Thnx
Stefaan | dojo | dijit | null | null | null | null | open | TabContainer in BorderContainer not showing correctly
===
I am using a borderContainer with a fix width and centering in the center of my page (Use of a div around the bordercontainer).
Everything works fine until i add a TabContainer. All of a sudden i can not see my Tab's anymore. This goes as wel for IE as FF.
Is this a bug or something else? How could i work around this?
I'm using the latest release of dojo 1.4.3.
I've tried using borderContainer in borderContainer with no result.
Thnx
Stefaan | 0 |
8,011,053 | 11/04/2011 14:47:26 | 1,010,805 | 10/24/2011 11:55:39 | 1 | 0 | Can anyone give me a C# equivalent of this java block of code which uses vector and hashtable? | public synchronized void addLogEntry(String header,String message)
{
if (log == null)
{
log = new Hashtable();
logHeaders = new Vector();
}
Vector v = (Vector)log.get(header);
if (log.get(header) == null)
{
v = new Vector();
log.put(header, v);
logHeaders.addElement(header);
}
v.addElement(message);
} | java | vector | null | null | null | 12/17/2011 23:40:42 | not a real question | Can anyone give me a C# equivalent of this java block of code which uses vector and hashtable?
===
public synchronized void addLogEntry(String header,String message)
{
if (log == null)
{
log = new Hashtable();
logHeaders = new Vector();
}
Vector v = (Vector)log.get(header);
if (log.get(header) == null)
{
v = new Vector();
log.put(header, v);
logHeaders.addElement(header);
}
v.addElement(message);
} | 1 |
8,760,908 | 01/06/2012 16:20:34 | 1,134,566 | 01/06/2012 15:18:53 | 3 | 0 | jQuery element not displaying | The function below display two box elements, each with it's own message, one below the other. I cannot get the #managerbtns element to appear at all. I have it initially hidden along with the #managermsg element, but it never appears anywhere on the page. Only the #managermsg box fades in. I've tried to alter the properties for the #managerbtns element, but nothing works.
function DeleteUser(id, deleting){
var message = "<h1>Are you sure? All records associated with this user will be deleted also.</h1>";
var btns = "<a href=# class=delete id="+id+">Delete</a> | <a href=# class=cancel id="+id+">Cancel</a>";
$('#managermsg').html(message);
$('#managerbtns').html(btns);
$('#managermsg').fadeIn(500);
$('#managerbtns').fadeIn(500);
}; | jquery | null | null | null | null | null | open | jQuery element not displaying
===
The function below display two box elements, each with it's own message, one below the other. I cannot get the #managerbtns element to appear at all. I have it initially hidden along with the #managermsg element, but it never appears anywhere on the page. Only the #managermsg box fades in. I've tried to alter the properties for the #managerbtns element, but nothing works.
function DeleteUser(id, deleting){
var message = "<h1>Are you sure? All records associated with this user will be deleted also.</h1>";
var btns = "<a href=# class=delete id="+id+">Delete</a> | <a href=# class=cancel id="+id+">Cancel</a>";
$('#managermsg').html(message);
$('#managerbtns').html(btns);
$('#managermsg').fadeIn(500);
$('#managerbtns').fadeIn(500);
}; | 0 |
8,284,126 | 11/27/2011 06:56:32 | 1,067,654 | 11/27/2011 06:51:44 | 1 | 0 | Shopify .liquid & .css edit locations | I'm pretty new to Shopify, and trying to get things working on the web in general, and am having some problems making some changes to the Minimo theme. I'm hoping to get some help with:
1. Due to what I'm selling (wine) and where (Oz), I have to place a disclaimer on the homepage "Won't sell booze to <18, etc". I figure I'll place this above the cart and am worried about ruining the entire theme, as I recently did using Wordpress. My question is, which .liquid file, and where, does the code go and what is it? Also, I'm assuming I'll have to input something into a .css file as well. Yes, I'm that bad!
2. On the 'Products' page, there's a header that reads, 'Products'. Duh. Which .liquid file is this in? I need to change it and just can't seem to find it. Really.
3. And, now for an easier one, as I'm assuming I've just missed an adjustment tool on the editor, how, on the 'Products' page, do you reorganise the product collection?. I've seen how to do this for the items displayed on the frontpage but can't seem to find it for the 'Products' page.
Any answer, to any question, automatically qualifies you for legendary status!
Cheers,
Pete | css | liquid | liquid-layout | shopify | null | 11/27/2011 10:37:37 | off topic | Shopify .liquid & .css edit locations
===
I'm pretty new to Shopify, and trying to get things working on the web in general, and am having some problems making some changes to the Minimo theme. I'm hoping to get some help with:
1. Due to what I'm selling (wine) and where (Oz), I have to place a disclaimer on the homepage "Won't sell booze to <18, etc". I figure I'll place this above the cart and am worried about ruining the entire theme, as I recently did using Wordpress. My question is, which .liquid file, and where, does the code go and what is it? Also, I'm assuming I'll have to input something into a .css file as well. Yes, I'm that bad!
2. On the 'Products' page, there's a header that reads, 'Products'. Duh. Which .liquid file is this in? I need to change it and just can't seem to find it. Really.
3. And, now for an easier one, as I'm assuming I've just missed an adjustment tool on the editor, how, on the 'Products' page, do you reorganise the product collection?. I've seen how to do this for the items displayed on the frontpage but can't seem to find it for the 'Products' page.
Any answer, to any question, automatically qualifies you for legendary status!
Cheers,
Pete | 2 |
8,314,064 | 11/29/2011 16:17:05 | 1,070,084 | 11/28/2011 20:22:38 | 11 | 0 | Paypal IPN Script, issue with feof and fgets | I've been having issues with my Paypal IPN listener script for a couple of days now. For those of you who are unfamiliar with the Paypal IPN system, basically Paypal sends your script with a message about the transaction, which you send back with a couple of bits added. If Paypal receives the correct reply, it'll reply with 'VERIFIED', and if not it'll say 'INVALID'.
I initially thought that the problem I was experiencing was with the 'fsockopen' command:
$fp=fsockopen('ssl://sandbox.paypal.com', 443, $errno, $errstr, 30);
However, having reduced all of my code to pretty much just this line, it seems to connect ok. The problem comes in with the 'feof' and 'fgets' commands. The script just hangs up, and I don't know why. I've essentially copied the code suggested on the Paypal IPN Listener website, so I assumed that it would work! If you could help me understand why feof or fgets are causing it to stall then your help would be much appreciated.
Here's the full script:
$postback = 'cmd=_notify-validate'; //doesn't matter what these include for now
$header='abc';
//Script has been activated, create debug
$filename = 'debug/debug1_script.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle,$postback);
fclose($filehandle);
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);//open the connection
//no connection, create debug file
if(!$fp){
$filename = 'debug/debug2_fpfail.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle, $errstr.'('.$errno.')');
fclose($filehandle);
die();
}
//post data back
fputs($fp, $header . $postback);
//create debug file
$filename = 'debug/debug3_postback.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle, $header.$postback);
fclose($filehandle);
//script hangs with either of the two following lines included
while(!feof($fp)){
$res=fgets($fp,1024);
}
Many thanks in advance! | php | paypal | paypal-ipn | fgets | feof | null | open | Paypal IPN Script, issue with feof and fgets
===
I've been having issues with my Paypal IPN listener script for a couple of days now. For those of you who are unfamiliar with the Paypal IPN system, basically Paypal sends your script with a message about the transaction, which you send back with a couple of bits added. If Paypal receives the correct reply, it'll reply with 'VERIFIED', and if not it'll say 'INVALID'.
I initially thought that the problem I was experiencing was with the 'fsockopen' command:
$fp=fsockopen('ssl://sandbox.paypal.com', 443, $errno, $errstr, 30);
However, having reduced all of my code to pretty much just this line, it seems to connect ok. The problem comes in with the 'feof' and 'fgets' commands. The script just hangs up, and I don't know why. I've essentially copied the code suggested on the Paypal IPN Listener website, so I assumed that it would work! If you could help me understand why feof or fgets are causing it to stall then your help would be much appreciated.
Here's the full script:
$postback = 'cmd=_notify-validate'; //doesn't matter what these include for now
$header='abc';
//Script has been activated, create debug
$filename = 'debug/debug1_script.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle,$postback);
fclose($filehandle);
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);//open the connection
//no connection, create debug file
if(!$fp){
$filename = 'debug/debug2_fpfail.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle, $errstr.'('.$errno.')');
fclose($filehandle);
die();
}
//post data back
fputs($fp, $header . $postback);
//create debug file
$filename = 'debug/debug3_postback.txt';
$filehandle=fopen($filename, 'w');
fwrite($filehandle, $header.$postback);
fclose($filehandle);
//script hangs with either of the two following lines included
while(!feof($fp)){
$res=fgets($fp,1024);
}
Many thanks in advance! | 0 |
381,004 | 12/19/2008 13:44:09 | 39,317 | 11/20/2008 13:43:57 | 20 | 2 | AJAX + ASP.net to retrieve data from Sql Server? | I'm looking to dynamically control a set of drop downs so that they'll filter their items after another drop down's index has been changed.
I'm working in C#/ASP.net and it would be great if I could get the necessary data straight from Sql Server. I suppose I could generate an xml file whenever new data is uploaded to the server but that sounds like a pain.
Is there an obvious way to do what I need to do? | asp.net | ajax | javascript | c# | null | null | open | AJAX + ASP.net to retrieve data from Sql Server?
===
I'm looking to dynamically control a set of drop downs so that they'll filter their items after another drop down's index has been changed.
I'm working in C#/ASP.net and it would be great if I could get the necessary data straight from Sql Server. I suppose I could generate an xml file whenever new data is uploaded to the server but that sounds like a pain.
Is there an obvious way to do what I need to do? | 0 |
8,023,475 | 11/05/2011 21:38:56 | 805,704 | 06/19/2011 20:15:09 | 331 | 3 | Game development: XNA, DirectX, OpenGL and inbetween | I'm a computer science student who's about to graduate, I have a lot of experience in C# and .NET development and
I'd like to start focusing in game development.
I had a XNA course in college which was really cool, (we developed a simple space invaders game) so you can say I have already been introduced to game development.
Obviously, I'd really like to build more complex and advanced 2D and 3D games but I'm intrigued, and wondering what should be the technology that I should pick for the development.
Although I really liked XNA and I love the .NET framework in general, I somehow feel that knowing how to develop games under the XNA platform won't assist me in developing games to other platforms which do not support DirectX (like the various Android devices, IPhone, IPad etc`), and maybe I should focus on creating OpenGL API based games instead (I saw a couple of books for .NET OpenGL development).
What are your thoughts regarding this? | opengl | xna | directx | null | null | 11/05/2011 22:37:14 | not constructive | Game development: XNA, DirectX, OpenGL and inbetween
===
I'm a computer science student who's about to graduate, I have a lot of experience in C# and .NET development and
I'd like to start focusing in game development.
I had a XNA course in college which was really cool, (we developed a simple space invaders game) so you can say I have already been introduced to game development.
Obviously, I'd really like to build more complex and advanced 2D and 3D games but I'm intrigued, and wondering what should be the technology that I should pick for the development.
Although I really liked XNA and I love the .NET framework in general, I somehow feel that knowing how to develop games under the XNA platform won't assist me in developing games to other platforms which do not support DirectX (like the various Android devices, IPhone, IPad etc`), and maybe I should focus on creating OpenGL API based games instead (I saw a couple of books for .NET OpenGL development).
What are your thoughts regarding this? | 4 |
8,695,568 | 01/01/2012 21:10:27 | 1,125,410 | 01/01/2012 21:04:24 | 1 | 0 | what this code under RijndaelManaged means? | I just wanna know what this codes means? I have tried to put it in C# compiler but it does not work..
private byte[] Method_05(string A_0, string A_1)
{
RijndaelManaged managed = new RijndaelManaged {
Key = Convert.FromBase64String(A_0),
IV = Convert.FromBase64String(A_1)
};strong text
Stream manifestResourceStream = base.GetType().Assembly.GetManifestResourceStream("s.Assembly");
CryptoStream stream2 = new CryptoStream(manifestResourceStream, managed.CreateDecryptor(), CryptoStreamMode.Read);
byte[] buffer = new byte[manifestResourceStream.Length];
stream2.Read(buffer, 0, buffer.Length);
stream2.Close();
manifestResourceStream.Close();
return buffer;
}
**my problem here with those lines, I know that looks kinda decryption but what is mean anyway?**
Stream manifestResourceStream = base.GetType().Assembly.GetManifestResourceStream("s.Assembly");
CryptoStream stream2 = new CryptoStream(manifestResourceStream, managed.CreateDecryptor(), CryptoStreamMode.Read);
byte[] buffer = new byte[manifestResourceStream.Length];
stream2.Read(buffer, 0, buffer.Length);
stream2.Close();
manifestResourceStream.Close();
return buffer;
| c# | null | null | null | null | 06/19/2012 11:42:25 | too localized | what this code under RijndaelManaged means?
===
I just wanna know what this codes means? I have tried to put it in C# compiler but it does not work..
private byte[] Method_05(string A_0, string A_1)
{
RijndaelManaged managed = new RijndaelManaged {
Key = Convert.FromBase64String(A_0),
IV = Convert.FromBase64String(A_1)
};strong text
Stream manifestResourceStream = base.GetType().Assembly.GetManifestResourceStream("s.Assembly");
CryptoStream stream2 = new CryptoStream(manifestResourceStream, managed.CreateDecryptor(), CryptoStreamMode.Read);
byte[] buffer = new byte[manifestResourceStream.Length];
stream2.Read(buffer, 0, buffer.Length);
stream2.Close();
manifestResourceStream.Close();
return buffer;
}
**my problem here with those lines, I know that looks kinda decryption but what is mean anyway?**
Stream manifestResourceStream = base.GetType().Assembly.GetManifestResourceStream("s.Assembly");
CryptoStream stream2 = new CryptoStream(manifestResourceStream, managed.CreateDecryptor(), CryptoStreamMode.Read);
byte[] buffer = new byte[manifestResourceStream.Length];
stream2.Read(buffer, 0, buffer.Length);
stream2.Close();
manifestResourceStream.Close();
return buffer;
| 3 |
1,450,436 | 09/20/2009 06:24:34 | 73,109 | 03/03/2009 07:54:59 | 153 | 5 | Should Apple bundle the Mono Touch runtime with every iPhone? | It strikes me as a good idea for Apple to negotiate with Novell and bundle the Mono Touch runtime (only the runtime of course) into every iPhone and iPod Touch. Perhaps even make it a "one time install" that automatically gets downloaded from the App Store the first time one downloads an app build with Mono Touch, making every subsequent Mono Touch app much lighter to download (without the runtime).
Doing so would be similar in a way to adding Bootcamp to OS X: it would make it easier for C# developers to join the party, but that wouldn't mean these developers will all stick to C#... What convinced me to buy a Mac is Bootcamp - I figured I could always install Windows if I didn't like OS X (and I liked the hardware, so no problem there). 6 months later, I'm using OS X full time...
Would there be any technical issues in doing so? I see only advantages for all parties, not one disadvantage to anyone (except maybe for the few unfortunate Apple employees who would have to test the crap out of the Mono Touch runtime before bundling it):
- Novell wins because Mono Touch becomes much more viable (Mono Touch apps become much lighter all of the sudden)
- Developers win because now there's one more tool in the tool belt
- Many C# Developers would be very interested by this
- Apple wins because that would bring even more attention to the platform, more revenue in developer fees, more potential great apps, etc
- Users win because less space is used by different Apps having copies of the same runtime accumulating on their devices
Would there be a major technical obstacle in bundling Mono Touch to iPhone OS?
| iphone | monotouch | null | null | null | 12/08/2011 23:12:18 | not constructive | Should Apple bundle the Mono Touch runtime with every iPhone?
===
It strikes me as a good idea for Apple to negotiate with Novell and bundle the Mono Touch runtime (only the runtime of course) into every iPhone and iPod Touch. Perhaps even make it a "one time install" that automatically gets downloaded from the App Store the first time one downloads an app build with Mono Touch, making every subsequent Mono Touch app much lighter to download (without the runtime).
Doing so would be similar in a way to adding Bootcamp to OS X: it would make it easier for C# developers to join the party, but that wouldn't mean these developers will all stick to C#... What convinced me to buy a Mac is Bootcamp - I figured I could always install Windows if I didn't like OS X (and I liked the hardware, so no problem there). 6 months later, I'm using OS X full time...
Would there be any technical issues in doing so? I see only advantages for all parties, not one disadvantage to anyone (except maybe for the few unfortunate Apple employees who would have to test the crap out of the Mono Touch runtime before bundling it):
- Novell wins because Mono Touch becomes much more viable (Mono Touch apps become much lighter all of the sudden)
- Developers win because now there's one more tool in the tool belt
- Many C# Developers would be very interested by this
- Apple wins because that would bring even more attention to the platform, more revenue in developer fees, more potential great apps, etc
- Users win because less space is used by different Apps having copies of the same runtime accumulating on their devices
Would there be a major technical obstacle in bundling Mono Touch to iPhone OS?
| 4 |
11,262,199 | 06/29/2012 12:56:22 | 1,045,704 | 11/14/2011 13:49:58 | 1,126 | 35 | How to achieve this substring? | There is a string having a dot form like this : `1.1.3`
I want to get the `substring` of this string from the beginning untill the position of the last "." - 1 , that is `1.1` .
How to achieve that ? | php | null | null | null | null | 06/29/2012 13:02:21 | not a real question | How to achieve this substring?
===
There is a string having a dot form like this : `1.1.3`
I want to get the `substring` of this string from the beginning untill the position of the last "." - 1 , that is `1.1` .
How to achieve that ? | 1 |
5,090,405 | 02/23/2011 11:42:56 | 630,105 | 02/23/2011 11:42:56 | 1 | 0 | c++ http request methods | i have written an search system in c++ with lucene c and crawler in c and i need to get the search result via browser to get to process it in client side(displaying the search result..) like an API how can i do that in c++ i mean i need to provide an REST API to process.. | c++ | null | null | null | null | 02/24/2011 01:13:59 | not a real question | c++ http request methods
===
i have written an search system in c++ with lucene c and crawler in c and i need to get the search result via browser to get to process it in client side(displaying the search result..) like an API how can i do that in c++ i mean i need to provide an REST API to process.. | 1 |
9,352,457 | 02/19/2012 19:29:21 | 535,556 | 12/08/2010 20:25:47 | 70 | 0 | mobclix or admob integration with Phonegap | i need to know how to integrate Admob or Mobclix banner adds into Phonegap based app.
I tried mobile website in Admob but app code not working in app and both ads servicess offers only SDK for native apps.
Could somebody help we with any tutorial?
Many thanks | android | iphone | mobile | phonegap | advertising | 05/23/2012 08:18:26 | not constructive | mobclix or admob integration with Phonegap
===
i need to know how to integrate Admob or Mobclix banner adds into Phonegap based app.
I tried mobile website in Admob but app code not working in app and both ads servicess offers only SDK for native apps.
Could somebody help we with any tutorial?
Many thanks | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.