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
9,265,701
02/13/2012 18:16:27
1,192,617
02/06/2012 15:35:36
18
0
sql error - data truncation for datetime - using java/hibernate/timestamp property
The scenario: I have a servlet that receives xmls, parses them (using jaxb), persists the parsed data to a mysql db (using hibernate) and also saves a copy of the xml for future reference. It saves this xml also when parsing fails. In these cases I receive an email with a summary of the error and then check the saved xml for clues to what went wrong. The operation runs pretty smoothly. The servlet receives a couple of thousands xmls per day. The problem: At least once a day I get an error like this: org.hibernate.exception.DataException: could not insert .......... Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '20122012-01-22 15:20:51' for column 'createdAt' at row 1 I get this error for some other "columns" as well. These columns are datetime type on mysql side and java.sql.Timestamp on the java side. When I take a look at the xml that was received i see the correct date format: "2012-01-22 15:20:51" Any idea what could have gone wrong?
java
mysql
hibernate
jaxb
truncation
null
open
sql error - data truncation for datetime - using java/hibernate/timestamp property === The scenario: I have a servlet that receives xmls, parses them (using jaxb), persists the parsed data to a mysql db (using hibernate) and also saves a copy of the xml for future reference. It saves this xml also when parsing fails. In these cases I receive an email with a summary of the error and then check the saved xml for clues to what went wrong. The operation runs pretty smoothly. The servlet receives a couple of thousands xmls per day. The problem: At least once a day I get an error like this: org.hibernate.exception.DataException: could not insert .......... Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect datetime value: '20122012-01-22 15:20:51' for column 'createdAt' at row 1 I get this error for some other "columns" as well. These columns are datetime type on mysql side and java.sql.Timestamp on the java side. When I take a look at the xml that was received i see the correct date format: "2012-01-22 15:20:51" Any idea what could have gone wrong?
0
8,320,312
11/30/2011 02:07:32
18,309
09/18/2008 22:13:45
3,792
42
Why is .index() resolving as a number in this statement while .parent().index() is resolving as a string?
Here is the code, it is referencing a TD and "farmland" is the id of the table: $("#farmland td").click(function(){ $("#console").html($(this).index() + 1 + ", " + $(this).parent().index() + 1); }); When I click a TD, I am getting 1,01 or 1,11 or 1,21 etc... the number is properly adding for .index() but for .parent().index() it is appending the 1 as if it is a string! Thought this was very curious, as I expected it to either act one way, or the other, not two different ways! My first guess may be that it's because my `+ ", " +` is switching it to work as a string?
javascript
jquery
null
null
null
null
open
Why is .index() resolving as a number in this statement while .parent().index() is resolving as a string? === Here is the code, it is referencing a TD and "farmland" is the id of the table: $("#farmland td").click(function(){ $("#console").html($(this).index() + 1 + ", " + $(this).parent().index() + 1); }); When I click a TD, I am getting 1,01 or 1,11 or 1,21 etc... the number is properly adding for .index() but for .parent().index() it is appending the 1 as if it is a string! Thought this was very curious, as I expected it to either act one way, or the other, not two different ways! My first guess may be that it's because my `+ ", " +` is switching it to work as a string?
0
6,301,546
06/10/2011 03:03:06
511,438
11/17/2010 22:55:52
382
12
Return (T)Request[key];
I have this existing code which works very well. public static T SessionGet<T>(string key) { if (Session[key] == null) return default(T); else return (T)Session[key]; } I wanted to make a version that works for Request. I realise that Request is string based. So how can I change the code so that error, as in the comment below, does not occur without having to place a large switch based on typeof(T). return (T)Request[key]; // Cannot cast expression of type 'string' to type '(T)' Here is the function.... public static T RequestGet<T>(string key) { if (Request[key] == null) return default(T); else return (T)Request[key]; } thank you
c#
asp.net
null
null
null
null
open
Return (T)Request[key]; === I have this existing code which works very well. public static T SessionGet<T>(string key) { if (Session[key] == null) return default(T); else return (T)Session[key]; } I wanted to make a version that works for Request. I realise that Request is string based. So how can I change the code so that error, as in the comment below, does not occur without having to place a large switch based on typeof(T). return (T)Request[key]; // Cannot cast expression of type 'string' to type '(T)' Here is the function.... public static T RequestGet<T>(string key) { if (Request[key] == null) return default(T); else return (T)Request[key]; } thank you
0
4,355,756
12/04/2010 20:49:18
173,149
09/14/2009 13:42:30
132
8
Why most open source (OSI) license contain text about Warranty Disclaimers?
Suppose I put open source code on public without Warranty Disclaimers and some one use it. Then this person can damage me in judgement?
copyright
copyright-law
null
null
null
12/05/2010 20:38:36
off topic
Why most open source (OSI) license contain text about Warranty Disclaimers? === Suppose I put open source code on public without Warranty Disclaimers and some one use it. Then this person can damage me in judgement?
2
9,349,044
02/19/2012 12:15:01
576,758
01/15/2011 14:12:54
1,074
30
Load Properties from resources folder within JAR
I have a JAR file Movie Library.jar, its contents are depicted below: ![enter image description here][1] [1]: http://i.stack.imgur.com/eMHgk.png The class PropertiesUtils is resides in the client.jar (shown in picture) and the properties files are in properties folder which resides in resources folder. I am trying to load properties as: String absolutePath = LazyProperties.class.getClass().getResource(filePath).getPath(); File file = new File(absolutePath); InputStream stream = new FileInputStream(file); Properties properties = new Properties(); properties.load(stream); But it is showing: file:\D:\Code\MovieLibrary\build\jar\Movie%20Library.jar!\resources\properties\movie_library.properties (The filename, directory name, or volume label syntax is incorrect) I am unable to figure it as `System.out.println(file)` prints: file:/D:/Code/MovieLibrary/build/jar/Movie%20Library.jar!/resources/properties/movie_library.properties Any help is appreciable. Thanks in advance.
java
file
properties
io
inputstream
null
open
Load Properties from resources folder within JAR === I have a JAR file Movie Library.jar, its contents are depicted below: ![enter image description here][1] [1]: http://i.stack.imgur.com/eMHgk.png The class PropertiesUtils is resides in the client.jar (shown in picture) and the properties files are in properties folder which resides in resources folder. I am trying to load properties as: String absolutePath = LazyProperties.class.getClass().getResource(filePath).getPath(); File file = new File(absolutePath); InputStream stream = new FileInputStream(file); Properties properties = new Properties(); properties.load(stream); But it is showing: file:\D:\Code\MovieLibrary\build\jar\Movie%20Library.jar!\resources\properties\movie_library.properties (The filename, directory name, or volume label syntax is incorrect) I am unable to figure it as `System.out.println(file)` prints: file:/D:/Code/MovieLibrary/build/jar/Movie%20Library.jar!/resources/properties/movie_library.properties Any help is appreciable. Thanks in advance.
0
10,055,792
04/07/2012 15:36:53
1,299,507
03/29/2012 00:01:27
1
0
Convert dict to string
Have been searching how to convert a dictionary to a string. But the results found is not the ones i am looking for. The results i currently find is basically turning the whole dictionary into a string, but i don't really want {}, , and : in my string. So i got a dictionary of sorted URLvars i wanted to join together again. vars = {"id":"2", "test":"3"} so i want a way to convert this dictionary to: vars = "id=2&test=3"
string
dictionary
python-2.7
null
null
null
open
Convert dict to string === Have been searching how to convert a dictionary to a string. But the results found is not the ones i am looking for. The results i currently find is basically turning the whole dictionary into a string, but i don't really want {}, , and : in my string. So i got a dictionary of sorted URLvars i wanted to join together again. vars = {"id":"2", "test":"3"} so i want a way to convert this dictionary to: vars = "id=2&test=3"
0
8,570,981
12/20/2011 04:55:26
554,075
12/26/2010 02:42:39
1,057
19
How to implement `opIndex` in higher dimensions?
struct M{ T opIndex(uint i){ ... } } which gives me this: m[i] but what if I want it in two dimension so that I could do: m[i][j] is there anyway to do this?
d
null
null
null
null
null
open
How to implement `opIndex` in higher dimensions? === struct M{ T opIndex(uint i){ ... } } which gives me this: m[i] but what if I want it in two dimension so that I could do: m[i][j] is there anyway to do this?
0
6,658,477
07/12/2011 01:07:42
815,560
06/25/2011 18:10:38
114
13
What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)?
What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)? 1) Use android frame work and iOS framework. 2) Or use a cross platform development library something like (AirPlay SDK for example). 3) Or there is other way else you prefer. Please feel free to give me your suggestions.
iphone
android
mobile-application
null
null
null
open
What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)? === What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)? 1) Use android frame work and iOS framework. 2) Or use a cross platform development library something like (AirPlay SDK for example). 3) Or there is other way else you prefer. Please feel free to give me your suggestions.
0
10,691,453
05/21/2012 19:34:43
1,312,478
04/04/2012 09:40:22
73
4
AWS EC2 pricing
I am planning to start with small EC2 RESERVED instance with 3 year commitment. If in between I upgrade it to Large instance; will I be able to use my upfront payment I made for small instance ?
amazon-ec2
amazon-web-services
null
null
null
05/22/2012 14:07:02
off topic
AWS EC2 pricing === I am planning to start with small EC2 RESERVED instance with 3 year commitment. If in between I upgrade it to Large instance; will I be able to use my upfront payment I made for small instance ?
2
9,633,814
03/09/2012 12:07:47
1,259,236
03/09/2012 11:59:58
1
0
How To Secure Shared MySql User
We have a mySql user that have about 20 database and all of each database is for one site , and i know its not secure and i want secure it and the users hadn't any access to other users database . and i dont want to create a new mysql user for each users , is there any way to secure this databases with this condition ? Thanks in Advance .
php
mysql
database
security
null
03/09/2012 15:49:26
not a real question
How To Secure Shared MySql User === We have a mySql user that have about 20 database and all of each database is for one site , and i know its not secure and i want secure it and the users hadn't any access to other users database . and i dont want to create a new mysql user for each users , is there any way to secure this databases with this condition ? Thanks in Advance .
1
6,458,024
06/23/2011 17:17:24
778,653
06/01/2011 02:42:09
16
0
Websites looking different across browsers? Why don't people care?
Our company is looking at building a brand new website in the next couple of months and the IT director is all gung-ho to start using HTML5 and CSS3. He really thinks it's the coolest thing and definitely doesn't care that a website styled with HTML5 and CSS3 is going to look and function great in Firefox, safari, opera and just ok in all versions of IE. Granted IE9 is definitely a nice improvement from IE8, but won't be a standard amongst our visitors for a while. But my question is. **Why don't people care that their website looks different across browsers?** I feel like I am missing something completely. Our analytics shows that 72-74% of our visitors use IE. In addition, research done for our visitors show the vast majority of them are, in marketing terms, considered "laggards" (always the last to adapt new technology. A lot of older 45-65+ business men and women.) I am a tech geek like my boss is, I love new technology, and I wish everyone in the world had browsers that supported the latest and greatest. **But from a business standpoint, I just don't see the sense in constructing a web site that implements technology that a vast amount of our visitors won't be able to see or use (or care about, if we're being honest). Those people will only be able to see a degraded version of our site.** To me it makes sense to continue to use technology that is consistent. Right now, it is so easy to make your website look the same across all browsers. But that's just my opinion, anyone else out there agree, disagree?
html5
css3
cross-browser
browser-compatibility
null
06/23/2011 18:20:42
not constructive
Websites looking different across browsers? Why don't people care? === Our company is looking at building a brand new website in the next couple of months and the IT director is all gung-ho to start using HTML5 and CSS3. He really thinks it's the coolest thing and definitely doesn't care that a website styled with HTML5 and CSS3 is going to look and function great in Firefox, safari, opera and just ok in all versions of IE. Granted IE9 is definitely a nice improvement from IE8, but won't be a standard amongst our visitors for a while. But my question is. **Why don't people care that their website looks different across browsers?** I feel like I am missing something completely. Our analytics shows that 72-74% of our visitors use IE. In addition, research done for our visitors show the vast majority of them are, in marketing terms, considered "laggards" (always the last to adapt new technology. A lot of older 45-65+ business men and women.) I am a tech geek like my boss is, I love new technology, and I wish everyone in the world had browsers that supported the latest and greatest. **But from a business standpoint, I just don't see the sense in constructing a web site that implements technology that a vast amount of our visitors won't be able to see or use (or care about, if we're being honest). Those people will only be able to see a degraded version of our site.** To me it makes sense to continue to use technology that is consistent. Right now, it is so easy to make your website look the same across all browsers. But that's just my opinion, anyone else out there agree, disagree?
4
10,056,848
04/07/2012 17:51:24
558,516
12/30/2010 17:18:59
41
5
I don't to compile my app
Anybody has one idea about this problem? I'm developing a app with database SQLite3. Ld /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator/iCollection.app/iCollection normal i386 cd "/Users/asrsantos/Documents/Projects/Real Projects/Objective-C/iCollection/iCollection" setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator -F/Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator -filelist /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Intermediates/iCollection.build/Debug-iphonesimulator/iCollection.build/Objects-normal/i386/iCollection.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lsqlite3 -lsqlite3.0 -framework Security -framework SystemConfiguration -framework MessageUI -framework Twitter -framework CFNetwork -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator/iCollection.app/iCollection Undefined symbols for architecture i386: "_OBJC_CLASS_$_Database", referenced from: objc-class-ref in iCollectionAppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
database
xcode
compiler
null
null
04/09/2012 05:37:55
not a real question
I don't to compile my app === Anybody has one idea about this problem? I'm developing a app with database SQLite3. Ld /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator/iCollection.app/iCollection normal i386 cd "/Users/asrsantos/Documents/Projects/Real Projects/Objective-C/iCollection/iCollection" setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator -F/Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator -filelist /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Intermediates/iCollection.build/Debug-iphonesimulator/iCollection.build/Objects-normal/i386/iCollection.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lsqlite3 -lsqlite3.0 -framework Security -framework SystemConfiguration -framework MessageUI -framework Twitter -framework CFNetwork -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/asrsantos/Library/Developer/Xcode/DerivedData/iCollection-gnicszoxzmnmkvdrgskxebfnaqua/Build/Products/Debug-iphonesimulator/iCollection.app/iCollection Undefined symbols for architecture i386: "_OBJC_CLASS_$_Database", referenced from: objc-class-ref in iCollectionAppDelegate.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
1
9,420,656
02/23/2012 20:23:13
1,120,121
12/28/2011 22:32:17
344
14
What is the best dp dimensions to make your xml layouts as a base for?
What Dp and emulator is the best for developing xml layouts on android with eclipse IDE?
java
android
xml
eclipse
android-emulator
02/24/2012 20:31:31
not constructive
What is the best dp dimensions to make your xml layouts as a base for? === What Dp and emulator is the best for developing xml layouts on android with eclipse IDE?
4
9,504,764
02/29/2012 18:40:33
525,240
11/30/2010 13:53:11
26
3
How can I configure execution start between dependent jobs?
My Jenkins server is set up with two jobs A and B say. Job A is triggered from changes in subversion, runs unit tests and if successful, creates a WAR and deploys it to another environment. If Job A succeeds, then Job B triggers. This job runs tests against the deployed WAR. The problem is that the deployment process takes a while and the WAR is not ready in time for when Job B starts and tries to use it. I'm looking for ideas on how to delay Job B until the WAR is up and running. Is there a way, once Job B is triggered to wait for x seconds? I really don't want to put it into the tests in Job B if I can avoid it. Thanks
jenkins
null
null
null
null
null
open
How can I configure execution start between dependent jobs? === My Jenkins server is set up with two jobs A and B say. Job A is triggered from changes in subversion, runs unit tests and if successful, creates a WAR and deploys it to another environment. If Job A succeeds, then Job B triggers. This job runs tests against the deployed WAR. The problem is that the deployment process takes a while and the WAR is not ready in time for when Job B starts and tries to use it. I'm looking for ideas on how to delay Job B until the WAR is up and running. Is there a way, once Job B is triggered to wait for x seconds? I really don't want to put it into the tests in Job B if I can avoid it. Thanks
0
7,477,434
09/19/2011 21:20:00
953,561
09/19/2011 21:20:00
1
0
Android : get the current view (displayed on the screen)?
How can I retrieve the current view that is currently diplayed when processing/handling an event ?
android
events
user-interface
view
null
09/19/2011 23:48:04
not a real question
Android : get the current view (displayed on the screen)? === How can I retrieve the current view that is currently diplayed when processing/handling an event ?
1
10,382,540
04/30/2012 10:57:41
821,442
06/29/2011 15:35:07
10
0
Project Euler #19
Warning! Spoilers ahead! > You are given the following information, but you may prefer to do some > research for yourself. > > 1 Jan 1900 was a Monday. > Thirty days has September, > April, June and November. > All the rest have thirty-one, > Saving February alone, > Which has twenty-eight, rain or shine. > And on leap years, twenty-nine. > > A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400. How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)? At first, it seems like a simple problem. However, as I coded the solution, I ran into an odd problem - the answer should, in fact, be 171, but I get 173, whatever I do. I've looked over and over again my code, but nevertheless cannot find the bug. #include <iostream> using namespace std; int main () { int count = 0, days_in_month, days_passed = 1; for (int i = 1900; i <= 2000; i++) { for (int j = 1; j <= 12; j++) { if (j == 4 || j == 6 || j == 9 || j == 11) { days_in_month = 30; } else if (j == 2) { if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) { days_in_month = 29; } else { days_in_month = 28; } } else { days_in_month = 31; } if (days_passed % 7 == 0) { count++; } days_passed += days_in_month; } } cout << count << endl; cin.ignore(); return 0; } Can anyone notice anything wrong with my code?
c++
project-euler
null
null
null
05/01/2012 01:38:17
too localized
Project Euler #19 === Warning! Spoilers ahead! > You are given the following information, but you may prefer to do some > research for yourself. > > 1 Jan 1900 was a Monday. > Thirty days has September, > April, June and November. > All the rest have thirty-one, > Saving February alone, > Which has twenty-eight, rain or shine. > And on leap years, twenty-nine. > > A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400. How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)? At first, it seems like a simple problem. However, as I coded the solution, I ran into an odd problem - the answer should, in fact, be 171, but I get 173, whatever I do. I've looked over and over again my code, but nevertheless cannot find the bug. #include <iostream> using namespace std; int main () { int count = 0, days_in_month, days_passed = 1; for (int i = 1900; i <= 2000; i++) { for (int j = 1; j <= 12; j++) { if (j == 4 || j == 6 || j == 9 || j == 11) { days_in_month = 30; } else if (j == 2) { if (i % 400 == 0 || (i % 4 == 0 && i % 100 != 0)) { days_in_month = 29; } else { days_in_month = 28; } } else { days_in_month = 31; } if (days_passed % 7 == 0) { count++; } days_passed += days_in_month; } } cout << count << endl; cin.ignore(); return 0; } Can anyone notice anything wrong with my code?
3
4,556,387
12/29/2010 17:44:49
556,325
12/28/2010 19:13:13
6
0
MVVM - implementing 'IsDirty' functionality to a ModelView in order to save data
Being new to WPF & MVVM I struggling with some basic functionality. Let me first explain what I am after, and then attach some example code... I have a screen showing a list of users, and I display the details of the selected user on the right-hand side with editable textboxes. I then have a Save button which is DataBound, but I would only like this button to display when data has actually changed. ie - I need to check for "dirty data". I have a fully MVVM example in which I have a Model called User: namespace Test.Model { class User { public string UserName { get; set; } public string Surname { get; set; } public string Firstname { get; set; } } } Then, the ViewModel looks like this: using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Windows.Input; using Test.Model; namespace Test.ViewModel { class UserViewModel : ViewModelBase { //Private variables private ObservableCollection<User> _users; RelayCommand _userSave; //Properties public ObservableCollection<User> User { get { if (_users == null) { _users = new ObservableCollection<User>(); //I assume I need this Handler, but I am stuggling to implement it successfully //_users.CollectionChanged += HandleChange; //Populate with users _users.Add(new User {UserName = "Bob", Firstname="Bob", Surname="Smith"}); _users.Add(new User {UserName = "Smob", Firstname="John", Surname="Davy"}); } return _users; } } //Not sure what to do with this?!?! //private void HandleChange(object sender, NotifyCollectionChangedEventArgs e) //{ // if (e.Action == NotifyCollectionChangedAction.Remove) // { // foreach (TestViewModel item in e.NewItems) // { // //Removed items // } // } // else if (e.Action == NotifyCollectionChangedAction.Add) // { // foreach (TestViewModel item in e.NewItems) // { // //Added items // } // } //} //Commands public ICommand UserSave { get { if (_userSave == null) { _userSave = new RelayCommand(param => this.UserSaveExecute(), param => this.UserSaveCanExecute); } return _userSave; } } void UserSaveExecute() { //Here I will call my DataAccess to actually save the data } bool UserSaveCanExecute { get { //This is where I would like to know whether the currently selected item has been edited and is thus "dirty" return false; } } //constructor public UserViewModel() { } } } The "RelayCommand" is just a simple wrapper class, as is the "ViewModelBase". (I'll attach the latter though just for clarity) using System; using System.ComponentModel; namespace Test.ViewModel { public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable { protected ViewModelBase() { } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = this.PropertyChanged; if (handler != null) { var e = new PropertyChangedEventArgs(propertyName); handler(this, e); } } public void Dispose() { this.OnDispose(); } protected virtual void OnDispose() { } } } Finally - the XAML <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:Test.ViewModel" Title="MainWindow" Height="350" Width="525"> <Window.DataContext> <vm:UserViewModel/> </Window.DataContext> <Grid> <ListBox Height="238" HorizontalAlignment="Left" Margin="12,12,0,0" Name="listBox1" VerticalAlignment="Top" Width="197" ItemsSource="{Binding Path=User}" IsSynchronizedWithCurrentItem="True"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Firstname}"/> <TextBlock Text="{Binding Path=Surname}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Label Content="Username" Height="28" HorizontalAlignment="Left" Margin="232,16,0,0" Name="label1" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,21,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/UserName}" /> <Label Content="Surname" Height="28" HorizontalAlignment="Left" Margin="232,50,0,0" Name="label2" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,52,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/Surname}" /> <Label Content="Firstname" Height="28" HorizontalAlignment="Left" Margin="232,84,0,0" Name="label3" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,86,0,0" Name="textBox3" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/Firstname}" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="368,159,0,0" Name="button1" VerticalAlignment="Top" Width="75" Command="{Binding Path=UserSave}" /> </Grid> </Window> So basically, when I edit a surname, the Save button should be enabled; and if I undo my edit - well then it should be Disabled again as nothing has changed. I have seen this in many examples, but have not yet found out how to do it. Any help would be much appreciated! Brendan
c#
wpf
mvvm
observablecollection
null
null
open
MVVM - implementing 'IsDirty' functionality to a ModelView in order to save data === Being new to WPF & MVVM I struggling with some basic functionality. Let me first explain what I am after, and then attach some example code... I have a screen showing a list of users, and I display the details of the selected user on the right-hand side with editable textboxes. I then have a Save button which is DataBound, but I would only like this button to display when data has actually changed. ie - I need to check for "dirty data". I have a fully MVVM example in which I have a Model called User: namespace Test.Model { class User { public string UserName { get; set; } public string Surname { get; set; } public string Firstname { get; set; } } } Then, the ViewModel looks like this: using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Windows.Input; using Test.Model; namespace Test.ViewModel { class UserViewModel : ViewModelBase { //Private variables private ObservableCollection<User> _users; RelayCommand _userSave; //Properties public ObservableCollection<User> User { get { if (_users == null) { _users = new ObservableCollection<User>(); //I assume I need this Handler, but I am stuggling to implement it successfully //_users.CollectionChanged += HandleChange; //Populate with users _users.Add(new User {UserName = "Bob", Firstname="Bob", Surname="Smith"}); _users.Add(new User {UserName = "Smob", Firstname="John", Surname="Davy"}); } return _users; } } //Not sure what to do with this?!?! //private void HandleChange(object sender, NotifyCollectionChangedEventArgs e) //{ // if (e.Action == NotifyCollectionChangedAction.Remove) // { // foreach (TestViewModel item in e.NewItems) // { // //Removed items // } // } // else if (e.Action == NotifyCollectionChangedAction.Add) // { // foreach (TestViewModel item in e.NewItems) // { // //Added items // } // } //} //Commands public ICommand UserSave { get { if (_userSave == null) { _userSave = new RelayCommand(param => this.UserSaveExecute(), param => this.UserSaveCanExecute); } return _userSave; } } void UserSaveExecute() { //Here I will call my DataAccess to actually save the data } bool UserSaveCanExecute { get { //This is where I would like to know whether the currently selected item has been edited and is thus "dirty" return false; } } //constructor public UserViewModel() { } } } The "RelayCommand" is just a simple wrapper class, as is the "ViewModelBase". (I'll attach the latter though just for clarity) using System; using System.ComponentModel; namespace Test.ViewModel { public abstract class ViewModelBase : INotifyPropertyChanged, IDisposable { protected ViewModelBase() { } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { PropertyChangedEventHandler handler = this.PropertyChanged; if (handler != null) { var e = new PropertyChangedEventArgs(propertyName); handler(this, e); } } public void Dispose() { this.OnDispose(); } protected virtual void OnDispose() { } } } Finally - the XAML <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:Test.ViewModel" Title="MainWindow" Height="350" Width="525"> <Window.DataContext> <vm:UserViewModel/> </Window.DataContext> <Grid> <ListBox Height="238" HorizontalAlignment="Left" Margin="12,12,0,0" Name="listBox1" VerticalAlignment="Top" Width="197" ItemsSource="{Binding Path=User}" IsSynchronizedWithCurrentItem="True"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Path=Firstname}"/> <TextBlock Text="{Binding Path=Surname}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <Label Content="Username" Height="28" HorizontalAlignment="Left" Margin="232,16,0,0" Name="label1" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,21,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/UserName}" /> <Label Content="Surname" Height="28" HorizontalAlignment="Left" Margin="232,50,0,0" Name="label2" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,52,0,0" Name="textBox2" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/Surname}" /> <Label Content="Firstname" Height="28" HorizontalAlignment="Left" Margin="232,84,0,0" Name="label3" VerticalAlignment="Top" /> <TextBox Height="23" HorizontalAlignment="Left" Margin="323,86,0,0" Name="textBox3" VerticalAlignment="Top" Width="120" Text="{Binding Path=User/Firstname}" /> <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="368,159,0,0" Name="button1" VerticalAlignment="Top" Width="75" Command="{Binding Path=UserSave}" /> </Grid> </Window> So basically, when I edit a surname, the Save button should be enabled; and if I undo my edit - well then it should be Disabled again as nothing has changed. I have seen this in many examples, but have not yet found out how to do it. Any help would be much appreciated! Brendan
0
8,487,242
12/13/2011 09:59:55
1,095,469
12/13/2011 09:57:27
1
0
set fixed height for header and footer in grid view
I have grid in my project in that i need the fixed height for both header and footer with pagination, i have 10 records per page, for instance i am taking 12 records from database,in the first page, 10 records is showing correctly, GRID height is 220px, while in the second page, 2 records are showing, at that time footer color is filling the place of the empty records. but i need the empty space there, Please help me, I am strugling in this task for last two days. the grid height is fixed
asp.net
null
null
null
null
null
open
set fixed height for header and footer in grid view === I have grid in my project in that i need the fixed height for both header and footer with pagination, i have 10 records per page, for instance i am taking 12 records from database,in the first page, 10 records is showing correctly, GRID height is 220px, while in the second page, 2 records are showing, at that time footer color is filling the place of the empty records. but i need the empty space there, Please help me, I am strugling in this task for last two days. the grid height is fixed
0
11,657,002
07/25/2012 19:19:48
1,552,583
07/25/2012 18:44:25
1
0
Latest fsck execution on Solaris
Linux has a tune2fs command to determine the last time fsck was executed. Is there something similar in Solaris that can be used to determine last fsck execution?
solaris
execution
last
fsc
null
07/26/2012 20:16:17
off topic
Latest fsck execution on Solaris === Linux has a tune2fs command to determine the last time fsck was executed. Is there something similar in Solaris that can be used to determine last fsck execution?
2
9,428,267
02/24/2012 09:24:05
907,695
08/23/2011 12:19:01
3,723
119
LAN setup - Internet and IPTV (separate LANs) over one cable
My goal is to combine Internet and IPTV signal from Optical modem, and bring these signals over one cable to different location at home. Problem is: - Optical modem has 2 ports, one for IPTV, one for Internet over PPPOE - IPTV port has its own DHCP/DNS server and gateway, needed for set top box to work, while my Internet needs own DHCP/DNS server in order to work - Optical modem is black box provided by ISP, with no user settings Currently I have 2 wires at home for both these signal. I'm looking for optimization to put both to one router, and over one cable bring these sub-lans to other router, where they would be split to set top box and PC's using Internet. Here it is in picture: ![enter image description here][1] One router has dd-wrt custom firwmare, other has built-in firmware with limited functions. How can I accomplish this? VLANs? Playing with dnsmasq? When I plug it as on the image in desired situation, it basically works, but there're 2 DHCP/DNS servers on network, which causes wrong IP's assigned by random either to PC or to STB, failing them to work. If by miracle they got correct IP's and DHCP settings (gateway, dns), this setup work. So how can I route this so that both sub-lans do not fight, and each STB and PC's get IP settings from correct DHCP server? [1]: http://i.stack.imgur.com/xB0wc.png
networking
router
lan
null
null
02/28/2012 14:11:44
off topic
LAN setup - Internet and IPTV (separate LANs) over one cable === My goal is to combine Internet and IPTV signal from Optical modem, and bring these signals over one cable to different location at home. Problem is: - Optical modem has 2 ports, one for IPTV, one for Internet over PPPOE - IPTV port has its own DHCP/DNS server and gateway, needed for set top box to work, while my Internet needs own DHCP/DNS server in order to work - Optical modem is black box provided by ISP, with no user settings Currently I have 2 wires at home for both these signal. I'm looking for optimization to put both to one router, and over one cable bring these sub-lans to other router, where they would be split to set top box and PC's using Internet. Here it is in picture: ![enter image description here][1] One router has dd-wrt custom firwmare, other has built-in firmware with limited functions. How can I accomplish this? VLANs? Playing with dnsmasq? When I plug it as on the image in desired situation, it basically works, but there're 2 DHCP/DNS servers on network, which causes wrong IP's assigned by random either to PC or to STB, failing them to work. If by miracle they got correct IP's and DHCP settings (gateway, dns), this setup work. So how can I route this so that both sub-lans do not fight, and each STB and PC's get IP settings from correct DHCP server? [1]: http://i.stack.imgur.com/xB0wc.png
2
7,105,897
08/18/2011 10:22:06
660,151
03/15/2011 07:44:09
433
19
Git branch and ls
I'm not sure if this is the right place to ask this, please redirect me if not. I'm new to git and while learning it I stumbled upon this. How does `git branch branchName` and 'ls' work with each other. For eg: If I have a master and test branch and test branch has an extra testFile when compared to master branch. Now, while in the master branch, if I `ls`, I'll wont see the testFile but after switching to the test branch and `ls`, I'll see the testFile kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git branch master * test kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout master M editor/editor_parts/syntax/operator_syntax.js Switched to branch 'master' kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ ls cgi-bin index.php misc underConstruction editor jquery-1.5.2.min.js php.php userManage fileManage jquery-ui-1.8.11.custom.css projectManage userPages images login test.php kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout test M editor/editor_parts/syntax/operator_syntax.js Switched to branch 'test' kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ ls cgi-bin index.php misc test.php editor jquery-1.5.2.min.js php.php underConstruction fileManage jquery-ui-1.8.11.custom.css projectManage userManage images login testFile.txt userPages kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ But `pwd` from both branches shows the same location. So, how does switching branches change the output of `ls` ( which as I understand is a function of linux) ?
linux
git
git-branch
null
null
null
open
Git branch and ls === I'm not sure if this is the right place to ask this, please redirect me if not. I'm new to git and while learning it I stumbled upon this. How does `git branch branchName` and 'ls' work with each other. For eg: If I have a master and test branch and test branch has an extra testFile when compared to master branch. Now, while in the master branch, if I `ls`, I'll wont see the testFile but after switching to the test branch and `ls`, I'll see the testFile kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git branch master * test kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout master M editor/editor_parts/syntax/operator_syntax.js Switched to branch 'master' kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ ls cgi-bin index.php misc underConstruction editor jquery-1.5.2.min.js php.php userManage fileManage jquery-ui-1.8.11.custom.css projectManage userPages images login test.php kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ git checkout test M editor/editor_parts/syntax/operator_syntax.js Switched to branch 'test' kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ ls cgi-bin index.php misc test.php editor jquery-1.5.2.min.js php.php underConstruction fileManage jquery-ui-1.8.11.custom.css projectManage userManage images login testFile.txt userPages kiran@kiran-desktop:/media/kiran/Linux_Server/dev$ But `pwd` from both branches shows the same location. So, how does switching branches change the output of `ls` ( which as I understand is a function of linux) ?
0
5,905,962
05/06/2011 01:37:54
703,856
04/12/2011 10:23:50
1
0
how to use accelerometer to change voice (auto tune)
I am interested in creating an auto tune app and did a bit of research and apparently thats now possible by using accelerometer that apple provides but I have no idea how to do that. can someone help out by giving me a link to a tutorial or give me an example code to change the voice inserted into the function. Thanks in advance.
iphone
objective-c
iphone-sdk-4.0
null
null
05/06/2011 03:52:50
not a real question
how to use accelerometer to change voice (auto tune) === I am interested in creating an auto tune app and did a bit of research and apparently thats now possible by using accelerometer that apple provides but I have no idea how to do that. can someone help out by giving me a link to a tutorial or give me an example code to change the voice inserted into the function. Thanks in advance.
1
10,486,670
05/07/2012 17:49:52
680,111
03/28/2011 11:21:51
62
0
Is there a package for non-local means filtering in R?
As the title says, is there a premade function for non-local filtering?
r
signal-processing
null
null
null
05/07/2012 17:58:52
not constructive
Is there a package for non-local means filtering in R? === As the title says, is there a premade function for non-local filtering?
4
6,462,711
06/24/2011 02:29:30
811,430
06/23/2011 02:07:47
1
0
How can I capture the custom events being triggered by my plugin using this pattern?
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript"> (function($){ /* Object Template */ var MyPlugin = function(element, options) { var el = $(element), self = this; var settings = $.extend({ param: 'defaultValue' }, options || {}); //Public Properties this.pubProp = settings.param; this.init = function(){ el.bind('click',function(){alert('')}) .text(el.attr('id')) .css('color','blue') .trigger('objInit'); } // Public method this.publicMethod = function(){ console.log('public method called from ' + el.attr('id')); }; // Private method var privateMethod = function(){ console.log('private method called!'); }; this.init(); }; /* Object Template */ $.fn.myplugin = function(options) { return this.each(function() { var el = $(this); /* Return if element already has instance*/ if (el.data('myplugin')) return; // pass options to plugin constructor var myplugin = new MyPlugin(this, options); /* plug in work here*/ // Store object in element data el.data('myplugin', myplugin); }); }; })(jQuery); </script> <div id="tw1" class="twitterWidget">ONE</div> <div id="tw2" class="twitterWidget">TWO</div> <div id="tw3" class="twitterWidget">THREE</div> <script type="text/javascript"> $('#tw1, #tw2').myplugin(); $('#tw1').data('myplugin').publicMethod(); //$('#tw1').data('myplugin').bind('objInit', function(){ // console.log('event fired'); //$("#tw1").data("myplugin").bind is not a function //}); $('#tw1').bind('objInit', function(){ console.log('event fired'); //nothing }); </script>
jquery
jquery-plugins
jquery-events
null
null
06/25/2011 10:14:43
not a real question
How can I capture the custom events being triggered by my plugin using this pattern? === <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript"> (function($){ /* Object Template */ var MyPlugin = function(element, options) { var el = $(element), self = this; var settings = $.extend({ param: 'defaultValue' }, options || {}); //Public Properties this.pubProp = settings.param; this.init = function(){ el.bind('click',function(){alert('')}) .text(el.attr('id')) .css('color','blue') .trigger('objInit'); } // Public method this.publicMethod = function(){ console.log('public method called from ' + el.attr('id')); }; // Private method var privateMethod = function(){ console.log('private method called!'); }; this.init(); }; /* Object Template */ $.fn.myplugin = function(options) { return this.each(function() { var el = $(this); /* Return if element already has instance*/ if (el.data('myplugin')) return; // pass options to plugin constructor var myplugin = new MyPlugin(this, options); /* plug in work here*/ // Store object in element data el.data('myplugin', myplugin); }); }; })(jQuery); </script> <div id="tw1" class="twitterWidget">ONE</div> <div id="tw2" class="twitterWidget">TWO</div> <div id="tw3" class="twitterWidget">THREE</div> <script type="text/javascript"> $('#tw1, #tw2').myplugin(); $('#tw1').data('myplugin').publicMethod(); //$('#tw1').data('myplugin').bind('objInit', function(){ // console.log('event fired'); //$("#tw1").data("myplugin").bind is not a function //}); $('#tw1').bind('objInit', function(){ console.log('event fired'); //nothing }); </script>
1
1,540,985
10/08/2009 22:58:28
126,681
06/22/2009 04:25:25
1
0
Querying tables listed in DBA_Tables
A third party product we have at my company uses Oracle as a backend. I'm attempting to log into the Oracle database and look at the schema and data. I've logged in as sys/sysdba, created a user with a default tablespace of that created by the application, and granted the user all necessary permissions to query the structures. I've also set O7_DICTIONARY_ACCESSIBILITY to true to allow querying of the data dictionary objects. After logging in as the user and querying User_Tables nothing is returned. But when I query DBA_Tables the tables I'd expect to find are returned. I'm new to Oracle so I'm not quite certain how a non-system table can be in the tablespace, but not a user_table. More importantly, how do you query the data in these tables? Whenever I attempt a simple "Select *" from the tables I get a "table or view does not exist" error. Thanks in advance.
oracle
null
null
null
null
null
open
Querying tables listed in DBA_Tables === A third party product we have at my company uses Oracle as a backend. I'm attempting to log into the Oracle database and look at the schema and data. I've logged in as sys/sysdba, created a user with a default tablespace of that created by the application, and granted the user all necessary permissions to query the structures. I've also set O7_DICTIONARY_ACCESSIBILITY to true to allow querying of the data dictionary objects. After logging in as the user and querying User_Tables nothing is returned. But when I query DBA_Tables the tables I'd expect to find are returned. I'm new to Oracle so I'm not quite certain how a non-system table can be in the tablespace, but not a user_table. More importantly, how do you query the data in these tables? Whenever I attempt a simple "Select *" from the tables I get a "table or view does not exist" error. Thanks in advance.
0
9,591,766
03/06/2012 20:56:13
2,496
08/22/2008 14:30:33
1,000
32
How do I fix error with MassTransit
I am trying to use MassTransit, I installed it using nuget and am just using their base example: [Quick start guide][1] When I run this code I get an exceptions (with the inner exceptions listed): * "An exception was thrown during service bus creation" * "Failed to create the bus service: SubscriptionRouterService" * "msmq-pgm://235.109.116.115:7784/test_queue_control_subscriptions => An exception was thrown during Send" * "Length cannot be less than zero.\r\nParameter name: length" Is there any help anyone can give me on getting past this error? Notes: MSMQ is installed, and I've used it for WCF based MSMQ services. All the queues look like they are being created in MSMQ before that error line [1]: http://docs.masstransit-project.com/en/latest/configuration/quickstart.html
msmq
masstransit
null
null
null
03/07/2012 21:01:53
not a real question
How do I fix error with MassTransit === I am trying to use MassTransit, I installed it using nuget and am just using their base example: [Quick start guide][1] When I run this code I get an exceptions (with the inner exceptions listed): * "An exception was thrown during service bus creation" * "Failed to create the bus service: SubscriptionRouterService" * "msmq-pgm://235.109.116.115:7784/test_queue_control_subscriptions => An exception was thrown during Send" * "Length cannot be less than zero.\r\nParameter name: length" Is there any help anyone can give me on getting past this error? Notes: MSMQ is installed, and I've used it for WCF based MSMQ services. All the queues look like they are being created in MSMQ before that error line [1]: http://docs.masstransit-project.com/en/latest/configuration/quickstart.html
1
8,860,667
01/14/2012 06:48:39
1,101,208
12/16/2011 04:06:21
109
6
jquery valid email check
I am just a beginner in jquery.I have used email field in my form. The form shouldn't submit if the email field is empty. I used the following code if(document.getElementById('emailaddress').value == ''){ alert('Enter the Email Address'); document.getElementById('emailaddress').focus(); return false; } How can i check the entered email is a valid one using simple jquery?
java
php
jquery
null
null
null
open
jquery valid email check === I am just a beginner in jquery.I have used email field in my form. The form shouldn't submit if the email field is empty. I used the following code if(document.getElementById('emailaddress').value == ''){ alert('Enter the Email Address'); document.getElementById('emailaddress').focus(); return false; } How can i check the entered email is a valid one using simple jquery?
0
3,167,113
07/02/2010 15:35:01
382,155
07/02/2010 14:57:13
1
0
Is there a way to open the content of a page via php, using the cookies stored in the browser?
I have a web-site based on PHP, to which I would like to add a members-only area. Instead of creating my own registration/login pages, I would like to make a piece of code which will look if the user is logged on a particular site (for simplicity, we could assume that this site is Facebook) and if yes, allow him to navigate on my site. If no, tell him to log on on that site and come back after that. I would like to accomplish this by making my site open a page on that site, that has a welcome screen if the user is logged in or requires the username/password otherwise. By analyzing the content of that page, I would be able to see if the user is logged in or not. I have tried to achieve this by using CURL (see the code below), but did not succeeded, as even if the user was logged in on that site via the same browser, when opening my site it was shown as if he wasn't. I suppose that the problem is in the cookies, as I have somewhere read that while making CURL requests the cookies saved in the browser are not available. Is there any way to make a PHP script open a page from another site, using the cookies stored in the browser (the cookies were created previously by that site)? Here is the PHP code from my site: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'www.my-site.com'); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_USERAGENT, 'User agent'); $data = curl_exec($ch); echo($data);
php
cookies
curl
null
null
null
open
Is there a way to open the content of a page via php, using the cookies stored in the browser? === I have a web-site based on PHP, to which I would like to add a members-only area. Instead of creating my own registration/login pages, I would like to make a piece of code which will look if the user is logged on a particular site (for simplicity, we could assume that this site is Facebook) and if yes, allow him to navigate on my site. If no, tell him to log on on that site and come back after that. I would like to accomplish this by making my site open a page on that site, that has a welcome screen if the user is logged in or requires the username/password otherwise. By analyzing the content of that page, I would be able to see if the user is logged in or not. I have tried to achieve this by using CURL (see the code below), but did not succeeded, as even if the user was logged in on that site via the same browser, when opening my site it was shown as if he wasn't. I suppose that the problem is in the cookies, as I have somewhere read that while making CURL requests the cookies saved in the browser are not available. Is there any way to make a PHP script open a page from another site, using the cookies stored in the browser (the cookies were created previously by that site)? Here is the PHP code from my site: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'www.my-site.com'); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_USERAGENT, 'User agent'); $data = curl_exec($ch); echo($data);
0
10,749,121
05/25/2012 05:50:26
174,129
09/16/2009 06:00:16
1,671
86
How to regroup records with different values in one SQL query
Let's say I have the following table : Name - Country - Age -------------------- Toto - Switzerland - 10 Titi - France - 12 Tata - Italy - 21 Tutu - England - 13 Tete - Italy - 14 I want to create a sql query as simple as possible to regroup people living in defined grouped countries like : Group A = Switzerland + Italy Group B = France + England I don't know how to create a group withn my records with a column that could have multiple different values in the same group... Could somebody help me with this ? More information : SQL Server 2008 database.
sql
query
columns
group
null
null
open
How to regroup records with different values in one SQL query === Let's say I have the following table : Name - Country - Age -------------------- Toto - Switzerland - 10 Titi - France - 12 Tata - Italy - 21 Tutu - England - 13 Tete - Italy - 14 I want to create a sql query as simple as possible to regroup people living in defined grouped countries like : Group A = Switzerland + Italy Group B = France + England I don't know how to create a group withn my records with a column that could have multiple different values in the same group... Could somebody help me with this ? More information : SQL Server 2008 database.
0
9,628,497
03/09/2012 03:22:29
577,950
01/17/2011 01:13:36
1
3
Mathematica List and Which Issue
I am going crazy because I can't make Mathematica behave.. I am solving an ODE with NDSolve and it does not work because of one function that does not output what I would expect. My function is of this form: y[x_] := Which[ 0<=x<=10, {{1,2,3},{-9,-8,-7}}, 10<x<20, {{4,5,6},{-6,-5,-4}}, x>=20, {{7,8,9},{-3,-2,-1}} ]; If use the function in a context like this: Ans[x_] := Total[y[x][[1]] {10,20,30}]; As long as I call it with a numerical value it works. Ans[3] = Total[y[3][[1]] {10,20,30}] = Total[{1,2,3} {10,20,30}] = Total[{10,40,90}] = 140 But when my ODE solver calls it with another function, then it behaves very weird. Ans[z[t]] = Total[y[z[t]][[1]] {10,20,30}] = Total[(0<=x<=10) {10,20,30}] = ??? non-sense It seems that the argument y[z[t]][[1]] simply takes the 'Which' first condition. Why?? Thanks for the help!
mathematica
null
null
null
null
03/10/2012 03:23:20
too localized
Mathematica List and Which Issue === I am going crazy because I can't make Mathematica behave.. I am solving an ODE with NDSolve and it does not work because of one function that does not output what I would expect. My function is of this form: y[x_] := Which[ 0<=x<=10, {{1,2,3},{-9,-8,-7}}, 10<x<20, {{4,5,6},{-6,-5,-4}}, x>=20, {{7,8,9},{-3,-2,-1}} ]; If use the function in a context like this: Ans[x_] := Total[y[x][[1]] {10,20,30}]; As long as I call it with a numerical value it works. Ans[3] = Total[y[3][[1]] {10,20,30}] = Total[{1,2,3} {10,20,30}] = Total[{10,40,90}] = 140 But when my ODE solver calls it with another function, then it behaves very weird. Ans[z[t]] = Total[y[z[t]][[1]] {10,20,30}] = Total[(0<=x<=10) {10,20,30}] = ??? non-sense It seems that the argument y[z[t]][[1]] simply takes the 'Which' first condition. Why?? Thanks for the help!
3
7,191,578
08/25/2011 13:52:44
450,689
09/17/2010 14:27:58
28
3
Export Jqgrid data to excel using asp.net
I am using Jqgrid 3.7 every thing works fine and now i want to export the data to excel on click event. I am using Load Once method which makes loading and filtering of huge data in a faster way. Can any one suggest any help to fix this issue. I am using asp.net 4.0 and not MVC.
asp.net
jqgrid-asp.net
null
null
null
null
open
Export Jqgrid data to excel using asp.net === I am using Jqgrid 3.7 every thing works fine and now i want to export the data to excel on click event. I am using Load Once method which makes loading and filtering of huge data in a faster way. Can any one suggest any help to fix this issue. I am using asp.net 4.0 and not MVC.
0
8,019,544
11/05/2011 10:22:16
1,030,965
11/05/2011 10:14:02
1
0
Multiple subdirectory error with mod_rewrite
I am trying to use mod_rewrite manually in joomla, and I have the following Rule: RewriteRule ^test/(t1|t2|t3)-(.*).html$ /index.php?option=com_jumi&fileid=39&$1=$2 [L,NC] So that I want the url http://www.mysite.com/index.php?option=com_jumi&fileid=39&t1=foo be displayed like http://www.mysite.com/test/t1-foo.html The rule works correctly, but when I am in the rewritten page the links like http://www.mysite.com/link.html or http://www.mysite.com/xxx/link.html become http://www.mysite.com/test/link.html or http://www.mysite.com/xxx/test/link.html respectively. any suggestions? thank you
.htaccess
mod-rewrite
joomla
null
null
null
open
Multiple subdirectory error with mod_rewrite === I am trying to use mod_rewrite manually in joomla, and I have the following Rule: RewriteRule ^test/(t1|t2|t3)-(.*).html$ /index.php?option=com_jumi&fileid=39&$1=$2 [L,NC] So that I want the url http://www.mysite.com/index.php?option=com_jumi&fileid=39&t1=foo be displayed like http://www.mysite.com/test/t1-foo.html The rule works correctly, but when I am in the rewritten page the links like http://www.mysite.com/link.html or http://www.mysite.com/xxx/link.html become http://www.mysite.com/test/link.html or http://www.mysite.com/xxx/test/link.html respectively. any suggestions? thank you
0
6,716,197
07/16/2011 08:08:42
669,969
03/21/2011 18:43:18
1
0
Stylize <select> with css
How do I achieve the style like the image below? http://imageshack.us/photo/my-images/268/selectstyle.gif/
css
select
coding-style
null
null
07/17/2011 03:55:14
not a real question
Stylize <select> with css === How do I achieve the style like the image below? http://imageshack.us/photo/my-images/268/selectstyle.gif/
1
1,868,571
12/08/2009 17:34:41
226,962
12/08/2009 08:05:36
1
0
What is RVA and VA?
Plz explain about those things... :)
reverse
software-engineering
null
null
null
07/20/2012 01:52:19
not a real question
What is RVA and VA? === Plz explain about those things... :)
1
4,304,381
11/29/2010 13:51:44
173,718
09/15/2009 12:56:22
446
15
archiving the table : searching for the best way
there is a table which has 80.000 rows. Everyday I will clone this table to another log table giving a name like 20101129_TABLE , and every day the prefix will be changed according to date.. As you calculate, the data will be 2400 000 rows every month.. Advices please for saving space, and getting fast service and other advantages and disadvantages!! how should i think to create the best archive or log.. it is a table has the accounts info. branch code balance etc
sql
sql-server-2008
logging
null
null
null
open
archiving the table : searching for the best way === there is a table which has 80.000 rows. Everyday I will clone this table to another log table giving a name like 20101129_TABLE , and every day the prefix will be changed according to date.. As you calculate, the data will be 2400 000 rows every month.. Advices please for saving space, and getting fast service and other advantages and disadvantages!! how should i think to create the best archive or log.. it is a table has the accounts info. branch code balance etc
0
4,044,737
10/28/2010 16:00:10
465,100
10/03/2010 10:21:52
6
0
Photo of «Introduction to automata...» by Hopcroft and Ullman '79 cover?
Where can I get the photo of “Introduction to automata theory, languages and computation” by Hopcroft and Ullman **'79** (first edition) cover in order to be able to read all the phrases placed on the cover? Obviously the ones that gave me Google.Images (from Wikipedia, Amazon and others) do not allow this.
automata
null
null
null
null
10/28/2010 16:04:13
off topic
Photo of «Introduction to automata...» by Hopcroft and Ullman '79 cover? === Where can I get the photo of “Introduction to automata theory, languages and computation” by Hopcroft and Ullman **'79** (first edition) cover in order to be able to read all the phrases placed on the cover? Obviously the ones that gave me Google.Images (from Wikipedia, Amazon and others) do not allow this.
2
2,524,986
03/26/2010 16:38:19
292,788
03/13/2010 03:23:39
91
10
Delete / Remove node from XPathNodeIterator, given an XPath
First of all, if someone has a different, perhaps shorter (or better), solution to the problem, it's welcome as well. I'm trying to "simply" remove (almost) duplicate elements in XSLT. There's some (metadata) nodes i don't want to include when comparing, and i couldn't figure out how do do that in XSLT so thought i'd extend with with a function removing these nodes. Like so: <xsl:for-each select="abx:removeNodes(d/df600|d/df610|d/df611|d/df630|d/df650|d/df651|d/df655, '*[@key=&quot;i1&quot; or @key=&quot;i2&quot; or key=&quot;db&quot;]')"> <xsl:if test="not(node()=preceding-sibling::*)"> blah </xsl:if> </xsl:for-each> And the extension, which doesn't work so well... (C#) public XPathNodeIterator removeNodes(XPathNodeIterator p_NodeIterator, String removeXPath) { Logger Logger = new Logger("xslt"); Logger.Log("removeNodes(removeXPath={0}):", removeXPath); foreach (XPathNavigator CurrentNode in p_NodeIterator) { Logger.Log("removeNodes(): CurrentNode.OuterXml={0}.", CurrentNode.OuterXml); foreach (XPathNavigator CurrentSubNode in CurrentNode.Select(removeXPath)) { Logger.Log("removeNodes(): CurrentSubNode.OuterXml={0}.", CurrentSubNode.OuterXml); // How do i delete this node!? //CurrentSubNode.DeleteSelf(); } } return p_NodeIterator; } My initial approach using 'CurrentSubNode.DeleteSelf();' doesn't work because it gets confused and loses its position in the XPathNavigator, causing it to only delete the first item it finds using "removeXPath". Something like a DeleteAndMoveNext() would be nice but there seems to be no such method...
xslt
xml
c#
null
null
null
open
Delete / Remove node from XPathNodeIterator, given an XPath === First of all, if someone has a different, perhaps shorter (or better), solution to the problem, it's welcome as well. I'm trying to "simply" remove (almost) duplicate elements in XSLT. There's some (metadata) nodes i don't want to include when comparing, and i couldn't figure out how do do that in XSLT so thought i'd extend with with a function removing these nodes. Like so: <xsl:for-each select="abx:removeNodes(d/df600|d/df610|d/df611|d/df630|d/df650|d/df651|d/df655, '*[@key=&quot;i1&quot; or @key=&quot;i2&quot; or key=&quot;db&quot;]')"> <xsl:if test="not(node()=preceding-sibling::*)"> blah </xsl:if> </xsl:for-each> And the extension, which doesn't work so well... (C#) public XPathNodeIterator removeNodes(XPathNodeIterator p_NodeIterator, String removeXPath) { Logger Logger = new Logger("xslt"); Logger.Log("removeNodes(removeXPath={0}):", removeXPath); foreach (XPathNavigator CurrentNode in p_NodeIterator) { Logger.Log("removeNodes(): CurrentNode.OuterXml={0}.", CurrentNode.OuterXml); foreach (XPathNavigator CurrentSubNode in CurrentNode.Select(removeXPath)) { Logger.Log("removeNodes(): CurrentSubNode.OuterXml={0}.", CurrentSubNode.OuterXml); // How do i delete this node!? //CurrentSubNode.DeleteSelf(); } } return p_NodeIterator; } My initial approach using 'CurrentSubNode.DeleteSelf();' doesn't work because it gets confused and loses its position in the XPathNavigator, causing it to only delete the first item it finds using "removeXPath". Something like a DeleteAndMoveNext() would be nice but there seems to be no such method...
0
3,390,789
08/02/2010 18:45:17
366,252
06/14/2010 10:59:50
198
1
In php what is more efficient n-1 < x OR n <= x
What is more efficient if ($n-1 < $x) or if ($n <= $x) Anyone know?
php
null
null
null
null
null
open
In php what is more efficient n-1 < x OR n <= x === What is more efficient if ($n-1 < $x) or if ($n <= $x) Anyone know?
0
5,892,084
05/05/2011 02:45:52
296,559
03/18/2010 13:49:00
71
4
How to remove evolution from debian but keep gnome
Well it's in the title I did try this: aptitude unmarkauto gnome-desktop-environment gdm-themes gnome-themes-extras gnome-games libpam-gnome-keyring gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg rhythmbox synaptic system-config-printer totem-mozilla epiphany-extensions serpentine gnome-app-install arj avahi-daemon deluge+ gnome_
remove
debian
gnome
evolution
debian-based
05/05/2011 05:53:50
off topic
How to remove evolution from debian but keep gnome === Well it's in the title I did try this: aptitude unmarkauto gnome-desktop-environment gdm-themes gnome-themes-extras gnome-games libpam-gnome-keyring gstreamer0.10-plugins-ugly gstreamer0.10-ffmpeg rhythmbox synaptic system-config-printer totem-mozilla epiphany-extensions serpentine gnome-app-install arj avahi-daemon deluge+ gnome_
2
9,530,174
03/02/2012 08:28:55
1,244,619
03/02/2012 08:21:32
1
0
Indent in dreamweaver cs4 like Notepad++ (code indentation preview)
How do i get to see the code indentation preview in Dreamweaver cs4, like the one shown in notepad++? For example i should know where tags are started and closed, so it will be easy to figure it out, and by a click - and + line in notepad++ Thanks.
dreamweaver
indentation
null
null
null
null
open
Indent in dreamweaver cs4 like Notepad++ (code indentation preview) === How do i get to see the code indentation preview in Dreamweaver cs4, like the one shown in notepad++? For example i should know where tags are started and closed, so it will be easy to figure it out, and by a click - and + line in notepad++ Thanks.
0
5,791,483
04/26/2011 14:01:00
465,558
10/04/2010 05:58:18
620
16
How to Parse DataContract object to xml ?
I define some class as 'DataContract' I need to save this object in my database ( as xml ) before i sending it to the client. When the .net framework send this object to the client - the object parse to xml - so i want to hold this xml and add it to my Database How can i do it ? How can i get this xml without / before the sending to the client ?
wcf
null
null
null
null
null
open
How to Parse DataContract object to xml ? === I define some class as 'DataContract' I need to save this object in my database ( as xml ) before i sending it to the client. When the .net framework send this object to the client - the object parse to xml - so i want to hold this xml and add it to my Database How can i do it ? How can i get this xml without / before the sending to the client ?
0
5,814,286
04/28/2011 06:01:24
675,640
03/24/2011 20:20:14
88
0
Updating a list<Class>
I am trying to update a list<class>, but I have no idea how to pass the values back to the <class>. IE I do not know how to call the list at location 2 changed the class values 1,2,3,4,5 to 6,7,8,9,0 the class is a form and the method I want to use will essentially be: public FormStudent(int a, string b, int c, double d, char f) { textBoxID.Text = a.ToString(); textBoxName.Text = b; textBoxCredits.Text = c.ToString(); textBoxTuition.Text = d.ToString(); if (f == 'R') { radioButtonResident.Checked = true; } else { radioButtonNonResident.Checked = true; } } My list is: private List<Student> studentList = new List<Student>(); oh! and to make it even more difficult I am getting the list value from a listView via private void buttonUpdate_Click(object sender, EventArgs e) { Student stu = new Student(); ListView.SelectedListViewItemCollection selectedItems = listView1.SelectedItems; int count = selectedItems.Count; for (int i = 0; i < count; i++) { *** I NEED THE UPDATE HERE TO CALL \/ *** FormStudent stuInfoForm = new FormStudent(stu.Id, stu.Name, stu.Credits, stu.Tuition, stu.Residency ); studentList.RemoveAt(i); stuInfoForm.Owner = this; stuInfoForm.ShowDialog(); } refreshList(); }
c#
visual-studio
class
list
listview
null
open
Updating a list<Class> === I am trying to update a list<class>, but I have no idea how to pass the values back to the <class>. IE I do not know how to call the list at location 2 changed the class values 1,2,3,4,5 to 6,7,8,9,0 the class is a form and the method I want to use will essentially be: public FormStudent(int a, string b, int c, double d, char f) { textBoxID.Text = a.ToString(); textBoxName.Text = b; textBoxCredits.Text = c.ToString(); textBoxTuition.Text = d.ToString(); if (f == 'R') { radioButtonResident.Checked = true; } else { radioButtonNonResident.Checked = true; } } My list is: private List<Student> studentList = new List<Student>(); oh! and to make it even more difficult I am getting the list value from a listView via private void buttonUpdate_Click(object sender, EventArgs e) { Student stu = new Student(); ListView.SelectedListViewItemCollection selectedItems = listView1.SelectedItems; int count = selectedItems.Count; for (int i = 0; i < count; i++) { *** I NEED THE UPDATE HERE TO CALL \/ *** FormStudent stuInfoForm = new FormStudent(stu.Id, stu.Name, stu.Credits, stu.Tuition, stu.Residency ); studentList.RemoveAt(i); stuInfoForm.Owner = this; stuInfoForm.ShowDialog(); } refreshList(); }
0
11,132,932
06/21/2012 06:48:10
537,819
12/10/2010 12:08:37
79
1
Appending image in string in ios
I want to draw string in ios like String [image] String [image] String [image] String [image] is there anyway to do the same.Please help.
iphone
objective-c
ios
ios5
null
06/21/2012 08:20:48
not a real question
Appending image in string in ios === I want to draw string in ios like String [image] String [image] String [image] String [image] is there anyway to do the same.Please help.
1
6,639,118
07/10/2011 04:14:35
837,305
07/10/2011 04:14:35
1
0
Issues with @font-face
I'm having trouble using @font-face with fonts located on my machine. My files aren't on a server yet. I'm trying to preview them offline, but they aren't loading. Here is the code from the css file: @font-face{ font-family:"chunk"; src: url('file:///C:/...Fonts/Chunkfive.otf');} div{ font-family:"chunk";} Has anyone had similar problems?
css
css3
null
null
null
null
open
Issues with @font-face === I'm having trouble using @font-face with fonts located on my machine. My files aren't on a server yet. I'm trying to preview them offline, but they aren't loading. Here is the code from the css file: @font-face{ font-family:"chunk"; src: url('file:///C:/...Fonts/Chunkfive.otf');} div{ font-family:"chunk";} Has anyone had similar problems?
0
6,921,047
08/03/2011 02:35:08
331,896
05/03/2010 23:46:11
305
3
Configure ColdFusion site on Windows Server 2008 R2
I have been asked to migrate a ColdFusion site that is running on Windows Server 2003 to a new server, which is running Windows Server 2008 R2, 64bit. I am a .Net developer and know my way around Windows and IIS fairly well. Though, I have never done anything with ColdFusion. I ran this command: <cfdump var="#SERVER#" /> and received the output below. The 2008R2 server is vanilla. Can someone help me by generally telling me what I need to do to get the site running? Thanks for any advise given. APPSERVER JRun4 EXPIRATION {ts '2011-07-01 09:07:52'} INSTALLKIT Native Windows PRODUCTLEVEL Standard PRODUCTNAME ColdFusion Server PRODUCTVERSION 7,0,2,142559 ROOTDIR D:\CFusionMX7 ADDITIONALINFORMATION [empty string] ARCH x86 BUILDNUMBER [empty string] NAME Windows 2003 VERSION 5.2
windows
coldfusion
null
null
null
08/05/2011 14:08:06
off topic
Configure ColdFusion site on Windows Server 2008 R2 === I have been asked to migrate a ColdFusion site that is running on Windows Server 2003 to a new server, which is running Windows Server 2008 R2, 64bit. I am a .Net developer and know my way around Windows and IIS fairly well. Though, I have never done anything with ColdFusion. I ran this command: <cfdump var="#SERVER#" /> and received the output below. The 2008R2 server is vanilla. Can someone help me by generally telling me what I need to do to get the site running? Thanks for any advise given. APPSERVER JRun4 EXPIRATION {ts '2011-07-01 09:07:52'} INSTALLKIT Native Windows PRODUCTLEVEL Standard PRODUCTNAME ColdFusion Server PRODUCTVERSION 7,0,2,142559 ROOTDIR D:\CFusionMX7 ADDITIONALINFORMATION [empty string] ARCH x86 BUILDNUMBER [empty string] NAME Windows 2003 VERSION 5.2
2
3,546,375
08/23/2010 09:46:10
422,562
08/17/2010 07:40:49
6
0
I need a Matlab Code for 16QAM and 64QAM with 3x3 and 4x4 for Likelihood
Heia... I Need a Matlab code for 16QAM and 64QAM with 3x3 and 4x4 For Likelihood thanks alot
matlab
signal-processing
null
null
null
08/25/2010 11:59:54
not a real question
I need a Matlab Code for 16QAM and 64QAM with 3x3 and 4x4 for Likelihood === Heia... I Need a Matlab code for 16QAM and 64QAM with 3x3 and 4x4 For Likelihood thanks alot
1
423,921
01/08/2009 11:14:18
15,233
09/17/2008 07:28:10
23
4
XmlDocument and slow schema processing
I have an xml template document that I need to load into an XmlDocument. eg myXMLDocument.Load(myXMLFile); However this is very slow as it loads in the dtd. I have tried both `"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"` and a local copy of the dtd. Both take more or less the same time. If I turn of loading the dtd by setting the resolver to null (for example), I then get errors such as `"Reference to undeclared entity 'nbsp'"` if the document contains these. I need to use an XmlDocument as I need to manipulate the DOM before outputting the document. How can I get round these problems?
c#
.net
xml
xmldocument
dtd
null
open
XmlDocument and slow schema processing === I have an xml template document that I need to load into an XmlDocument. eg myXMLDocument.Load(myXMLFile); However this is very slow as it loads in the dtd. I have tried both `"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"` and a local copy of the dtd. Both take more or less the same time. If I turn of loading the dtd by setting the resolver to null (for example), I then get errors such as `"Reference to undeclared entity 'nbsp'"` if the document contains these. I need to use an XmlDocument as I need to manipulate the DOM before outputting the document. How can I get round these problems?
0
11,106,313
06/19/2012 17:36:50
1,361,972
04/27/2012 20:41:42
1
1
Sort in Forward_lists using BigO notation?
Basically, anyone knows, what should be the Big-O notation (needed for the assignment), for the sort function, of the new C++11 forward_list class? <br /> Just a small, working example of it, reading from a file: std::forward_list<string> words3; ifstream songs; songs.open ("songs.txt"); string line; while (songs){ getline (songs, line); words3.push_front(line); } words3.sort(); Thanks in advance.
algorithm
homework
c++11
big-o
analysis
null
open
Sort in Forward_lists using BigO notation? === Basically, anyone knows, what should be the Big-O notation (needed for the assignment), for the sort function, of the new C++11 forward_list class? <br /> Just a small, working example of it, reading from a file: std::forward_list<string> words3; ifstream songs; songs.open ("songs.txt"); string line; while (songs){ getline (songs, line); words3.push_front(line); } words3.sort(); Thanks in advance.
0
9,793,674
03/20/2012 19:36:36
479,805
10/18/2010 21:18:34
767
17
full info for GPG/PGP keys
I have a GPG key for which I want all the different algorithms and sizes involved. i.e i want to know 1) the public key algo and key size, 2 the cipher algo and 3) the digest algorithm. is there a command to gpg to list all this info.
encryption
gpg
pgp
null
null
04/03/2012 11:11:15
off topic
full info for GPG/PGP keys === I have a GPG key for which I want all the different algorithms and sizes involved. i.e i want to know 1) the public key algo and key size, 2 the cipher algo and 3) the digest algorithm. is there a command to gpg to list all this info.
2
740,180
04/11/2009 14:28:14
7,391
09/15/2008 13:39:40
1
5
Usage of ORMs like NHibernate when there are many associations - performance concerns
I have created an application (a web-based application) which now has a large number of associations. Simply put, an Account: - has many Users - has Settings - has many Projects Similarly a Project: - has many Items A User: - has many Tasks And so on, with loads more associations. Nothing particularly unusual about that I hope. I chose to use NHibernate to give me a nice set of persistent classes with mappers defining all of the associations. But is this approach right? On every request to the application the Account is loaded (because it is needed) and this then requests a large amount of data from the DB that is not required. Lazy loading is an option, but I don't know if my initial approach couldn't be better. All I want at that stage is the Account and associated Settings so should the mapping reflect this? Trouble is I want things like all the Projects for an Account at other points so I need the mappers to reflect all of the associations. My concern is that lazy-loading may just be compensating for a bad initial architecture on my part. I am well aware that this may just be a result of my as-yet poor knowledge of the inner workings of NHibernate. As a result I'd be grateful for any suggestions on good practice.
nhibernate
orm
web-applications
performance
null
null
open
Usage of ORMs like NHibernate when there are many associations - performance concerns === I have created an application (a web-based application) which now has a large number of associations. Simply put, an Account: - has many Users - has Settings - has many Projects Similarly a Project: - has many Items A User: - has many Tasks And so on, with loads more associations. Nothing particularly unusual about that I hope. I chose to use NHibernate to give me a nice set of persistent classes with mappers defining all of the associations. But is this approach right? On every request to the application the Account is loaded (because it is needed) and this then requests a large amount of data from the DB that is not required. Lazy loading is an option, but I don't know if my initial approach couldn't be better. All I want at that stage is the Account and associated Settings so should the mapping reflect this? Trouble is I want things like all the Projects for an Account at other points so I need the mappers to reflect all of the associations. My concern is that lazy-loading may just be compensating for a bad initial architecture on my part. I am well aware that this may just be a result of my as-yet poor knowledge of the inner workings of NHibernate. As a result I'd be grateful for any suggestions on good practice.
0
11,488,242
07/14/2012 23:41:36
1,526,234
07/14/2012 23:16:01
1
0
Routing issue with shopping cart
I am creating a shopping cart via Rails 3.0.10 & having an ongoing issues with it, so do hope someone here can help me getting it resolved please. After getting NoMethodError in Carts#show fixed-shopping cart working perfectly again, pushing & pulling via GitHub, Routing Error-No route matches is coming up! Does anyone know, what the problem is? Thanks in advance for your help;-)
ruby-on-rails
ruby-on-rails-3
null
null
null
07/16/2012 02:00:30
not a real question
Routing issue with shopping cart === I am creating a shopping cart via Rails 3.0.10 & having an ongoing issues with it, so do hope someone here can help me getting it resolved please. After getting NoMethodError in Carts#show fixed-shopping cart working perfectly again, pushing & pulling via GitHub, Routing Error-No route matches is coming up! Does anyone know, what the problem is? Thanks in advance for your help;-)
1
3,959,447
10/18/2010 13:07:36
1,392,690
01/26/2010 22:58:37
188
3
Refactoring sql into regexp - Microsoft Access
I'm not a pro with regexp and especially in this specific context. Any idea how to use a function to do a RegExp Replace and then calling it from the query in Microsoft Access? By the way, this query oddly enough doesn't work fully and maybe it's why this could use regexp. The idea is to match the three fields in the temp_table query: last_name || first_name || middle_initial Blair || Sheron || S Brown || Wanda || R Rodriguez || Lillian || M Glaubman || Alan || with what is in either names_1 or names_2 field in print_ready: BLAIR,SHERON S BROWN,BRENON I H/E BROWN,WANDA R RODRIGUEZ,LILLIAN M GLAUBMAN,ALAN & SHORSTEIN,LILLIAN For some strange reason, my query fails to return the four names above, even though they are obviously in the temp_table, as shown above. The trick though is that names_1 and names_2 will have more names than what I need (as shown in the second item in the list above) so I must use Like. And if there's a value in middle_initial column, then I need to check print_ready for that middle initial as well, otherwise I don't check for middle_initial. This ensures if there's a middle initial, it doesnt't return records with first and last name similarities, but only returns the record with the initial as well. Here's the query: SELECT print_ready.id, print_ready.names_1, print_ready.names_2, print_ready.addresses, print_ready.cities, print_ready.us_states_and_canada, print_ready.zip_codes FROM print_ready, temp_query WHERE ( ( REPLACE(REPLACE(REPLACE(print_ready.names_1,'LIV',''),'REV',''),'TR','') ) and ( print_ready.us_states_and_canada = "FL" or print_ready.us_states_and_canada = "NY" ) and IIF ((temp_query.middle_initial IS NOT NULL), ( ( print_ready.names_1 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_1 Like "* " & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_1 Like "* " & temp_query.first_name & " " & temp_query.middle_initial ) and ( print_ready.names_1 Like temp_query.last_name & ",*" or print_ready.names_1 Like temp_query.last_name & " *" or print_ready.names_1 Like "* " & temp_query.last_name & " *" ) OR ( print_ready.names_2 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_2 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_2 Like "* " & temp_query.first_name & " " & temp_query.middle_initial ) and ( print_ready.names_2 Like temp_query.last_name & ",*" or print_ready.names_2 Like temp_query.last_name & " *" or print_ready.names_2 Like "* " & temp_query.last_name & " *" ) ), ( ( print_ready.names_1 Like "*," & temp_query.first_name & " *" or print_ready.names_1 Like "*," & temp_query.first_name or print_ready.names_1 Like "* " & temp_query.first_name & " *" ) and ( print_ready.names_1 Like temp_query.last_name & ",*" or print_ready.names_1 Like temp_query.last_name & " *" or print_ready.names_1 Like "* " & temp_query.last_name & " *" ) OR ( print_ready.names_2 Like "*," & temp_query.first_name & " *" or print_ready.names_2 Like "*," & temp_query.first_name or print_ready.names_2 Like "* " & temp_query.first_name & " *" ) and ( print_ready.names_2 Like temp_query.last_name & ",*" or print_ready.names_2 Like temp_query.last_name & " *" or print_ready.names_2 Like "* " & temp_query.last_name & " *" ) ) ) );
regex
query
ms-access
null
null
null
open
Refactoring sql into regexp - Microsoft Access === I'm not a pro with regexp and especially in this specific context. Any idea how to use a function to do a RegExp Replace and then calling it from the query in Microsoft Access? By the way, this query oddly enough doesn't work fully and maybe it's why this could use regexp. The idea is to match the three fields in the temp_table query: last_name || first_name || middle_initial Blair || Sheron || S Brown || Wanda || R Rodriguez || Lillian || M Glaubman || Alan || with what is in either names_1 or names_2 field in print_ready: BLAIR,SHERON S BROWN,BRENON I H/E BROWN,WANDA R RODRIGUEZ,LILLIAN M GLAUBMAN,ALAN & SHORSTEIN,LILLIAN For some strange reason, my query fails to return the four names above, even though they are obviously in the temp_table, as shown above. The trick though is that names_1 and names_2 will have more names than what I need (as shown in the second item in the list above) so I must use Like. And if there's a value in middle_initial column, then I need to check print_ready for that middle initial as well, otherwise I don't check for middle_initial. This ensures if there's a middle initial, it doesnt't return records with first and last name similarities, but only returns the record with the initial as well. Here's the query: SELECT print_ready.id, print_ready.names_1, print_ready.names_2, print_ready.addresses, print_ready.cities, print_ready.us_states_and_canada, print_ready.zip_codes FROM print_ready, temp_query WHERE ( ( REPLACE(REPLACE(REPLACE(print_ready.names_1,'LIV',''),'REV',''),'TR','') ) and ( print_ready.us_states_and_canada = "FL" or print_ready.us_states_and_canada = "NY" ) and IIF ((temp_query.middle_initial IS NOT NULL), ( ( print_ready.names_1 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_1 Like "* " & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_1 Like "* " & temp_query.first_name & " " & temp_query.middle_initial ) and ( print_ready.names_1 Like temp_query.last_name & ",*" or print_ready.names_1 Like temp_query.last_name & " *" or print_ready.names_1 Like "* " & temp_query.last_name & " *" ) OR ( print_ready.names_2 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_2 Like "*," & temp_query.first_name & " " & temp_query.middle_initial & " *" or print_ready.names_2 Like "* " & temp_query.first_name & " " & temp_query.middle_initial ) and ( print_ready.names_2 Like temp_query.last_name & ",*" or print_ready.names_2 Like temp_query.last_name & " *" or print_ready.names_2 Like "* " & temp_query.last_name & " *" ) ), ( ( print_ready.names_1 Like "*," & temp_query.first_name & " *" or print_ready.names_1 Like "*," & temp_query.first_name or print_ready.names_1 Like "* " & temp_query.first_name & " *" ) and ( print_ready.names_1 Like temp_query.last_name & ",*" or print_ready.names_1 Like temp_query.last_name & " *" or print_ready.names_1 Like "* " & temp_query.last_name & " *" ) OR ( print_ready.names_2 Like "*," & temp_query.first_name & " *" or print_ready.names_2 Like "*," & temp_query.first_name or print_ready.names_2 Like "* " & temp_query.first_name & " *" ) and ( print_ready.names_2 Like temp_query.last_name & ",*" or print_ready.names_2 Like temp_query.last_name & " *" or print_ready.names_2 Like "* " & temp_query.last_name & " *" ) ) ) );
0
5,632,350
04/12/2011 08:25:15
510,036
11/16/2010 20:49:51
262
22
AS3: Detecting when an object gets added to a movieclip
Alright, so I'm trying to figure out when a child is added to a movieclip "x", and handling/detouring this operation from withing this "x" movieclip. I tried overriding addChild and addChildAt at with no prevail. The movieclips that are placed on the stage via flash still don't trigger addChild or addChildAt. However, tracing `this.numChildren` shows '2' correctly. Any hints?
actionscript-3
events
override
detect
addchild
null
open
AS3: Detecting when an object gets added to a movieclip === Alright, so I'm trying to figure out when a child is added to a movieclip "x", and handling/detouring this operation from withing this "x" movieclip. I tried overriding addChild and addChildAt at with no prevail. The movieclips that are placed on the stage via flash still don't trigger addChild or addChildAt. However, tracing `this.numChildren` shows '2' correctly. Any hints?
0
9,645,807
03/10/2012 10:48:49
889,312
08/11/2011 06:02:51
339
7
Youtube Web Integrator on Websites
I recently used **Picasa Webalbum Integrator(PWI)** on my website to fetch images from my picasa account and successfully done it. However i like to know is there **similar approach(API'/toolkit**) available to fetch **Youtube videos** on website. By fetching i don't mean **embedding videos on the page**. I like to use the approach like pwi. And i also don't want to fetch **videos from my picasa account**. Just plain and simple **Youtube Channel**. Thanks
javascript
website
youtube
youtube-javascript-api
null
null
open
Youtube Web Integrator on Websites === I recently used **Picasa Webalbum Integrator(PWI)** on my website to fetch images from my picasa account and successfully done it. However i like to know is there **similar approach(API'/toolkit**) available to fetch **Youtube videos** on website. By fetching i don't mean **embedding videos on the page**. I like to use the approach like pwi. And i also don't want to fetch **videos from my picasa account**. Just plain and simple **Youtube Channel**. Thanks
0
9,228,637
02/10/2012 13:38:57
635,620
02/26/2011 15:18:21
3
0
Issue in adding dynamic cell in table view?
Please have a look on my code which i am using to add dynamic cells in my table view add run time. At did select of my table view i have called this method. - (void) allServersFound { // called from delegate when bonjourservices has listings of machines: NSArray *newPosts = [[NSArray alloc]initWithObjects:@"A", nil]; // NSArray of machine names; NSMutableArray *tempArray = [[NSMutableArray alloc] initWithObjects: @"A",@"B",@"C",@"D", nil]; int i = 0; for (NSArray *count in newPosts) { [tempArray addObject:[NSIndexPath indexPathForRow:i++ inSection:0]]; } [[self tblHome] beginUpdates]; [[self tblHome] insertRowsAtIndexPaths:tempArray withRowAnimation:UITableViewRowAnimationNone]; [[self tblHome] endUpdates]; [tempArray release]; } But this give me following Exception at run time: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSIndexPath _fastCStringContents:]: unrecognized selector sent to instance 0x4e0e130 May you please tell me what it means... and it will be solved. Thanks in advance.
iphone
objective-c
ios
ipad
null
null
open
Issue in adding dynamic cell in table view? === Please have a look on my code which i am using to add dynamic cells in my table view add run time. At did select of my table view i have called this method. - (void) allServersFound { // called from delegate when bonjourservices has listings of machines: NSArray *newPosts = [[NSArray alloc]initWithObjects:@"A", nil]; // NSArray of machine names; NSMutableArray *tempArray = [[NSMutableArray alloc] initWithObjects: @"A",@"B",@"C",@"D", nil]; int i = 0; for (NSArray *count in newPosts) { [tempArray addObject:[NSIndexPath indexPathForRow:i++ inSection:0]]; } [[self tblHome] beginUpdates]; [[self tblHome] insertRowsAtIndexPaths:tempArray withRowAnimation:UITableViewRowAnimationNone]; [[self tblHome] endUpdates]; [tempArray release]; } But this give me following Exception at run time: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSIndexPath _fastCStringContents:]: unrecognized selector sent to instance 0x4e0e130 May you please tell me what it means... and it will be solved. Thanks in advance.
0
9,532,297
03/02/2012 11:08:14
1,244,901
03/02/2012 10:58:31
1
0
corner cut menu bar in using html and css?
I want to design a menu bar with several links using <ul>s and <li>s. In this menu bar, I want "home" and "contact us" on the left and right side corner cut. I would rather not do this in HTML and CSS.
html
css
null
null
null
03/02/2012 11:36:40
not a real question
corner cut menu bar in using html and css? === I want to design a menu bar with several links using <ul>s and <li>s. In this menu bar, I want "home" and "contact us" on the left and right side corner cut. I would rather not do this in HTML and CSS.
1
2,474,294
03/19/2010 00:32:18
99,033
04/30/2009 23:05:56
201
8
Oracle database links between 10g and 11g
Does anyone have experience with database links between 10g and 11g? Is this a supported setup/operation? Is it possible? Are there any problems? Caveats?
oracle
database
oracle10g
oracle11g
null
null
open
Oracle database links between 10g and 11g === Does anyone have experience with database links between 10g and 11g? Is this a supported setup/operation? Is it possible? Are there any problems? Caveats?
0
9,864,602
03/25/2012 22:18:26
1,015,647
10/27/2011 00:53:18
149
18
input text name array
I have a form that uses jquery to generate rows of input fields these text inputs need to be tied into and array 1,2,3... with the sub array designating the value for a,b,c,d.. <td><input type="text" name="1[a]"/></td> <td><input type="text" name="1[b]"/></td> <td><input type="text" name="1[c]"/></td> <td><input type="text" name="1[d]"/></td> <td><input type="text" name="1[e]"/></td> <td><input type="text" name="1[f]"/></td> This is what i am getting print_r($_POST); > Array ( [1] => S [1a] => 6 [1b] => 5 [1c] => 4 [1d] => 3 [1e] => 2 [2] => M [2a] => 6 [2b] => 5 [2c] => 4 [2d] => 3 [2e] => 2 ) I Want: 1 as the array and a,b,c,d... as the sub array with value 1[a]=value 1[b]=value Thank you for your help!
php
html
arrays
forms
input
03/26/2012 18:26:32
too localized
input text name array === I have a form that uses jquery to generate rows of input fields these text inputs need to be tied into and array 1,2,3... with the sub array designating the value for a,b,c,d.. <td><input type="text" name="1[a]"/></td> <td><input type="text" name="1[b]"/></td> <td><input type="text" name="1[c]"/></td> <td><input type="text" name="1[d]"/></td> <td><input type="text" name="1[e]"/></td> <td><input type="text" name="1[f]"/></td> This is what i am getting print_r($_POST); > Array ( [1] => S [1a] => 6 [1b] => 5 [1c] => 4 [1d] => 3 [1e] => 2 [2] => M [2a] => 6 [2b] => 5 [2c] => 4 [2d] => 3 [2e] => 2 ) I Want: 1 as the array and a,b,c,d... as the sub array with value 1[a]=value 1[b]=value Thank you for your help!
3
4,502,465
12/21/2010 18:11:09
548,701
12/19/2010 10:07:19
40
0
JSF myBean.myGetter called before form submission
I have the following page: <h:form id="gameSelectionForm"> <h:selectOneMenu id="gameSelection"> <f:selectItems value="#{gameBean.gameIds}" /> </h:selectOneMenu> <h:commandButton id="gameSelector" value="Play" action="#{gameBean.changeGame}" /> </h:form> <h:panelGroup id="gameDiv"> <f:verbatim> <iframe src="/levelup/resources/games/#{gameBean.gameId}/#{gameBean.htmlPage}" width="700px" height="800px" frameborder="0"/> </f:verbatim> </h:panelGroup> When I click on the "gameSelector" button, here is the sequence of events: 1. gameBean.getGameId and gameBean.getHtmlPage are called 2. gameBean.changeGame is called 3. The page is refreshed. My issues lies in the order of 1. and 2. The changeGame modifies a gameBean variable that is used by the getGameId and getHtmlPage. I thus want to it execute first, so that when other panels are refreshed, they contain the proper data. Please note that this issue seems to occur only for the call within the gameDiv element (other variables are properly refreshed). Would you have any idea as to what I could do to revert the order of 1. and 2., so that the changeGame() method is the first one called? I am using JavaServer Faces 2.0 on Tomcat 7.0. Thanks in advance
jsf
page-refresh
null
null
null
null
open
JSF myBean.myGetter called before form submission === I have the following page: <h:form id="gameSelectionForm"> <h:selectOneMenu id="gameSelection"> <f:selectItems value="#{gameBean.gameIds}" /> </h:selectOneMenu> <h:commandButton id="gameSelector" value="Play" action="#{gameBean.changeGame}" /> </h:form> <h:panelGroup id="gameDiv"> <f:verbatim> <iframe src="/levelup/resources/games/#{gameBean.gameId}/#{gameBean.htmlPage}" width="700px" height="800px" frameborder="0"/> </f:verbatim> </h:panelGroup> When I click on the "gameSelector" button, here is the sequence of events: 1. gameBean.getGameId and gameBean.getHtmlPage are called 2. gameBean.changeGame is called 3. The page is refreshed. My issues lies in the order of 1. and 2. The changeGame modifies a gameBean variable that is used by the getGameId and getHtmlPage. I thus want to it execute first, so that when other panels are refreshed, they contain the proper data. Please note that this issue seems to occur only for the call within the gameDiv element (other variables are properly refreshed). Would you have any idea as to what I could do to revert the order of 1. and 2., so that the changeGame() method is the first one called? I am using JavaServer Faces 2.0 on Tomcat 7.0. Thanks in advance
0
10,347,626
04/27/2012 08:49:50
970,706
09/29/2011 08:32:05
150
0
Loading XML file once in javascript closure
I am currently trying to create a javascript closure that will create a drop down list using values from the XML file I have. I have got it working for most of the code, and was loading the XML file each time I had to use it. I want to make the code more efficient though and only load the XML file once. I've tried to do this using the code below, but keep getting an error. This is the code I have for the closure... var closure = function() { var xmlDoc; return{ setXML: function() { xmlDoc = this.loadXMLDoc("feed.xml"); }, loadXMLDoc: function(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname, false); xhttp.send(); return xhttp.responseXML; }, createField: function() { x = xmlDoc.getElementsByTagName("name"); //code to create the drop down box }, findValue: function() { y = xmlDoc.getElementsByTagName("value"); //code to find value } }; }(); This is the code that calls the function... $(document).ready(function () { productSelector.setXML(); }); The error i'm getting is 'Cannot call method 'getElementsByTagName' of undefined', which is found in the createField function. It's the first instance of me trying to use the xmlDoc. Any help or tutorials on the issue is much appreciated.
javascript
xml
closures
null
null
null
open
Loading XML file once in javascript closure === I am currently trying to create a javascript closure that will create a drop down list using values from the XML file I have. I have got it working for most of the code, and was loading the XML file each time I had to use it. I want to make the code more efficient though and only load the XML file once. I've tried to do this using the code below, but keep getting an error. This is the code I have for the closure... var closure = function() { var xmlDoc; return{ setXML: function() { xmlDoc = this.loadXMLDoc("feed.xml"); }, loadXMLDoc: function(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname, false); xhttp.send(); return xhttp.responseXML; }, createField: function() { x = xmlDoc.getElementsByTagName("name"); //code to create the drop down box }, findValue: function() { y = xmlDoc.getElementsByTagName("value"); //code to find value } }; }(); This is the code that calls the function... $(document).ready(function () { productSelector.setXML(); }); The error i'm getting is 'Cannot call method 'getElementsByTagName' of undefined', which is found in the createField function. It's the first instance of me trying to use the xmlDoc. Any help or tutorials on the issue is much appreciated.
0
1,492,982
09/29/2009 14:40:35
30,587
10/23/2008 00:14:24
2,570
98
Compiling an application that uses WinUsb
I am in the process of writing an application to communicate with Usb devices using WinUsb.dll. This is a user-mode library that allows communication with a device through winusb.sys installed as its driver in the kernel. I am writing this application in C++ with Visual Studio 2008. The header WinUsb.h is found in the Windows DDK so I add the include path "D:\WinDDK\7100.0.0\inc\ddk". I then get an error that Usb.h cannot be found which WinUsb.h includes, Usb.h is also in the ddk but in a different directory, so I add "D:\WinDDK\7100.0.0\inc\api" as an include dir. Once I add that path then everything goes in the toilet and I start getting compile errors in stdio.h and a bunch of other weird places. I really don't want to use the DDK build system and compiler in order to simply use this DLL, thats one of the main reasons I'm using WinUsb instead of writing a proper driver. Has anyone built an application using WinUsb.dll and Visual Studio?
winusb
wdf
c++
null
null
null
open
Compiling an application that uses WinUsb === I am in the process of writing an application to communicate with Usb devices using WinUsb.dll. This is a user-mode library that allows communication with a device through winusb.sys installed as its driver in the kernel. I am writing this application in C++ with Visual Studio 2008. The header WinUsb.h is found in the Windows DDK so I add the include path "D:\WinDDK\7100.0.0\inc\ddk". I then get an error that Usb.h cannot be found which WinUsb.h includes, Usb.h is also in the ddk but in a different directory, so I add "D:\WinDDK\7100.0.0\inc\api" as an include dir. Once I add that path then everything goes in the toilet and I start getting compile errors in stdio.h and a bunch of other weird places. I really don't want to use the DDK build system and compiler in order to simply use this DLL, thats one of the main reasons I'm using WinUsb instead of writing a proper driver. Has anyone built an application using WinUsb.dll and Visual Studio?
0
9,906,209
03/28/2012 11:06:30
390,123
07/13/2010 05:35:54
82
6
How to add functionality to elements in the child view in expandable list in android?
![enter image description here][1] I am developing an application for android tablet. i am trying to develop the following UI I have used custom expandable list view, having text views and buttons in xml file. By using SimpleExpandableListAdapter i have added this list to my main activity. Now i want to give action to each element in my list view. for that i need to get access for those buttons in each line.. Can some one have experienced this please help me to achieve. any help would be appreciated. [1]: http://i.stack.imgur.com/5duAo.png Is this how I should do it? I am a newbie in Android and am really stuck.
android
null
null
null
null
null
open
How to add functionality to elements in the child view in expandable list in android? === ![enter image description here][1] I am developing an application for android tablet. i am trying to develop the following UI I have used custom expandable list view, having text views and buttons in xml file. By using SimpleExpandableListAdapter i have added this list to my main activity. Now i want to give action to each element in my list view. for that i need to get access for those buttons in each line.. Can some one have experienced this please help me to achieve. any help would be appreciated. [1]: http://i.stack.imgur.com/5duAo.png Is this how I should do it? I am a newbie in Android and am really stuck.
0
6,436,905
06/22/2011 08:20:46
326,840
06/06/2009 20:12:25
106
4
Automate setting of User Defined Attributes in IB 3.2
Is there a way to automate tasks in Interface Builder version 3.2? Specifically, I need to attache User Defined Attributes to quite a few views. - can it be done using AppleScript? - is the XIB format documented well enough to do this using some general purpose scripting language (say Ruby)?
cocoa
osx
interface-builder
null
null
null
open
Automate setting of User Defined Attributes in IB 3.2 === Is there a way to automate tasks in Interface Builder version 3.2? Specifically, I need to attache User Defined Attributes to quite a few views. - can it be done using AppleScript? - is the XIB format documented well enough to do this using some general purpose scripting language (say Ruby)?
0
7,301,751
09/04/2011 19:54:06
74,908
03/06/2009 22:39:16
433
2
Ruby on rails Layout page blinking on link clicks in Chrome
I have a site-wide header I'm currently using in my layouts/application.html.erb file and when I click on links to go from page to page within the website, the Chrome browser blinks looking like it is doing a full page refresh including the header. In Firefox the header never changes when I go from page to page within the website and there is no blink. Do RoR layout/application.html.erb pages produce a full page refresh? Is this a browser bug?
ruby-on-rails
ruby-on-rails-3
null
null
null
null
open
Ruby on rails Layout page blinking on link clicks in Chrome === I have a site-wide header I'm currently using in my layouts/application.html.erb file and when I click on links to go from page to page within the website, the Chrome browser blinks looking like it is doing a full page refresh including the header. In Firefox the header never changes when I go from page to page within the website and there is no blink. Do RoR layout/application.html.erb pages produce a full page refresh? Is this a browser bug?
0
8,856,534
01/13/2012 20:01:28
345,138
05/19/2010 14:00:32
58
3
How to Acces all Images and Videos stored on SD-Card in Blackberry?
There is a problem in getting all images and Videos stored on SD-Card in Blackberry, kindly help me that how can i access these. Thanks in Advance.
blackberry
null
null
null
null
01/18/2012 03:07:25
not a real question
How to Acces all Images and Videos stored on SD-Card in Blackberry? === There is a problem in getting all images and Videos stored on SD-Card in Blackberry, kindly help me that how can i access these. Thanks in Advance.
1
537,297
02/11/2009 15:22:02
15,255
09/17/2008 07:42:39
600
34
"Screen" effect in Java 2D graphics
This is a question that's been bugging me for some time now: In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque. I would dearly love to be able to replicate this composite using Java 2D graphics, but my repeated attempts at trying to coax AlphaComposite into this have failed - and indeed I think this is outside of AlphaComposite's capabilities. Any ideas on how to do this?
alpha
composite
java
graphics
screen
null
open
"Screen" effect in Java 2D graphics === This is a question that's been bugging me for some time now: In photoshop/GIMP, there is a "screen" layer composition mode. This mode has bright colours have a strong alpha, and dark colours a weak one. Black is entirely transparent, white entirely opaque. I would dearly love to be able to replicate this composite using Java 2D graphics, but my repeated attempts at trying to coax AlphaComposite into this have failed - and indeed I think this is outside of AlphaComposite's capabilities. Any ideas on how to do this?
0
3,173,448
07/04/2010 01:51:44
188,788
10/13/2009 01:52:53
1,019
75
HTML5 canvas: find out if click co-ordinates are inside a given rectangle
May be some one has had similar experiences on this dilemma and can help me out here... Basically, I have a canvas element on which I draw several rectangles in a loop using context.fillRect (x, y, width, height) Now, I want some of the rectangles to be hotspots and respond to click events. I can find out the exact (x,y) of a click event using `event.layerX` and `event.layerY`. Given that I know the following: - the exact x,y of the click - the x,y,width and height of every rectangle *how do I find out if the click event occurred inside the perimeter a certain rectangle or not*? and, *which rectangle the click event occurred 0n?* Is there like a mathematical formula for this? Any help would be much appreciated, and if I'm not clear enough, let me know... Thanks
javascript
events
canvas
null
null
null
open
HTML5 canvas: find out if click co-ordinates are inside a given rectangle === May be some one has had similar experiences on this dilemma and can help me out here... Basically, I have a canvas element on which I draw several rectangles in a loop using context.fillRect (x, y, width, height) Now, I want some of the rectangles to be hotspots and respond to click events. I can find out the exact (x,y) of a click event using `event.layerX` and `event.layerY`. Given that I know the following: - the exact x,y of the click - the x,y,width and height of every rectangle *how do I find out if the click event occurred inside the perimeter a certain rectangle or not*? and, *which rectangle the click event occurred 0n?* Is there like a mathematical formula for this? Any help would be much appreciated, and if I'm not clear enough, let me know... Thanks
0
7,436,820
09/15/2011 20:03:55
860,324
07/24/2011 15:06:39
52
2
Is Zepto just a subset of jQuery?
I was amazed that backbone.js can use either jQuery or Zepto as its "helper library". How did the Zepto people manage to have a syntax compatible with jQuery's? Is Zepto just a subset of jQuery?
jquery
zepto
null
null
null
09/15/2011 22:14:22
not constructive
Is Zepto just a subset of jQuery? === I was amazed that backbone.js can use either jQuery or Zepto as its "helper library". How did the Zepto people manage to have a syntax compatible with jQuery's? Is Zepto just a subset of jQuery?
4
3,816,445
09/28/2010 19:43:46
61,207
02/01/2009 14:45:27
1,134
52
Undefined reference to static member
I have a static member in my class. It's declared and defined: In my header: class Bla { ... static Bla* instance; ... }; In my implementation file: Bla::Bla* instance = 0; But ld doesn't seems to like it: release/bla.o:bla.cpp:(.text+0x19f7): undefined reference to `Bla::instance' I'm using GCC 4.4.0 from the Qt SDK. I can't figure it out what I'm doing wrong. Can someone shed a light on this issue?
c++
gcc
null
null
null
null
open
Undefined reference to static member === I have a static member in my class. It's declared and defined: In my header: class Bla { ... static Bla* instance; ... }; In my implementation file: Bla::Bla* instance = 0; But ld doesn't seems to like it: release/bla.o:bla.cpp:(.text+0x19f7): undefined reference to `Bla::instance' I'm using GCC 4.4.0 from the Qt SDK. I can't figure it out what I'm doing wrong. Can someone shed a light on this issue?
0
2,141,049
01/26/2010 17:04:19
1,406
08/15/2008 12:26:06
889
24
How to check if an JPA/hibernate database is up with second-level caching
I have a JSP/Spring application using Hibernate/JPA connected to a database. I have an external program that check if the web server is up every 5 minutes. The program call a specific URL to check if the web server is still running. The server returns "SUCCESS". Obviously if the server is now, nothing is returned. The request timesout and an alert is raised to inform the sysadmin that something is wrong... I would like to add another layer to this process: I would like the server to return "ERROR" if the database server is down. Is there a way using Hibernate to check if the database server is alive and well? What I tought to do was to take an object and try to save it. This would work, but I think it's probably too much for what I want. I could also read(load) an object from the database. But since we use second-level caching for all our objects, the object will be loaded from the cache, and not the database. What I'm looking for is something like: HibernateUtils.checkDatabase() Does such a function exist in Hibernate?
jpa
database
hibernate
spring
c3p0
null
open
How to check if an JPA/hibernate database is up with second-level caching === I have a JSP/Spring application using Hibernate/JPA connected to a database. I have an external program that check if the web server is up every 5 minutes. The program call a specific URL to check if the web server is still running. The server returns "SUCCESS". Obviously if the server is now, nothing is returned. The request timesout and an alert is raised to inform the sysadmin that something is wrong... I would like to add another layer to this process: I would like the server to return "ERROR" if the database server is down. Is there a way using Hibernate to check if the database server is alive and well? What I tought to do was to take an object and try to save it. This would work, but I think it's probably too much for what I want. I could also read(load) an object from the database. But since we use second-level caching for all our objects, the object will be loaded from the cache, and not the database. What I'm looking for is something like: HibernateUtils.checkDatabase() Does such a function exist in Hibernate?
0
2,697,852
04/23/2010 10:40:40
293,838
03/15/2010 09:15:16
18
0
Programming advice - Which Loops?
Theres no easy way to say this so ill just say it in the form of a story. Im looking for advice on which loops and where. Here goes: - out of 200-odd fields in the database, i need to run the following against each field. - extract allowed values using extract function - place allowed values into an array - loop the array to be inserted into a db table - first check records dont already exist. - if they dont exist insert into table. ive found myself playing with this for the past two days and getting tangled and tangled in loops. wondering if anybody can guide.
php
loops
mysql
database
array
04/25/2010 10:04:51
not a real question
Programming advice - Which Loops? === Theres no easy way to say this so ill just say it in the form of a story. Im looking for advice on which loops and where. Here goes: - out of 200-odd fields in the database, i need to run the following against each field. - extract allowed values using extract function - place allowed values into an array - loop the array to be inserted into a db table - first check records dont already exist. - if they dont exist insert into table. ive found myself playing with this for the past two days and getting tangled and tangled in loops. wondering if anybody can guide.
1
9,733,327
03/16/2012 07:14:00
1,124,494
12/31/2011 16:22:47
66
4
Is there any way to find out the majority color in an image file in java?
I want to find out the majority color in an image file and set it to background of a swing frame. What should I do?
java
image
swing
file
colors
null
open
Is there any way to find out the majority color in an image file in java? === I want to find out the majority color in an image file and set it to background of a swing frame. What should I do?
0
801,944
04/29/2009 11:34:35
361,526
03/30/2009 11:54:37
1
2
Mjpeg VLC and HTTP Streaming
I'm generating a MJpeg Stream and trying to stream it to VLC and play it there. The code: public void SendMultiPartData(String contentType, Func<byte[]> getData) { MemoryStream mem = null; response.StatusCode = 200; for ( byte[] buffer = getData(); buffer != null && buffer.Length > 0; buffer = getData()) { response.ContentType = "multipart/x-mixed-replace; boundary=--testboundary"; ASCIIEncoding ae = new ASCIIEncoding(); byte[] boundary = ae.GetBytes("\r\n--testboundary\r\nContent-Type: " + contentType + "\r\nContent-Length:" + buffer.Length + "\r\n\r\n"); mem = new MemoryStream(boundary); mem.WriteTo(response.OutputStream); mem = new MemoryStream(buffer); mem.WriteTo(response.OutputStream); response.OutputStream.Flush(); } mem.Close(); listener.Close(); } If I try to open the stream with firefox, there's no problem at all, although with VLC it doesn't work (VLC seems to keep reading but never shows the video) I've been sniffing VLC-to-VLC streaming and they seems to use as HTTP header "application/octet-stream" instead of multipart/x-mixed-replace Any ideas ? Tks in advance, Jose
http
streaming
c#
mjpeg
vlc
null
open
Mjpeg VLC and HTTP Streaming === I'm generating a MJpeg Stream and trying to stream it to VLC and play it there. The code: public void SendMultiPartData(String contentType, Func<byte[]> getData) { MemoryStream mem = null; response.StatusCode = 200; for ( byte[] buffer = getData(); buffer != null && buffer.Length > 0; buffer = getData()) { response.ContentType = "multipart/x-mixed-replace; boundary=--testboundary"; ASCIIEncoding ae = new ASCIIEncoding(); byte[] boundary = ae.GetBytes("\r\n--testboundary\r\nContent-Type: " + contentType + "\r\nContent-Length:" + buffer.Length + "\r\n\r\n"); mem = new MemoryStream(boundary); mem.WriteTo(response.OutputStream); mem = new MemoryStream(buffer); mem.WriteTo(response.OutputStream); response.OutputStream.Flush(); } mem.Close(); listener.Close(); } If I try to open the stream with firefox, there's no problem at all, although with VLC it doesn't work (VLC seems to keep reading but never shows the video) I've been sniffing VLC-to-VLC streaming and they seems to use as HTTP header "application/octet-stream" instead of multipart/x-mixed-replace Any ideas ? Tks in advance, Jose
0
2,650,780
04/16/2010 05:16:15
141,172
07/20/2009 04:36:50
11,294
535
VS2010 Extension like Smart Paster?
Alex Papadimoulis' [Smart Paster][1] is a great little tool that can paste text in programmer-friendly ways (e.g. as a StringBuilder, as a language-specific string literal, etc.). However, it doesn't seem to be available for VS2010. Anyone know of a similar extension or of plans to port Smart Paster? [1]: http://weblogs.asp.net/alex_papadimoulis/archive/2004/05/25/Smart-Paster-1.1-Add-In---StringBuilder-and-Better-C_2300_-Handling.aspx
vs2010
extension
null
null
null
null
open
VS2010 Extension like Smart Paster? === Alex Papadimoulis' [Smart Paster][1] is a great little tool that can paste text in programmer-friendly ways (e.g. as a StringBuilder, as a language-specific string literal, etc.). However, it doesn't seem to be available for VS2010. Anyone know of a similar extension or of plans to port Smart Paster? [1]: http://weblogs.asp.net/alex_papadimoulis/archive/2004/05/25/Smart-Paster-1.1-Add-In---StringBuilder-and-Better-C_2300_-Handling.aspx
0
2,688
08/05/2008 18:45:46
432
08/05/2008 17:18:46
21
4
What all do I need to escape when sending a (My)SQL query?
When you execute a SQL query, you have to clean your 'strings' or users can execute malicious SQL on your website. I usually just have a function escape_string(blah), which: - Replaces escapes (\) with double escapes (\\). - Replaces single quotes (') with an escaped single quote (\'). Is this adequate? Is there a hole in my code? Speedy library to reliably do this for me?
mysql
security
null
null
null
null
open
What all do I need to escape when sending a (My)SQL query? === When you execute a SQL query, you have to clean your 'strings' or users can execute malicious SQL on your website. I usually just have a function escape_string(blah), which: - Replaces escapes (\) with double escapes (\\). - Replaces single quotes (') with an escaped single quote (\'). Is this adequate? Is there a hole in my code? Speedy library to reliably do this for me?
0
7,619,579
10/01/2011 10:10:39
718,315
04/21/2011 05:05:29
448
40
cakephp: find conditions
Array ( [0] => Array ( [DebateComment] => Array ( [id] => 126 [user_id] => 17 [debate_id] => 32 [debate_comment_title] => hiiiiiii [debate_comments] => gfdfg dfg . [debate_type] => against [total_postive_counts] => 1 [total_negative_counts] => 0 [accept_challenges] => Enable [status] => Active [modified] => 2011-08-19 11:12:59 [created] => 2011-08-18 17:50:53 ) [User] => Array ( [id] => 17 [group_id] => 3 [fb_user_id] => 0 [username] => xyz [email] => xyz@xyz.com [password] => 077dadf3cc9c5fcb95dfacc3d8ff5049123b2d89 [status] => 1 [verify_code] => [signup_ip] => [is_verified] => 1 [user_comment_warn_status] => 0 [user_ip_address] => [referred_by_user_id] => 0 [twitter_user_id] => 0 [twitter_access_key] => [twitter_access_token] => [modified] => 2011-05-05 10:43:15 [Userdetail] => Array ( [id] => 14 [user_id] => 17 [firstname] => xyz [lastname] => [about_me] => [tagline] => [visible_status] => Online [show_welcome_message] => Yes [created] => 2011-05-05 10:43:15 [modified] => 2011-05-05 10:43:15 ) ) ) I write this query but dosent get output. $arr = $this->DebateComment->find('all',array( 'conditions'=>array('User.Userdetail.visible_status'=>'Online'), 'recursive'=>3)); My Question : I want to find all DebateComment .but conditions is that visibale_status => online in Userdetails.
cakephp
cakephp-1.3
cakephp-1.2
null
null
10/03/2011 11:58:06
too localized
cakephp: find conditions === Array ( [0] => Array ( [DebateComment] => Array ( [id] => 126 [user_id] => 17 [debate_id] => 32 [debate_comment_title] => hiiiiiii [debate_comments] => gfdfg dfg . [debate_type] => against [total_postive_counts] => 1 [total_negative_counts] => 0 [accept_challenges] => Enable [status] => Active [modified] => 2011-08-19 11:12:59 [created] => 2011-08-18 17:50:53 ) [User] => Array ( [id] => 17 [group_id] => 3 [fb_user_id] => 0 [username] => xyz [email] => xyz@xyz.com [password] => 077dadf3cc9c5fcb95dfacc3d8ff5049123b2d89 [status] => 1 [verify_code] => [signup_ip] => [is_verified] => 1 [user_comment_warn_status] => 0 [user_ip_address] => [referred_by_user_id] => 0 [twitter_user_id] => 0 [twitter_access_key] => [twitter_access_token] => [modified] => 2011-05-05 10:43:15 [Userdetail] => Array ( [id] => 14 [user_id] => 17 [firstname] => xyz [lastname] => [about_me] => [tagline] => [visible_status] => Online [show_welcome_message] => Yes [created] => 2011-05-05 10:43:15 [modified] => 2011-05-05 10:43:15 ) ) ) I write this query but dosent get output. $arr = $this->DebateComment->find('all',array( 'conditions'=>array('User.Userdetail.visible_status'=>'Online'), 'recursive'=>3)); My Question : I want to find all DebateComment .but conditions is that visibale_status => online in Userdetails.
3
9,429,919
02/24/2012 11:23:40
1,230,619
02/24/2012 11:12:12
1
0
win32 very low level assembly - application startup issue
I am busy programming a win32 program in assembly with a form and buttons... The problem is windows modify my variables in ram. The place were a store my hInstance and hwnd variables. I have found a workaround, but it is not an elegant solution. I would like to know why windows modify my variables and also were can I find documentation which describe the start up of an application.
api
winapi
assembly
user32
null
null
open
win32 very low level assembly - application startup issue === I am busy programming a win32 program in assembly with a form and buttons... The problem is windows modify my variables in ram. The place were a store my hInstance and hwnd variables. I have found a workaround, but it is not an elegant solution. I would like to know why windows modify my variables and also were can I find documentation which describe the start up of an application.
0
9,167,138
02/06/2012 20:56:18
1,193,041
02/06/2012 18:53:56
1
0
when i try to scan more than 1 string in c programming there is something wrong
i m a newbe in programing when i try to do a normal scanning of a string in c programming there is no problem but when i do alot of scanning of c that is when the problem starts PROBLEM: the problem starts when its in the second iteration of the for loop that skips the scanf and does not let me enter data. int main() { int ID = 0; char name[100]; char programme[100]; float CGPA = 0; int i= 0; printf("enter name\n"); scanf(" %s", name); printf("enter Id\n"); scanf("%d", &ID); printf("enter programme\n"); scanf(" %s", programme); printf("enter cgpa\n"); scanf("%.2f", &ID); printf("enter name\n"); scanf(" %s", name); printf("enter Id\n"); scanf("%d", &ID); printf("enter programme\n"); scanf(" %s", programme); printf("enter cgpa\n"); scanf("%.2f", &ID); system("PAUSE"); } RESULT enter name lol enter Id 123 enter programme www enter cgpa 123 **enter name enter Id** lol **enter programme enter cgpa** 123 Press any key to continue . . . the **BOLD** words is the problem
c
scanf
null
null
null
02/07/2012 16:03:10
not a real question
when i try to scan more than 1 string in c programming there is something wrong === i m a newbe in programing when i try to do a normal scanning of a string in c programming there is no problem but when i do alot of scanning of c that is when the problem starts PROBLEM: the problem starts when its in the second iteration of the for loop that skips the scanf and does not let me enter data. int main() { int ID = 0; char name[100]; char programme[100]; float CGPA = 0; int i= 0; printf("enter name\n"); scanf(" %s", name); printf("enter Id\n"); scanf("%d", &ID); printf("enter programme\n"); scanf(" %s", programme); printf("enter cgpa\n"); scanf("%.2f", &ID); printf("enter name\n"); scanf(" %s", name); printf("enter Id\n"); scanf("%d", &ID); printf("enter programme\n"); scanf(" %s", programme); printf("enter cgpa\n"); scanf("%.2f", &ID); system("PAUSE"); } RESULT enter name lol enter Id 123 enter programme www enter cgpa 123 **enter name enter Id** lol **enter programme enter cgpa** 123 Press any key to continue . . . the **BOLD** words is the problem
1
1,904,369
12/14/2009 23:54:59
90,740
04/14/2009 16:27:22
6
0
What should I expect by taking a programming logic test for a potential employer?
I am currently looking for entry level .NET developer positions, and I was contacted by a company today that wants to schedule a "Programmer's Logic Test" that is mainly sequence logic and math but no coding. What is the best way to prepare for such a test, if there is a best way?
interview-questions
career-development
null
null
null
02/06/2012 01:06:46
off topic
What should I expect by taking a programming logic test for a potential employer? === I am currently looking for entry level .NET developer positions, and I was contacted by a company today that wants to schedule a "Programmer's Logic Test" that is mainly sequence logic and math but no coding. What is the best way to prepare for such a test, if there is a best way?
2
8,283,500
11/27/2011 03:45:29
206,446
11/08/2009 22:19:26
4,280
5
Declare methods dynamically in Javascript
I have a model and want to declare functions for all attributes on it. Let's say these are the attributes: [firstName, lastName] I want to be able to get them with: person.firstName() person.lastName() How do I define methods programmatically from an array of strings?
javascript
node.js
null
null
null
null
open
Declare methods dynamically in Javascript === I have a model and want to declare functions for all attributes on it. Let's say these are the attributes: [firstName, lastName] I want to be able to get them with: person.firstName() person.lastName() How do I define methods programmatically from an array of strings?
0
11,683,021
07/27/2012 07:08:50
496,864
11/04/2010 06:40:40
987
20
Openssl C++ get expiry date
What is the function that I should use to get the x509 certificate expiry date? I will first check the validity of the certificate. If it has expired, I need to get the expiry date of the certificate.
c++
openssl
x509certificate
null
null
null
open
Openssl C++ get expiry date === What is the function that I should use to get the x509 certificate expiry date? I will first check the validity of the certificate. If it has expired, I need to get the expiry date of the certificate.
0
937,646
06/02/2009 02:07:46
8,280
09/15/2008 15:36:56
1,024
30
Can abstract thinking be taught?
I broke some of the cardinal rules for hiring and am now stuck with a fairly 'bad' hire. My biggest concern is that the person's abstract thinking is really weak. So, my question is do you guys think abstract thinking can be taught? And if so how? Or should I start preparing an exit strategy? I'm sure some of you guys have been caught in the same predicament before, what did you do?
abstraction
thinking
problem-solving
null
null
09/22/2011 17:20:27
off topic
Can abstract thinking be taught? === I broke some of the cardinal rules for hiring and am now stuck with a fairly 'bad' hire. My biggest concern is that the person's abstract thinking is really weak. So, my question is do you guys think abstract thinking can be taught? And if so how? Or should I start preparing an exit strategy? I'm sure some of you guys have been caught in the same predicament before, what did you do?
2
8,147,483
11/16/2011 06:10:59
336,444
07/31/2009 14:58:45
217
14
Raphaël API and code review
I started playing with Raphaël and I'm wondering if somebody could do the code review of what I have so far and maybe give me some tips how to improve it. Basically what I'm trying to accomplish is the zoom-in/zoom-out effect on the element when mouseover event is being triggered on the element. The effect should paused when mouseout effect is triggered. Here is what I have so far: var paper = new Raphael(document.getElementById('container'), 500, 500); var dot = paper.circle(100, 100, 15); dot.attr({fill: "#ff0000"}); // is there a better way to do this? var animation = Raphael.animation({r: 25}, 1000, function () { this.animate({r: 15}, 1000, function () { this.animate(animation); }); }); dot.mouseover(function () { dot.animate(animation); }); dot.mouseout(function () { this.pause(); this.animate({r: 15}, 500); }); You can also see the demo here: http://jsfiddle.net/KEg8y/
javascript
raphael
null
null
null
12/01/2011 22:25:30
off topic
Raphaël API and code review === I started playing with Raphaël and I'm wondering if somebody could do the code review of what I have so far and maybe give me some tips how to improve it. Basically what I'm trying to accomplish is the zoom-in/zoom-out effect on the element when mouseover event is being triggered on the element. The effect should paused when mouseout effect is triggered. Here is what I have so far: var paper = new Raphael(document.getElementById('container'), 500, 500); var dot = paper.circle(100, 100, 15); dot.attr({fill: "#ff0000"}); // is there a better way to do this? var animation = Raphael.animation({r: 25}, 1000, function () { this.animate({r: 15}, 1000, function () { this.animate(animation); }); }); dot.mouseover(function () { dot.animate(animation); }); dot.mouseout(function () { this.pause(); this.animate({r: 15}, 500); }); You can also see the demo here: http://jsfiddle.net/KEg8y/
2
7,642,790
10/04/2011 02:44:55
447,979
09/15/2010 03:38:46
1,549
174
file is not read by completely
I have an file text with approximate 113687 lines, but my application read only 314 lines, can anyone say why? Any help is appreciated. My code: string file = @"a:\foo.txt"; StreamReader reader = File.OpenText(file); string line; int rows = 0; while ((line = reader.ReadLine()) != null) { ++rows; doSomethingWith(line); // ... }
c#
.net
file
null
null
10/05/2011 03:52:58
not a real question
file is not read by completely === I have an file text with approximate 113687 lines, but my application read only 314 lines, can anyone say why? Any help is appreciated. My code: string file = @"a:\foo.txt"; StreamReader reader = File.OpenText(file); string line; int rows = 0; while ((line = reader.ReadLine()) != null) { ++rows; doSomethingWith(line); // ... }
1
7,983,802
11/02/2011 16:25:55
877,506
08/03/2011 21:37:17
13
0
More than one tab bar in an app?
I have developed an app that has work successfully for the last 4 months using iOS 4.3 and under. Since iOS 5 however the tightening of view hierarchy has left my app dead in the water. The app starts with a tab bar as its main view with 5 tabs. When the user selects a row on a tableview on the first tab it pushes onto another tabbar with 3 tabs which gives specific information about that selection. This structure worked fine but obviously broke when testing on iOS 5. My question is: Is it bad design to utilize 2 or more tab bars in one application? I don't mean "bad design" in the grand scheme of things because that is subjective. I mean in a practical sense where it is specifically forbidden or not recommended.
uitabbarcontroller
null
null
null
null
null
open
More than one tab bar in an app? === I have developed an app that has work successfully for the last 4 months using iOS 4.3 and under. Since iOS 5 however the tightening of view hierarchy has left my app dead in the water. The app starts with a tab bar as its main view with 5 tabs. When the user selects a row on a tableview on the first tab it pushes onto another tabbar with 3 tabs which gives specific information about that selection. This structure worked fine but obviously broke when testing on iOS 5. My question is: Is it bad design to utilize 2 or more tab bars in one application? I don't mean "bad design" in the grand scheme of things because that is subjective. I mean in a practical sense where it is specifically forbidden or not recommended.
0
6,909,861
08/02/2011 09:26:00
830,918
07/06/2011 05:21:28
20
2
How to replace a webfile content with a file content?
I have a file called **filecontent.txt** which includes some php code. And i have another file called **index.php**, I want to **replace** the **index.php** content with the **filecontent.txt** content. Is there any solution for it?? Please help me on this.
php
null
null
null
null
null
open
How to replace a webfile content with a file content? === I have a file called **filecontent.txt** which includes some php code. And i have another file called **index.php**, I want to **replace** the **index.php** content with the **filecontent.txt** content. Is there any solution for it?? Please help me on this.
0
11,473,094
07/13/2012 15:01:50
914,373
08/26/2011 15:13:05
358
9
SSIS transfer SQL server objects task -> Foreign key constraint error
I try to copy a database from 1 server to the other to build a staging environment. I do this with SSID. First I delete the existing database on my staging server, create a new and empty one and then I run the script. I copy everything. Most of my databases copy correctly except for 1 which gives me a Foreign Key constraint error. What can I do to fix this? I tried googling, but without any results. SSIS package "XXXXXXXX.dtsx" starting. Information: 0x4002F418 at MyDatabase, Transfer SQL Server Objects Task: There are no Logins to transfer. Error: 0xC002F325 at myDB, Transfer SQL Server Objects Task: Execution failed with the following error: "ERROR : errorCode=-1073548784 description=Executing the query "ALTER TABLE [dbo].[TemplatePropertyValue] WITH CH..." failed with the following error: "The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_VALUE1_Template". The conflict occurred in database "myDB", table "dbo.Template", column 'Id'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}". Task failed: myDB SSIS package "XXXXXXXXX.dtsx" finished: Success.
sql-server-2008
ssis
null
null
null
07/16/2012 02:31:52
off topic
SSIS transfer SQL server objects task -> Foreign key constraint error === I try to copy a database from 1 server to the other to build a staging environment. I do this with SSID. First I delete the existing database on my staging server, create a new and empty one and then I run the script. I copy everything. Most of my databases copy correctly except for 1 which gives me a Foreign Key constraint error. What can I do to fix this? I tried googling, but without any results. SSIS package "XXXXXXXX.dtsx" starting. Information: 0x4002F418 at MyDatabase, Transfer SQL Server Objects Task: There are no Logins to transfer. Error: 0xC002F325 at myDB, Transfer SQL Server Objects Task: Execution failed with the following error: "ERROR : errorCode=-1073548784 description=Executing the query "ALTER TABLE [dbo].[TemplatePropertyValue] WITH CH..." failed with the following error: "The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_VALUE1_Template". The conflict occurred in database "myDB", table "dbo.Template", column 'Id'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={C81DFC5A-3B22-4DA3-BD3B-10BF861A7F9C}". Task failed: myDB SSIS package "XXXXXXXXX.dtsx" finished: Success.
2
8,097,908
11/11/2011 17:46:23
1,010,047
10/23/2011 23:52:19
42
0
Frame to Timecode Conversion HTML5
I'm looking to convert a frame number (for a given sample rate) into time in HTML5. eg: sample_rate = 24fps frame 226 => ? time Please advise.
java
video
null
null
null
null
open
Frame to Timecode Conversion HTML5 === I'm looking to convert a frame number (for a given sample rate) into time in HTML5. eg: sample_rate = 24fps frame 226 => ? time Please advise.
0
5,837,731
04/29/2011 21:47:35
382,906
07/04/2010 01:40:57
936
47
Putting comma between each word in NSString
I have an NSString that is like @"nice car" and would like to create an NSString that is @"nice,car". Is there a way to do this?
objective-c
nsstring
replace
null
null
null
open
Putting comma between each word in NSString === I have an NSString that is like @"nice car" and would like to create an NSString that is @"nice,car". Is there a way to do this?
0
8,977,628
01/23/2012 19:44:16
387,852
07/09/2010 15:03:07
2,071
70
Is Java 7 safe yet?
I remember when Java 7 was initially released, there were many suggestions [not to use it for anything][1] as there were some bugs in compiler optimizations. This was apparently [not merely hypothetical][2]. I haven't followed the situation closely since then; have these issues been worked out and it is generally considered safe to use at this point? [This page][3] from java.com makes me think perhaps it's not quite ready yet, but I don't want to read too much into it. If it is not yet safe, is it sufficient to use `-XX:-UseLoopPredicate` as a VM argument? [1]: http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/ [2]: http://stackoverflow.com/q/6894104/387852 [3]: http://www.java.com/en/download/faq/java7.xml
java
bugs
java-7
hotspot
null
01/24/2012 12:15:09
not constructive
Is Java 7 safe yet? === I remember when Java 7 was initially released, there were many suggestions [not to use it for anything][1] as there were some bugs in compiler optimizations. This was apparently [not merely hypothetical][2]. I haven't followed the situation closely since then; have these issues been worked out and it is generally considered safe to use at this point? [This page][3] from java.com makes me think perhaps it's not quite ready yet, but I don't want to read too much into it. If it is not yet safe, is it sufficient to use `-XX:-UseLoopPredicate` as a VM argument? [1]: http://www.lucidimagination.com/blog/2011/07/28/dont-use-java-7-for-anything/ [2]: http://stackoverflow.com/q/6894104/387852 [3]: http://www.java.com/en/download/faq/java7.xml
4
1,644,737
10/29/2009 15:57:30
56,672
01/19/2009 13:04:20
2,324
165
Un obfuscate URL using mod rewrite.
I work for a company that used to have a polocy of obfuscating URLs for articles which you needed to register to use. So they would have something like /story.php?story_id=Z_ZXYZ which there was some code which mapped letters to numbers to work out the true story id so Z = 0 Y = 1 X = 2 etc. We are now moving technology stack and have decided that obfuscated urls are not needed. So I am looking at whether it is possible to un obfuscate the URLs using mod rewrite So far I have RewriteCond %{REQUEST_URI} ^.*story.php [NC] RewriteCond %{QUERY_STRING} ^.*story_id=Z_([ZXYWVUTSRQ]*) [NC] RewriteRule ^.*$ /story/${decryptmap:%1} [L,R=301] I have a rewrite map in the httpd.conf file <IfModule mod_rewrite.c> RewriteMap decryptmap txt:decyrpsdstxt </IfModule> Which has content ## ## decrypt urls ## Z 0 X 1 etc.. but it dosn't seem to be working, even if I put some text in the Rewriterule as so `RewriteRule ^.*$ /story/${decryptmap:ZXY} [L,R=301]` I get a url like `/story/?story_id=Z_ZAD` Is there anything obvious I am doing wrong? I can see that the two conditions are being matched but the map doesn’t seem to work. Should I even be trying to get mod rewrite to do this? I could redirect to a script which did this fairly easily but that would put redirect code in two places which I didn't like the idea of. (I'm not worried about the ?story_id=Z_ZAD, I know how to get rid of that)
mod-rewrite
obfuscation
null
null
null
null
open
Un obfuscate URL using mod rewrite. === I work for a company that used to have a polocy of obfuscating URLs for articles which you needed to register to use. So they would have something like /story.php?story_id=Z_ZXYZ which there was some code which mapped letters to numbers to work out the true story id so Z = 0 Y = 1 X = 2 etc. We are now moving technology stack and have decided that obfuscated urls are not needed. So I am looking at whether it is possible to un obfuscate the URLs using mod rewrite So far I have RewriteCond %{REQUEST_URI} ^.*story.php [NC] RewriteCond %{QUERY_STRING} ^.*story_id=Z_([ZXYWVUTSRQ]*) [NC] RewriteRule ^.*$ /story/${decryptmap:%1} [L,R=301] I have a rewrite map in the httpd.conf file <IfModule mod_rewrite.c> RewriteMap decryptmap txt:decyrpsdstxt </IfModule> Which has content ## ## decrypt urls ## Z 0 X 1 etc.. but it dosn't seem to be working, even if I put some text in the Rewriterule as so `RewriteRule ^.*$ /story/${decryptmap:ZXY} [L,R=301]` I get a url like `/story/?story_id=Z_ZAD` Is there anything obvious I am doing wrong? I can see that the two conditions are being matched but the map doesn’t seem to work. Should I even be trying to get mod rewrite to do this? I could redirect to a script which did this fairly easily but that would put redirect code in two places which I didn't like the idea of. (I'm not worried about the ?story_id=Z_ZAD, I know how to get rid of that)
0
10,577,826
05/14/2012 05:17:37
1,033,503
11/07/2011 09:48:11
621
23
Improving OOP skills? Which SmallTalk?
I am going to start learning `SmallTalk` for improving my object oriented skills. Which SmallTalk implementation would best serve my purpose. If possible where could I find material to learn recommended implementation. P.S 1: No please don't recommend skipping the idea of learning Smalltalk and going for C# or Java. P.S 2: If you think there are other better ways to improve my OOP skills. What are they? I am a Ruby dev on Macintosh. Thanks
ruby
oop
self-improvement
smalltalk
null
05/14/2012 16:25:21
not constructive
Improving OOP skills? Which SmallTalk? === I am going to start learning `SmallTalk` for improving my object oriented skills. Which SmallTalk implementation would best serve my purpose. If possible where could I find material to learn recommended implementation. P.S 1: No please don't recommend skipping the idea of learning Smalltalk and going for C# or Java. P.S 2: If you think there are other better ways to improve my OOP skills. What are they? I am a Ruby dev on Macintosh. Thanks
4
8,554,757
12/18/2011 20:58:06
1,104,561
12/18/2011 14:25:12
1
0
When a user Like my page embeded in my site some functions should call
I have a simple site, I want to code that when ever a user on my site Like my Page which is embeded in it another button should appear below it saying "Proceed to Next Step" Hope so you got my idea.
php
javascript
mysql
facebook
like
null
open
When a user Like my page embeded in my site some functions should call === I have a simple site, I want to code that when ever a user on my site Like my Page which is embeded in it another button should appear below it saying "Proceed to Next Step" Hope so you got my idea.
0
3,135,584
06/28/2010 19:41:17
6,244
09/13/2008 07:26:29
1,949
226
Good javascript event calendar using YUI
Has anyone come across an Events Calendar (eg shows events on a calender format rather than allowing user to choose date) that uses YUI as its base. I have found some based on jquery, but I am trying to standardise my stuff to YUI so wondering if anyone has any there, I cant seem to find one on YUI pages. Otherwise a recommendation of the best jquery one would be appreciated.
javascript
jquery
yui
null
null
02/07/2012 15:07:10
too localized
Good javascript event calendar using YUI === Has anyone come across an Events Calendar (eg shows events on a calender format rather than allowing user to choose date) that uses YUI as its base. I have found some based on jquery, but I am trying to standardise my stuff to YUI so wondering if anyone has any there, I cant seem to find one on YUI pages. Otherwise a recommendation of the best jquery one would be appreciated.
3
9,120,402
02/02/2012 21:38:30
1,186,138
02/02/2012 21:01:37
1
0
Hibernate - mapping external table
I have 2 oracle tables. One of them is an oracle external table and the other a standard oracle table with a primary key. I want to be able to select columns from both tables using a LEFT OUTER JOIN. I am just not sure how to setup the hql mapping for the external table since it doesn't have a primary key. External Table DDL CREATE TABLE MY_EXTERNAL ( TRANSDATE VARCHAR2(8), ACC_NO VARCHAR2(10), TRANSID VARCHAR2(20), ID VARCHAR2(16), FEE NUMBER(17), AMOUNT NUMBER(17) ) ORGANIZATION EXTERNAL ( DEFAULT DIRECTORY MY_EXTERNAL_DIR ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ) LOCATION ('my_feed.dat') ) DDL for table to join to CREATE TABLE ACCTINFO ( SEQ NUMBER(12), IDENT VARCHAR2(16), AVAILBAL NUMBER(17), HOLDONOD CHAR(1) ) CREATE UNIQUE INDEX "ACCTINFO_PK" ON ACCTINFO ( SEQ ) CREATE INDEX IDENT_IDX ON ACCTINFO ( IDENT ) I want to select everything from MY_EXTERNAL and ACCTINFO if present using a join from ID of MY_EXTERNAL to IDENT of ACCTINFO I would appreciate any help I can get in setting up the classes and the query
hql
null
null
null
null
null
open
Hibernate - mapping external table === I have 2 oracle tables. One of them is an oracle external table and the other a standard oracle table with a primary key. I want to be able to select columns from both tables using a LEFT OUTER JOIN. I am just not sure how to setup the hql mapping for the external table since it doesn't have a primary key. External Table DDL CREATE TABLE MY_EXTERNAL ( TRANSDATE VARCHAR2(8), ACC_NO VARCHAR2(10), TRANSID VARCHAR2(20), ID VARCHAR2(16), FEE NUMBER(17), AMOUNT NUMBER(17) ) ORGANIZATION EXTERNAL ( DEFAULT DIRECTORY MY_EXTERNAL_DIR ACCESS PARAMETERS ( RECORDS DELIMITED BY NEWLINE FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ) LOCATION ('my_feed.dat') ) DDL for table to join to CREATE TABLE ACCTINFO ( SEQ NUMBER(12), IDENT VARCHAR2(16), AVAILBAL NUMBER(17), HOLDONOD CHAR(1) ) CREATE UNIQUE INDEX "ACCTINFO_PK" ON ACCTINFO ( SEQ ) CREATE INDEX IDENT_IDX ON ACCTINFO ( IDENT ) I want to select everything from MY_EXTERNAL and ACCTINFO if present using a join from ID of MY_EXTERNAL to IDENT of ACCTINFO I would appreciate any help I can get in setting up the classes and the query
0
1,409,003
09/11/2009 04:41:17
93,962
04/21/2009 18:43:17
358
7
mac and iphone development books 2009
What the best books available right now on Mac and iPhone development ? Thanks Michael
osx
iphone
null
null
null
09/24/2011 14:17:53
not constructive
mac and iphone development books 2009 === What the best books available right now on Mac and iPhone development ? Thanks Michael
4
7,464,866
09/18/2011 22:25:40
775,355
05/29/2011 18:06:46
110
1
Server Connection Not Working
I wrote my own server in Java and I'm kind of a noob. The client program connects to my IP Address at port 5000 over a TCP connection. When I run the server and the client on the same machine, it connects and the server is saying the incoming IP Adress is 127.0.0.1 - localhost. When I run the client on a seperate machine, it never connects. I know I fixed this problem a while ago by changing some router settings but I forget how. Could someone explain to me in simple terms how to fix this? My router is verizon and I'm using Windows Vista.
java
networking
tcp
firewall
null
09/18/2011 23:21:42
not a real question
Server Connection Not Working === I wrote my own server in Java and I'm kind of a noob. The client program connects to my IP Address at port 5000 over a TCP connection. When I run the server and the client on the same machine, it connects and the server is saying the incoming IP Adress is 127.0.0.1 - localhost. When I run the client on a seperate machine, it never connects. I know I fixed this problem a while ago by changing some router settings but I forget how. Could someone explain to me in simple terms how to fix this? My router is verizon and I'm using Windows Vista.
1
7,416,732
09/14/2011 13:01:31
944,659
09/14/2011 12:51:26
1
0
Online Chess by VB.net
as the topic header shows my question is about Coding an online chess by VB.net. I coded the chess game with all rules , now I designed a login form for it, but I don't know how to connect to a Database and send query , to check the User and pass. I searched about connecting to a DB and I found something. but i didn't found anything about sending query. I need a code that contains connecting to a DB and sending query for example about checking username and password to DB. thanks.
vb.net-2010
null
null
null
null
09/14/2011 14:41:16
not a real question
Online Chess by VB.net === as the topic header shows my question is about Coding an online chess by VB.net. I coded the chess game with all rules , now I designed a login form for it, but I don't know how to connect to a Database and send query , to check the User and pass. I searched about connecting to a DB and I found something. but i didn't found anything about sending query. I need a code that contains connecting to a DB and sending query for example about checking username and password to DB. thanks.
1
8,837,294
01/12/2012 15:09:28
1,086,037
12/07/2011 16:10:11
4
0
run unix script as scheduled job
I want my unix script to run as a scheduled job such that the script is invoked once every 15 minutes. Is there any way to achieve this other than running the script as a cron job?
unix
null
null
null
null
01/12/2012 21:28:39
off topic
run unix script as scheduled job === I want my unix script to run as a scheduled job such that the script is invoked once every 15 minutes. Is there any way to achieve this other than running the script as a cron job?
2
1,867,861
12/08/2009 15:53:35
49,887
12/29/2008 16:36:59
548
8
Python dictionary, keep keys/values in same order as declared
new to Python and had a question about dictionaries. I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the order that I declared it. So if I have the dictionary: d = {'ac':33, 'gw':20, 'ap':102, 'za':321, 'bs':10} It isn't it that order if I view it or iterate through it, is there any way to make sure Python will keep the explicit order that I declared the keys/values in? Using Python 2.6
python
dictionary
order
null
null
null
open
Python dictionary, keep keys/values in same order as declared === new to Python and had a question about dictionaries. I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the order that I declared it. So if I have the dictionary: d = {'ac':33, 'gw':20, 'ap':102, 'za':321, 'bs':10} It isn't it that order if I view it or iterate through it, is there any way to make sure Python will keep the explicit order that I declared the keys/values in? Using Python 2.6
0