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,251,972
6,251,995
Presenting Modal View Controller before window is visible
I would like to present a view controller modally before calling -makeKeyAndVisible on the application's window. However, this code only shows the mainNav view controller: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { MainViewController *main = [[MainView...
You should better make the window appear and then present the modal view with animated=NO. What's the point of presenting the modal view before everything else is instantiated and displayed? Edit To try to make your code work, here are a couple of hints. Try this: [mainNav presentModalViewController:learnNav animated:N...
Presenting Modal View Controller before window is visible I would like to present a view controller modally before calling -makeKeyAndVisible on the application's window. However, this code only shows the mainNav view controller: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictiona...
TITLE: Presenting Modal View Controller before window is visible QUESTION: I would like to present a view controller modally before calling -makeKeyAndVisible on the application's window. However, this code only shows the mainNav view controller: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithO...
[ "iphone", "ipad", "uiviewcontroller", "modalviewcontroller", "uiwindow" ]
1
3
2,331
1
0
2011-06-06T12:27:05.880000
2011-06-06T12:29:19.827000
6,251,974
6,252,056
is_array() distinction
I have a piece of code where a variable can either be an array or just a string. if(!is_array($relation['display_name'])) { // do something with $relation['display_name'] } else { foreach($relation['display_name'] as $display_name) { // do the same with $display_name } } This of course works - but it's not very nice. A...
You can do it like this: foreach((array)$relation['display_name'] as $display_name) { // do something with $display_name }
is_array() distinction I have a piece of code where a variable can either be an array or just a string. if(!is_array($relation['display_name'])) { // do something with $relation['display_name'] } else { foreach($relation['display_name'] as $display_name) { // do the same with $display_name } } This of course works - bu...
TITLE: is_array() distinction QUESTION: I have a piece of code where a variable can either be an array or just a string. if(!is_array($relation['display_name'])) { // do something with $relation['display_name'] } else { foreach($relation['display_name'] as $display_name) { // do the same with $display_name } } This of...
[ "php", "arrays" ]
3
7
502
6
0
2011-06-06T12:27:17.473000
2011-06-06T12:33:10.263000
6,251,975
6,252,818
Specified throwing AxisFault in WSDL file
I generate my web service from WSDL file. But I need t o define in this file that my methods in SkeletonInterface thow Axis Fault Exception. Smth like: void method() throws AxisFault{....} In which way I can do this (in WSDL). Thanks.
In short, it's bad practice to reuse AxisFault for your own application faults. When I see AxisFault, it signals that something internal to the Axis autogen code failed. This could include your exception wrapped inside of it. First, I want to address your pseudcode. void method() throws AxisFault{....} This pseudocode ...
Specified throwing AxisFault in WSDL file I generate my web service from WSDL file. But I need t o define in this file that my methods in SkeletonInterface thow Axis Fault Exception. Smth like: void method() throws AxisFault{....} In which way I can do this (in WSDL). Thanks.
TITLE: Specified throwing AxisFault in WSDL file QUESTION: I generate my web service from WSDL file. But I need t o define in this file that my methods in SkeletonInterface thow Axis Fault Exception. Smth like: void method() throws AxisFault{....} In which way I can do this (in WSDL). Thanks. ANSWER: In short, it's b...
[ "java", "web-services", "wsdl", "apache-axis" ]
0
1
1,954
2
0
2011-06-06T12:27:30.763000
2011-06-06T13:36:08.493000
6,251,983
6,252,001
Calling method from another class
To begin, I would like to apologize for my English:) I have FirstViewController, which contains scrollView. This is scrolView with enabled paging, and have 2 pages with 2 different view controllers. From one of the view controllers by touching the button the third view controller appears like a modal view. I call a met...
Make sure you have hooked up your IBOutlets in Interface Builder.
Calling method from another class To begin, I would like to apologize for my English:) I have FirstViewController, which contains scrollView. This is scrolView with enabled paging, and have 2 pages with 2 different view controllers. From one of the view controllers by touching the button the third view controller appea...
TITLE: Calling method from another class QUESTION: To begin, I would like to apologize for my English:) I have FirstViewController, which contains scrollView. This is scrolView with enabled paging, and have 2 pages with 2 different view controllers. From one of the view controllers by touching the button the third vie...
[ "iphone", "objective-c", "class", "object", "methods" ]
0
1
715
1
0
2011-06-06T12:28:08.097000
2011-06-06T12:29:35.850000
6,251,988
6,252,046
Is it correct to serialize an event? (Applying a DataMember attribute)
A very simple question... Is it correct to apply a DataMember attribute to an event or a delegate to let it be serialized? Consider what I'm thinking about this: 1) Well, a delegate is a type, based on other types, so as long as those types are serializable themselves there is no need (not correct) to serialize a deleg...
No it is not correct. DataMember can be applied only on property or field - that is defined by AttributeTargets: [AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, Inherited = false, AllowMultiple = false)] public sealed class DataMemberAttribute: Attribute {... } AttributeTargets have separate ...
Is it correct to serialize an event? (Applying a DataMember attribute) A very simple question... Is it correct to apply a DataMember attribute to an event or a delegate to let it be serialized? Consider what I'm thinking about this: 1) Well, a delegate is a type, based on other types, so as long as those types are seri...
TITLE: Is it correct to serialize an event? (Applying a DataMember attribute) QUESTION: A very simple question... Is it correct to apply a DataMember attribute to an event or a delegate to let it be serialized? Consider what I'm thinking about this: 1) Well, a delegate is a type, based on other types, so as long as th...
[ "c#", ".net", "wcf", "serialization", "datacontract" ]
0
3
894
1
0
2011-06-06T12:28:43.867000
2011-06-06T12:32:18.050000
6,251,989
6,252,066
Why is my json encoded?
I have the following code which I post a bunch of JSON data to an ASHX file where I will process this data. Somehow the JSON is encoded and I have no clue what encoded it. $.ajax({ url: '/save_objects_channels.ashx', data: jsonParams, contentType: 'application/json', dataType: 'json', success: function(data) { }, erro...
jQuery encoded it. You chose to send it as a GET request (which is the default for.ajax() ), which transfers all data in the URL as part of the query string. As Clement Herreman also points out, the query string must be encoded. You might want to switch to type: "POST" in your.ajax() parameters. GET requests have a len...
Why is my json encoded? I have the following code which I post a bunch of JSON data to an ASHX file where I will process this data. Somehow the JSON is encoded and I have no clue what encoded it. $.ajax({ url: '/save_objects_channels.ashx', data: jsonParams, contentType: 'application/json', dataType: 'json', success: f...
TITLE: Why is my json encoded? QUESTION: I have the following code which I post a bunch of JSON data to an ASHX file where I will process this data. Somehow the JSON is encoded and I have no clue what encoded it. $.ajax({ url: '/save_objects_channels.ashx', data: jsonParams, contentType: 'application/json', dataType: ...
[ "json", "jquery" ]
0
4
555
2
0
2011-06-06T12:28:45.110000
2011-06-06T12:34:00
6,252,022
6,252,088
PHP mention script
I'm working on a mention script that gets an users profile link when it is being mentioned in a news article or something. I've done the mention script, but it splits the users name after it finds a space. When an user wants to mention somebody they will start their name with a @ symbol. So my script stops after it fin...
There's no way to figure out if a username is just one word or multiple words from your example because the username has the exact same formatting as the rest of the string. There are a few ways you can fix this. You explode on @ then read up until you reach some indicator of the end of the username. So strings would t...
PHP mention script I'm working on a mention script that gets an users profile link when it is being mentioned in a news article or something. I've done the mention script, but it splits the users name after it finds a space. When an user wants to mention somebody they will start their name with a @ symbol. So my script...
TITLE: PHP mention script QUESTION: I'm working on a mention script that gets an users profile link when it is being mentioned in a news article or something. I've done the mention script, but it splits the users name after it finds a space. When an user wants to mention somebody they will start their name with a @ sy...
[ "php" ]
2
1
2,794
7
0
2011-06-06T12:30:42.300000
2011-06-06T12:36:03.857000
6,252,029
6,252,158
Edit text with alert dialog box
I am new to android development and I want to show an alert dialog box for an edit text field. User should enter his weight from 10kg to 99kg only if he enters more than 2 digits alert dialog box should appear, and also with out entering the weight if we press the measure Button it should show the alert dialog. plz som...
You can do something like this AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle("Weight"); alertDialog.setMessage("You forgot to enter your weight!"); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // do ...
Edit text with alert dialog box I am new to android development and I want to show an alert dialog box for an edit text field. User should enter his weight from 10kg to 99kg only if he enters more than 2 digits alert dialog box should appear, and also with out entering the weight if we press the measure Button it shoul...
TITLE: Edit text with alert dialog box QUESTION: I am new to android development and I want to show an alert dialog box for an edit text field. User should enter his weight from 10kg to 99kg only if he enters more than 2 digits alert dialog box should appear, and also with out entering the weight if we press the measu...
[ "android", "android-edittext", "android-alertdialog" ]
1
4
6,473
3
0
2011-06-06T12:31:13.227000
2011-06-06T12:40:53.270000
6,252,030
6,252,177
index ot of bounds exception
game.getS().getVehicles().get(1).updatePosition(positions.get(0)); we are making a client - server racing game and we got this exception in this exact line what can we do or what can we change? here i will show you the all code: package speedrace.client; import static speedrace.common.Config.*; import speedrace.commo...
In your for-loops you almost always start from 1. Is that correct? To let us find the problem, you should post more code, I guess.
index ot of bounds exception game.getS().getVehicles().get(1).updatePosition(positions.get(0)); we are making a client - server racing game and we got this exception in this exact line what can we do or what can we change? here i will show you the all code: package speedrace.client; import static speedrace.common.Conf...
TITLE: index ot of bounds exception QUESTION: game.getS().getVehicles().get(1).updatePosition(positions.get(0)); we are making a client - server racing game and we got this exception in this exact line what can we do or what can we change? here i will show you the all code: package speedrace.client; import static spe...
[ "java", "indexoutofboundsexception" ]
0
0
269
2
0
2011-06-06T12:31:14.073000
2011-06-06T12:42:20.017000
6,252,050
6,252,083
JSTL c:choose issue
I need to implement a switch case using JSTL choose statement, I have tree different choise. Anyone knows the reason why the code below doesn't work? Thanks in advance. Carta di Identità Passaporto Patente di Guida Carta di Identità Passaporto Patente di Guida Carta di Identità Passaporto Patente di Guida Scegli... Car...
Because you didn't evaluate the entire expression inside ${}. Fix it accordingly:......
JSTL c:choose issue I need to implement a switch case using JSTL choose statement, I have tree different choise. Anyone knows the reason why the code below doesn't work? Thanks in advance. Carta di Identità Passaporto Patente di Guida Carta di Identità Passaporto Patente di Guida Carta di Identità Passaporto Patente di...
TITLE: JSTL c:choose issue QUESTION: I need to implement a switch case using JSTL choose statement, I have tree different choise. Anyone knows the reason why the code below doesn't work? Thanks in advance. Carta di Identità Passaporto Patente di Guida Carta di Identità Passaporto Patente di Guida Carta di Identità Pas...
[ "jsp", "jstl", "el" ]
1
5
5,795
2
0
2011-06-06T12:32:45.293000
2011-06-06T12:35:25.033000
6,252,051
6,252,359
How to post on friend wall using Graph Api in iPhone
i am implementing a facebook application, i have used Graph Api and have successfully logged into facebook and got the friend list with the id in UITableView, now i have one string, how should i post on friend wall, Suppose if i click on any of my friend in UITableView, a message should be post,plz help me EDIT: Code N...
Are you using the Facebook iOS SDK? Assuming you are, use requestWithGraphPath e.g.- [_facebook requestWithGraphPath:@"uid/feed" andParams:[NSMutableDictionary dictionaryWithObject:@"Post on wall" forKey:@"message"] andHTTPMethod:@"POST" andDelegate:self]; Where uid is the user id of the user, naturally. You'll need to...
How to post on friend wall using Graph Api in iPhone i am implementing a facebook application, i have used Graph Api and have successfully logged into facebook and got the friend list with the id in UITableView, now i have one string, how should i post on friend wall, Suppose if i click on any of my friend in UITableVi...
TITLE: How to post on friend wall using Graph Api in iPhone QUESTION: i am implementing a facebook application, i have used Graph Api and have successfully logged into facebook and got the friend list with the id in UITableView, now i have one string, how should i post on friend wall, Suppose if i click on any of my f...
[ "iphone", "facebook" ]
1
1
1,423
1
0
2011-06-06T12:32:53.260000
2011-06-06T12:57:48.173000
6,252,060
6,252,269
Check folder path
I'm trying to check if the path given exists. In case it doesn't, I'd like to create a folder with name given in the same directory. Let's say pathOne: "/home/music/A" and pathTwo: "/home/music/B", such that folder A exists but folder B doesn't. Nothing happens if the path given by the user is pathOne, but if its pathT...
You should be able to use Boost Filesystem exists function. It's also portable. There is a very good tutorial describing this very scenario, named Using status queries to determine file existence and type - (tut2.cpp)
Check folder path I'm trying to check if the path given exists. In case it doesn't, I'd like to create a folder with name given in the same directory. Let's say pathOne: "/home/music/A" and pathTwo: "/home/music/B", such that folder A exists but folder B doesn't. Nothing happens if the path given by the user is pathOne...
TITLE: Check folder path QUESTION: I'm trying to check if the path given exists. In case it doesn't, I'd like to create a folder with name given in the same directory. Let's say pathOne: "/home/music/A" and pathTwo: "/home/music/B", such that folder A exists but folder B doesn't. Nothing happens if the path given by t...
[ "c++", "directory" ]
2
3
7,166
4
0
2011-06-06T12:33:23.853000
2011-06-06T12:51:04.133000
6,252,061
6,258,006
Display Hierarchy in a DropDown List
I have a data hierarchy that I currently display in a treeview. I was wondering what would be the easiest way to convert this hierarchy into a dropdown list as well. In a treeview I can find a specific node and add an item under that node. I'm not sure how to do that with a drop down list. Below is the code I have for ...
Your code looks fine but from your comment under your question, it sounds like you are getting a negative value for the index on this line: int index = ddl.Items.IndexOf(ddl.Items.FindByValue(rs.GetString(4).ToString().ToLower())); A negative value indicates that the dropdownlist item that you were searching for was no...
Display Hierarchy in a DropDown List I have a data hierarchy that I currently display in a treeview. I was wondering what would be the easiest way to convert this hierarchy into a dropdown list as well. In a treeview I can find a specific node and add an item under that node. I'm not sure how to do that with a drop dow...
TITLE: Display Hierarchy in a DropDown List QUESTION: I have a data hierarchy that I currently display in a treeview. I was wondering what would be the easiest way to convert this hierarchy into a dropdown list as well. In a treeview I can find a specific node and add an item under that node. I'm not sure how to do th...
[ "c#", "asp.net", "t-sql", "drop-down-menu", "hierarchy" ]
3
3
11,943
3
0
2011-06-06T12:33:30.063000
2011-06-06T21:04:01.240000
6,252,063
6,262,158
How to get the physical address from the logical one in a Linux kernel module?
Is there any suitable way to get the physical address by the logical one except to walk through page directory entries by hand? I've looked for this functionality in kernel's sources and found that there is a follow_page function that do it well with built-in huge and transparent-huge pages support. But it's not export...
Well, it might looks as something like that (follow PTE from an virtual address): void follow_pte(struct mm_struct * mm, unsigned long address, pte_t * entry) { pgd_t * pgd = pgd_offset(mm, address); printk("follow_pte() for %lx\n", address); entry->pte = 0; if (!pgd_none(*pgd) &&!pgd_bad(*pgd)) { pud_t * pud = pud_o...
How to get the physical address from the logical one in a Linux kernel module? Is there any suitable way to get the physical address by the logical one except to walk through page directory entries by hand? I've looked for this functionality in kernel's sources and found that there is a follow_page function that do it ...
TITLE: How to get the physical address from the logical one in a Linux kernel module? QUESTION: Is there any suitable way to get the physical address by the logical one except to walk through page directory entries by hand? I've looked for this functionality in kernel's sources and found that there is a follow_page fu...
[ "linux", "memory-management", "linux-kernel" ]
11
6
20,731
3
0
2011-06-06T12:33:37.813000
2011-06-07T07:52:03.280000
6,252,065
6,252,176
Runtime ASP.NET confirmation dialog box
I need to ask the user if he/she wants to continue an operation (say, save operation). So, after the user clicks the Save button, some stuff is checked on the server side. If one condition is met, the user must be asked if he/she wants to proceed. Based on user's answer, the postback should be automatically performed c...
You can use btnExample.Attributes.Add("onclick", "javascript:return confirm('continue?')"; just one of the options... EDIT: for your needs you will want to use AJAX, call a method on the server and upon callback open the confirm window. 2nd Edit: if the server side work isn't long I would this using AJAX. AJAX works as...
Runtime ASP.NET confirmation dialog box I need to ask the user if he/she wants to continue an operation (say, save operation). So, after the user clicks the Save button, some stuff is checked on the server side. If one condition is met, the user must be asked if he/she wants to proceed. Based on user's answer, the post...
TITLE: Runtime ASP.NET confirmation dialog box QUESTION: I need to ask the user if he/she wants to continue an operation (say, save operation). So, after the user clicks the Save button, some stuff is checked on the server side. If one condition is met, the user must be asked if he/she wants to proceed. Based on user'...
[ "c#", "asp.net", "ajax" ]
2
1
4,099
3
0
2011-06-06T12:33:54.290000
2011-06-06T12:42:17.110000
6,252,067
6,252,209
What are the criteria for automatic semicolon insertion?
Possible Duplicate: What are the rules for Javascript's automatic semicolon insertion? JavaScript befuddles me with its implicit line termination. It's a very C-like language, except that ending lines in a semi-colon is often optional. So how does it decide when to assume an end-of-line? Consider this example: var x = ...
The ECMA specification (ch. 7.9.1, page 26) states: There are three basic rules of semicolon insertion: When, as the program is parsed from left to right, a token (called the offending token) is encountered that is not allowed by any production of the grammar, then a semicolon is automatically inserted before the offen...
What are the criteria for automatic semicolon insertion? Possible Duplicate: What are the rules for Javascript's automatic semicolon insertion? JavaScript befuddles me with its implicit line termination. It's a very C-like language, except that ending lines in a semi-colon is often optional. So how does it decide when ...
TITLE: What are the criteria for automatic semicolon insertion? QUESTION: Possible Duplicate: What are the rules for Javascript's automatic semicolon insertion? JavaScript befuddles me with its implicit line termination. It's a very C-like language, except that ending lines in a semi-colon is often optional. So how do...
[ "javascript", "syntax" ]
1
7
2,118
2
0
2011-06-06T12:34:00.483000
2011-06-06T12:45:16.130000
6,252,085
6,252,185
Exception handling in pl/sql
I have a stored procedure create or replace procedure Trial is Begin ---Block A-- EXCEPTION when others then insert into error_log values('error'); --Block A ends---- --Block B ---- ----Block B ends--- end; I want code in Block B to execute in all condition i.e if exception in Block A is raised or not.With the above co...
You can created nested blocks: create or replace procedure Trial is Begin begin ---Block A-- EXCEPTION when others then insert into error_log values('error'); end; begin --Block B ---- end; end;
Exception handling in pl/sql I have a stored procedure create or replace procedure Trial is Begin ---Block A-- EXCEPTION when others then insert into error_log values('error'); --Block A ends---- --Block B ---- ----Block B ends--- end; I want code in Block B to execute in all condition i.e if exception in Block A is ra...
TITLE: Exception handling in pl/sql QUESTION: I have a stored procedure create or replace procedure Trial is Begin ---Block A-- EXCEPTION when others then insert into error_log values('error'); --Block A ends---- --Block B ---- ----Block B ends--- end; I want code in Block B to execute in all condition i.e if exceptio...
[ "oracle", "plsql" ]
6
7
3,411
2
0
2011-06-06T12:35:55.907000
2011-06-06T12:42:55.100000
6,252,086
6,254,061
How to stream byte array image?
For some strange reason, a five year old internal asp.net web app that is used through IE6 has suddenly developed an issue, even though there have been no code changes. Certain images that are being streamed back to the web browser aren't appearing for some users. I don't know why this was suddenly started happening or...
Response.End() is generally bad as it aborts the IIS thread even if it's in the middle of Flush()-ing. Use Response.Flush() followed by Response.Close() to make sure all content is sent to the client.
How to stream byte array image? For some strange reason, a five year old internal asp.net web app that is used through IE6 has suddenly developed an issue, even though there have been no code changes. Certain images that are being streamed back to the web browser aren't appearing for some users. I don't know why this w...
TITLE: How to stream byte array image? QUESTION: For some strange reason, a five year old internal asp.net web app that is used through IE6 has suddenly developed an issue, even though there have been no code changes. Certain images that are being streamed back to the web browser aren't appearing for some users. I don...
[ "c#", "asp.net", "image", "stream" ]
2
1
2,107
2
0
2011-06-06T12:36:00.457000
2011-06-06T15:06:41.827000
6,252,092
6,252,143
how to change back button title of navigation in iphone
How to not show Back Bar Button of navigation controller. When I am trying to write my title with " " then this is showing default title name (Root). How to change it?
if you don't want to see the back button, use below self.navigationItem.backBarButtonItem = nil; if you want to see your text instead of "Back" button. you could also define your action:. self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"MyOwnBackTitle" style: UIBarButtonItemStyleBordere...
how to change back button title of navigation in iphone How to not show Back Bar Button of navigation controller. When I am trying to write my title with " " then this is showing default title name (Root). How to change it?
TITLE: how to change back button title of navigation in iphone QUESTION: How to not show Back Bar Button of navigation controller. When I am trying to write my title with " " then this is showing default title name (Root). How to change it? ANSWER: if you don't want to see the back button, use below self.navigationIt...
[ "iphone" ]
0
6
1,687
3
0
2011-06-06T12:36:19.480000
2011-06-06T12:39:35.270000
6,252,094
6,252,181
php mail invalid HELO name
i am trying to use localhost to send mail. however, i am getting this error when sending: Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1). i have smtp settings correct in php.ini and am just confused as to what this means. thanks
There seem to be two primary reasons for this. The first has to do with the email client configuration (google INVALID HELO OUTLOOK). The other reason is an improperly configured SMTP server where the server sends out emails with only the server name and not a fully qualified name (e.g., emailserver vs emailserver.mydo...
php mail invalid HELO name i am trying to use localhost to send mail. however, i am getting this error when sending: Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1). i have smtp settings correct in php.ini and am just confused as to what this means. tha...
TITLE: php mail invalid HELO name QUESTION: i am trying to use localhost to send mail. however, i am getting this error when sending: Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1). i have smtp settings correct in php.ini and am just confused as to wh...
[ "php", "wamp" ]
1
1
8,050
2
0
2011-06-06T12:36:28.420000
2011-06-06T12:42:38.843000
6,252,095
6,252,157
Lists + Structs: Object reference not set to an instance of an object
I get this error with this code: struct Msg { public int remove; public string text; } public class Messages { #region Class Variables protected SpriteBatch sb; List msgList; #endregion public Messages(SpriteBatch spriteBatch) { sb = spriteBatch; List msgList = new List (); } public int Now() { return DateTime.Now.S...
The field msgList is not initialized. In the constructor you declared and initialized a new local variable of type List. public Messages(SpriteBatch spriteBatch) { sb = spriteBatch; msgList = new List (); // correct way }
Lists + Structs: Object reference not set to an instance of an object I get this error with this code: struct Msg { public int remove; public string text; } public class Messages { #region Class Variables protected SpriteBatch sb; List msgList; #endregion public Messages(SpriteBatch spriteBatch) { sb = spriteBatch; L...
TITLE: Lists + Structs: Object reference not set to an instance of an object QUESTION: I get this error with this code: struct Msg { public int remove; public string text; } public class Messages { #region Class Variables protected SpriteBatch sb; List msgList; #endregion public Messages(SpriteBatch spriteBatch) { s...
[ "c#", "list", "struct" ]
2
5
3,829
2
0
2011-06-06T12:36:29.623000
2011-06-06T12:40:42.787000
6,252,102
6,252,171
Why can't the browser search POST HTML request's body for the parameters and then bookmark the pages like for GET
POST HTML requests can't be bookmarked but GET ones can be. The reason given is that the parameters are appended in the case of GET whereas they are not in POST. Why can't the browser search POST HTML requests body for the parameters and then bookmark the pages like for GET?
Theoretically speaking — they could. They shouldn't though, as POST requests are supposed to "request that the origin server accept the entity enclosed in the request as a new subordinate of the resource". Examples given by the spec are: Annotation of existing resources; Posting a message to a bulletin board, newsgroup...
Why can't the browser search POST HTML request's body for the parameters and then bookmark the pages like for GET POST HTML requests can't be bookmarked but GET ones can be. The reason given is that the parameters are appended in the case of GET whereas they are not in POST. Why can't the browser search POST HTML reque...
TITLE: Why can't the browser search POST HTML request's body for the parameters and then bookmark the pages like for GET QUESTION: POST HTML requests can't be bookmarked but GET ones can be. The reason given is that the parameters are appended in the case of GET whereas they are not in POST. Why can't the browser sear...
[ "html", "post", "get" ]
1
1
155
2
0
2011-06-06T12:37:12.637000
2011-06-06T12:42:01.760000
6,252,115
6,252,163
Freeing a pointer from memory in c#
I'm dealing with pointer in C# using fixed{} phrases. I placed my code inside the brackets of the fixed statement and want to know if the Garbage collection will handle the pointer freeing after the fixed statement fixed{int * p=&x} { // i work with x. } if not how can I free it?
Your pointer points to a managed object ( x ) so there is nothing to worry about: the pointer does not need to be freed (or rather, it goes out of scope at the end of the fixed block) and the pointee x itself is managed by the GC.
Freeing a pointer from memory in c# I'm dealing with pointer in C# using fixed{} phrases. I placed my code inside the brackets of the fixed statement and want to know if the Garbage collection will handle the pointer freeing after the fixed statement fixed{int * p=&x} { // i work with x. } if not how can I free it?
TITLE: Freeing a pointer from memory in c# QUESTION: I'm dealing with pointer in C# using fixed{} phrases. I placed my code inside the brackets of the fixed statement and want to know if the Garbage collection will handle the pointer freeing after the fixed statement fixed{int * p=&x} { // i work with x. } if not how ...
[ "c#" ]
6
5
1,466
2
0
2011-06-06T12:37:39.953000
2011-06-06T12:41:06.843000
6,252,123
6,252,173
Android TextView Wrap
Here is my problem. How to make text don't wrap? I already tried to make text smaller. Didn't work. Tried to do singleline="true". Here is what he do(2 screen shot 6-7 textview) 1 Screenshot) Here is I made it in the Eclipse 2 Screenshot) Here is how it showen in the emulator
Try setting android:ellipsize to none for each TextView. For more details see documentation on this attribute. From xml: From code: TextView textView = new TextView(context);... textView.setEllipsize(null);
Android TextView Wrap Here is my problem. How to make text don't wrap? I already tried to make text smaller. Didn't work. Tried to do singleline="true". Here is what he do(2 screen shot 6-7 textview) 1 Screenshot) Here is I made it in the Eclipse 2 Screenshot) Here is how it showen in the emulator
TITLE: Android TextView Wrap QUESTION: Here is my problem. How to make text don't wrap? I already tried to make text smaller. Didn't work. Tried to do singleline="true". Here is what he do(2 screen shot 6-7 textview) 1 Screenshot) Here is I made it in the Eclipse 2 Screenshot) Here is how it showen in the emulator AN...
[ "java", "android", "android-activity", "textview" ]
6
4
7,757
2
0
2011-06-06T12:38:08.203000
2011-06-06T12:42:07.903000
6,252,141
6,252,420
Memory layout of a set
How is a set organized in memory in Delphi? What I try to do is casting a simple type to a set type like var MyNumber: Word; ShiftState: TShiftState; begin MyNumber:=42; ShiftState:=TShiftState(MyNumber); end; Delphi (2009) won't allow this and I don't understand why. It would make my life a lot easier in cases where I...
A Delphi set is a bit field who's bits correspond to the associated values of the elements in your set. For a set of normal enumerated types the bit layout is straight-forward: bit 0 corresponds to set element with ordinal value 0 bit 1 corresponds to set element with ordinal value 1 and so on. Things get a bit interes...
Memory layout of a set How is a set organized in memory in Delphi? What I try to do is casting a simple type to a set type like var MyNumber: Word; ShiftState: TShiftState; begin MyNumber:=42; ShiftState:=TShiftState(MyNumber); end; Delphi (2009) won't allow this and I don't understand why. It would make my life a lot ...
TITLE: Memory layout of a set QUESTION: How is a set organized in memory in Delphi? What I try to do is casting a simple type to a set type like var MyNumber: Word; ShiftState: TShiftState; begin MyNumber:=42; ShiftState:=TShiftState(MyNumber); end; Delphi (2009) won't allow this and I don't understand why. It would m...
[ "delphi", "casting", "set", "delphi-2009" ]
7
6
1,213
4
0
2011-06-06T12:39:22.647000
2011-06-06T13:03:36.050000
6,252,146
6,253,705
QT threads :Getting QObject::startTimer: timers cannot be started from another thread warning
I follow the examples from the Qt SDK, starting timer in the QThread Subclass but I keep getting the warning and the thread never starts the timer. Here is the code: NotificationThread::NotificationThread(QObject *parent):QThread(parent), m_timerInterval(0) { moveToThread(this); } NotificationThread::~NotificationThre...
If you add the line m_NotificationTimer.moveToThread(this); to beginning of run() method of your thread from that point on your timer object will invoke the connected slot within the your thread. When you first create the timer it will run within your main thread. By moving it to your own thread as above the moveToThre...
QT threads :Getting QObject::startTimer: timers cannot be started from another thread warning I follow the examples from the Qt SDK, starting timer in the QThread Subclass but I keep getting the warning and the thread never starts the timer. Here is the code: NotificationThread::NotificationThread(QObject *parent):QThr...
TITLE: QT threads :Getting QObject::startTimer: timers cannot be started from another thread warning QUESTION: I follow the examples from the Qt SDK, starting timer in the QThread Subclass but I keep getting the warning and the thread never starts the timer. Here is the code: NotificationThread::NotificationThread(QOb...
[ "c++", "qthread" ]
14
9
47,409
3
0
2011-06-06T12:39:41.107000
2011-06-06T14:41:21.410000
6,252,150
6,252,807
WCF Message Encryption without Authentication/Authorization or Certificates
I have a.NET 4.0 project with two modules that will communicate via WCF services and I'd like to implement a custom encryption mechanism. My scenario: I control both endpoints (client and server) but not the connection between them Windows auth is out of question, since I do not know at this point where the modules wil...
I would say that you don't want security - static key for encrypting messages with symmetric encryption algorithm is just a notion of security. Anyway if you want to do that there are really extension points which will allow you to do that on many different levels. Encrypting the whole message - that would require cust...
WCF Message Encryption without Authentication/Authorization or Certificates I have a.NET 4.0 project with two modules that will communicate via WCF services and I'd like to implement a custom encryption mechanism. My scenario: I control both endpoints (client and server) but not the connection between them Windows auth...
TITLE: WCF Message Encryption without Authentication/Authorization or Certificates QUESTION: I have a.NET 4.0 project with two modules that will communicate via WCF services and I'd like to implement a custom encryption mechanism. My scenario: I control both endpoints (client and server) but not the connection between...
[ ".net", "wcf", "encryption" ]
1
2
1,449
1
0
2011-06-06T12:39:51.480000
2011-06-06T13:35:00.587000
6,252,154
6,290,353
ASP.NET MVC default binder: too long ints, empty validation error message
I've got the following model class (stripped for simplicity): public class Info { public int IntData { get; set; } } Here's my Razor form that uses this model: @model Info @Html.ValidationSummary() @using (Html.BeginForm()) { @Html.TextBoxFor(x => x.IntData) } Now if I enter a non-numeric data into the textbox, I recei...
One way would be to write a custom model binder: public class IntModelBinder: DefaultModelBinder { public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { var value = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); if (value!= null) { int temp; if (!i...
ASP.NET MVC default binder: too long ints, empty validation error message I've got the following model class (stripped for simplicity): public class Info { public int IntData { get; set; } } Here's my Razor form that uses this model: @model Info @Html.ValidationSummary() @using (Html.BeginForm()) { @Html.TextBoxFor(x =...
TITLE: ASP.NET MVC default binder: too long ints, empty validation error message QUESTION: I've got the following model class (stripped for simplicity): public class Info { public int IntData { get; set; } } Here's my Razor form that uses this model: @model Info @Html.ValidationSummary() @using (Html.BeginForm()) { @H...
[ "c#", "validation", "asp.net-mvc-3", "model-binding", "defaultmodelbinder" ]
8
8
2,395
2
0
2011-06-06T12:40:21.307000
2011-06-09T08:58:01.317000
6,252,170
6,282,489
How to set up intent for viewing image that is saved in internal storage with default Android viewer?
What I am trying to do is to download image from web (its in GIF format, if that changes anything) and show it on screen with zoom/pan capability. I've successfully downloaded image into Bitmap instance myBitmap, but ImageView doesnt have zooming feature. So instead I'm willing to present it with default viewer which h...
The following works well for me: Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(outputFileName)),"image/jpeg"); startActivity(intent); The difference that I see is that you do not call the setDataAndType.
How to set up intent for viewing image that is saved in internal storage with default Android viewer? What I am trying to do is to download image from web (its in GIF format, if that changes anything) and show it on screen with zoom/pan capability. I've successfully downloaded image into Bitmap instance myBitmap, but I...
TITLE: How to set up intent for viewing image that is saved in internal storage with default Android viewer? QUESTION: What I am trying to do is to download image from web (its in GIF format, if that changes anything) and show it on screen with zoom/pan capability. I've successfully downloaded image into Bitmap instan...
[ "android", "android-image" ]
1
3
1,513
1
0
2011-06-06T12:42:00.700000
2011-06-08T17:02:59.900000
6,252,172
6,252,416
How to center main div horizontally and still have a div on its left
i'm looking for the best way to do the following: --------------------------|-------------------------- | | | -------- ------------------------- | | | menu | | | | | | | | | | | -------- | #content | | | | | | | | | | | | | | | ------------------------- | | | | | --------------------------|-------------------------- Th...
Provided all widths are fixed, try this: http://jsfiddle.net/hvrzx/ It requires one additional div, but removes all positioning. Compute margin-left of #innerwrap using the following formula: (o+c)/2-i, where o is the width of #outerwrap, c is the width of #content and i is the width of #innerwrap. Change of #innerwrap...
How to center main div horizontally and still have a div on its left i'm looking for the best way to do the following: --------------------------|-------------------------- | | | -------- ------------------------- | | | menu | | | | | | | | | | | -------- | #content | | | | | | | | | | | | | | | -----------------------...
TITLE: How to center main div horizontally and still have a div on its left QUESTION: i'm looking for the best way to do the following: --------------------------|-------------------------- | | | -------- ------------------------- | | | menu | | | | | | | | | | | -------- | #content | | | | | | | | | | | | | | | -----...
[ "css", "positioning", "center", "css-position" ]
2
0
286
3
0
2011-06-06T12:42:04.353000
2011-06-06T13:03:06.237000
6,252,174
6,261,418
Signing requests with Twitter API
Here is a problem that is driving me crazy: the code below works perfectly for the first URL (lookup), but not for the second one (update status). I get an Incorrect signature error with my request... url = string.Format("http://api.twitter.com/1/users/lookup.xml?screen_name={0}", myOAuth.UrlEncode("someuser")); url = ...
This is just a small piece of conjecture. Possible problem 1. The update api will only work if actually send it as a POST request (not only sign it as a POST request). When twitter recreates your signature to verify the signature you send, it checks which http method the request was sent with and uses that information ...
Signing requests with Twitter API Here is a problem that is driving me crazy: the code below works perfectly for the first URL (lookup), but not for the second one (update status). I get an Incorrect signature error with my request... url = string.Format("http://api.twitter.com/1/users/lookup.xml?screen_name={0}", myOA...
TITLE: Signing requests with Twitter API QUESTION: Here is a problem that is driving me crazy: the code below works perfectly for the first URL (lookup), but not for the second one (update status). I get an Incorrect signature error with my request... url = string.Format("http://api.twitter.com/1/users/lookup.xml?scre...
[ "c#", "oauth", "twitter" ]
0
2
501
1
0
2011-06-06T12:42:10.680000
2011-06-07T06:34:50.560000
6,252,184
6,291,378
How do i create folders in sdcard containing images while installing application on device?
I am using gridview example with image adapter to render images with difference that these images are retrieved from a particular folder in sdcard for e.g. /sdcard/images. I am testing this application on emulator.For this i have firstly configured sdcard on emulator and then pushed the images on this particular folder...
This can be done by creating zip of all resources and put them in assets folder and then unzip these folder into sdcard using following reference: http://www.jondev.net/articles/Unzipping_Files_with_Android_%28Programmatically%29
How do i create folders in sdcard containing images while installing application on device? I am using gridview example with image adapter to render images with difference that these images are retrieved from a particular folder in sdcard for e.g. /sdcard/images. I am testing this application on emulator.For this i hav...
TITLE: How do i create folders in sdcard containing images while installing application on device? QUESTION: I am using gridview example with image adapter to render images with difference that these images are retrieved from a particular folder in sdcard for e.g. /sdcard/images. I am testing this application on emula...
[ "android", "android-sdcard" ]
1
0
1,691
5
0
2011-06-06T12:42:53.743000
2011-06-09T10:29:08.567000
6,252,187
6,252,481
Test default value and setter in same test-case or separate test cases
Would you recommend doing any grouping of test cases within @Test methods, or have one @Test method per test scenario? For example, let's suppose that there are different ways to set the context in an application. Is the following idea acceptable? @Test public void testContextSetting() { // Test default setting assert(...
I prefer having one test case per method. First it is easier to see what cases are being tested if they are split into methods as opposed to looking for comments embedded in the code. Most IDEs will give you a summary of methods, so instead of saying "did I test edgecase XYZ?" and then hunting for a comment, or looking...
Test default value and setter in same test-case or separate test cases Would you recommend doing any grouping of test cases within @Test methods, or have one @Test method per test scenario? For example, let's suppose that there are different ways to set the context in an application. Is the following idea acceptable? @...
TITLE: Test default value and setter in same test-case or separate test cases QUESTION: Would you recommend doing any grouping of test cases within @Test methods, or have one @Test method per test scenario? For example, let's suppose that there are different ways to set the context in an application. Is the following ...
[ "java", "testing", "junit4" ]
40
35
19,117
5
0
2011-06-06T12:43:33.007000
2011-06-06T13:09:06.957000
6,252,191
6,290,898
Wordcount C++ Hadoop pipes does not work
I am trying to run the example of wordcount in C++ like this link describes the way to do: Running the WordCount program in C++. The compilation works fine, but when I tried to run my program, an error appeared: bin/hadoop pipes -conf../dev/word.xml -input testtile.txt -output wordcount-out 11/06/06 14:23:40 WARN mapre...
I do not know if I have to answer to my question in this way, or edit my question. Anyway I find the solution and I just want to tell it for everyone who will get the same error. After few days of research and try, I understand that Fedora and C++ on 64bits for Hadoop is not a good match. I tried to compile the Hadoop ...
Wordcount C++ Hadoop pipes does not work I am trying to run the example of wordcount in C++ like this link describes the way to do: Running the WordCount program in C++. The compilation works fine, but when I tried to run my program, an error appeared: bin/hadoop pipes -conf../dev/word.xml -input testtile.txt -output w...
TITLE: Wordcount C++ Hadoop pipes does not work QUESTION: I am trying to run the example of wordcount in C++ like this link describes the way to do: Running the WordCount program in C++. The compilation works fine, but when I tried to run my program, an error appeared: bin/hadoop pipes -conf../dev/word.xml -input test...
[ "c++", "hadoop", "cluster-computing", "word-count" ]
1
1
1,646
1
0
2011-06-06T12:43:50.357000
2011-06-09T09:44:09.983000
6,252,194
6,252,292
How to install OpenRasta Visual Studio Templates?
I know I'm missing something stupid. I followed the instructions in wiki and I got few zip files in bin\Release\vside folder, which I'm sure are visual studio templates. But I don't know how to install them to be available in Visual Studio new project dialog.
Copy the zip files to My Doucmetns/Visual Studio 2008/Templates We don't support those templates anymore though as no one is there to maintain them anymore (they are only for vs 2008)
How to install OpenRasta Visual Studio Templates? I know I'm missing something stupid. I followed the instructions in wiki and I got few zip files in bin\Release\vside folder, which I'm sure are visual studio templates. But I don't know how to install them to be available in Visual Studio new project dialog.
TITLE: How to install OpenRasta Visual Studio Templates? QUESTION: I know I'm missing something stupid. I followed the instructions in wiki and I got few zip files in bin\Release\vside folder, which I'm sure are visual studio templates. But I don't know how to install them to be available in Visual Studio new project ...
[ "visual-studio-2010", "templates", "installation", "project", "openrasta" ]
1
3
259
1
0
2011-06-06T12:43:57.270000
2011-06-06T12:52:28.643000
6,252,199
6,252,324
.htaccess 301 Redirect problem
I have the following code in.htaccess redirect 301 /movies/ /list.php?category=13 It works, but when go to /movies/ other.html, it also redirects to list.php, but I don't actually need that, as there is another rule that handles URLs of type ^movies/(.*)\.html$
Use RedirectMatch and use the line ending $ in your match. Here the / may or may not be present. RedirectMatch 301 /movies(/)?$ /list.php?category=13
.htaccess 301 Redirect problem I have the following code in.htaccess redirect 301 /movies/ /list.php?category=13 It works, but when go to /movies/ other.html, it also redirects to list.php, but I don't actually need that, as there is another rule that handles URLs of type ^movies/(.*)\.html$
TITLE: .htaccess 301 Redirect problem QUESTION: I have the following code in.htaccess redirect 301 /movies/ /list.php?category=13 It works, but when go to /movies/ other.html, it also redirects to list.php, but I don't actually need that, as there is another rule that handles URLs of type ^movies/(.*)\.html$ ANSWER: ...
[ ".htaccess", "redirect" ]
2
1
444
1
0
2011-06-06T12:44:38.313000
2011-06-06T12:55:20.260000
6,252,200
6,252,244
Log wrong Username/Password attempts with IP good practice?
i've developed an intranet application and implemented an custom ASP.NET Membership Provider with Forms-Authentication. I thought it would be a good idea to log all failed login attempts in DBMS. Hence i've created a table with following model: Now my question: Is it good practise to store this for safety reasons or is...
Not a good idea for users who misspell their user ID but give the correct password!
Log wrong Username/Password attempts with IP good practice? i've developed an intranet application and implemented an custom ASP.NET Membership Provider with Forms-Authentication. I thought it would be a good idea to log all failed login attempts in DBMS. Hence i've created a table with following model: Now my question...
TITLE: Log wrong Username/Password attempts with IP good practice? QUESTION: i've developed an intranet application and implemented an custom ASP.NET Membership Provider with Forms-Authentication. I thought it would be a good idea to log all failed login attempts in DBMS. Hence i've created a table with following mode...
[ "asp.net", "security", "asp.net-membership", "data-protection" ]
0
4
539
4
0
2011-06-06T12:44:49.373000
2011-06-06T12:48:09.297000
6,252,203
6,252,286
System.Net.HttpListener only explicitly implements IDisposable
Why does HttpListener explicitly implement IDisposable. This means you have to cast to IDisposable before calling dispose and in my opinion makes the fact you have to call dispose less obvious.
You don't need an explicit cast if you use a using block. (This is the preferred idiom, where possible, for dealing with IDisposable objects.) using (HttpListener hl = /*... */) { //... } It has a Close method which is pretty-much an alias for Dispose. (Not my favourite pattern, but the framework designers seem to like...
System.Net.HttpListener only explicitly implements IDisposable Why does HttpListener explicitly implement IDisposable. This means you have to cast to IDisposable before calling dispose and in my opinion makes the fact you have to call dispose less obvious.
TITLE: System.Net.HttpListener only explicitly implements IDisposable QUESTION: Why does HttpListener explicitly implement IDisposable. This means you have to cast to IDisposable before calling dispose and in my opinion makes the fact you have to call dispose less obvious. ANSWER: You don't need an explicit cast if y...
[ ".net" ]
7
7
1,649
1
0
2011-06-06T12:45:02.433000
2011-06-06T12:52:08.920000
6,252,205
6,252,484
ajax not running after var data = json_parse(msg.d);
This is the first time i am playing with Ajax. I am trying to just create a basic login at the moment. Anyways i have the following script.. For some reason it does not run anything after var data = json_parse(msg.d); It shows the first two alerts but noting after. the ajax page has the following ` [WebMethod] public s...
Whats inside the function json_parse? That function could be the source of your error. A better method to parse JSON is like this. Go to Douglas Crockford's Github JSON-js/json2.js and copy it Minify it at jscompress.com and copy the compressed code ( can skip this step ) Paste it somewhere in your Application folder a...
ajax not running after var data = json_parse(msg.d); This is the first time i am playing with Ajax. I am trying to just create a basic login at the moment. Anyways i have the following script.. For some reason it does not run anything after var data = json_parse(msg.d); It shows the first two alerts but noting after. t...
TITLE: ajax not running after var data = json_parse(msg.d); QUESTION: This is the first time i am playing with Ajax. I am trying to just create a basic login at the moment. Anyways i have the following script.. For some reason it does not run anything after var data = json_parse(msg.d); It shows the first two alerts b...
[ "c#", "asp.net", "ajax" ]
0
0
977
2
0
2011-06-06T12:45:05.193000
2011-06-06T13:09:27.330000
6,252,211
6,254,590
(iphone) submit app for world-wide or specific countries
I'd like to eventually submit my app for world-wide access. However, I'd like to submit to specific countries first. I wonder if I can gradually broaden the countries where my app will be sold. And, if there's a way to do it, would it be any different from submitting it world-wide from the beginning. Would I still mana...
You can change your app country by country availability in the Rights and Pricing section on ITunesConnect. You will not have to handle more than one binary, it's always the same binary, you just change on which countries it will be available on the same way you can change the price.
(iphone) submit app for world-wide or specific countries I'd like to eventually submit my app for world-wide access. However, I'd like to submit to specific countries first. I wonder if I can gradually broaden the countries where my app will be sold. And, if there's a way to do it, would it be any different from submit...
TITLE: (iphone) submit app for world-wide or specific countries QUESTION: I'd like to eventually submit my app for world-wide access. However, I'd like to submit to specific countries first. I wonder if I can gradually broaden the countries where my app will be sold. And, if there's a way to do it, would it be any dif...
[ "iphone", "submit", "publish" ]
2
6
890
1
0
2011-06-06T12:45:20.450000
2011-06-06T15:48:34.793000
6,252,218
6,252,306
ASP.NET Web Service Application vs ASP.NET Web Service
I am a newbie in.NET. Today I am learning about Web Service. I found two ways of creating a web service. First one is - Right click on Solution << Add New Project << ASP.NET Web Service Application Second one is - Right click on Solution << Add New Web Site << ASP.NET Web Service What is the difference between them?
The Web Service Application precompiles all of your code into a singe.dll that will be placed in the bin. So if you have several web service files and code in each one of them, they will all be compiled into a common dll. This library will be loaded each time any of the services is called. The web service website will ...
ASP.NET Web Service Application vs ASP.NET Web Service I am a newbie in.NET. Today I am learning about Web Service. I found two ways of creating a web service. First one is - Right click on Solution << Add New Project << ASP.NET Web Service Application Second one is - Right click on Solution << Add New Web Site << ASP....
TITLE: ASP.NET Web Service Application vs ASP.NET Web Service QUESTION: I am a newbie in.NET. Today I am learning about Web Service. I found two ways of creating a web service. First one is - Right click on Solution << Add New Project << ASP.NET Web Service Application Second one is - Right click on Solution << Add Ne...
[ "asp.net", "web-services" ]
0
3
1,036
3
0
2011-06-06T12:45:37.783000
2011-06-06T12:53:44.740000
6,252,225
6,264,188
How can JMX in embedded glassfish be activated?
how can one activate JMX in embedded glassfish (using maven-embedded-glassfish-plugin)?
The solution is to provide proper domain.xml to plugin: ${basedir}/domain.xml Default one has JMX inactive.
How can JMX in embedded glassfish be activated? how can one activate JMX in embedded glassfish (using maven-embedded-glassfish-plugin)?
TITLE: How can JMX in embedded glassfish be activated? QUESTION: how can one activate JMX in embedded glassfish (using maven-embedded-glassfish-plugin)? ANSWER: The solution is to provide proper domain.xml to plugin: ${basedir}/domain.xml Default one has JMX inactive.
[ "maven", "jmx", "glassfish-3", "glassfish-embedded" ]
1
0
288
1
0
2011-06-06T12:46:10.310000
2011-06-07T10:57:55.023000
6,252,236
6,259,146
using python nltk to find similarity between two web pages?
I want to find whether two web pages are similar or not. Can someone suggest if python nltk with wordnet similarity functions helpful and how? What is the best similarity function to be used in this case?
The spotsigs paper mentioned by joyceschan addresses content duplication detection and it contains plenty of food for thought. If you are looking for a quick comparison of key terms, nltk standard functions might suffice. With nltk you can pull synonyms of your terms by looking up the synsets contained by WordNet >>> f...
using python nltk to find similarity between two web pages? I want to find whether two web pages are similar or not. Can someone suggest if python nltk with wordnet similarity functions helpful and how? What is the best similarity function to be used in this case?
TITLE: using python nltk to find similarity between two web pages? QUESTION: I want to find whether two web pages are similar or not. Can someone suggest if python nltk with wordnet similarity functions helpful and how? What is the best similarity function to be used in this case? ANSWER: The spotsigs paper mentioned...
[ "python", "nlp", "nltk", "wordnet" ]
7
14
6,874
2
0
2011-06-06T12:47:26.713000
2011-06-06T23:25:35.137000
6,252,242
6,252,718
How to JSON encode a hash?
I would like to iterate over a hash on the server-side, and send it over to the client in the sorted order using JSON. My question is: When I am in my foreach -loop and have the key and complex value (see how my hash looks like at the bottom), how do I insert it in to the JSON string? Here is how I do that use JSON; my...
And the JSON builtin sort does not enough? see: http://metacpan.org/pod/JSON#sort_by Sorting is supported only with JSON:PP (Perl, not XS - AFAIK) so: use JSON::PP; use warnings; use strict; my $data = { 'aaa' => { a => 1, b => 2, }, 'bbb' => { x => 3, }, 'a2' => { z => 4, } }; my $json = JSON::PP->new->allow_nonref;...
How to JSON encode a hash? I would like to iterate over a hash on the server-side, and send it over to the client in the sorted order using JSON. My question is: When I am in my foreach -loop and have the key and complex value (see how my hash looks like at the bottom), how do I insert it in to the JSON string? Here is...
TITLE: How to JSON encode a hash? QUESTION: I would like to iterate over a hash on the server-side, and send it over to the client in the sorted order using JSON. My question is: When I am in my foreach -loop and have the key and complex value (see how my hash looks like at the bottom), how do I insert it in to the JS...
[ "perl", "json", "hash" ]
7
9
10,621
2
0
2011-06-06T12:47:54.213000
2011-06-06T13:28:37.340000
6,252,257
6,252,521
Grails controllers each with multiple buttons
I want to do something like the folowing image: Everytime i click on Add, a new page is shown and i chose the name for a button to add. Every button, when is clicked, should pass a diferent params to the same controller (same controller for each button, what differs is the params list). The button name should come from...
Params will be available in the controller for form elements that are present in the form. In your case, you probably want to use a hidden within the form: In your controller, you'll be able to use params.id.
Grails controllers each with multiple buttons I want to do something like the folowing image: Everytime i click on Add, a new page is shown and i chose the name for a button to add. Every button, when is clicked, should pass a diferent params to the same controller (same controller for each button, what differs is the ...
TITLE: Grails controllers each with multiple buttons QUESTION: I want to do something like the folowing image: Everytime i click on Add, a new page is shown and i chose the name for a button to add. Every button, when is clicked, should pass a diferent params to the same controller (same controller for each button, wh...
[ "grails", "button", "controllers" ]
0
0
483
1
0
2011-06-06T12:50:12.820000
2011-06-06T13:12:49.050000
6,252,260
6,255,021
Cannot update image using fileupload in mvc
I am trying to update the text and images which is already updated to the databases. I have got a admin section in which there is a news menu, where the user can edit and update the news with images. The problem is i can edit and update the news text but the images doesnt update. Below is the controller and view: [Http...
TryUpdateModel won't update files. You could manually copy the streams into the corresponding property of your News model: foreach (var file in files) { byte[] buffer = new byte[file.InputStream.Length]; file.InputStream.Read(buffer, 0, buffer.Length); news.Files.Add(buffer); }
Cannot update image using fileupload in mvc I am trying to update the text and images which is already updated to the databases. I have got a admin section in which there is a news menu, where the user can edit and update the news with images. The problem is i can edit and update the news text but the images doesnt upd...
TITLE: Cannot update image using fileupload in mvc QUESTION: I am trying to update the text and images which is already updated to the databases. I have got a admin section in which there is a news menu, where the user can edit and update the news with images. The problem is i can edit and update the news text but the...
[ "asp.net-mvc", "asp.net-mvc-3", "input", "updatemodel" ]
0
0
430
1
0
2011-06-06T12:50:20.097000
2011-06-06T16:22:51.417000
6,252,263
6,252,659
Need assistance optimizing ColdFusion query pulling data from several tables
I wrote a query that my db admins are telling me need optimized, but my SQL knowledge is limited. The query pulls the press releases and 1 related photo and caption for each. It joins the site (location) table on id. SELECT pr.press_release_id, pr.Site_id, pr.press_release_subject, pr.press_release_title, pr.press_rele...
First and foremost, consider caching. ColdFusion can easily cache queries (e.g...., but if you need to ensure timeliness when the underlying press release table updates, instead use cachePut() and cacheGet(), where values are put in when the press release table is updated. Next, the WHERE clause LIKE statements are pro...
Need assistance optimizing ColdFusion query pulling data from several tables I wrote a query that my db admins are telling me need optimized, but my SQL knowledge is limited. The query pulls the press releases and 1 related photo and caption for each. It joins the site (location) table on id. SELECT pr.press_release_id...
TITLE: Need assistance optimizing ColdFusion query pulling data from several tables QUESTION: I wrote a query that my db admins are telling me need optimized, but my SQL knowledge is limited. The query pulls the press releases and 1 related photo and caption for each. It joins the site (location) table on id. SELECT p...
[ "sql-server-2005", "coldfusion" ]
1
4
215
2
0
2011-06-06T12:50:31.173000
2011-06-06T13:23:34.863000
6,252,268
6,253,870
When and how often should I be registering class maps in mongo?
At what point should I be registering class maps when using Mongo? I understand that auto mapping is fine most of the time, but I have a hierarchical class structure. Should I be registering class maps in a static constructor or before each query/insert? I would like to put a check in before each query/insert but the m...
Class maps must be registered exactly once, as your application initializes. It doesn't matter where you do this (static constructor, etc...) as long as it is only done once and is done before any serialization of those classes is attempted. If it's a console application, do your initialization in Main. If it's a web a...
When and how often should I be registering class maps in mongo? At what point should I be registering class maps when using Mongo? I understand that auto mapping is fine most of the time, but I have a hierarchical class structure. Should I be registering class maps in a static constructor or before each query/insert? I...
TITLE: When and how often should I be registering class maps in mongo? QUESTION: At what point should I be registering class maps when using Mongo? I understand that auto mapping is fine most of the time, but I have a hierarchical class structure. Should I be registering class maps in a static constructor or before ea...
[ "mongodb", "mongodb-.net-driver" ]
1
1
237
1
0
2011-06-06T12:50:59.937000
2011-06-06T14:52:35.087000
6,252,272
6,252,395
generating and using all IP addresses with php
knowing nothing about java (I thought a thread on this same topic for java) and a tiny bit about php, I was wondering how I could generate, with php, a complete list of all the possible IPs (0.0.0.0 to 255.255.255.255) and then how I can use each of those in a php script that is intended to test a IP verification tool ...
Rather than generating a possible database / storage for ~4 billion IP4 addresses (assuming you are only looking at IPv4 ignoring all IPv6 addresses) would it not be easier, and more practical just generate random IP address combinations to test with, which you can easily validate with RegEx? The following regex would ...
generating and using all IP addresses with php knowing nothing about java (I thought a thread on this same topic for java) and a tiny bit about php, I was wondering how I could generate, with php, a complete list of all the possible IPs (0.0.0.0 to 255.255.255.255) and then how I can use each of those in a php script t...
TITLE: generating and using all IP addresses with php QUESTION: knowing nothing about java (I thought a thread on this same topic for java) and a tiny bit about php, I was wondering how I could generate, with php, a complete list of all the possible IPs (0.0.0.0 to 255.255.255.255) and then how I can use each of those...
[ "php", "list", "for-loop", "ip" ]
1
3
2,518
2
0
2011-06-06T12:51:10.233000
2011-06-06T13:00:55.163000
6,252,277
6,253,184
How do you Record and Playback editing events on a contenteditable div?
I'm trying to find a way to write some unit-tests that can be used to write/test new wysiwyg html editors or just the default browser behavior for contenteditable divs. I want to record the keypresses (perhaps other events too, but keypresses are the most interesting) or just write the events manually and then play the...
You won't be able to do what you want here, I don't think. Most browsers do not allow script to fully simulate a keypress: you can fire the event but the associated browser behaviour (updating the value of an input, editing the content of a contenteditable element, moving the caret, etc.) will not happen. Regarding doc...
How do you Record and Playback editing events on a contenteditable div? I'm trying to find a way to write some unit-tests that can be used to write/test new wysiwyg html editors or just the default browser behavior for contenteditable divs. I want to record the keypresses (perhaps other events too, but keypresses are t...
TITLE: How do you Record and Playback editing events on a contenteditable div? QUESTION: I'm trying to find a way to write some unit-tests that can be used to write/test new wysiwyg html editors or just the default browser behavior for contenteditable divs. I want to record the keypresses (perhaps other events too, bu...
[ "javascript", "events", "contenteditable" ]
3
3
811
1
0
2011-06-06T12:51:34.023000
2011-06-06T14:01:48.033000
6,252,280
6,252,400
Find the most frequent number in a NumPy array
Suppose I have the following NumPy array: a = np.array([1,2,3,1,2,1,1,1,3,2,2,1]) How can I find the most frequent number in this array?
If your list contains all non-negative ints, you should take a look at numpy.bincounts: http://docs.scipy.org/doc/numpy/reference/generated/numpy.bincount.html and then probably use np.argmax: a = np.array([1,2,3,1,2,1,1,1,3,2,2,1]) counts = np.bincount(a) print(np.argmax(counts)) For a more complicated list (that perh...
Find the most frequent number in a NumPy array Suppose I have the following NumPy array: a = np.array([1,2,3,1,2,1,1,1,3,2,2,1]) How can I find the most frequent number in this array?
TITLE: Find the most frequent number in a NumPy array QUESTION: Suppose I have the following NumPy array: a = np.array([1,2,3,1,2,1,1,1,3,2,2,1]) How can I find the most frequent number in this array? ANSWER: If your list contains all non-negative ints, you should take a look at numpy.bincounts: http://docs.scipy.org...
[ "python", "numpy" ]
183
250
273,980
14
0
2011-06-06T12:51:40.327000
2011-06-06T13:01:19.980000
6,252,287
6,252,348
excel vba call subroutine with variables
I defined the following subroutine: Sub EnterCellValueMonthNumber(cells As range, number As Integer) range(cells).Select ActiveCell.FormulaR1C1 = number End Sub When I call the subroutine like this: EnterCellValueMonthNumber ("N23:Q23",1) I get the following error message: Compile error Expected: = I have no idea why...
You would call the sub as EnterCellValueMonthNumber "N23:Q23", 1 No brackets. Or Call EnterCellValueMonthNumber("N23:Q23", 1) Brackets, and Call before it. Also, your Sub is expecting a Range object as the first argument and you're supplying a string; you should change the signature of the sub to: Sub EnterCellValueMon...
excel vba call subroutine with variables I defined the following subroutine: Sub EnterCellValueMonthNumber(cells As range, number As Integer) range(cells).Select ActiveCell.FormulaR1C1 = number End Sub When I call the subroutine like this: EnterCellValueMonthNumber ("N23:Q23",1) I get the following error message: Com...
TITLE: excel vba call subroutine with variables QUESTION: I defined the following subroutine: Sub EnterCellValueMonthNumber(cells As range, number As Integer) range(cells).Select ActiveCell.FormulaR1C1 = number End Sub When I call the subroutine like this: EnterCellValueMonthNumber ("N23:Q23",1) I get the following ...
[ "excel", "vba", "subroutine" ]
32
55
85,842
3
0
2011-06-06T12:52:09.490000
2011-06-06T12:57:13.367000
6,252,290
6,252,340
to get latitude and longitude by passing address
i want to get the latitude and longitude by passing the address in url. i want to get the responce in xml format. i had try to google it out i got this 1)http://code.google.com/apis/maps/documentation/geocoding/index.html But this is geving the responce of REQUEST_DENIED And then 2)http://www.storm-consultancy.com/blog...
Well, if you want to use the Google API then you can get an API key. There are other resources you can try as well.
to get latitude and longitude by passing address i want to get the latitude and longitude by passing the address in url. i want to get the responce in xml format. i had try to google it out i got this 1)http://code.google.com/apis/maps/documentation/geocoding/index.html But this is geving the responce of REQUEST_DENIED...
TITLE: to get latitude and longitude by passing address QUESTION: i want to get the latitude and longitude by passing the address in url. i want to get the responce in xml format. i had try to google it out i got this 1)http://code.google.com/apis/maps/documentation/geocoding/index.html But this is geving the responce...
[ "java-me" ]
0
1
1,041
2
0
2011-06-06T12:52:16.037000
2011-06-06T12:56:19.767000
6,252,300
6,252,390
declaring a class member function as friend of a template class
#include< iostream> using namespace std; template< class t> class X { private: t x; public: template< class u> friend u y::getx(X< u> ); void setx(t s) {x=s;} }; class y { public: template< class t> t getx(X< t> d) {return d.x;} }; int main() { X< int> x1; x1.setx(7); y y1; cout<< y1.getx(x1); return 0; } The abov...
You should "forward declare" class y before template class X. I.e., just put: class y; // forward declaration template class X...
declaring a class member function as friend of a template class #include< iostream> using namespace std; template< class t> class X { private: t x; public: template< class u> friend u y::getx(X< u> ); void setx(t s) {x=s;} }; class y { public: template< class t> t getx(X< t> d) {return d.x;} }; int main() { X< int...
TITLE: declaring a class member function as friend of a template class QUESTION: #include< iostream> using namespace std; template< class t> class X { private: t x; public: template< class u> friend u y::getx(X< u> ); void setx(t s) {x=s;} }; class y { public: template< class t> t getx(X< t> d) {return d.x;} }; i...
[ "c++" ]
3
1
1,626
2
0
2011-06-06T12:53:06.797000
2011-06-06T13:00:26.297000
6,252,302
6,252,985
Convert seconds to formatted time like 12:59?
Possible Duplicate: Convert seconds to days, minutes, and hours in Obj-c How to do it in Objective-C For example: 349200 seconds??
Add the below function and pass "seconds" value in this function. - (void)displayTimeWithSecond:(NSInteger)seconds { NSInteger remindMinute = seconds / 60; NSInteger remindHours = remindMinute / 60; NSInteger remindMinutes = seconds - (remindHours * 3600); NSInteger remindMinuteNew = remindMinutes / 60; NSInteger rem...
Convert seconds to formatted time like 12:59? Possible Duplicate: Convert seconds to days, minutes, and hours in Obj-c How to do it in Objective-C For example: 349200 seconds??
TITLE: Convert seconds to formatted time like 12:59? QUESTION: Possible Duplicate: Convert seconds to days, minutes, and hours in Obj-c How to do it in Objective-C For example: 349200 seconds?? ANSWER: Add the below function and pass "seconds" value in this function. - (void)displayTimeWithSecond:(NSInteger)seconds {...
[ "iphone", "objective-c", "ipad", "nsdate", "nsdateformatter" ]
2
10
1,950
1
0
2011-06-06T12:53:20.823000
2011-06-06T13:48:34.327000
6,252,312
6,283,358
how to parse " Remote " xml file using jquery/ajex for phonegap?
Any idea about how to parse a remote XML file using jQuery/AJAX for PhoneGap? Or any PhoneGap code? Thanks.
Sounds like you would just use a run of the mill XMLHttpRequest or assuming ajax then $.ajax(). Nothing special should be required. Phone gap (provided it is set up properly) can make cross domain calls. Just make sure your android application permissions are set.
how to parse " Remote " xml file using jquery/ajex for phonegap? Any idea about how to parse a remote XML file using jQuery/AJAX for PhoneGap? Or any PhoneGap code? Thanks.
TITLE: how to parse " Remote " xml file using jquery/ajex for phonegap? QUESTION: Any idea about how to parse a remote XML file using jQuery/AJAX for PhoneGap? Or any PhoneGap code? Thanks. ANSWER: Sounds like you would just use a run of the mill XMLHttpRequest or assuming ajax then $.ajax(). Nothing special should b...
[ "jquery", "android", "html", "cordova" ]
1
2
1,401
1
0
2011-06-06T12:54:14.070000
2011-06-08T18:19:57.060000
6,252,318
6,252,396
WCF Proxy Generation Problems
I'm having problems with Proxy Generation in VS2010. I have created a Client/Server app using WCF and the Pub/Sub pattern particularly. The service works well locally but while I can launch the service on the server and can access it through the relevent url's through my browser I cannot "Configure Service Reference" w...
First off, you don't need to " Configure Service Reference " after you develop. Only change the address point in the web.config or app.config. Second, check on the server part if the mex end point is configured, otherwise you won't be able to create other clients. And finally, when you try to access the WSDL for the se...
WCF Proxy Generation Problems I'm having problems with Proxy Generation in VS2010. I have created a Client/Server app using WCF and the Pub/Sub pattern particularly. The service works well locally but while I can launch the service on the server and can access it through the relevent url's through my browser I cannot "...
TITLE: WCF Proxy Generation Problems QUESTION: I'm having problems with Proxy Generation in VS2010. I have created a Client/Server app using WCF and the Pub/Sub pattern particularly. The service works well locally but while I can launch the service on the server and can access it through the relevent url's through my ...
[ "wcf", "visual-studio-2010", "proxy-classes" ]
0
0
1,424
1
0
2011-06-06T12:54:46.893000
2011-06-06T13:00:58.027000
6,252,322
6,252,892
WCF: Service to service call
Suppose i have following WCF Services. UtilityService (Service to provide utility functions) SomeOtherService 1 SomeOtherService 2 SomeOtherService 3 what is the best design to Use UtilityService in other services. All services are exposed on separate endpoints...
Are those services in the same application? If yes create the instance of the service class directly instead of using all the WCF infrastructure! If they are not in the same application (and you don't share service assembly) you must use Add service reference as with any other WCF service.
WCF: Service to service call Suppose i have following WCF Services. UtilityService (Service to provide utility functions) SomeOtherService 1 SomeOtherService 2 SomeOtherService 3 what is the best design to Use UtilityService in other services. All services are exposed on separate endpoints...
TITLE: WCF: Service to service call QUESTION: Suppose i have following WCF Services. UtilityService (Service to provide utility functions) SomeOtherService 1 SomeOtherService 2 SomeOtherService 3 what is the best design to Use UtilityService in other services. All services are exposed on separate endpoints... ANSWER:...
[ "wcf" ]
3
0
3,862
1
0
2011-06-06T12:55:07.890000
2011-06-06T13:41:53.720000
6,252,327
6,252,376
Casting a CONCAT
Alrighty, I was tasked with getting the sale price for an item. I found to do this that I needed to take the data from the discount_percent and multiply it against card_price. (Don't really know how to multiply and subtract yet in mysql). select discount_percent from card_sales order by card_id The output of discount_p...
If something has a decimal point in the first place, it clearly can't be an integer, yes? You'd want to cast it to DOUBLE, not SIGNED. But I'd say it's better to compute your whole expression numerically; you can get the percentage by dividing the value by 100, rather than by trying to construct the text of a decimal. ...
Casting a CONCAT Alrighty, I was tasked with getting the sale price for an item. I found to do this that I needed to take the data from the discount_percent and multiply it against card_price. (Don't really know how to multiply and subtract yet in mysql). select discount_percent from card_sales order by card_id The out...
TITLE: Casting a CONCAT QUESTION: Alrighty, I was tasked with getting the sale price for an item. I found to do this that I needed to take the data from the discount_percent and multiply it against card_price. (Don't really know how to multiply and subtract yet in mysql). select discount_percent from card_sales order ...
[ "mysql" ]
0
0
1,053
1
0
2011-06-06T12:55:35.970000
2011-06-06T12:59:12.947000
6,252,329
6,252,676
How to send mails using Spring Framework
I am working on Spring based project; I am looking to implement an use-case in which I can send email to specific userId, As I know I can send mail using SimpleMailMessage Interface and MailSender Class of SpringFramework. Is there other way to do same one? Are there any references available for more specific study...?
As mentioned, you can use SimpleMailMessage and/or MailSender if you like; the Spring classes are intended to expose a simpler interface over the traditional JavaMail API: The Spring Framework provides a helpful utility library for sending email that shields the user from the specifics of the underlying mailing system ...
How to send mails using Spring Framework I am working on Spring based project; I am looking to implement an use-case in which I can send email to specific userId, As I know I can send mail using SimpleMailMessage Interface and MailSender Class of SpringFramework. Is there other way to do same one? Are there any referen...
TITLE: How to send mails using Spring Framework QUESTION: I am working on Spring based project; I am looking to implement an use-case in which I can send email to specific userId, As I know I can send mail using SimpleMailMessage Interface and MailSender Class of SpringFramework. Is there other way to do same one? Are...
[ "java", "spring" ]
1
4
2,171
2
0
2011-06-06T12:51:28.697000
2011-06-06T13:25:23.067000
6,252,333
6,265,990
Advantage Database Server 10 - Error 1500
I got an application (written in Delphi 2009) that uses an ADS Server (Version 10.10). I'm using the TDataSet Components to access the database. On my dev machine everything is ok. But on a test machine (also with ADS 10.10), I get the error 1500 when trying to open an TAdsQuery that selects data from a table containin...
You should put the aicu32.dll and icudt40l.dat either into your application directory or into the System32/SysWOW64 folder on the client side.
Advantage Database Server 10 - Error 1500 I got an application (written in Delphi 2009) that uses an ADS Server (Version 10.10). I'm using the TDataSet Components to access the database. On my dev machine everything is ok. But on a test machine (also with ADS 10.10), I get the error 1500 when trying to open an TAdsQuer...
TITLE: Advantage Database Server 10 - Error 1500 QUESTION: I got an application (written in Delphi 2009) that uses an ADS Server (Version 10.10). I'm using the TDataSet Components to access the database. On my dev machine everything is ok. But on a test machine (also with ADS 10.10), I get the error 1500 when trying t...
[ "database", "delphi", "delphi-2009", "advantage-database-server" ]
0
6
1,837
2
0
2011-06-06T12:56:06.470000
2011-06-07T13:34:42.320000
6,252,335
6,252,788
BitmapField click does not work on Blackberry application
i arranged 7 bimapfield in horizontal if i click the bitmapfield it want to push the another screen Here is my code but i did't get the another screen can any one help me whats wrong in this code BitmapField bitmap1 = new BitmapField( Bitmap.getBitmapResource("profile_n.png"),FOCUSABLE | DrawStyle.HCENTER) { protected ...
You can use a custom field that hold a image and behave like a button instead of bitmapfield. Here is the code i suggest: import net.rim.device.api.system.Bitmap; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.Graphics; public class CustomButton extends Field{ protected Bitmap icon; protected int fie...
BitmapField click does not work on Blackberry application i arranged 7 bimapfield in horizontal if i click the bitmapfield it want to push the another screen Here is my code but i did't get the another screen can any one help me whats wrong in this code BitmapField bitmap1 = new BitmapField( Bitmap.getBitmapResource("p...
TITLE: BitmapField click does not work on Blackberry application QUESTION: i arranged 7 bimapfield in horizontal if i click the bitmapfield it want to push the another screen Here is my code but i did't get the another screen can any one help me whats wrong in this code BitmapField bitmap1 = new BitmapField( Bitmap.ge...
[ "blackberry", "java-me" ]
3
3
650
1
0
2011-06-06T12:56:09.620000
2011-06-06T13:33:42.130000
6,252,341
6,253,612
Not able to write into text file
I need to write a string into a file. For that, my code is: -(void)writeToFile:(NSString *)fileName: (NSString *)data { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; // the path to write file NSString *appFile =...
Firstly, you are calling your method strangely. Rename the method to -(void)writeString:(NSString *) data toFile:(NSString *)fileName and call it like so: [obj writeString:@"this is mahesh babu" toFile:@"iphone.txt"]; Secondly, writeToFile:atomically: is deprecated, use writeToFile:atomically:encoding:error:: NSError *...
Not able to write into text file I need to write a string into a file. For that, my code is: -(void)writeToFile:(NSString *)fileName: (NSString *)data { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; // the path ...
TITLE: Not able to write into text file QUESTION: I need to write a string into a file. For that, my code is: -(void)writeToFile:(NSString *)fileName: (NSString *)data { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtInde...
[ "iphone", "objective-c", "ios" ]
0
2
728
3
0
2011-06-06T12:56:20.590000
2011-06-06T14:34:33.527000
6,252,344
6,252,508
IE table rowspan compatibility
I have my table with overlapping rowspans, but in IE it doesn't seem to want to do that, it keeps pushing the bottom right cell so that second last cell on the right side is the same height as the middle one on the left side, but in Firefox it doesn't do that. In every browser, except IE it looks like this: http://jsfi...
Seems your problem iwht IE 7, try applying border-collapse:collapse; on table via css
IE table rowspan compatibility I have my table with overlapping rowspans, but in IE it doesn't seem to want to do that, it keeps pushing the bottom right cell so that second last cell on the right side is the same height as the middle one on the left side, but in Firefox it doesn't do that. In every browser, except IE ...
TITLE: IE table rowspan compatibility QUESTION: I have my table with overlapping rowspans, but in IE it doesn't seem to want to do that, it keeps pushing the bottom right cell so that second last cell on the right side is the same height as the middle one on the left side, but in Firefox it doesn't do that. In every b...
[ "html", "css", "internet-explorer", "html-table" ]
3
1
2,692
1
0
2011-06-06T12:56:46.487000
2011-06-06T13:11:41.383000
6,252,346
6,253,089
The best practice for creating a text file reader on android?
I want to create an app that reads and displays a big text file, so basically, it's a text file reader. There is something specific with the reader is that I would like to show a background image with the text. When the text scrolls, the image moves along with it. I wondered what is the best practice for this? TextView...
I would recommand a WebView. But this would be easier if you already save the large Text as a HTML-Page. You can then use the loadURL() -method to show you'r HTML-File (i guess this is for the help-page?)
The best practice for creating a text file reader on android? I want to create an app that reads and displays a big text file, so basically, it's a text file reader. There is something specific with the reader is that I would like to show a background image with the text. When the text scrolls, the image moves along wi...
TITLE: The best practice for creating a text file reader on android? QUESTION: I want to create an app that reads and displays a big text file, so basically, it's a text file reader. There is something specific with the reader is that I would like to show a background image with the text. When the text scrolls, the im...
[ "android" ]
1
0
399
1
0
2011-06-06T12:56:57.997000
2011-06-06T13:55:25.363000
6,252,355
6,252,469
How to rename a primary key in Oracle such that it can be reused
On Oracle, I create a table like this: CREATE TABLE "Mig1"( "Id" INTEGER NOT NULL, CONSTRAINT "PK_Mig1" PRIMARY KEY ( "Id" ) ) Then, I rename the PK: ALTER TABLE "Mig1" RENAME CONSTRAINT "PK_Mig1" TO "PK_XXX" Then, I rename the table: ALTER TABLE "Mig1" RENAME TO "XXX" Then, I try to create another table that uses the ...
There is an index associated with the primary key constraint, and it is probably still called "PK_Mig1". Try this: ALTER INDEX "PK_Mig1" RENAME TO "PK_XXX";
How to rename a primary key in Oracle such that it can be reused On Oracle, I create a table like this: CREATE TABLE "Mig1"( "Id" INTEGER NOT NULL, CONSTRAINT "PK_Mig1" PRIMARY KEY ( "Id" ) ) Then, I rename the PK: ALTER TABLE "Mig1" RENAME CONSTRAINT "PK_Mig1" TO "PK_XXX" Then, I rename the table: ALTER TABLE "Mig1" R...
TITLE: How to rename a primary key in Oracle such that it can be reused QUESTION: On Oracle, I create a table like this: CREATE TABLE "Mig1"( "Id" INTEGER NOT NULL, CONSTRAINT "PK_Mig1" PRIMARY KEY ( "Id" ) ) Then, I rename the PK: ALTER TABLE "Mig1" RENAME CONSTRAINT "PK_Mig1" TO "PK_XXX" Then, I rename the table: AL...
[ "oracle", "ora-00955" ]
15
22
36,381
1
0
2011-06-06T12:57:28.207000
2011-06-06T13:08:22.850000
6,252,372
6,252,964
Questions about the Visitor pattern (sample in Java)
I'm just trying to understand the main benefits of using the Visitor pattern. Here's a sample Java implementation /////////////////////////////////// // Interfaces interface MamalVisitor { void visit(Mammal mammal); } interface MammalVisitable { public void accept(MamalVisitor visitor); } interface Mammal extends Mamma...
Visitor pattern is a fancy switch case / pattern matching system to facilitate graph traversal. As typical functional languages offer pattern matching and efficient ways to traverse graphs, interest is much more limited. Even in JAVA, with instanceof or using enum, a visitor is more of a fancy way to perform things tha...
Questions about the Visitor pattern (sample in Java) I'm just trying to understand the main benefits of using the Visitor pattern. Here's a sample Java implementation /////////////////////////////////// // Interfaces interface MamalVisitor { void visit(Mammal mammal); } interface MammalVisitable { public void accept(Ma...
TITLE: Questions about the Visitor pattern (sample in Java) QUESTION: I'm just trying to understand the main benefits of using the Visitor pattern. Here's a sample Java implementation /////////////////////////////////// // Interfaces interface MamalVisitor { void visit(Mammal mammal); } interface MammalVisitable { pub...
[ "java", "design-patterns", "visitor-pattern" ]
9
4
3,833
4
0
2011-06-06T12:58:41.303000
2011-06-06T13:47:00.947000
6,252,374
6,252,449
XSLT to limit the number of child nodes under a parent node
Sorry but a total xslt noob here Given XML that looks like: Is there an XSLT that will limit the number of child nodes under Foo so that there are only 3?
This transformation uses and overrides the identity rule/template: When applied on the provided XML document: the wanted, correct result is produced: Explanation: The identity rule /template copies every node "as-is". We have just one additional template that overrides the identity rule for any element that is a child ...
XSLT to limit the number of child nodes under a parent node Sorry but a total xslt noob here Given XML that looks like: Is there an XSLT that will limit the number of child nodes under Foo so that there are only 3?
TITLE: XSLT to limit the number of child nodes under a parent node QUESTION: Sorry but a total xslt noob here Given XML that looks like: Is there an XSLT that will limit the number of child nodes under Foo so that there are only 3? ANSWER: This transformation uses and overrides the identity rule/template: When applie...
[ "xml", "xslt" ]
1
2
2,090
3
0
2011-06-06T12:58:48.140000
2011-06-06T13:06:14.770000
6,252,381
6,257,030
Delegate.BeginInvoke
It looks like the C# compiler has some logic embedded in it to detect the presence of Silverlight, by examining the symbols inside mscorlib. When detecting a Silverlight version of mscorlib, it will not emit BeginInvoke and EndInvoke members on any delegate types it generates. This makes sense, as those methods aren't ...
I don't know the complete answer... but it looks like my particular problem was caused by a misspelling of AsyncCallback. I had it as AsyncCallBack. That of course makes sense, because the BeginInvoke and EndInvoke signature can't be emitted if there is no AsyncCallback delegate.
Delegate.BeginInvoke It looks like the C# compiler has some logic embedded in it to detect the presence of Silverlight, by examining the symbols inside mscorlib. When detecting a Silverlight version of mscorlib, it will not emit BeginInvoke and EndInvoke members on any delegate types it generates. This makes sense, as ...
TITLE: Delegate.BeginInvoke QUESTION: It looks like the C# compiler has some logic embedded in it to detect the presence of Silverlight, by examining the symbols inside mscorlib. When detecting a Silverlight version of mscorlib, it will not emit BeginInvoke and EndInvoke members on any delegate types it generates. Thi...
[ "c#", "silverlight" ]
6
0
600
1
0
2011-06-06T12:59:19.277000
2011-06-06T19:33:23.693000
6,252,383
6,252,406
Using EMF objects as keys
Is it possible to have EMF objects implement hashCode and equals? I would like to be able to use a model object as a key in a HashMap.
EObject's javadoc is clear about that. An EObject may not specialize hashCode or equals. However, you can use them in maps as long as you are aware of the identity semantics of Object#equals(..) and #hashCode.
Using EMF objects as keys Is it possible to have EMF objects implement hashCode and equals? I would like to be able to use a model object as a key in a HashMap.
TITLE: Using EMF objects as keys QUESTION: Is it possible to have EMF objects implement hashCode and equals? I would like to be able to use a model object as a key in a HashMap. ANSWER: EObject's javadoc is clear about that. An EObject may not specialize hashCode or equals. However, you can use them in maps as long a...
[ "eclipse", "eclipse-emf" ]
7
10
1,277
4
0
2011-06-06T12:59:44.173000
2011-06-06T13:01:54.677000
6,252,388
6,252,479
jQuery 1.3.2 validate help
I am using the jQuery validate plugin to validate my inputs in a form. The problem is that when a field is mandatory it shows this: This field is required. Instead I would like to show a little icon just after the input, replacing that This field is required. This is the code I am using: echo "
$('#form').validate({ rules: { field1: { required: true } }, messages: { field1: { required: "Message that shows when required field isnt filled"} }, submitHandler: { // whatever } }); Use the plug-in like this in order to have easier message / rule placement. http://docs.jquery.com/Plugins/Validation <- check the poss...
jQuery 1.3.2 validate help I am using the jQuery validate plugin to validate my inputs in a form. The problem is that when a field is mandatory it shows this: This field is required. Instead I would like to show a little icon just after the input, replacing that This field is required. This is the code I am using: echo...
TITLE: jQuery 1.3.2 validate help QUESTION: I am using the jQuery validate plugin to validate my inputs in a form. The problem is that when a field is mandatory it shows this: This field is required. Instead I would like to show a little icon just after the input, replacing that This field is required. This is the cod...
[ "jquery", "validation" ]
0
0
625
2
0
2011-06-06T13:00:21.933000
2011-06-06T13:08:58.757000
6,252,424
6,253,533
trying to get request.user, and then a query, in a form that overrides ModelChoiceField and is subclassed
I need to pass an instance variable (self.rank) to be used by a class variable (provider) (see the commented out line below). Commented out, the code below works. But I'm pretty sure I shouldn't be trying to pass an instance variable up to a class variable anyway. So I'm dumbfounded as to how to accomplish my goal, whi...
You can't do it that way, because self doesn't exist at that point - and even if you could, that would be executed at define time, so the rank would be static for all instantiations of the form. Instead, do it in __init__: provider = UserModelChoiceField(User.objects.none()) def __init__(self, user, *args, **kwargs): ...
trying to get request.user, and then a query, in a form that overrides ModelChoiceField and is subclassed I need to pass an instance variable (self.rank) to be used by a class variable (provider) (see the commented out line below). Commented out, the code below works. But I'm pretty sure I shouldn't be trying to pass a...
TITLE: trying to get request.user, and then a query, in a form that overrides ModelChoiceField and is subclassed QUESTION: I need to pass an instance variable (self.rank) to be used by a class variable (provider) (see the commented out line below). Commented out, the code below works. But I'm pretty sure I shouldn't b...
[ "django", "django-forms" ]
1
2
224
1
0
2011-06-06T13:03:47.423000
2011-06-06T14:29:03.217000
6,252,434
6,253,443
Lazy ApplicationListener
When I add ApplicationListener to a class, Spring instantiates the bean eagerly (probably to make sure that the bean gets all the events). In my case, I have a bean which listens for "CacheFlush" events (i.e. I don't really care how many I might miss). How do I implement a lazy ApplicationEvent listener in Spring 3.0?
I am not sure if what you want to do is possible directly, but one potential solution is to have a separate Observable bean listen for the cache flush events and notify its Observers when one comes in. Have your lazy bean register with the Observable when it is initialized.
Lazy ApplicationListener When I add ApplicationListener to a class, Spring instantiates the bean eagerly (probably to make sure that the bean gets all the events). In my case, I have a bean which listens for "CacheFlush" events (i.e. I don't really care how many I might miss). How do I implement a lazy ApplicationEvent...
TITLE: Lazy ApplicationListener QUESTION: When I add ApplicationListener to a class, Spring instantiates the bean eagerly (probably to make sure that the bean gets all the events). In my case, I have a bean which listens for "CacheFlush" events (i.e. I don't really care how many I might miss). How do I implement a laz...
[ "spring", "events", "lazy-initialization" ]
1
0
589
1
0
2011-06-06T13:04:52.320000
2011-06-06T14:21:56.310000
6,252,437
6,252,499
Implicit Makefile Targets
http://www.cprogramming.com/tutorial/makefiles_continued.html explains implicit targets: There are some actions that are nearly ubiquitous: for instance, you might have a collection of.c files that you may wish to execute the same command for. Ideally, the name of the file would be the target; using the implicit target...
Try: default: foo.bar echo "In default." %.bar: echo "In.bar." You may be asking about old-style suffix rules - for example this rule:.c.o: cc -c $< tells make how to build a.o file from a.c source. The form with the '%' is known as a pattern rules and is more "modern". I suggest you read the GNU Make manual, which is...
Implicit Makefile Targets http://www.cprogramming.com/tutorial/makefiles_continued.html explains implicit targets: There are some actions that are nearly ubiquitous: for instance, you might have a collection of.c files that you may wish to execute the same command for. Ideally, the name of the file would be the target;...
TITLE: Implicit Makefile Targets QUESTION: http://www.cprogramming.com/tutorial/makefiles_continued.html explains implicit targets: There are some actions that are nearly ubiquitous: for instance, you might have a collection of.c files that you may wish to execute the same command for. Ideally, the name of the file wo...
[ "makefile" ]
2
3
1,028
1
0
2011-06-06T13:05:04.320000
2011-06-06T13:10:44.067000
6,252,438
6,253,123
getting <a> tags and attribute with htmlagilitypack with vb.net
i have this code Dim htmldoc As HtmlDocument = New HtmlDocument() htmldoc.LoadHtml(strPageContent) Dim root As HtmlNode = htmldoc.DocumentNode For Each link As HtmlNode In root.SelectNodes("//a") If link.HasAttributes("href") Then doSomething() 'this doesn't work because hasAttributes only checks whether an element ha...
If HtmlAgilityPack supports this XPATH selector, you can replace //a with //a[@href] For Each link as HtmlNode In root.SelectNodes("//a[@href]") doSomething() Next Otherwise, you can use the Attributes property: For Each link as HtmlNode In root.SelectNodes("//a") If link.Attributes.Any(Function(a) a.Name = "href") The...
getting <a> tags and attribute with htmlagilitypack with vb.net i have this code Dim htmldoc As HtmlDocument = New HtmlDocument() htmldoc.LoadHtml(strPageContent) Dim root As HtmlNode = htmldoc.DocumentNode For Each link As HtmlNode In root.SelectNodes("//a") If link.HasAttributes("href") Then doSomething() 'this does...
TITLE: getting <a> tags and attribute with htmlagilitypack with vb.net QUESTION: i have this code Dim htmldoc As HtmlDocument = New HtmlDocument() htmldoc.LoadHtml(strPageContent) Dim root As HtmlNode = htmldoc.DocumentNode For Each link As HtmlNode In root.SelectNodes("//a") If link.HasAttributes("href") Then doSome...
[ "vb.net", "html-agility-pack" ]
1
1
3,688
2
0
2011-06-06T13:05:12.273000
2011-06-06T13:57:25.303000
6,252,467
6,264,486
vbscript for creating registry entries was working, now it isn't. Any ideas?
I have a vbscript that creates a registry entry on a Windows Server 2003 machine. This script has been working fine for about a year now, but recently it just stopped working. I am thinking that a windows update must have changed something, maybe a security setting, whereby this script is no longer permitted to execute...
The description for the error code -2147023533 (0x80070553) is: Cannot start a new logon session with an ID that is already in use. A search for this code and description reveals: hotfix KB2283089 for fixing the error, an assumption that the error is caused by KB979683, a suggestion to reinstall service packs in order ...
vbscript for creating registry entries was working, now it isn't. Any ideas? I have a vbscript that creates a registry entry on a Windows Server 2003 machine. This script has been working fine for about a year now, but recently it just stopped working. I am thinking that a windows update must have changed something, ma...
TITLE: vbscript for creating registry entries was working, now it isn't. Any ideas? QUESTION: I have a vbscript that creates a registry entry on a Windows Server 2003 machine. This script has been working fine for about a year now, but recently it just stopped working. I am thinking that a windows update must have cha...
[ "windows", "vbscript" ]
0
1
1,955
1
0
2011-06-06T13:08:14.373000
2011-06-07T11:26:09.690000
6,252,468
6,253,913
Instantiating a Qt File-Based Logger for Debugging in a C++ Library
The following page provides a nice simple solution for file based logging in Qt for debugging without using a larger logging framework like the many that are suggested in other SO questions. I'm writing a library and would like to instantiate a logger that the classes in the library can use (mostly for debugging purpos...
I pretty much agree with OrcunC but I'd recommend making that ofstream a little more accessible and capable of handling the Qt value types. Here's my recommended process: Create a global QIODevice that to which everything will be written. This will probably be a QFile. Create a QTextStream wrapper around that QIODevice...
Instantiating a Qt File-Based Logger for Debugging in a C++ Library The following page provides a nice simple solution for file based logging in Qt for debugging without using a larger logging framework like the many that are suggested in other SO questions. I'm writing a library and would like to instantiate a logger ...
TITLE: Instantiating a Qt File-Based Logger for Debugging in a C++ Library QUESTION: The following page provides a nice simple solution for file based logging in Qt for debugging without using a larger logging framework like the many that are suggested in other SO questions. I'm writing a library and would like to ins...
[ "c++", "debugging", "qt", "logging" ]
3
3
2,496
3
0
2011-06-06T13:08:16.453000
2011-06-06T14:55:18.043000
6,252,471
6,252,525
what is the use of "~" tilde in url?
what is the use of ~ tilde in URL? I am using cPanel, and have link including tilde, why is tilde there? When we buy server space but do not have dns or don't want to use it for development purposes,we use the like http://serverip/~foldername.
Actually tilde '~' represents home directory. When you place tilde in url, It will access from home directory
what is the use of "~" tilde in url? what is the use of ~ tilde in URL? I am using cPanel, and have link including tilde, why is tilde there? When we buy server space but do not have dns or don't want to use it for development purposes,we use the like http://serverip/~foldername.
TITLE: what is the use of "~" tilde in url? QUESTION: what is the use of ~ tilde in URL? I am using cPanel, and have link including tilde, why is tilde there? When we buy server space but do not have dns or don't want to use it for development purposes,we use the like http://serverip/~foldername. ANSWER: Actually til...
[ "apache", "url", "cpanel", "tilde" ]
48
22
60,742
5
0
2011-06-06T13:08:37.250000
2011-06-06T13:13:06.750000
6,252,475
6,252,557
Accessing components from a different thread C#
I have a windows form with a button in it. I have 2 threads and i want to change the button name from the other thread. I get an error when i do that. how can i change the button name? P.S. I know that a same question alredy posted, but the solution there can't help me. I can't use the Dispatcher, maybe it's because i ...
delegate void MyDelegate(string x); void ChangeName(string name) { if (this.InvokeRequired) { this.Invoke(new MyDelegate(this.ChangeName), new object[]{name}); return; } this.button.Text = name; } more info here How to update the GUI from another thread in C#?
Accessing components from a different thread C# I have a windows form with a button in it. I have 2 threads and i want to change the button name from the other thread. I get an error when i do that. how can i change the button name? P.S. I know that a same question alredy posted, but the solution there can't help me. I...
TITLE: Accessing components from a different thread C# QUESTION: I have a windows form with a button in it. I have 2 threads and i want to change the button name from the other thread. I get an error when i do that. how can i change the button name? P.S. I know that a same question alredy posted, but the solution ther...
[ "winforms", "multithreading" ]
0
1
128
2
0
2011-06-06T13:08:40.650000
2011-06-06T13:15:49.697000
6,252,489
6,252,520
Javascript automatic next image
I created this site which uses a simple javascript function to show images based on the user mousing over or clicking numbered boxes on the right. Now after testing it's been determined that an automatic slideshow should be added on top of this, so that next image will show after a few seconds. http://www.philippedollo...
Use setInterval(). function getNextPic() { //??? } setInterval(function () { showPic(getNextPic()); }, 3000); // 3 seconds There's no need for the if(document.getElementById) check, since the function is 100% cross-browser. function showPic(whichpic) { document.getElementById('placeholder').src = whichpic.href; docum...
Javascript automatic next image I created this site which uses a simple javascript function to show images based on the user mousing over or clicking numbered boxes on the right. Now after testing it's been determined that an automatic slideshow should be added on top of this, so that next image will show after a few s...
TITLE: Javascript automatic next image QUESTION: I created this site which uses a simple javascript function to show images based on the user mousing over or clicking numbered boxes on the right. Now after testing it's been determined that an automatic slideshow should be added on top of this, so that next image will ...
[ "javascript", "image", "slideshow" ]
1
1
464
2
0
2011-06-06T13:09:42.103000
2011-06-06T13:12:47.450000
6,252,491
6,252,646
How to retrieve image from database?
I want to save and retrieve the image from local database. I insert image as blob in db but I am usable to retrieve image. Please help me. Thanks Monali
What error are you getting? Using LINQ to SQL, the following code creates an HttpHandler and grabs a BLOB from a database... public class GetFile: IHttpHandler { public void ProcessRequest(HttpContext context) { Document document = new GigzDataContext().Documents.SingleOrDefault(p => p.Id == new Guid(context.Request.Q...
How to retrieve image from database? I want to save and retrieve the image from local database. I insert image as blob in db but I am usable to retrieve image. Please help me. Thanks Monali
TITLE: How to retrieve image from database? QUESTION: I want to save and retrieve the image from local database. I insert image as blob in db but I am usable to retrieve image. Please help me. Thanks Monali ANSWER: What error are you getting? Using LINQ to SQL, the following code creates an HttpHandler and grabs a BL...
[ "android" ]
0
0
1,330
2
0
2011-06-06T13:09:56.410000
2011-06-06T13:22:26.467000
6,252,492
6,252,554
Objective-C - pointer not nil after destroying the object
I'm playing a little on my linux with Objective-C. Actually I'm trying to learn it, and while working on this quest, I got stuck. Here is the code: #import #import int main(void) { NSObject *a = [[NSObject alloc] init]; printf("Class retain count: %i\n", [a retainCount]); printf("Is pointer nil: %i\n\n", (a==nil)); ...
releasing the object will not set it to nil. release will release the object that is pointed by your variable (in this case a ) however you variable still pointing to the same object memory address unless you do assign another address like: a = otherAddress; usually you will do: a = nil; //or a = [[NSObject alloc] init...
Objective-C - pointer not nil after destroying the object I'm playing a little on my linux with Objective-C. Actually I'm trying to learn it, and while working on this quest, I got stuck. Here is the code: #import #import int main(void) { NSObject *a = [[NSObject alloc] init]; printf("Class retain count: %i\n", [a re...
TITLE: Objective-C - pointer not nil after destroying the object QUESTION: I'm playing a little on my linux with Objective-C. Actually I'm trying to learn it, and while working on this quest, I got stuck. Here is the code: #import #import int main(void) { NSObject *a = [[NSObject alloc] init]; printf("Class retain c...
[ "objective-c", "pointers", "object", "null" ]
0
3
1,029
4
0
2011-06-06T13:10:03.077000
2011-06-06T13:15:25.533000
6,252,493
6,253,349
Database design using SQL Server 2005,
I have a user table with userid (pk), password, usertype. I have another table student with stdid (pk), stdname, stdaddress. I have a third table faculty with facid (pk), facname, facaddress. What I want to do is populate the user table with the pk from either student table or faculty table. How do I implement this in ...
What you have is a bad design. You do not want to use one or the other other PK as the PK in a table. This cannot every work. What happens when you try to insert student 10 (who is Joe Jones) but faculty 10 (Mary Smith) is already in the table. Well, the insert would fail becuse of the unique requirement of a PK. If al...
Database design using SQL Server 2005, I have a user table with userid (pk), password, usertype. I have another table student with stdid (pk), stdname, stdaddress. I have a third table faculty with facid (pk), facname, facaddress. What I want to do is populate the user table with the pk from either student table or fac...
TITLE: Database design using SQL Server 2005, QUESTION: I have a user table with userid (pk), password, usertype. I have another table student with stdid (pk), stdname, stdaddress. I have a third table faculty with facid (pk), facname, facaddress. What I want to do is populate the user table with the pk from either st...
[ "sql-server-2005" ]
0
0
164
3
0
2011-06-06T13:10:06
2011-06-06T14:14:37.277000
6,252,495
6,265,473
CAML Query BeginsWith Numeric Issue
In the following CAML query I reference 0 in the the line below. 0 This doesn't work even when the value is 0 bu twhen it is A it does work (I have entries in for both A and 0). I am unsure why numeric values are not getting picked up. Any help would be appreciated. Abbreviations 0
i do have a similar query like this which is actually working fine for me. Make sure that the columns in your query "TCategories" and "FirstCharacter" are of Text type. Thanks, -Codename "Santosh"
CAML Query BeginsWith Numeric Issue In the following CAML query I reference 0 in the the line below. 0 This doesn't work even when the value is 0 bu twhen it is A it does work (I have entries in for both A and 0). I am unsure why numeric values are not getting picked up. Any help would be appreciated. Abbreviations 0
TITLE: CAML Query BeginsWith Numeric Issue QUESTION: In the following CAML query I reference 0 in the the line below. 0 This doesn't work even when the value is 0 bu twhen it is A it does work (I have entries in for both A and 0). I am unsure why numeric values are not getting picked up. Any help would be appreciated....
[ "sharepoint", "sharepoint-2010", "sharepoint-2007", "caml" ]
2
2
2,358
1
0
2011-06-06T13:10:10.340000
2011-06-07T12:55:29.640000
6,252,502
6,252,619
Django - Raw SQL Queries - What Happens in Joins
I'm reading that I can use raw SQL in Django and have Django actually build my models from the result s. However I'm wondering what happens if I use joins in the raw SQL. How will Django know what models to use? (Are there any other issues I should be aware of?)
It's not the joins that matter, but the column names. You could, for example, do the following: SELECT table.id, other_table.name AS name from table join other_table using (id) and pass that into your table model. Django would then treat the names from other_table as though they were names from table and give your norm...
Django - Raw SQL Queries - What Happens in Joins I'm reading that I can use raw SQL in Django and have Django actually build my models from the result s. However I'm wondering what happens if I use joins in the raw SQL. How will Django know what models to use? (Are there any other issues I should be aware of?)
TITLE: Django - Raw SQL Queries - What Happens in Joins QUESTION: I'm reading that I can use raw SQL in Django and have Django actually build my models from the result s. However I'm wondering what happens if I use joins in the raw SQL. How will Django know what models to use? (Are there any other issues I should be a...
[ "django", "django-models" ]
8
7
9,007
1
0
2011-06-06T13:11:01.573000
2011-06-06T13:20:40.900000
6,252,503
6,252,738
Scrolling through UIScrollView in Interface Builder for Xcode 4
This seems to me as though it would be a common problem, but I can't seem to find the answer anywhere. This question seems to address the issue, but I can't seem to get the solution to work and I'm not sure it's referring to Xcode 4. When using Interface Builder in Xcode 4 and working with a UIScrollView, is there a wa...
Just a workaround which helps in Xcode4: Expand the Objects Panel which resides on the left of the Interface Builder view (there is the tiny arrow at the bottom of the panel). Drag your UIScrollView from the view hierachy and place it on the top level. Now you can resize it to access more content (scrolling to that con...
Scrolling through UIScrollView in Interface Builder for Xcode 4 This seems to me as though it would be a common problem, but I can't seem to find the answer anywhere. This question seems to address the issue, but I can't seem to get the solution to work and I'm not sure it's referring to Xcode 4. When using Interface B...
TITLE: Scrolling through UIScrollView in Interface Builder for Xcode 4 QUESTION: This seems to me as though it would be a common problem, but I can't seem to find the answer anywhere. This question seems to address the issue, but I can't seem to get the solution to work and I'm not sure it's referring to Xcode 4. When...
[ "iphone", "interface-builder", "uiscrollview", "xcode4" ]
27
23
19,983
7
0
2011-06-06T13:11:05.190000
2011-06-06T13:29:48.463000
6,252,504
6,252,661
how to convert ECMA-262(ActionScript3.0) RegularExpression to ICU(Objective-C) RegularExpression?
Now, I something doing about parse work. I want to use actionscript3.0 RegularExpression source code to Objective-C program. var reg:RegExp = new RegExp("^[0-9]+$", "gm"); how to convert NSRegularExpression? p.s: ActionScript 3.0 implements regular expressions as defined in the ECMAScript edition 3 language specificati...
Check how you use regexes in objective-c, reuse the pattern ^[0-9]+$ (btw. you can rewrite it to ^\d+$ ). You need also to activate the modifiers g (global match ==> matches all occurences) and m (multiline, makes the $ matches on line ends instead of string end).
how to convert ECMA-262(ActionScript3.0) RegularExpression to ICU(Objective-C) RegularExpression? Now, I something doing about parse work. I want to use actionscript3.0 RegularExpression source code to Objective-C program. var reg:RegExp = new RegExp("^[0-9]+$", "gm"); how to convert NSRegularExpression? p.s: ActionScr...
TITLE: how to convert ECMA-262(ActionScript3.0) RegularExpression to ICU(Objective-C) RegularExpression? QUESTION: Now, I something doing about parse work. I want to use actionscript3.0 RegularExpression source code to Objective-C program. var reg:RegExp = new RegExp("^[0-9]+$", "gm"); how to convert NSRegularExpressi...
[ "iphone", "objective-c", "regex", "ios", "actionscript-3" ]
0
0
189
1
0
2011-06-06T13:11:09.690000
2011-06-06T13:24:05.880000
6,252,510
6,252,562
Get object by reflection
I'm looking for mechanism in c# works like that: Car car1; Car car2; Car car = (Car)SomeMechanism.Get("car1"); car1 and car2 are fields So I want to get some object with reflection, not type:/ How can I do it in c#?
It's not possible for local variables but If you have a field, you can do class Foo{ public Car car1; public Car car2; } you can do object fooInstance =...; Car car1 = (Car)fooInstance.GetType().GetField("car1").GetValue(fooInstance);
Get object by reflection I'm looking for mechanism in c# works like that: Car car1; Car car2; Car car = (Car)SomeMechanism.Get("car1"); car1 and car2 are fields So I want to get some object with reflection, not type:/ How can I do it in c#?
TITLE: Get object by reflection QUESTION: I'm looking for mechanism in c# works like that: Car car1; Car car2; Car car = (Car)SomeMechanism.Get("car1"); car1 and car2 are fields So I want to get some object with reflection, not type:/ How can I do it in c#? ANSWER: It's not possible for local variables but If you ha...
[ "c#", ".net", "reflection", "c#-4.0", "system.reflection" ]
4
7
13,961
3
0
2011-06-06T13:11:50.930000
2011-06-06T13:16:13.503000
6,252,512
6,252,591
store data without using database in android
i have to make an android application in which i need to download a lot of data from the server which is sent to me via XML. i then need to parse the XML and then display the extracted information. To avoid making the application slow, i have decided to break my XML down into small parts.. so that i can only call the p...
You can use application preferences to store data as shown here (if the data is small enough). Their code sample shows: SharedPreferences gameSettings = getSharedPreferences("MyGamePreferences", MODE_PRIVATE); SharedPreferences.Editor prefEditor = gameSettings.edit(); prefEditor.putString("UserName", "Guest123"); prefE...
store data without using database in android i have to make an android application in which i need to download a lot of data from the server which is sent to me via XML. i then need to parse the XML and then display the extracted information. To avoid making the application slow, i have decided to break my XML down int...
TITLE: store data without using database in android QUESTION: i have to make an android application in which i need to download a lot of data from the server which is sent to me via XML. i then need to parse the XML and then display the extracted information. To avoid making the application slow, i have decided to bre...
[ "android" ]
0
1
4,240
3
0
2011-06-06T13:11:55.790000
2011-06-06T13:18:11.357000
6,252,524
6,252,846
How to make a request for sending a list of rows in a rest client -Android
I am working on a REST client in android.My web service is based on Rails.My scenario is that I have an class named user which has attributes like age,name, gender etc.I want to send a list of user objects to the server so that i can insert it into the database.Can someone let me know how i can do this using json?
Have your user class be a JSONObject and then post the objects to your server as JSON strings using JSONObject.quote() and turn those strings back into arrays/objects at the server end.
How to make a request for sending a list of rows in a rest client -Android I am working on a REST client in android.My web service is based on Rails.My scenario is that I have an class named user which has attributes like age,name, gender etc.I want to send a list of user objects to the server so that i can insert it i...
TITLE: How to make a request for sending a list of rows in a rest client -Android QUESTION: I am working on a REST client in android.My web service is based on Rails.My scenario is that I have an class named user which has attributes like age,name, gender etc.I want to send a list of user objects to the server so that...
[ "java", "android", "web-services", "json", "rest" ]
0
1
506
1
0
2011-06-06T13:13:04.360000
2011-06-06T13:38:29.697000
6,252,529
6,252,613
Problem in List of tuples
I have a list of tuples which i need to return a [Int] which are all the locations are dividable by 2.. type A = [(Int, Int, Int, Int)] func:: A -> [Int] func tuples = [a | (a, b, c, d) <- tuples, map a `mod` 2 == 0] func [(244,244,244,244),(244,244,244,244),(244,244,244,244)] Output [244,244,244] I have the current c...
type A = (Int, Int, Int, Int) func:: [A] -> [Int] func t = [a | (a, b, c, d) <- t, all even [a,b,c,d]] The all function returns true only if everything given satisfies the predicate. I've bundled the tuple into a list and checked the predicate.
Problem in List of tuples I have a list of tuples which i need to return a [Int] which are all the locations are dividable by 2.. type A = [(Int, Int, Int, Int)] func:: A -> [Int] func tuples = [a | (a, b, c, d) <- tuples, map a `mod` 2 == 0] func [(244,244,244,244),(244,244,244,244),(244,244,244,244)] Output [244,244...
TITLE: Problem in List of tuples QUESTION: I have a list of tuples which i need to return a [Int] which are all the locations are dividable by 2.. type A = [(Int, Int, Int, Int)] func:: A -> [Int] func tuples = [a | (a, b, c, d) <- tuples, map a `mod` 2 == 0] func [(244,244,244,244),(244,244,244,244),(244,244,244,244...
[ "list", "haskell", "list-comprehension", "tuples" ]
2
3
194
2
0
2011-06-06T13:13:41.367000
2011-06-06T13:20:02.320000
6,252,535
6,252,614
jQuery Menu Hover, but don't at click
HTML Structure: News JAVASCRIPT: $('.fadeThis >.hover').empty(); $('.fadeThis').each(function () { var text = $(this).text(); $(this).append(''+text+''); var $span = $('> span.hover', this).css('opacity', 0); $(this).hover(function () { $span.stop().fadeTo(500, 1); }, function () { $span.stop().fadeTo(500, 0); }).cli...
Your question is not very clear, but do you want someting like this? var fadeBlock = false; $(this).hover(function () { $span.stop().fadeTo(500, 1); }, function () { if (!fadeBlock) { $span.stop().fadeTo(500, 0); } else { fadeBlock = false;} }).click (function () { fadeBlock = true; });
jQuery Menu Hover, but don't at click HTML Structure: News JAVASCRIPT: $('.fadeThis >.hover').empty(); $('.fadeThis').each(function () { var text = $(this).text(); $(this).append(''+text+''); var $span = $('> span.hover', this).css('opacity', 0); $(this).hover(function () { $span.stop().fadeTo(500, 1); }, function ()...
TITLE: jQuery Menu Hover, but don't at click QUESTION: HTML Structure: News JAVASCRIPT: $('.fadeThis >.hover').empty(); $('.fadeThis').each(function () { var text = $(this).text(); $(this).append(''+text+''); var $span = $('> span.hover', this).css('opacity', 0); $(this).hover(function () { $span.stop().fadeTo(500, ...
[ "javascript", "jquery", "href", "html" ]
0
1
132
1
0
2011-06-06T13:14:16.727000
2011-06-06T13:20:16.800000
6,252,542
6,252,552
Define a destroy-method in annotation-based bean?
I'm looking for a way to tell spring which method on an annotation-based bean it should call when it's destryoing that bean. What I'm actually trying to achieve is, to be notified when a session-scoped bean is destroyed in order to persist some stuff from that session.
You need to implement DisposableBean, or (preferably) annotate the method with javax.annotation.PreDestroy, which is more portable.
Define a destroy-method in annotation-based bean? I'm looking for a way to tell spring which method on an annotation-based bean it should call when it's destryoing that bean. What I'm actually trying to achieve is, to be notified when a session-scoped bean is destroyed in order to persist some stuff from that session.
TITLE: Define a destroy-method in annotation-based bean? QUESTION: I'm looking for a way to tell spring which method on an annotation-based bean it should call when it's destryoing that bean. What I'm actually trying to achieve is, to be notified when a session-scoped bean is destroyed in order to persist some stuff f...
[ "spring", "annotations", "lifecycle" ]
17
25
11,102
1
0
2011-06-06T13:14:38.387000
2011-06-06T13:15:19.463000
6,252,558
6,252,861
Remove specific items from a listbox in MFC
CString dance[] = {L"Atb", L"Tiesto", L"Madonna", L"Paul van Dyk", L"Armin van Burren", L"Jennifer Lopez"}; for(int i = 0; i < m_ItemsListBox.GetCount(); ++i) { CString item; int length = m_ItemsListBox.GetTextLen(i); m_ItemsListBox.GetText(i, item.GetBuffer(length)); for(int j = 0; j < sizeof(dance)/sizeof(*dance); +...
Hmmm I wouldn't be comfortable deleting things from the list box while iterating through the items in the listbox seems to be asking for problems down the line. Honestly you could do something like this, I've just whipped together - construct a list of all the item indexes you want to remove and remove them at the end....
Remove specific items from a listbox in MFC CString dance[] = {L"Atb", L"Tiesto", L"Madonna", L"Paul van Dyk", L"Armin van Burren", L"Jennifer Lopez"}; for(int i = 0; i < m_ItemsListBox.GetCount(); ++i) { CString item; int length = m_ItemsListBox.GetTextLen(i); m_ItemsListBox.GetText(i, item.GetBuffer(length)); for(in...
TITLE: Remove specific items from a listbox in MFC QUESTION: CString dance[] = {L"Atb", L"Tiesto", L"Madonna", L"Paul van Dyk", L"Armin van Burren", L"Jennifer Lopez"}; for(int i = 0; i < m_ItemsListBox.GetCount(); ++i) { CString item; int length = m_ItemsListBox.GetTextLen(i); m_ItemsListBox.GetText(i, item.GetBuffe...
[ "c++", "mfc" ]
1
2
5,940
2
0
2011-06-06T13:15:55.710000
2011-06-06T13:39:42.833000
6,252,561
6,263,447
SSRS Sum in table group
I am working on SSRS reporting services. I have a table on which I applied group. Originally I had this data: I changed something in my tablix and created a tablix and added a parent group of Age i.e. left column and then in the right column, I applied an expression: =SUM(Fields!AgeTotal.Value, "Group1") which made the...
Right Click on the details cell and select add Total, then right click on the entire details rows and change it's visibility to Hide. This should do the trick! EDIT Setp by step tutorial with Image: First image example: on the left the result you want, on the right the result you get from a simple grouping. I'm getting...
SSRS Sum in table group I am working on SSRS reporting services. I have a table on which I applied group. Originally I had this data: I changed something in my tablix and created a tablix and added a parent group of Age i.e. left column and then in the right column, I applied an expression: =SUM(Fields!AgeTotal.Value, ...
TITLE: SSRS Sum in table group QUESTION: I am working on SSRS reporting services. I have a table on which I applied group. Originally I had this data: I changed something in my tablix and created a tablix and added a parent group of Age i.e. left column and then in the right column, I applied an expression: =SUM(Field...
[ "reporting-services", "sum", "ssrs-2008", "ssrs-tablix" ]
6
10
28,914
1
0
2011-06-06T13:16:10.400000
2011-06-07T09:47:05.380000
6,252,575
6,252,663
Executors threads not terminating
I am using Executors.newFixedThreadPool(100) method. Single command execution needs approx 20 threads. After executing the command 5-6 times, application stops responding. My thread is implementing Callable. I doubt, that thread doesn't terminate after completion. I have also called shutdown() to terminate the thread. ...
The threads don't terminate. What happens is this: All worker threads wait for the input queue One thread pops the head element from the queue It runs the Callable It pushes the result into the result queue It waits for a new element in the input queue So either the result queue overflows or your Callable doesn't retur...
Executors threads not terminating I am using Executors.newFixedThreadPool(100) method. Single command execution needs approx 20 threads. After executing the command 5-6 times, application stops responding. My thread is implementing Callable. I doubt, that thread doesn't terminate after completion. I have also called sh...
TITLE: Executors threads not terminating QUESTION: I am using Executors.newFixedThreadPool(100) method. Single command execution needs approx 20 threads. After executing the command 5-6 times, application stops responding. My thread is implementing Callable. I doubt, that thread doesn't terminate after completion. I h...
[ "java", "executors" ]
0
3
3,196
4
0
2011-06-06T13:17:08.123000
2011-06-06T13:24:19.620000
6,252,588
6,252,931
python datetime, convert weekday's abbrv to number?
How would i go about converting a weekday abbreviation (%a) into the weekday number (%u) using python datetime module?
>>> import calendar >>> zip(list(calendar.day_abbr), range(7)) [('Mon', 0), ('Tue', 1), ('Wed', 2), ('Thu', 3), ('Fri', 4), ('Sat', 5), ('Sun', 6)]
python datetime, convert weekday's abbrv to number? How would i go about converting a weekday abbreviation (%a) into the weekday number (%u) using python datetime module?
TITLE: python datetime, convert weekday's abbrv to number? QUESTION: How would i go about converting a weekday abbreviation (%a) into the weekday number (%u) using python datetime module? ANSWER: >>> import calendar >>> zip(list(calendar.day_abbr), range(7)) [('Mon', 0), ('Tue', 1), ('Wed', 2), ('Thu', 3), ('Fri', 4)...
[ "python", "datetime" ]
2
6
5,437
3
0
2011-06-06T13:18:08.953000
2011-06-06T13:44:05.080000
6,252,597
6,252,756
play creates tables with the fields sorted alphabetically
I am using a model in Play like this: package models; import java.util.*; import javax.persistence.*; import play.db.jpa.*; @Entity public class User extends Model { public String email; public String password; public String fullname; public boolean isAdmin; public User(String email, String password, String fullna...
Play uses Hibernate. Hibernate orders the columns when it creates the tables. See this discussion: It is sorted to ensurce deterministic ordering across clusters. To get a different order, let Hibernate create the DDLs for the tables and sort the columns the way you like. That is: Don't let Play/Hibernate create the ta...
play creates tables with the fields sorted alphabetically I am using a model in Play like this: package models; import java.util.*; import javax.persistence.*; import play.db.jpa.*; @Entity public class User extends Model { public String email; public String password; public String fullname; public boolean isAdmin;...
TITLE: play creates tables with the fields sorted alphabetically QUESTION: I am using a model in Play like this: package models; import java.util.*; import javax.persistence.*; import play.db.jpa.*; @Entity public class User extends Model { public String email; public String password; public String fullname; publi...
[ "java", "hibernate", "jpa", "playframework" ]
3
9
1,159
1
0
2011-06-06T13:18:38.190000
2011-06-06T13:31:11.333000
6,252,603
6,252,651
how to remove the listening of callback on anonymous method?
I wrote some class: public class A { public A() { serviceAdapter.CompletedCallBackEvent += new EventHandler( foo );... } void foo(object sender, EventArgs e) { serviceAdapter.CompletedCallBackEvent -= new EventHandler( foo ); } } Now, i want to change this callback listener with some anonymous - but i don't know how t...
You could simply assign your delegate/handler to a private variable. private EventHander _handler = null; public A() { _handler = delegate( object sender, EventArgs ee) { ServiceAdapter.CompletedCallBackEvent -= _handler; }; ServiceAdapter.CompletedCallBackEvent += _handler; }
how to remove the listening of callback on anonymous method? I wrote some class: public class A { public A() { serviceAdapter.CompletedCallBackEvent += new EventHandler( foo );... } void foo(object sender, EventArgs e) { serviceAdapter.CompletedCallBackEvent -= new EventHandler( foo ); } } Now, i want to change this c...
TITLE: how to remove the listening of callback on anonymous method? QUESTION: I wrote some class: public class A { public A() { serviceAdapter.CompletedCallBackEvent += new EventHandler( foo );... } void foo(object sender, EventArgs e) { serviceAdapter.CompletedCallBackEvent -= new EventHandler( foo ); } } Now, i wan...
[ "c#" ]
4
4
3,519
2
0
2011-06-06T13:19:26.360000
2011-06-06T13:22:51.320000
6,252,612
6,252,645
How to trim each string element in the string array without using loop?
var gender = from row in excel.Worksheet() select row["Gender *"].Value.ToString(); string[] genderArray = gender.ToArray().Distinct().ToArray(); in this case the content of genderArray are { "F", "M", "M "} i want that genderArray should only contain { "F", "M" }
var gender = (from row in excel.Worksheet() select row["Gender *"].Value.ToString()); string[] genderArray = gender.ToArray().Distinct().Select(g=>g.Trim()).ToArray(); You can also do the.Trim in the first query against Value.ToString().Trim(). Edited: I might have misplaced the select in the query.
How to trim each string element in the string array without using loop? var gender = from row in excel.Worksheet() select row["Gender *"].Value.ToString(); string[] genderArray = gender.ToArray().Distinct().ToArray(); in this case the content of genderArray are { "F", "M", "M "} i want that genderArray should only cont...
TITLE: How to trim each string element in the string array without using loop? QUESTION: var gender = from row in excel.Worksheet() select row["Gender *"].Value.ToString(); string[] genderArray = gender.ToArray().Distinct().ToArray(); in this case the content of genderArray are { "F", "M", "M "} i want that genderArra...
[ "c#", ".net", "arrays", "string" ]
3
5
3,311
4
0
2011-06-06T13:20:02.160000
2011-06-06T13:22:22.880000