question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,226,521
6,227,158
How to perform file import in background threads the safe way? How to do safe file I/O transactions in the background?
I'm looking for best practices to solve this hard problem: My app has a file import / export functionality coupled with Core Data. This means that when I import a file into my app, I create an entry in Core Data and copy this file over to a private directory of the App. Next, I process the file and create a few others ...
Can you perform your import operation in a manner that, if not atomic, is at least restartable? Eg. a file move that is restartable might look like: Search for and delete all files '*.tmp' in target folder. Find a file in source folder that needs to be copied - found one 'data.DB' Copy file to target folder as 'data.DB...
How to perform file import in background threads the safe way? How to do safe file I/O transactions in the background? I'm looking for best practices to solve this hard problem: My app has a file import / export functionality coupled with Core Data. This means that when I import a file into my app, I create an entry in...
TITLE: How to perform file import in background threads the safe way? How to do safe file I/O transactions in the background? QUESTION: I'm looking for best practices to solve this hard problem: My app has a file import / export functionality coupled with Core Data. This means that when I import a file into my app, I ...
[ "iphone", "ios", "file", "file-io", "concurrency" ]
1
2
461
2
0
2011-06-03T11:27:12.380000
2011-06-03T12:35:50.283000
6,226,522
6,235,095
Alpha channel coordinates
I have an image with transparent area(rectangle). I need to detect coords of the top left transparent pixel and the coords of the bottom right pixel. How to do that with imagemagick or ruby?
Image magick identify command using the options -verbose -alpha should print the information you need. devin@debian-desktop-1:~$ identify -verbose -alpha Extract http://upload.wikimedia.org/wikipedia/commons/5/51/Google.png Image: /tmp/magick-XXy36tWu Base filename: Google.png Format: PNG (Portable Network Graphics) Cl...
Alpha channel coordinates I have an image with transparent area(rectangle). I need to detect coords of the top left transparent pixel and the coords of the bottom right pixel. How to do that with imagemagick or ruby?
TITLE: Alpha channel coordinates QUESTION: I have an image with transparent area(rectangle). I need to detect coords of the top left transparent pixel and the coords of the bottom right pixel. How to do that with imagemagick or ruby? ANSWER: Image magick identify command using the options -verbose -alpha should print...
[ "ruby-on-rails", "ruby", "imagemagick" ]
0
1
258
1
0
2011-06-03T11:27:26.833000
2011-06-04T06:10:53.697000
6,226,538
6,226,653
How to increase the size of the title bar in an Android application?
How to increase the size of the title bar attached to the top of any screen in android
This is android title bar and you can not increase its size. It you need this feature in your application then you can create a custom title bar. Remove the this default Title bar by using this code in your activity.. getWindow().requestFeature(Window.FEATURE_NO_TITLE); or this in your manifast inside your activity tag...
How to increase the size of the title bar in an Android application? How to increase the size of the title bar attached to the top of any screen in android
TITLE: How to increase the size of the title bar in an Android application? QUESTION: How to increase the size of the title bar attached to the top of any screen in android ANSWER: This is android title bar and you can not increase its size. It you need this feature in your application then you can create a custom ti...
[ "android" ]
11
1
21,102
2
0
2011-06-03T11:28:29.973000
2011-06-03T11:41:15.440000
6,226,542
6,226,567
access button in jpanel
during the setup this function is called private JPanel Defer() { defer = new JPanel(); defer.setLayout(new BoxLayout(defer, BoxLayout.Y_AXIS)); JButton deferB = new JButton("Defer Staff Key Cutting"); Color col = colour.getColour("White"); deferB.setBackground(col); deferB.setActionCommand(def); deferB.addActionListen...
Inside the action Listener, you got to call the.getSource() method. This method returns object, so you got to cast it. Or make it a private instance variable. Then you can access it anywhere. (JButton)event.getSource(); From what i can tell from your code, the class your working in is an action listener. Which means in...
access button in jpanel during the setup this function is called private JPanel Defer() { defer = new JPanel(); defer.setLayout(new BoxLayout(defer, BoxLayout.Y_AXIS)); JButton deferB = new JButton("Defer Staff Key Cutting"); Color col = colour.getColour("White"); deferB.setBackground(col); deferB.setActionCommand(def)...
TITLE: access button in jpanel QUESTION: during the setup this function is called private JPanel Defer() { defer = new JPanel(); defer.setLayout(new BoxLayout(defer, BoxLayout.Y_AXIS)); JButton deferB = new JButton("Defer Staff Key Cutting"); Color col = colour.getColour("White"); deferB.setBackground(col); deferB.set...
[ "java", "swing" ]
0
4
2,070
3
0
2011-06-03T11:28:51.040000
2011-06-03T11:31:28.990000
6,226,544
6,279,947
OnTouchEvent missing View parameter in Monodroid
Why OnTouchEvent in Mono for Android doesn't have the View argument OnTouch has in Android for Java? How can I get the view that's firing the event? I'm trying to do something as the drag and zooming examples here. Thanks in advance.
The method you're looking at is Activity.OnTouchEvent which looks the same as it does in Java. The example you're looking at is actually using the OnTouchListener.onTouch method, which in Mono For Android maps to IOnTouchListener.OnTouch. A basic class definition that implemented this inferface would look something lik...
OnTouchEvent missing View parameter in Monodroid Why OnTouchEvent in Mono for Android doesn't have the View argument OnTouch has in Android for Java? How can I get the view that's firing the event? I'm trying to do something as the drag and zooming examples here. Thanks in advance.
TITLE: OnTouchEvent missing View parameter in Monodroid QUESTION: Why OnTouchEvent in Mono for Android doesn't have the View argument OnTouch has in Android for Java? How can I get the view that's firing the event? I'm trying to do something as the drag and zooming examples here. Thanks in advance. ANSWER: The method...
[ "android", "xamarin.android", "touch-event" ]
0
3
1,342
1
0
2011-06-03T11:28:55.237000
2011-06-08T14:02:13.100000
6,226,546
6,230,220
ElasticSearch mapping doesn't work
I'm trying to set up an ElasticSearch index with different analyzers for the individual fields. However, I can't seem to find a way to set field-specific analyzers; here's how I create my (test) index: curl -XPOST localhost:9200/twitter curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d ' { "tweet": { "proper...
To use a field-specific analyzer you need to specify this field in the query. Otherwise, default analyzer is used. Try curl -XGET 'localhost:9200/twitter/_search?q=message:fight' or curl -XGET 'localhost:9200/twitter/_search?df=message&q=looking'
ElasticSearch mapping doesn't work I'm trying to set up an ElasticSearch index with different analyzers for the individual fields. However, I can't seem to find a way to set field-specific analyzers; here's how I create my (test) index: curl -XPOST localhost:9200/twitter curl -XPUT 'http://localhost:9200/twitter/tweet/...
TITLE: ElasticSearch mapping doesn't work QUESTION: I'm trying to set up an ElasticSearch index with different analyzers for the individual fields. However, I can't seem to find a way to set field-specific analyzers; here's how I create my (test) index: curl -XPOST localhost:9200/twitter curl -XPUT 'http://localhost:9...
[ "elasticsearch" ]
9
11
7,731
2
0
2011-06-03T11:29:07.370000
2011-06-03T16:58:08.333000
6,226,550
6,226,634
how to create an id number that look like this: 00001...00002....?
I need to create several id's for several structs. Now I want that each id will start from 00001 to 99999 for example: the id of the first struct is 00001 the id of the second struct is 00002...and so on... Now I need to scanf it, and then printf it so the id that shown in the black window will look like this: The id o...
For a numerical variable, there is no concept of "leading zeroes". So if you want to use "0001" in your code, you will have to convert it into a string, adding leading 0's as required.
how to create an id number that look like this: 00001...00002....? I need to create several id's for several structs. Now I want that each id will start from 00001 to 99999 for example: the id of the first struct is 00001 the id of the second struct is 00002...and so on... Now I need to scanf it, and then printf it so ...
TITLE: how to create an id number that look like this: 00001...00002....? QUESTION: I need to create several id's for several structs. Now I want that each id will start from 00001 to 99999 for example: the id of the first struct is 00001 the id of the second struct is 00002...and so on... Now I need to scanf it, and ...
[ "c", "for-loop" ]
2
2
1,599
3
0
2011-06-03T11:29:29.880000
2011-06-03T11:39:04.083000
6,226,552
6,232,181
Does ACS support webrole based applications and STS
I have tried to look over the web but there are contradicting statements. Some of the posts from online forums say this is not being supported. Can anyone please confirm if ACS supports the scenario where the replying party application (and optionally the STS) is hosted in Azure cloud as a Webrole. If the answer is yes...
Yes, this is a supported scenario. Look here for samples: http://claimsid.codeplex.com The only special consideration for Windows Azure deployed apps relying on an STS (like ACS) is that the you will need to change the default cookie encryption mechanism for one that is "web farm friendly". This is very well documented...
Does ACS support webrole based applications and STS I have tried to look over the web but there are contradicting statements. Some of the posts from online forums say this is not being supported. Can anyone please confirm if ACS supports the scenario where the replying party application (and optionally the STS) is host...
TITLE: Does ACS support webrole based applications and STS QUESTION: I have tried to look over the web but there are contradicting statements. Some of the posts from online forums say this is not being supported. Can anyone please confirm if ACS supports the scenario where the replying party application (and optionall...
[ "azure", "webrole", "acs" ]
1
1
255
1
0
2011-06-03T11:29:45.780000
2011-06-03T20:15:48.120000
6,226,556
6,226,584
In MySQL add column with name CURDATE()?
I'd like to add a column to existing table in MySQL with name = the day the addition is performed. And I'd like this to happen within the database(i.e. without php,python,perl scripts) I tried this: SET @tmp_date = CURDATE(); ALTER TABLE my_report ADD @tmp_date INT(6); But query fails with error #1064 - You have an err...
set @query = concat("ALTER TABLE my_report ADD `", curdate(), "` INT(6)"); prepare stmt from @query; execute stmt;
In MySQL add column with name CURDATE()? I'd like to add a column to existing table in MySQL with name = the day the addition is performed. And I'd like this to happen within the database(i.e. without php,python,perl scripts) I tried this: SET @tmp_date = CURDATE(); ALTER TABLE my_report ADD @tmp_date INT(6); But query...
TITLE: In MySQL add column with name CURDATE()? QUESTION: I'd like to add a column to existing table in MySQL with name = the day the addition is performed. And I'd like this to happen within the database(i.e. without php,python,perl scripts) I tried this: SET @tmp_date = CURDATE(); ALTER TABLE my_report ADD @tmp_date...
[ "mysql", "sql", "mysql-error-1064" ]
1
1
1,563
2
0
2011-06-03T11:29:55.270000
2011-06-03T11:33:49.903000
6,226,587
6,226,794
Passing parameters with switches to a batch file
How do I display the value associated with switch A and switch B regardless of the order in which A and B was specified? Consider the following call to batch file ParamTest.cmd: C:\Paramtest.cmd \A valueA \B valueB Here's the contents of C:\Paramtest.cmd: ECHO Param1=%1 ECHO Param2=%2 ECHO Param3=%3 ECHO Param4=%4 Out...
In short, you need to define a loop and process the parameters in pairs. I typically process the parameter list using an approach that involves labels & GOTOs, as well as SHIFTs, basically like this: … SET ArgA= default for A SET ArgB= default for B:loop IF [%1] == [] GOTO continue IF [%1] == [/A] … IF [%1] == [/B] … S...
Passing parameters with switches to a batch file How do I display the value associated with switch A and switch B regardless of the order in which A and B was specified? Consider the following call to batch file ParamTest.cmd: C:\Paramtest.cmd \A valueA \B valueB Here's the contents of C:\Paramtest.cmd: ECHO Param1=%1 ...
TITLE: Passing parameters with switches to a batch file QUESTION: How do I display the value associated with switch A and switch B regardless of the order in which A and B was specified? Consider the following call to batch file ParamTest.cmd: C:\Paramtest.cmd \A valueA \B valueB Here's the contents of C:\Paramtest.cm...
[ "windows", "batch-file" ]
6
9
6,600
1
0
2011-06-03T11:34:02.580000
2011-06-03T11:55:38.187000
6,226,591
6,226,639
Another MVC routing problem
One day I'll understand routing but this is what I have: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{LicenceCode}", // URL with parameters new { control...
routes.MapRoute( "LicenceCode", "{LicenceCode}" new { controller = "Home", action = "Index", LicenceCode = UrlParameter.Optional } // Parameter defaults ); Then /1234 will route to the Index action of Home controller: public ActionResult Index(string licenceCode) {... }
Another MVC routing problem One day I'll understand routing but this is what I have: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{LicenceCode}", // URL w...
TITLE: Another MVC routing problem QUESTION: One day I'll understand routing but this is what I have: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{Licen...
[ "c#", "asp.net", "asp.net-mvc", "asp.net-mvc-3" ]
1
1
254
4
0
2011-06-03T11:34:26.890000
2011-06-03T11:40:11.027000
6,226,593
6,226,629
How better this can be written? PHP code
I am trying to generate final string to show users based on some conditions. $flag=0; $var='Please '; if($user->is_details_updated == 'N' && $user->needs_to_update_details == "Y") { $var='update your profile details'; $flag=1; } if ($flag ==1) { $var=' and '; } if($user->is_pass_changed == 'N' && $user->needs_to_update...
You can add messages to array and then join them with and $var = arrray() if($user->is_details_updated == 'N' && $user->needs_to_update_details == "Y") { $var[] ='update your profile details'; } if($user->is_pass_changed == 'N' && $user->needs_to_update_password == "Y") { $var[]='change password'; } echo join(" and ...
How better this can be written? PHP code I am trying to generate final string to show users based on some conditions. $flag=0; $var='Please '; if($user->is_details_updated == 'N' && $user->needs_to_update_details == "Y") { $var='update your profile details'; $flag=1; } if ($flag ==1) { $var=' and '; } if($user->is_pass...
TITLE: How better this can be written? PHP code QUESTION: I am trying to generate final string to show users based on some conditions. $flag=0; $var='Please '; if($user->is_details_updated == 'N' && $user->needs_to_update_details == "Y") { $var='update your profile details'; $flag=1; } if ($flag ==1) { $var=' and '; }...
[ "php", "if-statement", "conditional-statements" ]
2
6
114
3
0
2011-06-03T11:34:51.540000
2011-06-03T11:38:12.840000
6,226,594
6,226,711
array_map with str_replace
Is it possible to use array_map in conjunction with str_replace without calling another function to do the str_replace? For example: array_map(str_replace(' ', '-', XXXXX), $myArr);
There is no need for array_map. From the docs: "If subject is an array, then the search and replace is performed with every entry of subject, and the return value is an array as well."
array_map with str_replace Is it possible to use array_map in conjunction with str_replace without calling another function to do the str_replace? For example: array_map(str_replace(' ', '-', XXXXX), $myArr);
TITLE: array_map with str_replace QUESTION: Is it possible to use array_map in conjunction with str_replace without calling another function to do the str_replace? For example: array_map(str_replace(' ', '-', XXXXX), $myArr); ANSWER: There is no need for array_map. From the docs: "If subject is an array, then the sea...
[ "php", "str-replace", "array-map" ]
26
64
26,382
4
0
2011-06-03T11:34:58.780000
2011-06-03T11:47:59.993000
6,226,596
6,226,681
Testing Boolean in Actionscript for null
I have a Boolean variable in Actionscript 3. How can I check if it's undefined (not by being false) because false is a value or Boolean in Actionscript is FALSE by default >
In ActionScript, Boolean can have either true or false value only. If you don't specify any value, it is initialized to false by default. Edit: This behavior is different from Java's Boolean object type which is a wrapper over primitive boolean. See @Victor's comments below
Testing Boolean in Actionscript for null I have a Boolean variable in Actionscript 3. How can I check if it's undefined (not by being false) because false is a value or Boolean in Actionscript is FALSE by default >
TITLE: Testing Boolean in Actionscript for null QUESTION: I have a Boolean variable in Actionscript 3. How can I check if it's undefined (not by being false) because false is a value or Boolean in Actionscript is FALSE by default > ANSWER: In ActionScript, Boolean can have either true or false value only. If you don'...
[ "actionscript", "boolean" ]
7
8
4,419
2
0
2011-06-03T11:35:09.020000
2011-06-03T11:44:29.730000
6,226,597
6,227,355
openCV vs GIMP, edge detection fails in openCV
I am doing Sobel edge detection in openCV using the with following parameters: cv.Sobel(mat, edgemat, 1, 1) # mat -> source image # edgemat -> taget output image # 1 -> xorder (int) – Order of the derivative x # 1 -> yorder (int) – Order of the derivative y # apertureSize (int) – Size of the extended Sobel kernel -> it...
Simple answer: You are doing it wrong. See the documentation - what you are doing is computing the d^2/(dx dy) derivative of the image - that means "how do the horizontal edges change vertically" (or, equivalently, "how do the vertical edges change horizontally"), that means, for a vertical or horizontal edge you expec...
openCV vs GIMP, edge detection fails in openCV I am doing Sobel edge detection in openCV using the with following parameters: cv.Sobel(mat, edgemat, 1, 1) # mat -> source image # edgemat -> taget output image # 1 -> xorder (int) – Order of the derivative x # 1 -> yorder (int) – Order of the derivative y # apertureSize ...
TITLE: openCV vs GIMP, edge detection fails in openCV QUESTION: I am doing Sobel edge detection in openCV using the with following parameters: cv.Sobel(mat, edgemat, 1, 1) # mat -> source image # edgemat -> taget output image # 1 -> xorder (int) – Order of the derivative x # 1 -> yorder (int) – Order of the derivative...
[ "python", "opencv", "gimp", "edge-detection" ]
6
9
2,711
1
0
2011-06-03T11:35:18.877000
2011-06-03T12:55:03.240000
6,226,611
6,226,787
Whats will the html5 canvas actually be used for apart from paint type programs?
I know that html 5 canvas will allow for paint style image creating and manipulation, but what use does this really have? I just don't really understand all the hype when the practice use seems limited. Thanks
Oh! I would daresay that you haven't seen good HTML5 + CSS3 implementations. Check these wonders on Canvas. CSS3-Man Ball Droppings ( Bonus: View Source to see the wonderfully commented source code) And if that didn't leave you dumbstruck, check out the wonderful website http://www.chromeexperiments.com for pretty nift...
Whats will the html5 canvas actually be used for apart from paint type programs? I know that html 5 canvas will allow for paint style image creating and manipulation, but what use does this really have? I just don't really understand all the hype when the practice use seems limited. Thanks
TITLE: Whats will the html5 canvas actually be used for apart from paint type programs? QUESTION: I know that html 5 canvas will allow for paint style image creating and manipulation, but what use does this really have? I just don't really understand all the hype when the practice use seems limited. Thanks ANSWER: Oh...
[ "html", "canvas" ]
2
1
1,346
2
0
2011-06-03T11:36:55.007000
2011-06-03T11:54:56.343000
6,226,623
6,226,730
jQuery .after won't insert <body> element
Why doesn't this work? var newbody = " hello "; $("body").remove(); $("head").after(newbody); All i get after that is: hello How can i get it to stop dropping the body tags?
This is because of how jQuery's HTML insertion functions work with before() and after(). IIRC, they create a temporary element and set the innerHTML of the newly created element, before transferring the elements to where they're supposed to be. Since the tag can only be a child of the element, the major browsers remove...
jQuery .after won't insert <body> element Why doesn't this work? var newbody = " hello "; $("body").remove(); $("head").after(newbody); All i get after that is: hello How can i get it to stop dropping the body tags?
TITLE: jQuery .after won't insert <body> element QUESTION: Why doesn't this work? var newbody = " hello "; $("body").remove(); $("head").after(newbody); All i get after that is: hello How can i get it to stop dropping the body tags? ANSWER: This is because of how jQuery's HTML insertion functions work with before() ...
[ "jquery" ]
3
5
2,699
3
0
2011-06-03T11:37:44.100000
2011-06-03T11:49:31.493000
6,226,626
6,226,667
C++ stl list two structures cross-reference
I have such code with 2 structures: #include using namespace std; struct Connection; struct User; typedef list Connections; typedef list Users; struct User { Connections::iterator connection; }; struct Connection { Users::iterator user; }; But when I try to compile it, the compiler (C++ Builder XE) return me such e...
You're using incomplete type as type argument to std::list which invokes undefined bevahior according to the C++ Standard. §17​.4.3.6/2 says, In particular, the effects are undefined in the following cases: — if an incomplete type (3.9) is used as a template argument when instantiating a template component. So one solu...
C++ stl list two structures cross-reference I have such code with 2 structures: #include using namespace std; struct Connection; struct User; typedef list Connections; typedef list Users; struct User { Connections::iterator connection; }; struct Connection { Users::iterator user; }; But when I try to compile it, th...
TITLE: C++ stl list two structures cross-reference QUESTION: I have such code with 2 structures: #include using namespace std; struct Connection; struct User; typedef list Connections; typedef list Users; struct User { Connections::iterator connection; }; struct Connection { Users::iterator user; }; But when I try...
[ "c++", "list", "stl", "struct", "cross-reference" ]
3
3
1,587
2
0
2011-06-03T11:37:53.070000
2011-06-03T11:42:46.547000
6,226,627
6,226,836
Splitting the String with arithmetic operators and functions in java
I need some guidance on how to split a string with arithmetic operators and functions in java for the example String is: "string1"+"String2" >= 10 * function1() / function2() operators may be: + - * / ** / % / ( ) =!= > < <= >= After Split I need the output like: array[0]=string1 array[1]=string2 array[2]=10 I need onl...
If you need a regex for extracting things inside the double quotes and numbers, then you can use this java code: public static void main(String[] args) { Pattern p = Pattern.compile("\"(\\w+)\"|\\b\\d+\\b"); Matcher m = p.matcher( "\"string1\"+\"String2\" >= 10 * function1() / function2()"); List parts = new ArrayList ...
Splitting the String with arithmetic operators and functions in java I need some guidance on how to split a string with arithmetic operators and functions in java for the example String is: "string1"+"String2" >= 10 * function1() / function2() operators may be: + - * / ** / % / ( ) =!= > < <= >= After Split I need the ...
TITLE: Splitting the String with arithmetic operators and functions in java QUESTION: I need some guidance on how to split a string with arithmetic operators and functions in java for the example String is: "string1"+"String2" >= 10 * function1() / function2() operators may be: + - * / ** / % / ( ) =!= > < <= >= After...
[ "java", "regex", "split" ]
0
1
2,430
3
0
2011-06-03T11:38:09.640000
2011-06-03T12:00:52.753000
6,226,641
6,262,442
post xmldata through webservice iphone problem
This is my xml NSString *Message = [NSString stringWithFormat: @" \n" " \n" " 1088 \n" " \n"]; NSURL *url = [NSURL URLWithString:@"http://bvd.vndsupport.com/_ws/api/categories/index.asp"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d"...
This code will work perfectly. the problem is webservice page
post xmldata through webservice iphone problem This is my xml NSString *Message = [NSString stringWithFormat: @" \n" " \n" " 1088 \n" " \n"]; NSURL *url = [NSURL URLWithString:@"http://bvd.vndsupport.com/_ws/api/categories/index.asp"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSStrin...
TITLE: post xmldata through webservice iphone problem QUESTION: This is my xml NSString *Message = [NSString stringWithFormat: @" \n" " \n" " 1088 \n" " \n"]; NSURL *url = [NSURL URLWithString:@"http://bvd.vndsupport.com/_ws/api/categories/index.asp"]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWit...
[ "iphone", "objective-c" ]
0
1
676
2
0
2011-06-03T11:40:11.647000
2011-06-07T08:21:12.563000
6,226,669
6,226,755
Populate parent instance
I have a parent class, like this: public abstract class Business: IBusiness where T: Entity { protected Data data; public IEnumerable Select(DataContext db) { return data.Select(db); } } And I need to populate the instance of the "data" member on the child clas. At the moment I'm doing this: public class UserBusiness:...
create an abstract constructor: public abstract class Business: IBusiness where T: Entity { protected Data data; Business ( T _data) { data = _data } public IEnumerable Select(DataContext db) { return data.Select(db); } } Then call it in the derived constructor: public class UserBusiness: Business { public UserBusines...
Populate parent instance I have a parent class, like this: public abstract class Business: IBusiness where T: Entity { protected Data data; public IEnumerable Select(DataContext db) { return data.Select(db); } } And I need to populate the instance of the "data" member on the child clas. At the moment I'm doing this: p...
TITLE: Populate parent instance QUESTION: I have a parent class, like this: public abstract class Business: IBusiness where T: Entity { protected Data data; public IEnumerable Select(DataContext db) { return data.Select(db); } } And I need to populate the instance of the "data" member on the child clas. At the moment...
[ "c#", "oop" ]
0
2
140
1
0
2011-06-03T11:43:23.397000
2011-06-03T11:52:01.913000
6,226,678
6,238,907
Browser compatible code which take values from hidden field and pass it through query string on to other page
Right now I am using this code on client side. function winChangeOption() { window.open("../Reports/AdjustedPrincipal_Filter.aspx?schemeid=" + document.getElementById("hfSchemeID").value + "&PropertyRefID=" + document.getElementById("hfPropertyRefID").value + "&DatePart=" + document.getElementById("hfDatePart").value,"...
I don't know if it's your problem or not, but it looks like you need a semicolon before window.close(); Also, I would recommend changing your code like so: function winChangeOption() { var hfSchemID = document.getElementById("hfSchemeID").value; var hfPropertyRefID = document.getElementById("hfPropertyRefID").value; va...
Browser compatible code which take values from hidden field and pass it through query string on to other page Right now I am using this code on client side. function winChangeOption() { window.open("../Reports/AdjustedPrincipal_Filter.aspx?schemeid=" + document.getElementById("hfSchemeID").value + "&PropertyRefID=" + d...
TITLE: Browser compatible code which take values from hidden field and pass it through query string on to other page QUESTION: Right now I am using this code on client side. function winChangeOption() { window.open("../Reports/AdjustedPrincipal_Filter.aspx?schemeid=" + document.getElementById("hfSchemeID").value + "&P...
[ "vb.net" ]
0
0
387
1
0
2011-06-03T11:44:17.690000
2011-06-04T19:28:39.997000
6,226,685
6,226,718
Regular Expression - Start with 3538 and then contain 8 digits
E.g. match 353812345678 So far I have ^3538{1}[\d]{8} which works but does not restrict the length. How do I make sure the length is only a maximum of 12 digits?
Add a dollar sign ($) at the end of the regex: ^3538{1}[\d]{8}$
Regular Expression - Start with 3538 and then contain 8 digits E.g. match 353812345678 So far I have ^3538{1}[\d]{8} which works but does not restrict the length. How do I make sure the length is only a maximum of 12 digits?
TITLE: Regular Expression - Start with 3538 and then contain 8 digits QUESTION: E.g. match 353812345678 So far I have ^3538{1}[\d]{8} which works but does not restrict the length. How do I make sure the length is only a maximum of 12 digits? ANSWER: Add a dollar sign ($) at the end of the regex: ^3538{1}[\d]{8}$
[ "regex" ]
0
0
1,313
3
0
2011-06-03T11:44:47.123000
2011-06-03T11:48:39.963000
6,226,690
6,227,078
Creating a variable on database to hold global stats
Let's pretend I've got a social network. I'm always showing to the user how many users are registered and have activated their profile. So, everytime a single user logs in, it goes to DB and make a: select count(*) from users where status = 'activated' so if 5.000 users logs in, or simply refreshes the page, it will ma...
You could use an indexed view, that SQL Server will automatically maintain: create table dbo.users ( ID int not null, Activated bit not null ) go create view dbo.user_status_stats (Activated,user_count) with schemabinding as select Activated,COUNT_BIG(*) from dbo.users group by Activated go create unique clustered inde...
Creating a variable on database to hold global stats Let's pretend I've got a social network. I'm always showing to the user how many users are registered and have activated their profile. So, everytime a single user logs in, it goes to DB and make a: select count(*) from users where status = 'activated' so if 5.000 us...
TITLE: Creating a variable on database to hold global stats QUESTION: Let's pretend I've got a social network. I'm always showing to the user how many users are registered and have activated their profile. So, everytime a single user logs in, it goes to DB and make a: select count(*) from users where status = 'activat...
[ "sql", "sql-server", "sql-server-2005", "variables" ]
5
2
199
5
0
2011-06-03T11:45:14.067000
2011-06-03T12:26:28.590000
6,226,691
6,226,708
flash z-index problem
I'd like to change order flash swf and popupwindow. if the popupwindow opens. flash swf overlayed on popupwindow how can I solve this problem. I've found a solution about wmode. but some blog said wmode is so danger.
setting the wmode to opaque or transparent is your only option to get it to respect the z-order of your html. this has some drawbacks as you've noticed, but it's all a tradeoff, the other option is to rearrange your gui so this won't happen.
flash z-index problem I'd like to change order flash swf and popupwindow. if the popupwindow opens. flash swf overlayed on popupwindow how can I solve this problem. I've found a solution about wmode. but some blog said wmode is so danger.
TITLE: flash z-index problem QUESTION: I'd like to change order flash swf and popupwindow. if the popupwindow opens. flash swf overlayed on popupwindow how can I solve this problem. I've found a solution about wmode. but some blog said wmode is so danger. ANSWER: setting the wmode to opaque or transparent is your onl...
[ "flash", "z-index", "wmode" ]
0
2
2,205
1
0
2011-06-03T11:45:21.037000
2011-06-03T11:47:41.117000
6,226,692
6,226,714
IEnumerable<string> and string[]
Is there any advantage to using this private static IEnumerable GetColumnNames(this IDataReader reader) { for (int i = 0; i < reader.FieldCount; i++) yield return reader.GetName(i); } instead of this private static string[] GetColumnNames(this IDataReader reader) { var columnNames = new string[reader.FieldCount]; for ...
The two approaches are quite different so it depends on what you are subsequently going to do with the result I would say. For example: The first case requires the data reader to remain open until the result is read, the second doesn't. So how long are you going to hold this result for and do you want to leave the data...
IEnumerable<string> and string[] Is there any advantage to using this private static IEnumerable GetColumnNames(this IDataReader reader) { for (int i = 0; i < reader.FieldCount; i++) yield return reader.GetName(i); } instead of this private static string[] GetColumnNames(this IDataReader reader) { var columnNames = ne...
TITLE: IEnumerable<string> and string[] QUESTION: Is there any advantage to using this private static IEnumerable GetColumnNames(this IDataReader reader) { for (int i = 0; i < reader.FieldCount; i++) yield return reader.GetName(i); } instead of this private static string[] GetColumnNames(this IDataReader reader) { va...
[ "c#", ".net-4.0" ]
4
6
844
4
0
2011-06-03T11:45:28.387000
2011-06-03T11:48:12.303000
6,226,698
6,226,729
How to write js function return innerHTML?
I am trying to convert emoticon codes into emoticon images. I want to write it within a function. Here is original code without function yet: $.get("showMsgLive.php?username=" + str + "&servertime=" + servertime + "&usertime=" + usertime + "&lastmsgID=" + lastmsgid, function(newitems){ newitems = newitems.replace(/\(sm...
newitems.innerHTML = newitems; should not even work as newitems is a string and not an HTML element. I think all you have to do is: api.getContentPane().append(convertTextEmo(newitems)); Another tip to improve your code: As the image names of are the same as identifiers in the text, you could just create an array of na...
How to write js function return innerHTML? I am trying to convert emoticon codes into emoticon images. I want to write it within a function. Here is original code without function yet: $.get("showMsgLive.php?username=" + str + "&servertime=" + servertime + "&usertime=" + usertime + "&lastmsgID=" + lastmsgid, function(n...
TITLE: How to write js function return innerHTML? QUESTION: I am trying to convert emoticon codes into emoticon images. I want to write it within a function. Here is original code without function yet: $.get("showMsgLive.php?username=" + str + "&servertime=" + servertime + "&usertime=" + usertime + "&lastmsgID=" + las...
[ "javascript", "jquery" ]
2
3
674
2
0
2011-06-03T11:46:05.660000
2011-06-03T11:49:29.963000
6,226,699
6,226,710
how to make text view clickable in android?
is it possible in android to make text view clickable if yes then how??and if not then what will be the way for make a label clickable??i want to implement a call activity using this private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse("tel:"+keywordxmlparsing.pho...
textView.setOnClickListener(new View.OnClickListener()); Have you tried this?
how to make text view clickable in android? is it possible in android to make text view clickable if yes then how??and if not then what will be the way for make a label clickable??i want to implement a call activity using this private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.se...
TITLE: how to make text view clickable in android? QUESTION: is it possible in android to make text view clickable if yes then how??and if not then what will be the way for make a label clickable??i want to implement a call activity using this private void call() { try { Intent callIntent = new Intent(Intent.ACTION_CA...
[ "android" ]
30
52
102,814
11
0
2011-06-03T11:46:08.093000
2011-06-03T11:47:45.843000
6,226,702
6,226,743
How to create and set values for attribute in XML?
How to create and set values for attribute in XML? I need to set ateam id="101"? With this I listed my code. By using createAttribute i created but i dont know how to set value for that attribute.. /* create XML Content */ $domtree = new DOMDocument('1.0', 'UTF-8'); $xmlRoot = $domtree->createElement("xml"); $xmlRoot =...
The easiest way is using setAttribute: $v->setAttribute('id', 101);
How to create and set values for attribute in XML? How to create and set values for attribute in XML? I need to set ateam id="101"? With this I listed my code. By using createAttribute i created but i dont know how to set value for that attribute.. /* create XML Content */ $domtree = new DOMDocument('1.0', 'UTF-8'); $x...
TITLE: How to create and set values for attribute in XML? QUESTION: How to create and set values for attribute in XML? I need to set ateam id="101"? With this I listed my code. By using createAttribute i created but i dont know how to set value for that attribute.. /* create XML Content */ $domtree = new DOMDocument('...
[ "php", "xml", "dom" ]
6
9
10,688
1
0
2011-06-03T11:46:21.367000
2011-06-03T11:50:32.400000
6,226,716
6,234,865
Why do I get "Unable to start service Intent"?
I'm trying get some licensing code from AndroidPit.com working, but I get "Unable to start service Intent". Basically my code looks like this: Intent licenseIntent = new Intent("de.androidpit.app.services.ILicenseService"); if (mContext.bindService(licenseIntent, this, Context.BIND_AUTO_CREATE)) { // success } else { /...
The solution in my case was to start a server part on my phone (AppCenter from AndroidPit.com in this case). No entries in AndroidManifest are necessary for the client application.
Why do I get "Unable to start service Intent"? I'm trying get some licensing code from AndroidPit.com working, but I get "Unable to start service Intent". Basically my code looks like this: Intent licenseIntent = new Intent("de.androidpit.app.services.ILicenseService"); if (mContext.bindService(licenseIntent, this, Con...
TITLE: Why do I get "Unable to start service Intent"? QUESTION: I'm trying get some licensing code from AndroidPit.com working, but I get "Unable to start service Intent". Basically my code looks like this: Intent licenseIntent = new Intent("de.androidpit.app.services.ILicenseService"); if (mContext.bindService(licens...
[ "java", "android", "service", "android-intent" ]
0
0
1,101
2
0
2011-06-03T11:48:25.630000
2011-06-04T05:13:26.850000
6,226,722
6,227,057
Android XML Reading
I have xml file under res/xml/hi.xml when i use the below code it reads only the id element but i want to read the content of the xml tag not the id value while (eventType!= XmlPullParser.END_DOCUMENT) //Keep going until end of xml document { if (eventType == XmlPullParser.START_DOCUMENT) { Log.d("abhayxxxxx", myxml.ge...
I think problem is here in getAttributeValue() function: if (NodeValue.equalsIgnoreCase("author")) { Log.d("abhayxxxx","Reading data" + myxml.getAttributeValue(0)); } As you are using getAttributeValue(0), it will return the value of attribute of a tag, not the node value as you want. To get the node value use nextTe...
Android XML Reading I have xml file under res/xml/hi.xml when i use the below code it reads only the id element but i want to read the content of the xml tag not the id value while (eventType!= XmlPullParser.END_DOCUMENT) //Keep going until end of xml document { if (eventType == XmlPullParser.START_DOCUMENT) { Log.d("a...
TITLE: Android XML Reading QUESTION: I have xml file under res/xml/hi.xml when i use the below code it reads only the id element but i want to read the content of the xml tag not the id value while (eventType!= XmlPullParser.END_DOCUMENT) //Keep going until end of xml document { if (eventType == XmlPullParser.START_DO...
[ "android", "xml", "parsing" ]
0
1
756
1
0
2011-06-03T11:48:48.813000
2011-06-03T12:23:53.507000
6,226,723
6,226,839
Jquery Form - show/hide/stay visible on writing on input area
I have researched this for about 3 days non-stop and I'm starting to feel real despair. Also I have to say that I'm quite a newbie with JQuery, I only do small things now and then. So, here's the thing: I have this search form (in Wordpress). I want it to be hidden at the start. On mouse over menu link, it hides link a...
Use Ben Alman's code snippet - https://gist.github.com/450017 jQuery.expr[':'].focus = function( elem ) { return elem === document.activeElement && ( elem.type || elem.href ); }; Then you can do the following: jQuery(".buscar").mouseleave(function(){ if($('#toggle-search input:focus').length == 0) { jQuery('#toggle-sea...
Jquery Form - show/hide/stay visible on writing on input area I have researched this for about 3 days non-stop and I'm starting to feel real despair. Also I have to say that I'm quite a newbie with JQuery, I only do small things now and then. So, here's the thing: I have this search form (in Wordpress). I want it to be...
TITLE: Jquery Form - show/hide/stay visible on writing on input area QUESTION: I have researched this for about 3 days non-stop and I'm starting to feel real despair. Also I have to say that I'm quite a newbie with JQuery, I only do small things now and then. So, here's the thing: I have this search form (in Wordpress...
[ "jquery", "forms", "hover", "hide", "show" ]
1
2
2,196
2
0
2011-06-03T11:48:49.277000
2011-06-03T12:01:19.553000
6,226,728
6,226,758
jQuery live not updating button value on success
okay, here's the situation: //similarly multiple links when user clicks on any link, it's id is passed as a GET variable by an AJAX request. Upon success, another gets filled up with a list of buttons that have some values written on them. When the user clicks on the buttons, he can change the value written on the butt...
$this.html(json.update); instead of $(this).val(json.update);
jQuery live not updating button value on success okay, here's the situation: //similarly multiple links when user clicks on any link, it's id is passed as a GET variable by an AJAX request. Upon success, another gets filled up with a list of buttons that have some values written on them. When the user clicks on the but...
TITLE: jQuery live not updating button value on success QUESTION: okay, here's the situation: //similarly multiple links when user clicks on any link, it's id is passed as a GET variable by an AJAX request. Upon success, another gets filled up with a list of buttons that have some values written on them. When the user...
[ "jquery", "ajax" ]
0
1
604
1
0
2011-06-03T11:49:17.980000
2011-06-03T11:52:06.593000
6,226,736
6,226,767
How to call a PHP page uri from Bash on a local nginx server
I have a php page that runs on a local uri on a local nginx server. It is called like this: http://example.dev/index.php?v=var Is it possible to call this php page from inside a Bash script in order to make it run just like I do by typing the uri in Firefox? I tryed to access the script directly in cli: php /home/publi...
Try GNU Wget wget http://example.dev/index.php?v=var or cURL curl http://example.dev/index.php?v=var to run it like a browser would. Note: But this is not CLI in any way.
How to call a PHP page uri from Bash on a local nginx server I have a php page that runs on a local uri on a local nginx server. It is called like this: http://example.dev/index.php?v=var Is it possible to call this php page from inside a Bash script in order to make it run just like I do by typing the uri in Firefox? ...
TITLE: How to call a PHP page uri from Bash on a local nginx server QUESTION: I have a php page that runs on a local uri on a local nginx server. It is called like this: http://example.dev/index.php?v=var Is it possible to call this php page from inside a Bash script in order to make it run just like I do by typing th...
[ "bash", "command-line-interface", "php" ]
0
3
927
3
0
2011-06-03T11:50:00.447000
2011-06-03T11:52:48.153000
6,226,739
6,226,880
Is there a way to rename the android program shortcut on desktop?
In some modified version(for example, CM7), you can long press the shortcut to rename it. But CM7 have some bugs now. I would like to know is there a way I can do that? modify the database, change the programs code or resources is OK. Thanks.
You need to change AndroidManifest.xml file. You should find the activity that is launched by this icon and change android:label value there. This will change the icon name in Application Launcher and on Home Screen. It should looks something like this: The activity definition in AndroidManifest.xml should contain MAIN...
Is there a way to rename the android program shortcut on desktop? In some modified version(for example, CM7), you can long press the shortcut to rename it. But CM7 have some bugs now. I would like to know is there a way I can do that? modify the database, change the programs code or resources is OK. Thanks.
TITLE: Is there a way to rename the android program shortcut on desktop? QUESTION: In some modified version(for example, CM7), you can long press the shortcut to rename it. But CM7 have some bugs now. I would like to know is there a way I can do that? modify the database, change the programs code or resources is OK. T...
[ "android" ]
1
3
1,266
1
0
2011-06-03T11:50:04.827000
2011-06-03T12:06:27.633000
6,226,742
6,227,457
grouping / formatting `group` with `tags` with mysql or php
lets say we have an array like this from a mysql function like function getGroups($limit = 10) { $data = $this->fetchAll ( 'SELECT gid, `group`, information, tag FROM groups GROUP BY tag LIMIT '. $limit ); return $data; } Resulting array 0 => array 'gid' => string '6' (length=1) 'group' => string 'Media' (length=5) 'ta...
Are you trying to get a list of groups, plus all the tags for each group? GROUP_CONCAT() is the right way to get the tag list but you want to be grouping by group, not by tag: function getGroups($limit = 10) { $data = (array) $this->fetchAll ( 'SELECT `group`, GROUP_CONCAT(DISTINCT `tag` ORDER BY `tag`) AS `tags` FROM ...
grouping / formatting `group` with `tags` with mysql or php lets say we have an array like this from a mysql function like function getGroups($limit = 10) { $data = $this->fetchAll ( 'SELECT gid, `group`, information, tag FROM groups GROUP BY tag LIMIT '. $limit ); return $data; } Resulting array 0 => array 'gid' => st...
TITLE: grouping / formatting `group` with `tags` with mysql or php QUESTION: lets say we have an array like this from a mysql function like function getGroups($limit = 10) { $data = $this->fetchAll ( 'SELECT gid, `group`, information, tag FROM groups GROUP BY tag LIMIT '. $limit ); return $data; } Resulting array 0 =>...
[ "php", "mysql", "arrays", "formatting" ]
3
1
444
3
0
2011-06-03T11:50:24.303000
2011-06-03T13:05:37.747000
6,226,762
6,226,801
Jquery Mouseover - e is not defined
I built my own Jquery tooltip function, it worked for 3 months really good, but now (I don't know why) I get an error: "e is not defined" Can anybody tell me why? Example at jsFiddle.
You define your code to use variable event to receive the event object: $('.tip').live('mouseenter mousemove mouseleave', function(event) { You initially use the event variable: if (event.type == 'mouseenter') { However you then change to using the variable e: var sc_w = e.pageX + 100; Unsurprisingly, this doesn't work...
Jquery Mouseover - e is not defined I built my own Jquery tooltip function, it worked for 3 months really good, but now (I don't know why) I get an error: "e is not defined" Can anybody tell me why? Example at jsFiddle.
TITLE: Jquery Mouseover - e is not defined QUESTION: I built my own Jquery tooltip function, it worked for 3 months really good, but now (I don't know why) I get an error: "e is not defined" Can anybody tell me why? Example at jsFiddle. ANSWER: You define your code to use variable event to receive the event object: $...
[ "jquery", "mouseover" ]
1
3
2,293
2
0
2011-06-03T11:52:19.827000
2011-06-03T11:56:38.313000
6,226,784
6,226,887
How to refactor multiple complex if-else branches
This problem is for a piece of software that is use by companies that organise activities. When an activity is changed (status, starting time, number of persons), some people need to be notified of this (by e-mail). The code that is responsible for this started out very simple: the body of the e-mail contained all the ...
Sounds like something a rules engine could help with. Drools is one option, but it's almost certainly complete overkill! Do you have an interface representing a rule? Something like public class Activity {} public interface Rule { boolean applies(Activity); Activity applyRule(Activity x); } Given this, you could impl...
How to refactor multiple complex if-else branches This problem is for a piece of software that is use by companies that organise activities. When an activity is changed (status, starting time, number of persons), some people need to be notified of this (by e-mail). The code that is responsible for this started out very...
TITLE: How to refactor multiple complex if-else branches QUESTION: This problem is for a piece of software that is use by companies that organise activities. When an activity is changed (status, starting time, number of persons), some people need to be notified of this (by e-mail). The code that is responsible for thi...
[ "refactoring", "structure", "if-statement" ]
3
4
548
2
0
2011-06-03T11:54:31.053000
2011-06-03T12:07:27.417000
6,226,792
6,226,813
How can instance of interface access method of Object class?
interface Intf { } class A implements Intf { } class Test { public static void main(String[] args) { Intf obj = new A(); obj.toString(); } } A friend had shown me this code, I could not explain it to him... We know that methods defined in 'referred' object can only be run on an instance. As we can see no method is de...
As we can see no method is defined by Intf Actually, there is an implicitly declared toString method in Intf. Every interface (that doesn't explicitly extend another interface) has an implicit method declaration for each public method in Object. This is explained in detail in the Java Language Specification, § 9.2 Inte...
How can instance of interface access method of Object class? interface Intf { } class A implements Intf { } class Test { public static void main(String[] args) { Intf obj = new A(); obj.toString(); } } A friend had shown me this code, I could not explain it to him... We know that methods defined in 'referred' object ...
TITLE: How can instance of interface access method of Object class? QUESTION: interface Intf { } class A implements Intf { } class Test { public static void main(String[] args) { Intf obj = new A(); obj.toString(); } } A friend had shown me this code, I could not explain it to him... We know that methods defined in ...
[ "java" ]
5
11
5,384
7
0
2011-06-03T11:55:34.297000
2011-06-03T11:57:58.153000
6,226,796
6,226,893
Prevent operational risk with SQL-dependent architecture
I am currently working on a very critical tool, which has a strong dependency to a MySQL database. This particularly means that if the SQL server goes down some day, all users won't be able to use the application, since it is retrieving their configuration stored in database and launches components defined in DB, and a...
It's not the app's responsibility to implement fail-safe SQL backend. The app should check wheter the SQL server is running, and if not, it may retry the last SQL statement for a while, and print out a sad message in red if failed. If there are more SQL servers (hotswap or something), the app may switch automatically b...
Prevent operational risk with SQL-dependent architecture I am currently working on a very critical tool, which has a strong dependency to a MySQL database. This particularly means that if the SQL server goes down some day, all users won't be able to use the application, since it is retrieving their configuration stored...
TITLE: Prevent operational risk with SQL-dependent architecture QUESTION: I am currently working on a very critical tool, which has a strong dependency to a MySQL database. This particularly means that if the SQL server goes down some day, all users won't be able to use the application, since it is retrieving their co...
[ "mysql", "sql" ]
0
1
155
1
0
2011-06-03T11:55:43.603000
2011-06-03T12:08:26.400000
6,226,799
6,227,173
What is wrong with this procedure?
I am writing a small procedure. I have a cursor called c1, and a variable v_c1 that is declared like this: v_c1 c1%ROWTYPE. The cursor is fetched into it. The problem however is that the value extracted from the cursor is not a number. I'm really confused since it's a number in the table and it looks like a number when...
the problem is not when you compare numbers. It is on the next line - you try to assign a string containing comma (,) into a number variable v_co2_utslipp. You completely misguided me by the wrong "error" line:(.
What is wrong with this procedure? I am writing a small procedure. I have a cursor called c1, and a variable v_c1 that is declared like this: v_c1 c1%ROWTYPE. The cursor is fetched into it. The problem however is that the value extracted from the cursor is not a number. I'm really confused since it's a number in the ta...
TITLE: What is wrong with this procedure? QUESTION: I am writing a small procedure. I have a cursor called c1, and a variable v_c1 that is declared like this: v_c1 c1%ROWTYPE. The cursor is fetched into it. The problem however is that the value extracted from the cursor is not a number. I'm really confused since it's ...
[ "oracle", "plsql" ]
0
2
124
1
0
2011-06-03T11:56:27.373000
2011-06-03T12:37:25.370000
6,226,811
6,226,850
Problems with RedirectToAction MVC2 - Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult'
I am receiving this error when trying to use RedirectToAction, can anyone offer any advice on why this could be occuring, ive used this before without any problems, i must be missing something. Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult' [HttpPost] public ViewRes...
Try changing public ViewResult Edit(Customer customer) to public ActionResult Edit(Customer customer) ViewResult is derived from ActionResult and can only return Views. Since your code can return a View or a Redirect, you should use an ActionResult. See this answer for more information.
Problems with RedirectToAction MVC2 - Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult' I am receiving this error when trying to use RedirectToAction, can anyone offer any advice on why this could be occuring, ive used this before without any problems, i must be missin...
TITLE: Problems with RedirectToAction MVC2 - Cannot implicitly convert type 'System.Web.Mvc.RedirectToRouteResult' to 'System.Web.Mvc.ViewResult' QUESTION: I am receiving this error when trying to use RedirectToAction, can anyone offer any advice on why this could be occuring, ive used this before without any problems...
[ "asp.net", "asp.net-mvc-2", "redirecttoaction" ]
17
24
11,953
1
0
2011-06-03T11:57:49.880000
2011-06-03T12:02:27.623000
6,226,815
6,226,958
Exception while connecting android application with web service
This coding i got from here. I get error in log cat view like the one i mentioned after the coding.. please provide me some suggestion to clear this.. package com.example.firstws; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import org.ksoap2.SoapEnvelope; import org.ksoap2.se...
You can't do this TextView tv=(TextView)findViewById(R.id.textView1); before you call setContentView(). Since no layout has been set at the time of the class' initialization, it will fail. Move the assignment after your call to setContentView().
Exception while connecting android application with web service This coding i got from here. I get error in log cat view like the one i mentioned after the coding.. please provide me some suggestion to clear this.. package com.example.firstws; import android.app.Activity; import android.os.Bundle; import android.widge...
TITLE: Exception while connecting android application with web service QUESTION: This coding i got from here. I get error in log cat view like the one i mentioned after the coding.. please provide me some suggestion to clear this.. package com.example.firstws; import android.app.Activity; import android.os.Bundle; im...
[ "android" ]
0
1
738
1
0
2011-06-03T11:58:02.957000
2011-06-03T12:15:19.257000
6,226,832
6,227,170
WCF service hosting a C# generic class implementing generic Interface
I have a WCF service which exposes a Generic interface (and the service has a generic class implementing this interface). Then i try to host this service in a managed console app (just for testing purposes right now). The ThreadStart line results in error saying type for T not found. Now i cannot make Main generic by d...
When you host the service you cannot use open generics. You must specify concrete type to host concrete service. If you want to host services for more generic arguments you must indeed create a new host for each argument type and expose an endpoint with an unique address for each of them. Once the service is hosted it ...
WCF service hosting a C# generic class implementing generic Interface I have a WCF service which exposes a Generic interface (and the service has a generic class implementing this interface). Then i try to host this service in a managed console app (just for testing purposes right now). The ThreadStart line results in ...
TITLE: WCF service hosting a C# generic class implementing generic Interface QUESTION: I have a WCF service which exposes a Generic interface (and the service has a generic class implementing this interface). Then i try to host this service in a managed console app (just for testing purposes right now). The ThreadStar...
[ ".net", "wcf" ]
3
5
2,735
2
0
2011-06-03T12:00:09.163000
2011-06-03T12:37:08.587000
6,226,835
6,226,978
jquery UI add a second close anchor on modal dialog box
I am trying to add a second close button to my my UI modal box in addition to the close window text to the top right of my modal box. How can I do this? here is my code so far function showDialog(){ $("#example").dialog({ modal: true // Make the dialog "modal" (show an overlay beneath the dialog) }); return false; } He...
$("#second-anchor-id").click(function(){ $("#example").dialog("close"); return false; });
jquery UI add a second close anchor on modal dialog box I am trying to add a second close button to my my UI modal box in addition to the close window text to the top right of my modal box. How can I do this? here is my code so far function showDialog(){ $("#example").dialog({ modal: true // Make the dialog "modal" (sh...
TITLE: jquery UI add a second close anchor on modal dialog box QUESTION: I am trying to add a second close button to my my UI modal box in addition to the close window text to the top right of my modal box. How can I do this? here is my code so far function showDialog(){ $("#example").dialog({ modal: true // Make the ...
[ "jquery", "jquery-ui" ]
0
1
1,383
2
0
2011-06-03T12:00:21.367000
2011-06-03T12:17:27.873000
6,226,843
6,252,787
ASP MVC 3 - Ajax.BeginForm not submitting model
I have 2 partials on my main view, each uses an Ajax form with unobtrusive javascript enabled. The first partial works fine and will submit its model to the controller and everyone is happy. However the 2nd partial never sends over a model to the controller when submitting. They both are strongly typed partial views, a...
Found out for some unknown reason, the autobinder doesn't work... but UpdateModel(myModel); in the controller does work... so using that.
ASP MVC 3 - Ajax.BeginForm not submitting model I have 2 partials on my main view, each uses an Ajax form with unobtrusive javascript enabled. The first partial works fine and will submit its model to the controller and everyone is happy. However the 2nd partial never sends over a model to the controller when submittin...
TITLE: ASP MVC 3 - Ajax.BeginForm not submitting model QUESTION: I have 2 partials on my main view, each uses an Ajax form with unobtrusive javascript enabled. The first partial works fine and will submit its model to the controller and everyone is happy. However the 2nd partial never sends over a model to the control...
[ "asp.net-mvc-3" ]
0
0
937
1
0
2011-06-03T12:01:34.973000
2011-06-06T13:33:41.210000
6,226,852
6,227,325
Should I have FKs pointing to data that rarely changes, or just stick the data in directly?
Say that I have a few tables that never change, such as a 'State' (referring to U.S. states) or 'Country' table. If I then have a Customer table which stores information such as CustomerState, CustomerCountry, is it really necessary to store them as the FK to the respective table? The values are populated from forms th...
The design rule of thumb here is that if the set of values has low cardinality and its members are stable (though not necessarily immutable) then use a CHECK constraint (example: ISO 5218 sex codes ). Otherwise, use a look table with a foreign key. Note that some nation states (borders and names) are less stable than o...
Should I have FKs pointing to data that rarely changes, or just stick the data in directly? Say that I have a few tables that never change, such as a 'State' (referring to U.S. states) or 'Country' table. If I then have a Customer table which stores information such as CustomerState, CustomerCountry, is it really neces...
TITLE: Should I have FKs pointing to data that rarely changes, or just stick the data in directly? QUESTION: Say that I have a few tables that never change, such as a 'State' (referring to U.S. states) or 'Country' table. If I then have a Customer table which stores information such as CustomerState, CustomerCountry, ...
[ "sql" ]
6
4
157
8
0
2011-06-03T12:02:49.710000
2011-06-03T12:51:59.233000
6,226,853
6,226,870
Rewriting a GET URL
I'm using codeigniter to create a search page. I'd like to rewrite a GET url to work with CI. Example http://mysite.com/en/search?search=widgets becomes http://mysite.com/en/search/widgets I thought I could do this in the routes.php, but it doesn't seem to grab the stuff after the?. So now i'm thinking as a rewrite in....
You should use only the CI routing protocol. Anyway if you want to use.htaccess is this: RewriteEngine On RewriteRule ^en/search/([a-z]+) /en/search?search=$1 [L]
Rewriting a GET URL I'm using codeigniter to create a search page. I'd like to rewrite a GET url to work with CI. Example http://mysite.com/en/search?search=widgets becomes http://mysite.com/en/search/widgets I thought I could do this in the routes.php, but it doesn't seem to grab the stuff after the?. So now i'm think...
TITLE: Rewriting a GET URL QUESTION: I'm using codeigniter to create a search page. I'd like to rewrite a GET url to work with CI. Example http://mysite.com/en/search?search=widgets becomes http://mysite.com/en/search/widgets I thought I could do this in the routes.php, but it doesn't seem to grab the stuff after the?...
[ "php", ".htaccess", "codeigniter" ]
3
1
88
3
0
2011-06-03T12:03:19.380000
2011-06-03T12:05:23.587000
6,226,856
6,227,176
doctrine query runs slow why?
can any one help me out iam running a query using doctrine. i made indexing and foriegnkey reference for necessary tables here is my query echo "step1";echo date('h:i:s A');echo " "; $query = new Doctrine_Query(); $whereCond =''; $where='eng.id='.$campid; $select=''; $search = ''; /*if($queryv!=''){ $where.= " AND c."...
Your LIKE comparison is actually a "contains-substring" search when you put wildcard book-ends on the %search-term%. The typical advantages of a sorted index are not available on searches like this (because your wildcard says to ignore the characters at the start of the value); and so every value in the table (in the r...
doctrine query runs slow why? can any one help me out iam running a query using doctrine. i made indexing and foriegnkey reference for necessary tables here is my query echo "step1";echo date('h:i:s A');echo " "; $query = new Doctrine_Query(); $whereCond =''; $where='eng.id='.$campid; $select=''; $search = ''; /*if($qu...
TITLE: doctrine query runs slow why? QUESTION: can any one help me out iam running a query using doctrine. i made indexing and foriegnkey reference for necessary tables here is my query echo "step1";echo date('h:i:s A');echo " "; $query = new Doctrine_Query(); $whereCond =''; $where='eng.id='.$campid; $select=''; $sea...
[ "php", "mysql", "doctrine" ]
0
0
474
2
0
2011-06-03T12:03:33.440000
2011-06-03T12:38:01.943000
6,226,862
6,227,148
problem with removing UILabel from View
I have a UILabel in my view. I want to remove the UILabel if a certain function is being called. I have tried a couple of ways, but its not working! Codes tried: [[self.view viewWithTag:1] setHidden:YES]; or label.hidden=YES; or [label removeFromSuperview]; I have tried all of these codes, but to no avail. Cany anyone ...
is all that code in a single method? If yes.. you're creating new startLabel and startLabel2 and try to remove them in the else part of the code, but those are not the labels that you added as subviews. Make the labels as member of the class, and only alloc them once in the init/viewDidLoad method.
problem with removing UILabel from View I have a UILabel in my view. I want to remove the UILabel if a certain function is being called. I have tried a couple of ways, but its not working! Codes tried: [[self.view viewWithTag:1] setHidden:YES]; or label.hidden=YES; or [label removeFromSuperview]; I have tried all of th...
TITLE: problem with removing UILabel from View QUESTION: I have a UILabel in my view. I want to remove the UILabel if a certain function is being called. I have tried a couple of ways, but its not working! Codes tried: [[self.view viewWithTag:1] setHidden:YES]; or label.hidden=YES; or [label removeFromSuperview]; I ha...
[ "objective-c", "ios", "uilabel" ]
1
4
3,191
2
0
2011-06-03T12:04:10.410000
2011-06-03T12:34:15.213000
6,226,863
6,227,362
How to load dataset in a batch for ado.net
I have a large data in to table and i want to populate it remotely, when i start to fetch data, after some time connection get lost, and the action ends, pls help me to over come..!! regards, Akhil
You may be better off looking at using an ETL Tool. If you are using sql server, ssis may be an option. I've used Rhino ETL in the past to good success - http://ayende.com/blog/3102/rhino-etl-2-0 You can also search this forum or google for ETL Tools. That should give you various options. hope that helps....
How to load dataset in a batch for ado.net I have a large data in to table and i want to populate it remotely, when i start to fetch data, after some time connection get lost, and the action ends, pls help me to over come..!! regards, Akhil
TITLE: How to load dataset in a batch for ado.net QUESTION: I have a large data in to table and i want to populate it remotely, when i start to fetch data, after some time connection get lost, and the action ends, pls help me to over come..!! regards, Akhil ANSWER: You may be better off looking at using an ETL Tool. ...
[ "c#", "ado.net" ]
0
0
476
1
0
2011-06-03T12:04:19.553000
2011-06-03T12:55:30.660000
6,226,871
6,226,940
Unable to write to database
Hi there I developed an applicaiton that uses SQLlite database but after making setup project and installing it i get exceptions when writing to it System.Data.SQLite.SQLiteException: Attempt to write a read-only database what is the problem? it works fine while developing at visual studio EDIT I added user Everyone an...
In the link forum, the common root cause is permission issue. http://sqlite.phxsoftware.com/forums/p/864/7498.aspx Update Why not encrypt the sqlite database Encrypt SQLite database in C#
Unable to write to database Hi there I developed an applicaiton that uses SQLlite database but after making setup project and installing it i get exceptions when writing to it System.Data.SQLite.SQLiteException: Attempt to write a read-only database what is the problem? it works fine while developing at visual studio E...
TITLE: Unable to write to database QUESTION: Hi there I developed an applicaiton that uses SQLlite database but after making setup project and installing it i get exceptions when writing to it System.Data.SQLite.SQLiteException: Attempt to write a read-only database what is the problem? it works fine while developing ...
[ "c#", "winforms", "security", "sqlite", "readonly" ]
0
2
4,626
3
0
2011-06-03T12:05:38.870000
2011-06-03T12:13:22.930000
6,226,873
6,249,550
How do I access the service definition for a specific SharePoint list web service?
I have a problem accessing the web service?wsdl for SharePoint lists, although I can see the list of operations. For example, for the following URLS:://team/sites/test/_vti_bin/Lists.asmx - returns a list of operations://team/sites/test/_vti_bin/Lists.asmx?WSDL - returns the wsdl document://team/sites/test/Lists/TestLi...
I also asked this question on sharepoint.stackexchange.com and got confirmation that the WSDL exists at the Lists level rather than for individual list instances.
How do I access the service definition for a specific SharePoint list web service? I have a problem accessing the web service?wsdl for SharePoint lists, although I can see the list of operations. For example, for the following URLS:://team/sites/test/_vti_bin/Lists.asmx - returns a list of operations://team/sites/test/...
TITLE: How do I access the service definition for a specific SharePoint list web service? QUESTION: I have a problem accessing the web service?wsdl for SharePoint lists, although I can see the list of operations. For example, for the following URLS:://team/sites/test/_vti_bin/Lists.asmx - returns a list of operations:...
[ "sharepoint-2010" ]
1
0
11,135
2
0
2011-06-03T12:05:59.740000
2011-06-06T08:45:29.013000
6,226,881
6,227,045
PHP email attachments
I'm trying to send emails with multiple attachments. This is an example: $uid = md5(uniqid(time())); $header = "From: Test \r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: multipart/mixed; boundary=\"". $uid. "\"\r\n\r\n"; $header.= "--". $uid. "\r\n"; $header.= "Content-type:text/plain; charset=iso-8...
Some issues: There should be only one new line before a boundary. You have 2. You should have 2 dashes only after the last boundary. There are 2 places where Content-Transfer-Encoding needs to have a new line before. You may have forgotten to base64 encode your files. Your code looks like the result of some terrible co...
PHP email attachments I'm trying to send emails with multiple attachments. This is an example: $uid = md5(uniqid(time())); $header = "From: Test \r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: multipart/mixed; boundary=\"". $uid. "\"\r\n\r\n"; $header.= "--". $uid. "\r\n"; $header.= "Content-type:tex...
TITLE: PHP email attachments QUESTION: I'm trying to send emails with multiple attachments. This is an example: $uid = md5(uniqid(time())); $header = "From: Test \r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: multipart/mixed; boundary=\"". $uid. "\"\r\n\r\n"; $header.= "--". $uid. "\r\n"; $header.=...
[ "php", "email-attachments" ]
0
1
319
1
0
2011-06-03T12:06:57.103000
2011-06-03T12:22:40.573000
6,226,884
6,226,953
Set ECHO / TYPE output as a Variable in Batch Files
Is it possible to set the output of TYPE or ECHO as a variable in a batch file?
Convoluted, and it only works for a single line, but general: for /f "delims=" %%x in ('some command with output') do set "Var=%%x" For echo you don't need to do anything special, just change echo Foo into set Var=Foo And for files there is also the option of either set /p Var= or for /f "delims=" %%x in (file.txt) do ...
Set ECHO / TYPE output as a Variable in Batch Files Is it possible to set the output of TYPE or ECHO as a variable in a batch file?
TITLE: Set ECHO / TYPE output as a Variable in Batch Files QUESTION: Is it possible to set the output of TYPE or ECHO as a variable in a batch file? ANSWER: Convoluted, and it only works for a single line, but general: for /f "delims=" %%x in ('some command with output') do set "Var=%%x" For echo you don't need to do...
[ "windows", "batch-file" ]
1
4
19,733
1
0
2011-06-03T12:07:02.480000
2011-06-03T12:14:42.063000
6,226,894
6,226,977
How to split JavaScript code into multiple files and use them without including them via script tag in HTML?
I am making use of constructors (classes) extensively and would like each constructor to be in a separate file (something like Java). Suppose I have constructors say Class1, Class2,... Class10 and I only want to use Class1 and Class5 I need to use script tags to include Class1.js and Class2.js into the HTML page. Later...
You can use jQuery.getScript: http://api.jquery.com/jQuery.getScript Or any of the many javascript loaders like YUI, JSLoader, etc. See comparison here: https://spreadsheets.google.com/lv?key=tDdcrv9wNQRCNCRCflWxhYQ
How to split JavaScript code into multiple files and use them without including them via script tag in HTML? I am making use of constructors (classes) extensively and would like each constructor to be in a separate file (something like Java). Suppose I have constructors say Class1, Class2,... Class10 and I only want to...
TITLE: How to split JavaScript code into multiple files and use them without including them via script tag in HTML? QUESTION: I am making use of constructors (classes) extensively and would like each constructor to be in a separate file (something like Java). Suppose I have constructors say Class1, Class2,... Class10 ...
[ "javascript" ]
9
2
9,859
6
0
2011-06-03T12:08:27.217000
2011-06-03T12:17:26.880000
6,226,895
6,226,948
Consolidating multiple GET parameters into a single value
Im not really sure what im looking for but currently in my system i send a long url like this: $name=1&option=2&field=4.... And its quite long. So if i have a list of values like: name option field can i put them into a string in which i can break at certain points eg by a slash or whatever. And then encode the string ...
You could simply Base64-encode your data. $a = array('name' => '1', 'option' => '2', 'field' => '4'); $temp = json_encode($a); // convert array to string $data = base64_encode($temp); // encode string output: "eyJuYW1lIjoiMSIsIm9wdGlvbiI6IjIiLCJmaWVsZCI6IjQifQ==" To send this in an URL, you must encode it once more (li...
Consolidating multiple GET parameters into a single value Im not really sure what im looking for but currently in my system i send a long url like this: $name=1&option=2&field=4.... And its quite long. So if i have a list of values like: name option field can i put them into a string in which i can break at certain poi...
TITLE: Consolidating multiple GET parameters into a single value QUESTION: Im not really sure what im looking for but currently in my system i send a long url like this: $name=1&option=2&field=4.... And its quite long. So if i have a list of values like: name option field can i put them into a string in which i can br...
[ "php", "paypal-ipn" ]
1
1
206
4
0
2011-06-03T12:08:47.430000
2011-06-03T12:14:22.590000
6,226,897
6,227,332
Replicate class with main method as in Java IDE within Objective-C and Xcode 4
I have a simple question. Coming from a java background and having worked extensively with eclipse, netbeans or any other java IDE, is quite nice to have the possibility to add a main method to a class and execute it within the IDE, with just a click, and see the output. I was looking for the same possibility within xc...
There's not really a lightweight way to do this, but you have two options that I can think of depending on whether you want to keep the harness code you've written. If you do, then you'd need to make a new target in your project for each class you drive with a harness, and have that target build just the class you are ...
Replicate class with main method as in Java IDE within Objective-C and Xcode 4 I have a simple question. Coming from a java background and having worked extensively with eclipse, netbeans or any other java IDE, is quite nice to have the possibility to add a main method to a class and execute it within the IDE, with jus...
TITLE: Replicate class with main method as in Java IDE within Objective-C and Xcode 4 QUESTION: I have a simple question. Coming from a java background and having worked extensively with eclipse, netbeans or any other java IDE, is quite nice to have the possibility to add a main method to a class and execute it within...
[ "objective-c", "xcode4", "program-entry-point" ]
0
0
138
1
0
2011-06-03T12:08:50.873000
2011-06-03T12:52:48.583000
6,226,899
6,226,926
console program exits
Possible Duplicate: How to stop C++ console application from exiting immediately? I have the following console program: #include using namespace std; int main() { int a; int b; cout<<"Enter a"; cin>>a; cout<<"Enter b"; cin>>b; int result = a*b; cout<<"You entered"< Once i run the program,it accepts the input but e...
What about adding system ("pause"); before return 0; statement?
console program exits Possible Duplicate: How to stop C++ console application from exiting immediately? I have the following console program: #include using namespace std; int main() { int a; int b; cout<<"Enter a"; cin>>a; cout<<"Enter b"; cin>>b; int result = a*b; cout<<"You entered"< Once i run the program,it a...
TITLE: console program exits QUESTION: Possible Duplicate: How to stop C++ console application from exiting immediately? I have the following console program: #include using namespace std; int main() { int a; int b; cout<<"Enter a"; cin>>a; cout<<"Enter b"; cin>>b; int result = a*b; cout<<"You entered"< Once i ru...
[ "c++" ]
0
1
1,347
6
0
2011-06-03T12:09:02.263000
2011-06-03T12:11:52.677000
6,226,903
6,227,099
how to flip from one view to another view in iphone sdk
I wan't to flip from one view controller to another for that i used following coding on button click -(void)ClicOnLogout { LogOutViewController *logOut=[[LogOutViewController alloc]initwithnName:str]; logOut.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:logOut animated:Y...
You should read that Apple documentation article on Modal View Controllers which explains everything you are asking there. Basically what you need to do on your logout view is to call: [self dismissModalViewControllerAnimated:YES]; By calling this, the back (left-to-right) flip animation will be done automatically: UIM...
how to flip from one view to another view in iphone sdk I wan't to flip from one view controller to another for that i used following coding on button click -(void)ClicOnLogout { LogOutViewController *logOut=[[LogOutViewController alloc]initwithnName:str]; logOut.modalTransitionStyle = UIModalTransitionStyleFlipHorizon...
TITLE: how to flip from one view to another view in iphone sdk QUESTION: I wan't to flip from one view controller to another for that i used following coding on button click -(void)ClicOnLogout { LogOutViewController *logOut=[[LogOutViewController alloc]initwithnName:str]; logOut.modalTransitionStyle = UIModalTransiti...
[ "iphone" ]
0
1
1,588
2
0
2011-06-03T12:09:18.610000
2011-06-03T12:28:40.363000
6,226,907
6,227,394
Given filesystem pathname, how to retrieve corresponding ABSOLUTE ITEMIDLIST?
Looks like it can be done in one call or two, but which functions i have/must/should to use for that? I'm looking for best-practice approach, eg: API specially designed for path -> idl translation.
If it's really a file-system path, call ILCreateFromPath. If you need to handle non-file-system objects as well (like My Computer, or Network Neighborhood), then use SHParseDisplayName.
Given filesystem pathname, how to retrieve corresponding ABSOLUTE ITEMIDLIST? Looks like it can be done in one call or two, but which functions i have/must/should to use for that? I'm looking for best-practice approach, eg: API specially designed for path -> idl translation.
TITLE: Given filesystem pathname, how to retrieve corresponding ABSOLUTE ITEMIDLIST? QUESTION: Looks like it can be done in one call or two, but which functions i have/must/should to use for that? I'm looking for best-practice approach, eg: API specially designed for path -> idl translation. ANSWER: If it's really a ...
[ "c++", "windows", "delphi", "shell", "language-agnostic" ]
0
4
405
1
0
2011-06-03T12:09:52.417000
2011-06-03T12:58:58.317000
6,226,913
6,239,244
Detecting HTML5 data attribute in Modernizr
How do I detect if the browser supports HTML5 data attribute using Modernizr?
Test whether an element has the property dataset. Modernizr.addTest('data', function () { var elem = document.createElement('div'); return!!elem.dataset; });
Detecting HTML5 data attribute in Modernizr How do I detect if the browser supports HTML5 data attribute using Modernizr?
TITLE: Detecting HTML5 data attribute in Modernizr QUESTION: How do I detect if the browser supports HTML5 data attribute using Modernizr? ANSWER: Test whether an element has the property dataset. Modernizr.addTest('data', function () { var elem = document.createElement('div'); return!!elem.dataset; });
[ "html", "modernizr", "feature-detection", "custom-data-attribute" ]
4
5
1,907
1
0
2011-06-03T12:10:42.677000
2011-06-04T20:36:33.170000
6,226,924
6,227,315
Formatting first line of RichTextBox with capital letters and bold
If I have a RichTextBox and want output like the first line is a font with capital letters and bold, while the next line on the contrary, what should I do? output like this: MY NAME IS Diana My address is China
Hey try this, it works, but you might see the text flicker for a second if the user types really fast, like holding down "Enter" and etc. private void Form_Load(object sender, EventArgs e) { // append the function to the RichTextBox's TextChanged event MyRichTextBox.TextChanged += Capitalize_Bold_FirstLine; } private ...
Formatting first line of RichTextBox with capital letters and bold If I have a RichTextBox and want output like the first line is a font with capital letters and bold, while the next line on the contrary, what should I do? output like this: MY NAME IS Diana My address is China
TITLE: Formatting first line of RichTextBox with capital letters and bold QUESTION: If I have a RichTextBox and want output like the first line is a font with capital letters and bold, while the next line on the contrary, what should I do? output like this: MY NAME IS Diana My address is China ANSWER: Hey try this, i...
[ "c#", "vb.net", "richtextbox" ]
2
2
2,448
1
0
2011-06-03T12:11:44.067000
2011-06-03T12:51:07.070000
6,226,933
6,226,954
How do I join a table and change the names of the returned columns?
I've got a MS SQL 2008 table called "fruits" that looks like this: id name category_id -- ------------ ----------- 1 Apples 4 2 Bananas 6 3 Crackers 6 and another table called "categories" with: id category_name -- ------------- 4 Foo 6 Bar How do I produce a query that will return results that look like: fruit_name fr...
SELECT f.name AS fruit_name, c.category_name AS fruit_category_name FROM fruits AS f INNER JOIN categories AS c ON c.id = f.category_id
How do I join a table and change the names of the returned columns? I've got a MS SQL 2008 table called "fruits" that looks like this: id name category_id -- ------------ ----------- 1 Apples 4 2 Bananas 6 3 Crackers 6 and another table called "categories" with: id category_name -- ------------- 4 Foo 6 Bar How do I pr...
TITLE: How do I join a table and change the names of the returned columns? QUESTION: I've got a MS SQL 2008 table called "fruits" that looks like this: id name category_id -- ------------ ----------- 1 Apples 4 2 Bananas 6 3 Crackers 6 and another table called "categories" with: id category_name -- ------------- 4 Foo...
[ "sql-server", "sql-server-2008" ]
0
8
82
6
0
2011-06-03T12:12:40.150000
2011-06-03T12:14:48.547000
6,226,935
6,227,391
.deb Package for Stepstone (OpenNebula)
I have installed OpenNebula on my cluster (Ubuntu 11.04) by using.deb packages provided by Ubuntu. But, it seems like that there is no web management system Sunstone. Does anyone knows if there is.deb package for Stepstone? I realize that I could install Sunstone from OpenNebula's source, but I am not sure if it's poss...
OpenNebula Sunstone (not Stepstone) was released in OpenNebula 2.2, but Ubuntu still provides OpenNebula 2.0, the package hasn't yet been upgraded to OpenNebula 2.2, therefore Sunstone is not available with Ubuntu's package. If you want to use Sunstone in Ubuntu 11.04 you need to compile from source. It's actually quit...
.deb Package for Stepstone (OpenNebula) I have installed OpenNebula on my cluster (Ubuntu 11.04) by using.deb packages provided by Ubuntu. But, it seems like that there is no web management system Sunstone. Does anyone knows if there is.deb package for Stepstone? I realize that I could install Sunstone from OpenNebula'...
TITLE: .deb Package for Stepstone (OpenNebula) QUESTION: I have installed OpenNebula on my cluster (Ubuntu 11.04) by using.deb packages provided by Ubuntu. But, it seems like that there is no web management system Sunstone. Does anyone knows if there is.deb package for Stepstone? I realize that I could install Sunston...
[ "ubuntu", "cloud", "deb" ]
1
1
580
1
0
2011-06-03T12:12:57.747000
2011-06-03T12:58:37.443000
6,226,942
6,227,341
values in the text field are becoming null when we scroll the page in table view
hii every one i have created a data entry screen like this in which each row contains a text field here after entering data into the text field if we scroll the page which are all the text fields goesup(beyond the view) will set to null when it come back to the original position,, this is my code for each cell where Cu...
You are creating the text fields every time cellForRowAtIndexPath: is called. I think you can solve this problem by creating the text fields elsewhere, probably in viewDidLoad or similar method and just set the accessory view when the cellForRowAtIndexPath: is called. For example, tfText[0] = [[UITextField alloc] initW...
values in the text field are becoming null when we scroll the page in table view hii every one i have created a data entry screen like this in which each row contains a text field here after entering data into the text field if we scroll the page which are all the text fields goesup(beyond the view) will set to null wh...
TITLE: values in the text field are becoming null when we scroll the page in table view QUESTION: hii every one i have created a data entry screen like this in which each row contains a text field here after entering data into the text field if we scroll the page which are all the text fields goesup(beyond the view) w...
[ "iphone", "objective-c" ]
0
2
774
4
0
2011-06-03T12:13:26.020000
2011-06-03T12:53:45.843000
6,226,950
6,227,291
facebook-ios-sdk logout question
I have seen a lot of questions here regarding the Facebook Graph API but I still haven't find a solution for simple 'login'/'logout' operations using it. Looks like the Single Sign-On style is causing more confusion than benefits. I'd like to know if it is possible have the following situation: Enter in the app (no acc...
I'm afraid the answer is no, you can't do this. Your application is in a sandbox, and can't write outside, where global cookies are (for mobile safari) and Facebook app settings (in Facebook app preferences/cookies I think) You can only warn your user to logout outside of your app......Or you can just not use facebook ...
facebook-ios-sdk logout question I have seen a lot of questions here regarding the Facebook Graph API but I still haven't find a solution for simple 'login'/'logout' operations using it. Looks like the Single Sign-On style is causing more confusion than benefits. I'd like to know if it is possible have the following si...
TITLE: facebook-ios-sdk logout question QUESTION: I have seen a lot of questions here regarding the Facebook Graph API but I still haven't find a solution for simple 'login'/'logout' operations using it. Looks like the Single Sign-On style is causing more confusion than benefits. I'd like to know if it is possible hav...
[ "iphone", "facebook", "ios4", "facebook-graph-api", "logout" ]
12
3
22,808
7
0
2011-06-03T12:14:24.400000
2011-06-03T12:49:22.310000
6,226,952
6,227,162
Rewrite changing Url
I'd like to use apaches mod_rewrite to rewrite my url's. Normally, that i could do that, but i think is a special case. The content on the page depends on the url parameters, but is also capable of altering those parameters, and thus gaining new content without refreshing. The same parameters would always give the same...
I think you need the RewriteCond %{QUERY_STRING} before your RewriteRule. Something like: RewriteCond %{QUERY_STRING} div1=(.*)& Then you can access the bracketed values in the RewriteRule with %1... Just as you'd use $1 for bracketed values in the RewriteRule itself. You may also want to be looking at the RewriteRule ...
Rewrite changing Url I'd like to use apaches mod_rewrite to rewrite my url's. Normally, that i could do that, but i think is a special case. The content on the page depends on the url parameters, but is also capable of altering those parameters, and thus gaining new content without refreshing. The same parameters would...
TITLE: Rewrite changing Url QUESTION: I'd like to use apaches mod_rewrite to rewrite my url's. Normally, that i could do that, but i think is a special case. The content on the page depends on the url parameters, but is also capable of altering those parameters, and thus gaining new content without refreshing. The sam...
[ "mod-rewrite" ]
0
0
74
1
0
2011-06-03T12:14:25.997000
2011-06-03T12:36:19.413000
6,226,960
6,227,107
portlet class variable
http://wpcertification.blogspot.com/2009/03/understanding-standard-portlet-life.html at this page there is a sentence like: "The Portal server will create only one instance of portlet per JVM" What does it mean? Is it means that; if i use class variable in my portlet, all users will use the same values? I have a proble...
Portlets (like servlets) can service multiple requests concurrently. They are scoped to the application and should be threadsafe. You should not use member variables for per-user state. Request scope data should be held in the request (or possibly as render parameters ). If you want user data to persist across requests...
portlet class variable http://wpcertification.blogspot.com/2009/03/understanding-standard-portlet-life.html at this page there is a sentence like: "The Portal server will create only one instance of portlet per JVM" What does it mean? Is it means that; if i use class variable in my portlet, all users will use the same ...
TITLE: portlet class variable QUESTION: http://wpcertification.blogspot.com/2009/03/understanding-standard-portlet-life.html at this page there is a sentence like: "The Portal server will create only one instance of portlet per JVM" What does it mean? Is it means that; if i use class variable in my portlet, all users ...
[ "java", "jsp", "portlet" ]
0
0
318
1
0
2011-06-03T12:15:23.797000
2011-06-03T12:29:48.137000
6,226,995
6,227,165
JPA : best practices with unidirectional OneToMany
I have several little questions about best practices with JPA (via hibernate). My first question is about the complexity of one domain model. I've got a model Account which represents an... account;) An account have a lot of relations with other objects. A lot of them need to be known by the Account object but some of ...
You may use unidirectional relationships without problem if you don't need to navigate from an account to its messages (in code or in queries). whatever the solution you choose, you should define a foreign key constraint between the message and its account. This way, deleting an account without first deleting its messa...
JPA : best practices with unidirectional OneToMany I have several little questions about best practices with JPA (via hibernate). My first question is about the complexity of one domain model. I've got a model Account which represents an... account;) An account have a lot of relations with other objects. A lot of them ...
TITLE: JPA : best practices with unidirectional OneToMany QUESTION: I have several little questions about best practices with JPA (via hibernate). My first question is about the complexity of one domain model. I've got a model Account which represents an... account;) An account have a lot of relations with other objec...
[ "database", "hibernate", "jpa", "entity-relationship" ]
2
2
1,857
1
0
2011-06-03T12:18:32.447000
2011-06-03T12:36:25.247000
6,226,998
6,227,082
64 bit operations
I'm writing code for a primality testing function that handles long long int's.Do I have to use special operators for such large numbers?Is there any documentation concerning large number manipulation in C?I'm using the gnu standard library.Thanks.
long long is new in C99, though many compilers have supported that as an extension before that. With gcc a long long is 64 bits, you can use it like any other integer type, nothing special is required. There's a couple of things to be aware of though, integer constants in the source code needs the LL suffix (or LLU if ...
64 bit operations I'm writing code for a primality testing function that handles long long int's.Do I have to use special operators for such large numbers?Is there any documentation concerning large number manipulation in C?I'm using the gnu standard library.Thanks.
TITLE: 64 bit operations QUESTION: I'm writing code for a primality testing function that handles long long int's.Do I have to use special operators for such large numbers?Is there any documentation concerning large number manipulation in C?I'm using the gnu standard library.Thanks. ANSWER: long long is new in C99, t...
[ "c" ]
0
1
235
6
0
2011-06-03T12:18:39.450000
2011-06-03T12:26:40.317000
6,227,000
6,230,669
PHP how to trigger user error with trigger_error in an object destructor while the script shuts down?
While implementing some class I've run into a little problem: If the script ends and destructors are called because the script has finished, I wanted to trigger an error occasionally. I thought the trigger_error() function would be of use. However, if error_reporting(-1) the triggered error is not send any longer to ST...
Answer: Just do it. I had some misconfiguration for the error handler and therefore it did not work. My fault. However it's still interesting if there is any function or similar to determine the execution state on shutdown.
PHP how to trigger user error with trigger_error in an object destructor while the script shuts down? While implementing some class I've run into a little problem: If the script ends and destructors are called because the script has finished, I wanted to trigger an error occasionally. I thought the trigger_error() func...
TITLE: PHP how to trigger user error with trigger_error in an object destructor while the script shuts down? QUESTION: While implementing some class I've run into a little problem: If the script ends and destructors are called because the script has finished, I wanted to trigger an error occasionally. I thought the tr...
[ "php", "error-handling", "destructor" ]
0
0
757
2
0
2011-06-03T12:18:39.680000
2011-06-03T17:41:54.320000
6,227,006
6,227,132
Fixing a URL to the SERP of a instant JSON search script
I have a search script like Google Instant search which displays the relevant results as you type. It is written in JSON and uses JavaScript to make a URL of the result as the user types. However, if you click on a result and then come back to the SERP there are no results displayed. You have to start your search again...
If i understand you correctly you are doing a full page load to go to a result, and when you go back you do another full page load. Basically if you want to persist the search results over pageloads you will have to store the searchquery in session scope or as a cookie, and when the session/cookie is present the javasc...
Fixing a URL to the SERP of a instant JSON search script I have a search script like Google Instant search which displays the relevant results as you type. It is written in JSON and uses JavaScript to make a URL of the result as the user types. However, if you click on a result and then come back to the SERP there are ...
TITLE: Fixing a URL to the SERP of a instant JSON search script QUESTION: I have a search script like Google Instant search which displays the relevant results as you type. It is written in JSON and uses JavaScript to make a URL of the result as the user types. However, if you click on a result and then come back to t...
[ "javascript", "jquery", "html", "json" ]
0
0
173
1
0
2011-06-03T12:19:21.357000
2011-06-03T12:32:34.030000
6,227,017
6,227,232
Can I re-use XSL templates with unique XML content?
Maybe there is a better way of describing my problem... Here is an example of what I would like to do: Take this: This is 3C Lorem ipsum dolor consectetur adipiscing elit. Fusce mattis consequat malesuada. Consectetur adipiscing elit. Fusce mattis consequat malesuada. Nullam vel justo a dui pellentesque euismod. Intege...
Learn about using the identity rule/template and overriding it. This alone is the most fundamental and powerful XSLT design pattern. In your case we use this design pattern to override just the top element in the following way: When applied on the provided XML document: This is 3C Lorem ipsum dolor consectetur adipisci...
Can I re-use XSL templates with unique XML content? Maybe there is a better way of describing my problem... Here is an example of what I would like to do: Take this: This is 3C Lorem ipsum dolor consectetur adipiscing elit. Fusce mattis consequat malesuada. Consectetur adipiscing elit. Fusce mattis consequat malesuada....
TITLE: Can I re-use XSL templates with unique XML content? QUESTION: Maybe there is a better way of describing my problem... Here is an example of what I would like to do: Take this: This is 3C Lorem ipsum dolor consectetur adipiscing elit. Fusce mattis consequat malesuada. Consectetur adipiscing elit. Fusce mattis co...
[ "xml", "xslt" ]
1
3
60
1
0
2011-06-03T12:20:35.450000
2011-06-03T12:44:35.607000
6,227,025
6,239,187
Is there any publications about how to use association rules as SVM feature?
I'd like to do SVM classification with association rules as features(to detect malwares), is it possible? or is there some publications on this topic?
Here are some articles that might be (or not) relevant to your question: Keivan Kianmehr and Reda Alhajj. Effective Classification by Integrating Support Vector Machine and Association Rule Mining. Lecture Notes in Computer Science, 2006, Volume 4224/2006, 920-927 He et al. Extracting rule from SVM based on association...
Is there any publications about how to use association rules as SVM feature? I'd like to do SVM classification with association rules as features(to detect malwares), is it possible? or is there some publications on this topic?
TITLE: Is there any publications about how to use association rules as SVM feature? QUESTION: I'd like to do SVM classification with association rules as features(to detect malwares), is it possible? or is there some publications on this topic? ANSWER: Here are some articles that might be (or not) relevant to your qu...
[ "associations", "machine-learning", "svm" ]
2
1
155
1
0
2011-06-03T12:21:00.320000
2011-06-04T20:26:47.390000
6,227,028
6,227,092
PHP include path sub-folder files not included
I have a site where the PHP include path is /usr/share/php Within this path I have a sub-folder containing some utility files, e.g. /usr/share/php/utils. my_session.php is one of these utility files. My application calls require ("my_session.php"); and this works even though the file is actually within the utils folder...
According to PHP documentation when you try to include a file, only paths listed in the include_path directive are checked. PHP is not supposed to check their subfolders.
PHP include path sub-folder files not included I have a site where the PHP include path is /usr/share/php Within this path I have a sub-folder containing some utility files, e.g. /usr/share/php/utils. my_session.php is one of these utility files. My application calls require ("my_session.php"); and this works even thou...
TITLE: PHP include path sub-folder files not included QUESTION: I have a site where the PHP include path is /usr/share/php Within this path I have a sub-folder containing some utility files, e.g. /usr/share/php/utils. my_session.php is one of these utility files. My application calls require ("my_session.php"); and th...
[ "php" ]
2
4
6,947
3
0
2011-06-03T12:21:05.380000
2011-06-03T12:28:07.310000
6,227,030
6,227,252
Best way to handle per user Settings in Rails 3
I'm developing an application in Rails 3. In the application, users are allowed to send e-mails using their existing email account settings. What's the best approach to define per user settings for every user's credentials? Regards, Liviu
Given you'd probably want to offer the option for users to change/update their settings, they should go in a model. After that, it comes down to taste... If you have only a few settings, you could store them directly in the User model. If you have lots of settings, you could have a separate UserProfile model that belon...
Best way to handle per user Settings in Rails 3 I'm developing an application in Rails 3. In the application, users are allowed to send e-mails using their existing email account settings. What's the best approach to define per user settings for every user's credentials? Regards, Liviu
TITLE: Best way to handle per user Settings in Rails 3 QUESTION: I'm developing an application in Rails 3. In the application, users are allowed to send e-mails using their existing email account settings. What's the best approach to define per user settings for every user's credentials? Regards, Liviu ANSWER: Given ...
[ "ruby-on-rails", "actionmailer" ]
1
1
386
1
0
2011-06-03T12:21:08.603000
2011-06-03T12:45:54.933000
6,227,058
6,227,464
ending the life of a thread in python?
I have the below code but it lives on after the queue is empty, any insights: def processor(): while(1>0): if queue.empty() == True: print "the Queue is empty!" break source=queue.get() page = urllib2.urlopen(source) print page def main: for i in range(threads): th = Thread(target=processor) th.setDaemon(True) th.star...
You need to call queue.task_done() after printing the page, otherwise join() will block. Each thread, after using get() must call task_done(). See documentation for queue
ending the life of a thread in python? I have the below code but it lives on after the queue is empty, any insights: def processor(): while(1>0): if queue.empty() == True: print "the Queue is empty!" break source=queue.get() page = urllib2.urlopen(source) print page def main: for i in range(threads): th = Thread(targe...
TITLE: ending the life of a thread in python? QUESTION: I have the below code but it lives on after the queue is empty, any insights: def processor(): while(1>0): if queue.empty() == True: print "the Queue is empty!" break source=queue.get() page = urllib2.urlopen(source) print page def main: for i in range(threads):...
[ "python", "multithreading" ]
4
5
2,186
3
0
2011-06-03T12:23:54.490000
2011-06-03T13:06:14.123000
6,227,061
6,227,110
PHP - add underscores before capital letters
How can I replace a set of words that look like: SomeText to Some_Text?
This can easily be achieved using a regular expression: $result = preg_replace('/\B([A-Z])/', '_$1', $subject); a brief explanation of the regex: \B asserts position at a word boundary. [A-Z] matches any uppercase characters from A-Z. () wraps the match in a back reference number 1. Then we replace with '_$1' which mea...
PHP - add underscores before capital letters How can I replace a set of words that look like: SomeText to Some_Text?
TITLE: PHP - add underscores before capital letters QUESTION: How can I replace a set of words that look like: SomeText to Some_Text? ANSWER: This can easily be achieved using a regular expression: $result = preg_replace('/\B([A-Z])/', '_$1', $subject); a brief explanation of the regex: \B asserts position at a word ...
[ "php", "regex", "string", "case-conversion" ]
24
40
11,510
5
0
2011-06-03T12:24:08.103000
2011-06-03T12:29:59.090000
6,227,074
6,227,183
Simple Injector: Injecting a property in a base class
For several weeks I've been using the Simple Injector dependency injection container, with great success. I love the easy by which I can configure it. But now I have a design that I don't know how to configure. I have a base class where many types from derive, and I want to inject a dependency into a property of the ba...
The Simple Injector documentation on property injection gives a very clear explanation about this. The basic options are: Register an initialization delegate using RegisterInitializer. Override Simple Injector's PropertySelectionBehavior. As the documentation explains, the use of RegisterInitializer is not advised for ...
Simple Injector: Injecting a property in a base class For several weeks I've been using the Simple Injector dependency injection container, with great success. I love the easy by which I can configure it. But now I have a design that I don't know how to configure. I have a base class where many types from derive, and I...
TITLE: Simple Injector: Injecting a property in a base class QUESTION: For several weeks I've been using the Simple Injector dependency injection container, with great success. I love the easy by which I can configure it. But now I have a design that I don't know how to configure. I have a base class where many types ...
[ "c#", ".net", "dependency-injection", "ioc-container", "simple-injector" ]
5
9
8,040
1
0
2011-06-03T12:26:08.150000
2011-06-03T12:39:01.067000
6,227,086
6,227,118
Android UI in C++
I know this is kind of reinventing the wheel, but how hard would it be to implement an android user interface with C++? Is it hard to create things like buttons, and to handle touch screen events like button clicks? Is this feasible and if so, how would you go about doing it?
Take a look at Necessitas, its a Qt port for android which seems to work pretty well. It might still be in Alpha or Beta stage though, so it will depends on how "serious" your project is. But that proves for sure that one can use plain C++ to build a complete application, not only libraries.
Android UI in C++ I know this is kind of reinventing the wheel, but how hard would it be to implement an android user interface with C++? Is it hard to create things like buttons, and to handle touch screen events like button clicks? Is this feasible and if so, how would you go about doing it?
TITLE: Android UI in C++ QUESTION: I know this is kind of reinventing the wheel, but how hard would it be to implement an android user interface with C++? Is it hard to create things like buttons, and to handle touch screen events like button clicks? Is this feasible and if so, how would you go about doing it? ANSWER...
[ "c++", "android", "user-interface", "android-ndk" ]
6
5
9,270
3
0
2011-06-03T12:27:04.657000
2011-06-03T12:31:00.020000
6,227,087
6,227,122
Any opensource alternative to squish to test flash/silverlight/java applet gui objects?
If one doesn't have the source code, the only to test is to send keystroke and mouse move so I found this product but it's not free and opensource price is not even known:( http://doc.froglogic.com/squish/4.1/all/ugs-webnonhtml.html Squish supports automating interactions and testing non-HTML/DOM elements, that is, nat...
You could look at Sikuli IDE. It is more geared for automation than for testing, but it works nice.
Any opensource alternative to squish to test flash/silverlight/java applet gui objects? If one doesn't have the source code, the only to test is to send keystroke and mouse move so I found this product but it's not free and opensource price is not even known:( http://doc.froglogic.com/squish/4.1/all/ugs-webnonhtml.html...
TITLE: Any opensource alternative to squish to test flash/silverlight/java applet gui objects? QUESTION: If one doesn't have the source code, the only to test is to send keystroke and mouse move so I found this product but it's not free and opensource price is not even known:( http://doc.froglogic.com/squish/4.1/all/u...
[ "java", "silverlight", "flash", "testing" ]
0
1
4,314
2
0
2011-06-03T12:27:06.590000
2011-06-03T12:31:43.457000
6,227,106
6,227,228
Changing Views with MGSplitView Controller
In the app that io am creating, i have a custom copy of UISplitView Controller, MGSplitViewController. I have implemented it into my project which started off with the MultipleDetailViews sample code from apple. I have come across a problem where i cant seem to switch between viewcontrollers. When i push the tableview ...
You're just creating new view controllers. You're not adding them anywhere. You add view controllers to the split view controller by using its viewControllers property. EDIT: I've used MGSplitViewController, but I never tried to change the detail view like that. I just pushed the new detail view controller onto the nav...
Changing Views with MGSplitView Controller In the app that io am creating, i have a custom copy of UISplitView Controller, MGSplitViewController. I have implemented it into my project which started off with the MultipleDetailViews sample code from apple. I have come across a problem where i cant seem to switch between ...
TITLE: Changing Views with MGSplitView Controller QUESTION: In the app that io am creating, i have a custom copy of UISplitView Controller, MGSplitViewController. I have implemented it into my project which started off with the MultipleDetailViews sample code from apple. I have come across a problem where i cant seem ...
[ "iphone", "ipad", "uitableview", "uiviewcontroller", "uisplitviewcontroller" ]
1
0
962
1
0
2011-06-03T12:29:43.860000
2011-06-03T12:43:58.713000
6,227,119
6,227,160
When parsing XML with Linq, only one object gets fetched
I'm trying to populate an array with the following xml: 1307018090 10.4718867 10.38100000 10.49000000 14:39... and so on I'm using this Linq-query, which to me means that It'll create one object per: var items = from item in doc.Element("data").Descendants() select new Currency { Close = item.Element("price").Value.ToS...
You need to start the Linq-Xml like so var items = from item in doc.Element("data").Elements("item")
When parsing XML with Linq, only one object gets fetched I'm trying to populate an array with the following xml: 1307018090 10.4718867 10.38100000 10.49000000 14:39... and so on I'm using this Linq-query, which to me means that It'll create one object per: var items = from item in doc.Element("data").Descendants() sele...
TITLE: When parsing XML with Linq, only one object gets fetched QUESTION: I'm trying to populate an array with the following xml: 1307018090 10.4718867 10.38100000 10.49000000 14:39... and so on I'm using this Linq-query, which to me means that It'll create one object per: var items = from item in doc.Element("data")....
[ "c#", "xml", "linq", "linq-to-xml", "xml-parsing" ]
3
6
282
2
0
2011-06-03T12:31:15.530000
2011-06-03T12:36:04.450000
6,227,126
6,227,376
how to generate the instance for logger?
Here is my code package com.my; import org.apache.log4j.spi.LoggerFactory; import java.io.*; import java.util.logging.*; public class Log { public static void main(String[] args) { try{ FileHandler hand = new FileHandler("vk.log"); Logger log = Logger.getLogger("log_file"); log.addHandler(hand); log.warning("Doing car...
Your code should work if you delete the superfluous log.getLogger(""); statement and fix the imports. A couple of comments: If you have multiple loggers you can selectively turn them on and off. It is conventional to create multiple loggers based on class or package names; e.g. Logger log = Logger.getLogger(this.getCla...
how to generate the instance for logger? Here is my code package com.my; import org.apache.log4j.spi.LoggerFactory; import java.io.*; import java.util.logging.*; public class Log { public static void main(String[] args) { try{ FileHandler hand = new FileHandler("vk.log"); Logger log = Logger.getLogger("log_file"); log...
TITLE: how to generate the instance for logger? QUESTION: Here is my code package com.my; import org.apache.log4j.spi.LoggerFactory; import java.io.*; import java.util.logging.*; public class Log { public static void main(String[] args) { try{ FileHandler hand = new FileHandler("vk.log"); Logger log = Logger.getLogge...
[ "java", "logging" ]
1
4
5,153
3
0
2011-06-03T12:32:04.520000
2011-06-03T12:57:00.587000
6,227,133
6,228,882
strange error while sending confirmation email through devise on rails 3.0.3, ruby 1.8.7
I am using devise 1.3.4 on Rails 3.0.3 and ruby 1.8.7 for user authentication/authorization and new user creation. (I followed Ryan's railscast on devise and omniauth but also used the confirmable option) It works just fine when there are no users in the database. However, when I signout the only user and try to create...
String#encode! is new in Ruby 1.9 so its just not there in 1.8.7. So it looks as though the mail gem that you are using has a dependency on 1.9.
strange error while sending confirmation email through devise on rails 3.0.3, ruby 1.8.7 I am using devise 1.3.4 on Rails 3.0.3 and ruby 1.8.7 for user authentication/authorization and new user creation. (I followed Ryan's railscast on devise and omniauth but also used the confirmable option) It works just fine when th...
TITLE: strange error while sending confirmation email through devise on rails 3.0.3, ruby 1.8.7 QUESTION: I am using devise 1.3.4 on Rails 3.0.3 and ruby 1.8.7 for user authentication/authorization and new user creation. (I followed Ryan's railscast on devise and omniauth but also used the confirmable option) It works...
[ "ruby-on-rails", "ruby-on-rails-3", "devise" ]
0
1
423
1
0
2011-06-03T12:32:35.297000
2011-06-03T15:07:08.360000
6,227,138
6,227,213
How do you create a variable of scope EnvVariable?
How do you create a variable of scope EnvVariable as shown in this screenshot of this StackOverflow Answer?
The scope usually represents the Package name or a Control Flow task name. Here in this case, EnvVariable represents the package name. Refer screenshot # 4. To create a variable, follow the below mentioned steps. Right-click on the package and select Variables. Refer screenshot # 1. On the Variables pane, click the fir...
How do you create a variable of scope EnvVariable? How do you create a variable of scope EnvVariable as shown in this screenshot of this StackOverflow Answer?
TITLE: How do you create a variable of scope EnvVariable? QUESTION: How do you create a variable of scope EnvVariable as shown in this screenshot of this StackOverflow Answer? ANSWER: The scope usually represents the Package name or a Control Flow task name. Here in this case, EnvVariable represents the package name....
[ "ssis", "bids" ]
0
1
642
1
0
2011-06-03T12:33:13.750000
2011-06-03T12:42:14.900000
6,227,141
6,291,222
Sitecore Extranet login and PDF converter or Webclient
I'm having a problem using Winnovatives PDFConverter on pages that are protected by Extranet security (which is based on ASP.Net Membership). I've tried several different approaches, but the following I can get to work on my local machine, but not anywhere else. Code for login page, this code should bypass the login pr...
I contacted Sitecore to ask if they had a solution. Their solution was to create a Processor that would set an active user based on some criteria. This is the code I made for my site (it's probably not the best solution as UserAgent can be spoofed): public class MyResolver: HttpRequestProcessor { // Methods public over...
Sitecore Extranet login and PDF converter or Webclient I'm having a problem using Winnovatives PDFConverter on pages that are protected by Extranet security (which is based on ASP.Net Membership). I've tried several different approaches, but the following I can get to work on my local machine, but not anywhere else. Co...
TITLE: Sitecore Extranet login and PDF converter or Webclient QUESTION: I'm having a problem using Winnovatives PDFConverter on pages that are protected by Extranet security (which is based on ASP.Net Membership). I've tried several different approaches, but the following I can get to work on my local machine, but not...
[ "asp.net-membership", "webclient", "sitecore", "winnovative" ]
1
2
1,229
2
0
2011-06-03T12:33:41.427000
2011-06-09T10:13:56.243000
6,227,172
6,227,245
How does the get(key) work even after the hashtable has grown in size!
If a Hashtable is of size 8 originally and we hit the load factor and it grows double the size. How is get still able to retrieve the original values... so say we have a hash function key(8) transforms into 12345 as the hash value which we mod by 8 and we get the index 7... now when the hash table size grows to 16...fo...
This isn't Java specific - when a hash table grows (in most implementations I know of), it has to reassess the keys of all hashed objects, and place them into their new, correct bucket based on the number of buckets now available. This is also why resizing a hashtable is generally considered to be an "expensive" operat...
How does the get(key) work even after the hashtable has grown in size! If a Hashtable is of size 8 originally and we hit the load factor and it grows double the size. How is get still able to retrieve the original values... so say we have a hash function key(8) transforms into 12345 as the hash value which we mod by 8 ...
TITLE: How does the get(key) work even after the hashtable has grown in size! QUESTION: If a Hashtable is of size 8 originally and we hit the load factor and it grows double the size. How is get still able to retrieve the original values... so say we have a hash function key(8) transforms into 12345 as the hash value ...
[ "java" ]
3
4
223
4
0
2011-06-03T12:37:20.393000
2011-06-03T12:45:18.933000
6,227,175
6,227,263
How should I test a public method that access a private member
So I have something along the lines of this private List > listOfQueues = new List >() public void InsertInt(int id, int value) { listOfQueues[id].Enqueue(value); } Is this something I shouldn't be unit testing? If it is how do I test the InsertInt method without using any other methods? is it ok to use the method to r...
You generally do not want to test private members. The point of unit testing is that from the outside, the class takes the specified inputs and (when requested) will give you the correct outputs. You don't care about the implementation of HOW it gives you those outputs, you just care that it gives you the correct outpu...
How should I test a public method that access a private member So I have something along the lines of this private List > listOfQueues = new List >() public void InsertInt(int id, int value) { listOfQueues[id].Enqueue(value); } Is this something I shouldn't be unit testing? If it is how do I test the InsertInt method w...
TITLE: How should I test a public method that access a private member QUESTION: So I have something along the lines of this private List > listOfQueues = new List >() public void InsertInt(int id, int value) { listOfQueues[id].Enqueue(value); } Is this something I shouldn't be unit testing? If it is how do I test the ...
[ "c#", "nunit" ]
3
2
232
6
0
2011-06-03T12:37:53.583000
2011-06-03T12:46:38.833000
6,227,181
6,227,308
lazy list in Fragment
I am trying to implement a ListView with async image loading inside a Fragment. For this purpose, I took Fedor's LazyList code. The code works, however loaded images are not displayed until "scrolling them out" of the visible area and "scrolling in" again. That means the image is updated only if "getView()" is invoked ...
I think you have made mistake in setTag() method inside the getView() method. holder.imageView.setTag(loadURL); imageLoader.DisplayImage(loadURL, activity, holder.imageView); SetTag() and DisplayImage() both should have the same Image URL value.
lazy list in Fragment I am trying to implement a ListView with async image loading inside a Fragment. For this purpose, I took Fedor's LazyList code. The code works, however loaded images are not displayed until "scrolling them out" of the visible area and "scrolling in" again. That means the image is updated only if "...
TITLE: lazy list in Fragment QUESTION: I am trying to implement a ListView with async image loading inside a Fragment. For this purpose, I took Fedor's LazyList code. The code works, however loaded images are not displayed until "scrolling them out" of the visible area and "scrolling in" again. That means the image is...
[ "android", "list", "lazy-loading", "fragment" ]
1
2
1,865
1
0
2011-06-03T12:38:48.180000
2011-06-03T12:50:44.740000
6,227,184
6,236,319
DataNucleus Access Eclipse SchemaTool
I've installed and configured the Eclipse Plugin for the DataNucleus Access Platform yet when I try to run the SchemaTool I get the following error.. java.lang.NoClassDefFoundError: org/datanucleus/store/schema/SchemaTool it appears that the eclipse plugin is looking in an older location for the SchemaTool, it's actual...
Use the correct version of the Eclipse plugin for the version of DataNucleus being used. v2.x for DataNucleus v2.2, and v3.x for DataNucleus v3.0
DataNucleus Access Eclipse SchemaTool I've installed and configured the Eclipse Plugin for the DataNucleus Access Platform yet when I try to run the SchemaTool I get the following error.. java.lang.NoClassDefFoundError: org/datanucleus/store/schema/SchemaTool it appears that the eclipse plugin is looking in an older lo...
TITLE: DataNucleus Access Eclipse SchemaTool QUESTION: I've installed and configured the Eclipse Plugin for the DataNucleus Access Platform yet when I try to run the SchemaTool I get the following error.. java.lang.NoClassDefFoundError: org/datanucleus/store/schema/SchemaTool it appears that the eclipse plugin is look...
[ "eclipse", "datanucleus" ]
2
1
786
1
0
2011-06-03T12:39:08.553000
2011-06-04T10:56:40.283000
6,227,185
6,230,291
SpringMVC: Serving XHTML
I have a annotated spring-mvc controller which gives some data to a jsp-view. @RequestMapping(method = RequestMethod.GET) public ModelAndView editor(){ ModelAndView model = new ModelAndView("editor"); model.addObject("profile", "default"); model.addObject("extString", "[]"); return model; } Now, in my application befo...
On your jsp, you could put something like this on top: <%@ page language="java" contentType="application/xhtml+xml; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
SpringMVC: Serving XHTML I have a annotated spring-mvc controller which gives some data to a jsp-view. @RequestMapping(method = RequestMethod.GET) public ModelAndView editor(){ ModelAndView model = new ModelAndView("editor"); model.addObject("profile", "default"); model.addObject("extString", "[]"); return model; } No...
TITLE: SpringMVC: Serving XHTML QUESTION: I have a annotated spring-mvc controller which gives some data to a jsp-view. @RequestMapping(method = RequestMethod.GET) public ModelAndView editor(){ ModelAndView model = new ModelAndView("editor"); model.addObject("profile", "default"); model.addObject("extString", "[]"); ...
[ "xhtml", "spring-mvc", "content-type" ]
0
0
740
1
0
2011-06-03T12:39:11.427000
2011-06-03T17:04:43.330000
6,227,192
6,227,298
How to select an entry in a combobox using jquery?
I have a HTML combobox which has two entries. One is blank and the other is some text. I don't know what the values are. Is there anyway by using jquery (given the constaint above) that I can have the entry with text in it programtically selected in the combobox?
this is one way to do it assuming this is the html foo bar here is the jquery $('#foobar option:nth-child(2)').prop('selected',true); here is a working demo
How to select an entry in a combobox using jquery? I have a HTML combobox which has two entries. One is blank and the other is some text. I don't know what the values are. Is there anyway by using jquery (given the constaint above) that I can have the entry with text in it programtically selected in the combobox?
TITLE: How to select an entry in a combobox using jquery? QUESTION: I have a HTML combobox which has two entries. One is blank and the other is some text. I don't know what the values are. Is there anyway by using jquery (given the constaint above) that I can have the entry with text in it programtically selected in t...
[ "jquery", "select", "jquery-selectors", "drop-down-menu" ]
0
1
583
4
0
2011-06-03T12:39:49.683000
2011-06-03T12:49:56.170000
6,227,194
6,227,419
jQuery animation looping seems to send all animated elements crazy !
i asked a question earlier about setting the animation loop to play more than twice; once i added that code into my existing code it seems to send all my animated elements beserk; would you know what is being done wrong? Demo Link: http://www.prosperitymedia.co.uk/other/ the issue also is your browser might crash it ha...
I think there are a few issues here contributing to the issue. First of all,.hide() with no duration (and possibly other calls you're using here) does not get queued, it is done immediately. Your loop is not waiting for the animation to complete before running through another iteration, that is why you see a lot of fli...
jQuery animation looping seems to send all animated elements crazy ! i asked a question earlier about setting the animation loop to play more than twice; once i added that code into my existing code it seems to send all my animated elements beserk; would you know what is being done wrong? Demo Link: http://www.prosperi...
TITLE: jQuery animation looping seems to send all animated elements crazy ! QUESTION: i asked a question earlier about setting the animation loop to play more than twice; once i added that code into my existing code it seems to send all my animated elements beserk; would you know what is being done wrong? Demo Link: h...
[ "jquery" ]
0
3
377
1
0
2011-06-03T12:39:51.827000
2011-06-03T13:01:50.670000
6,227,197
6,237,202
Django login attempts sometimes silently fail
Recently, I've started to experience an issue on my Django-based site where logins will fail with no errors reported to the user after a few days of site uptime. Already logged in sessions continue to work fine, but no new logins can happen. The relevant info: I'm using the normal django.contrib.auth authentication stu...
Sounds like your web server is using persistent connections and running out. What do the pg logs say when you can't log in?
Django login attempts sometimes silently fail Recently, I've started to experience an issue on my Django-based site where logins will fail with no errors reported to the user after a few days of site uptime. Already logged in sessions continue to work fine, but no new logins can happen. The relevant info: I'm using the...
TITLE: Django login attempts sometimes silently fail QUESTION: Recently, I've started to experience an issue on my Django-based site where logins will fail with no errors reported to the user after a few days of site uptime. Already logged in sessions continue to work fine, but no new logins can happen. The relevant i...
[ "django", "forms", "postgresql", "authentication" ]
1
1
1,265
1
0
2011-06-03T12:40:13.330000
2011-06-04T14:11:54.377000
6,227,202
6,227,288
Why are these attributes being written in reversed order?
I'm working with QDomElement and QDomDocument to export data to XML. When I do this, the attributes get written in the correct order: element.setAttribute("xRepeat", xrepeat); element.setAttribute("yRepeat", yrepeat); This outputs something like xRepeat="3" yRepeat="8". Then I tried this... element.setAttribute("xrepea...
The order of attribute specifications in a start-tag or empty-element tag is not significant. Don't rely on software that requires a specfic order.
Why are these attributes being written in reversed order? I'm working with QDomElement and QDomDocument to export data to XML. When I do this, the attributes get written in the correct order: element.setAttribute("xRepeat", xrepeat); element.setAttribute("yRepeat", yrepeat); This outputs something like xRepeat="3" yRep...
TITLE: Why are these attributes being written in reversed order? QUESTION: I'm working with QDomElement and QDomDocument to export data to XML. When I do this, the attributes get written in the correct order: element.setAttribute("xRepeat", xrepeat); element.setAttribute("yRepeat", yrepeat); This outputs something lik...
[ "qt" ]
1
1
485
2
0
2011-06-03T12:40:57.217000
2011-06-03T12:48:54.103000
6,227,205
6,227,249
form input disabled works differently between chrome and firefox
I currently have a form with a disabled submit input. In firefox 4.0, if you press enter nothing happens (which is what I want). In Chrome (11) or IE 7, it will try to submit the page. Is there some Jquery that will make Chrome & IE behave like Firefox in this example? I've created a test page for people - http://jsfid...
It looks like a bug in Chrome. The proposed solution is to use javascript to subscribe to the onsubmit event of the form and if the button is disabled cancel the submission. Here's how you could achieve this with jQuery: $(function() { $('form').submit(function() { return!$(':submit', this).is(':disabled'); }); });
form input disabled works differently between chrome and firefox I currently have a form with a disabled submit input. In firefox 4.0, if you press enter nothing happens (which is what I want). In Chrome (11) or IE 7, it will try to submit the page. Is there some Jquery that will make Chrome & IE behave like Firefox in...
TITLE: form input disabled works differently between chrome and firefox QUESTION: I currently have a form with a disabled submit input. In firefox 4.0, if you press enter nothing happens (which is what I want). In Chrome (11) or IE 7, it will try to submit the page. Is there some Jquery that will make Chrome & IE beha...
[ "jquery", "html", "asp.net-mvc", "firefox", "google-chrome" ]
2
2
3,007
2
0
2011-06-03T12:41:19.350000
2011-06-03T12:45:35.280000
6,227,217
6,258,968
Allow non-admin users to create projects
I'm looking to allow non-admin users to create their own projects, i've found the option to set the default role for a non-admin who has created a project, but I cant find how to let them actually create the project, do I have to set a role for them somewhere? or is there a plugin I have to install?
It's there but not very intuitive. In order to have permissions in Redmine a user must be a member of a project first. Give a Role the "Add Project" permission Add the user as a Member to a project with that Role Then the user should be able to see the "Add Project" link on the cross project list (/projects)
Allow non-admin users to create projects I'm looking to allow non-admin users to create their own projects, i've found the option to set the default role for a non-admin who has created a project, but I cant find how to let them actually create the project, do I have to set a role for them somewhere? or is there a plug...
TITLE: Allow non-admin users to create projects QUESTION: I'm looking to allow non-admin users to create their own projects, i've found the option to set the default role for a non-admin who has created a project, but I cant find how to let them actually create the project, do I have to set a role for them somewhere? ...
[ "redmine", "redmine-plugins" ]
5
12
8,060
3
0
2011-06-03T12:43:06.657000
2011-06-06T23:01:18.750000
6,227,218
6,227,294
LIKE clause in Entity Framework
I have to search records where cityname like '%United States;AK;Adak%' and on basis of result, store value of columns in my viewmodel objects. I have written following code and it is causing an error when casting from a number value must be less than infinity. zipcode=United States;AK;Adak; var zipcd = (from u in db.Z...
Edit - That is a different error message to earlier? Never mind Your cast is wrong - you're trying to cast the results of the query (possibly more than 1 result) to a single object. Viewsearch vs = (Viewsearch)zipcd; Your zipcd is an IQueryable, not a Viewsearch. You could use Single() or First() if you're expecting on...
LIKE clause in Entity Framework I have to search records where cityname like '%United States;AK;Adak%' and on basis of result, store value of columns in my viewmodel objects. I have written following code and it is causing an error when casting from a number value must be less than infinity. zipcode=United States;AK;Ad...
TITLE: LIKE clause in Entity Framework QUESTION: I have to search records where cityname like '%United States;AK;Adak%' and on basis of result, store value of columns in my viewmodel objects. I have written following code and it is causing an error when casting from a number value must be less than infinity. zipcode=U...
[ "linq", "entity-framework" ]
1
0
513
1
0
2011-06-03T12:43:11.860000
2011-06-03T12:49:35.690000