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,184,112
6,184,131
Unfamiliar @interface statement
I came across an interface that was defined as shown below: @interface UITableViewCell (XXXXXXXX) @end Can someone explain what the value in the parentheses (XXXXXXX) does? I have not seen an interface of this format.
It means XXXXXXX is a category. It adds or modifies functionality to/of the UITableViewCell class. You can read about categories here. As an addition, the category conforms to the MHLazyTableImageCell protocol.
Unfamiliar @interface statement I came across an interface that was defined as shown below: @interface UITableViewCell (XXXXXXXX) @end Can someone explain what the value in the parentheses (XXXXXXX) does? I have not seen an interface of this format.
TITLE: Unfamiliar @interface statement QUESTION: I came across an interface that was defined as shown below: @interface UITableViewCell (XXXXXXXX) @end Can someone explain what the value in the parentheses (XXXXXXX) does? I have not seen an interface of this format. ANSWER: It means XXXXXXX is a category. It adds or ...
[ "objective-c", "cocoa-touch", "ios", "interface" ]
0
4
108
1
0
2011-05-31T07:09:12.413000
2011-05-31T07:11:33.733000
6,184,113
6,184,166
blend 4 and layout path
according to this article http://electricbeach.org/?p=653 and many others it's trivial to make a layout path. Well I've downloaded phone 7 developer kit but when I try to convert a shape (es. circle) to layout path is impossible because command is not active. Also pathlistbox don't exist in my blend version... you know...
You can only use the PathListBox in Silverlight 4 onwards, which is available on the Mango build of Windows Phone 7. You will need to download and install the Developer Tools for Windows Phone Mango.
blend 4 and layout path according to this article http://electricbeach.org/?p=653 and many others it's trivial to make a layout path. Well I've downloaded phone 7 developer kit but when I try to convert a shape (es. circle) to layout path is impossible because command is not active. Also pathlistbox don't exist in my b...
TITLE: blend 4 and layout path QUESTION: according to this article http://electricbeach.org/?p=653 and many others it's trivial to make a layout path. Well I've downloaded phone 7 developer kit but when I try to convert a shape (es. circle) to layout path is impossible because command is not active. Also pathlistbox d...
[ "windows-phone-7", "expression-blend" ]
0
0
299
1
0
2011-05-31T07:09:21.627000
2011-05-31T07:15:30.530000
6,184,117
6,184,133
Problem with navigation controller when set title
I want to make Navigation with 3 levels. I make the root controller and fill the table with data. But when I touch on some cell my application crash. This is part of my code: NavAppDelegate.h #import @interface NavAppDelegate: NSObject { } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic...
In your file's owner of your xib file set the view outlet to the view. OffersViewController 's view is not set in your case. Search for view outlet in OffersViewController File owner and set it to the view in Interface builder as shown.
Problem with navigation controller when set title I want to make Navigation with 3 levels. I make the root controller and fill the table with data. But when I touch on some cell my application crash. This is part of my code: NavAppDelegate.h #import @interface NavAppDelegate: NSObject { } @property (nonatomic, retain...
TITLE: Problem with navigation controller when set title QUESTION: I want to make Navigation with 3 levels. I make the root controller and fill the table with data. But when I touch on some cell my application crash. This is part of my code: NavAppDelegate.h #import @interface NavAppDelegate: NSObject { } @property ...
[ "iphone", "uitableview", "uinavigationcontroller" ]
0
1
448
1
0
2011-05-31T07:09:43.657000
2011-05-31T07:12:00.167000
6,184,121
6,184,171
Does save(:validate=>false) stop a counter_cache?
My question is pretty much the subject line: If I want to save a record but forego all validations, will it still update the relevant counter_cache s when it receives the call @record.save(:validate => false)? How does Rails treat counter_cache with respect to validations, and is there a command that controls each indi...
If you pass:validate=>false, it skips the valid? function call. Everything else works as expected.
Does save(:validate=>false) stop a counter_cache? My question is pretty much the subject line: If I want to save a record but forego all validations, will it still update the relevant counter_cache s when it receives the call @record.save(:validate => false)? How does Rails treat counter_cache with respect to validatio...
TITLE: Does save(:validate=>false) stop a counter_cache? QUESTION: My question is pretty much the subject line: If I want to save a record but forego all validations, will it still update the relevant counter_cache s when it receives the call @record.save(:validate => false)? How does Rails treat counter_cache with re...
[ "ruby-on-rails", "ruby-on-rails-3", "validation" ]
0
2
308
1
0
2011-05-31T07:10:01.937000
2011-05-31T07:15:39.173000
6,184,122
6,193,011
Jfree chart xy line implementation
I want to plot 4 lines in one dataset but I cannot. Could any1 tell me what libs in need in jfree and how I can implement them in 1 chart public void visualise(){ //visualise data XYSeries series = new XYSeries("Membrane mVolt"); XYSeries series2 = new XYSeries("potassium_channel_n_gate_n"); XYSeries series3 = new XYSe...
This example shows how to add multiple series to a DefaultXYDataset.
Jfree chart xy line implementation I want to plot 4 lines in one dataset but I cannot. Could any1 tell me what libs in need in jfree and how I can implement them in 1 chart public void visualise(){ //visualise data XYSeries series = new XYSeries("Membrane mVolt"); XYSeries series2 = new XYSeries("potassium_channel_n_ga...
TITLE: Jfree chart xy line implementation QUESTION: I want to plot 4 lines in one dataset but I cannot. Could any1 tell me what libs in need in jfree and how I can implement them in 1 chart public void visualise(){ //visualise data XYSeries series = new XYSeries("Membrane mVolt"); XYSeries series2 = new XYSeries("pota...
[ "java", "graphics", "plot", "jfreechart" ]
1
1
1,585
1
0
2011-05-31T07:10:02.437000
2011-05-31T20:12:53.290000
6,184,134
6,203,131
How can I set up my object properly using NSXMLParser?
What I am trying to do is for the parser to go over each row of XML and then assign the elements to an object. At the end of the row, the object is added to a NSMutableString. I just want one faxRecipient object to be set up per one row of XML. Here is a sample out put of the XML: 23 name1 +12345222 0 24 name2 +7890333...
Does your XML pass back a top level element name such as: 23 name1 +12345222 0 24 name2 +78903333 0 If yes, then you should be checking for that beginning element in your didStart and in your DidEnd such as: -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *) elementName namespaceURI:(NSString *)namespaceU...
How can I set up my object properly using NSXMLParser? What I am trying to do is for the parser to go over each row of XML and then assign the elements to an object. At the end of the row, the object is added to a NSMutableString. I just want one faxRecipient object to be set up per one row of XML. Here is a sample out...
TITLE: How can I set up my object properly using NSXMLParser? QUESTION: What I am trying to do is for the parser to go over each row of XML and then assign the elements to an object. At the end of the row, the object is added to a NSMutableString. I just want one faxRecipient object to be set up per one row of XML. He...
[ "iphone", "ios" ]
2
1
278
3
0
2011-05-31T07:12:10.167000
2011-06-01T14:49:44.660000
6,184,142
6,184,510
JTable TableRowSorter or Re-query MySQL DB?
Using JDBC and MySQL I am displaying a MySQL table in a JTable. Currently as soon as my Java application is launched the Database table is being queried for all results (e.g. SELECT * FROM tableExample) which then get displayed by the JTable. My question is, if I wish to apply a filter (or two) is it better to re-query...
Every JTable has a TableModel that holds it's data. The default implementation is DefaultTableModel, but you can implement your own, depending on the filters you want to use. If you query the database again, you can set the data on the TableModel or set a new instance of a TableModel on the JTable. model = new DefaultT...
JTable TableRowSorter or Re-query MySQL DB? Using JDBC and MySQL I am displaying a MySQL table in a JTable. Currently as soon as my Java application is launched the Database table is being queried for all results (e.g. SELECT * FROM tableExample) which then get displayed by the JTable. My question is, if I wish to appl...
TITLE: JTable TableRowSorter or Re-query MySQL DB? QUESTION: Using JDBC and MySQL I am displaying a MySQL table in a JTable. Currently as soon as my Java application is launched the Database table is being queried for all results (e.g. SELECT * FROM tableExample) which then get displayed by the JTable. My question is,...
[ "java", "mysql", "jdbc", "jtable" ]
0
1
1,050
2
0
2011-05-31T07:13:16.827000
2011-05-31T07:52:17.647000
6,184,143
6,188,477
Detect BSOD on Windows
Is there any way to detect if a BSOD has just occurred(before the OS shutdowns)? Thanks,
The kernel provides limited functionality for drivers to be informed of a bugcheck (i.e., BSOD) via KeRegisterBugCheckCallback. In the callback routine, you can attempt a graceful shutdown of your applications, etc. However, given that the system is bugchecking, most functionality will not be available.
Detect BSOD on Windows Is there any way to detect if a BSOD has just occurred(before the OS shutdowns)? Thanks,
TITLE: Detect BSOD on Windows QUESTION: Is there any way to detect if a BSOD has just occurred(before the OS shutdowns)? Thanks, ANSWER: The kernel provides limited functionality for drivers to be informed of a bugcheck (i.e., BSOD) via KeRegisterBugCheckCallback. In the callback routine, you can attempt a graceful s...
[ "windows", "exception", "detect", "bsod" ]
0
4
381
2
0
2011-05-31T07:13:27.317000
2011-05-31T13:40:25.617000
6,184,147
6,189,298
PHP to Mysql Line break Question
I am having hard time getting a form submitted textarea where people put in line breaks when they hit enter on their address..For example. I am using this to get the post $address = mysql_real_escape_string(trim($_POST['address'])); They are entering 123 test city,state. Then after they submit, in the mysql database th...
I was not able to resolve this the way I wanted to and just settled with using str_replace() to replace all "\r\n" stuff with a space...
PHP to Mysql Line break Question I am having hard time getting a form submitted textarea where people put in line breaks when they hit enter on their address..For example. I am using this to get the post $address = mysql_real_escape_string(trim($_POST['address'])); They are entering 123 test city,state. Then after they...
TITLE: PHP to Mysql Line break Question QUESTION: I am having hard time getting a form submitted textarea where people put in line breaks when they hit enter on their address..For example. I am using this to get the post $address = mysql_real_escape_string(trim($_POST['address'])); They are entering 123 test city,stat...
[ "php", "mysql", "line-breaks" ]
2
1
403
3
0
2011-05-31T07:13:58.507000
2011-05-31T14:41:16.923000
6,184,157
6,184,181
Java One-liner Scanner from URL Text file
In java, what code do I need to get from "http://www.mysite.com/text.txt" to a Scanner that parses the resulting text contained in the site in as few lines as possible.
URL yahoo = new URL("http://www.yahoo.com/"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; while ((inputLine = in.readLine())!= null) System.out.println(inputLine); in.close(); Reference Reading URL in Java
Java One-liner Scanner from URL Text file In java, what code do I need to get from "http://www.mysite.com/text.txt" to a Scanner that parses the resulting text contained in the site in as few lines as possible.
TITLE: Java One-liner Scanner from URL Text file QUESTION: In java, what code do I need to get from "http://www.mysite.com/text.txt" to a Scanner that parses the resulting text contained in the site in as few lines as possible. ANSWER: URL yahoo = new URL("http://www.yahoo.com/"); BufferedReader in = new BufferedRead...
[ "java", "url", "java.util.scanner" ]
4
5
15,976
4
0
2011-05-31T07:14:55.710000
2011-05-31T07:17:07.833000
6,184,169
6,184,470
alert() not working in Chrome
'nuff said. I have absolutely no clue why using alert() there wouldn't work. It works perfectly in Firefox, but gives that error in Chrome.
window.alert = null; alert('test'); // fail delete window.alert; // true alert('test'); // win window is an instance of DOMWindow, and by setting something to window.alert, the correct implementation is being "shadowed", i.e. when accessing alert it is first looking for it on the window object. Usually this is not foun...
alert() not working in Chrome 'nuff said. I have absolutely no clue why using alert() there wouldn't work. It works perfectly in Firefox, but gives that error in Chrome.
TITLE: alert() not working in Chrome QUESTION: 'nuff said. I have absolutely no clue why using alert() there wouldn't work. It works perfectly in Firefox, but gives that error in Chrome. ANSWER: window.alert = null; alert('test'); // fail delete window.alert; // true alert('test'); // win window is an instance of DOM...
[ "javascript", "google-chrome", "alert" ]
12
17
123,794
5
0
2011-05-31T07:15:35.043000
2011-05-31T07:47:56.693000
6,184,173
6,197,180
How to align joomla plugin through code
I am developing joomla 1.5 and 1.6 plugin(s). I am providing two input parameters: Alignment ( Left or right ) Display plugin ( after article or before article) Through code; is there any way to align plugin left or right, also display plugin before or after article. Please suggest your pointers for joomla 1.5 and joom...
I think that this can be succeed by overwriting the com_content templates. Maybe you can put a special text pattern like {PLUGIN_LEFT} and {PLUGIN_RIGHT} to the custom component template in /templates/TEMPLATE_NAME/html/com_content/article/default.php.You need to locate these patterns left and right side of the content...
How to align joomla plugin through code I am developing joomla 1.5 and 1.6 plugin(s). I am providing two input parameters: Alignment ( Left or right ) Display plugin ( after article or before article) Through code; is there any way to align plugin left or right, also display plugin before or after article. Please sugge...
TITLE: How to align joomla plugin through code QUESTION: I am developing joomla 1.5 and 1.6 plugin(s). I am providing two input parameters: Alignment ( Left or right ) Display plugin ( after article or before article) Through code; is there any way to align plugin left or right, also display plugin before or after art...
[ "joomla", "joomla1.5", "joomla-extensions", "joomla1.6", "joomla-template" ]
0
1
279
1
0
2011-05-31T07:15:48.023000
2011-06-01T06:35:26.090000
6,184,184
6,213,912
implementing simple Document management
My qustion is: How would you go on implementing simple DMS(document management) based on following requirements? DMS shouls be distributed web application. Support for document versioning. Support for document locking. Document search. Im already clear on what technologies I want to use. I will use Sring MVC, Hibernate...
@Eduard, regarding dependencies on 3rd parties - are you doing this as a college/university exercise or something that will affect real users in a production environment? At the risk of sounding very pretentious; don't reimplement the wheel! I'd definitely 2nd the call to use JCR, this way you are depending a standard ...
implementing simple Document management My qustion is: How would you go on implementing simple DMS(document management) based on following requirements? DMS shouls be distributed web application. Support for document versioning. Support for document locking. Document search. Im already clear on what technologies I want...
TITLE: implementing simple Document management QUESTION: My qustion is: How would you go on implementing simple DMS(document management) based on following requirements? DMS shouls be distributed web application. Support for document versioning. Support for document locking. Document search. Im already clear on what t...
[ "java", "webdav", "dms" ]
5
3
8,545
5
0
2011-05-31T07:17:37.997000
2011-06-02T11:27:53.767000
6,184,185
6,186,364
storage of different oracle data
my question is about Oracle data.In this scenario supposed there are two transactions running at about the same time in separate connections. These transactions have identical code, but different data. The transaction calls the following package procedure: PROCEDURE find(aKey Thing_tab.key%TYPE) IS BEGIN SELECT * INTO ...
Your terms are unfamiliar to me. I will do my best to translate them into the normal Oracle terms, which I hope will answer your question. Shared SQL Area In Oracle the Shared Pool of the SGA. In your scenario it will contain one parse tree for the SELECT statement and one execution plan. There is just one because the ...
storage of different oracle data my question is about Oracle data.In this scenario supposed there are two transactions running at about the same time in separate connections. These transactions have identical code, but different data. The transaction calls the following package procedure: PROCEDURE find(aKey Thing_tab....
TITLE: storage of different oracle data QUESTION: my question is about Oracle data.In this scenario supposed there are two transactions running at about the same time in separate connections. These transactions have identical code, but different data. The transaction calls the following package procedure: PROCEDURE fi...
[ "sql", "oracle", "memory-management", "transactions", "plsql" ]
2
3
107
2
0
2011-05-31T07:17:42.247000
2011-05-31T10:43:43.017000
6,184,191
6,185,822
ASP.NET MVC 3 unit tests for Membership.CreateUser always return MembershipCreateStatus error
I'm trying to write a unit test for creating a new user and verifying that the desired redirect occurs. Here's my Register action, which is pretty much out-of-the-box code from a VS template: [HttpPost] public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user Members...
The static class/method issue strikes again! the static method Membership.CreateUser is a hidden dependency here as it looks like your controller does not have a dependency, but actually it is dependent on this method, and you have not replaced (or been able to replace) this dependency in your test so you can control t...
ASP.NET MVC 3 unit tests for Membership.CreateUser always return MembershipCreateStatus error I'm trying to write a unit test for creating a new user and verifying that the desired redirect occurs. Here's my Register action, which is pretty much out-of-the-box code from a VS template: [HttpPost] public ActionResult Reg...
TITLE: ASP.NET MVC 3 unit tests for Membership.CreateUser always return MembershipCreateStatus error QUESTION: I'm trying to write a unit test for creating a new user and verifying that the desired redirect occurs. Here's my Register action, which is pretty much out-of-the-box code from a VS template: [HttpPost] publi...
[ "c#", "unit-testing", "asp.net-mvc-3", "tdd", "moq" ]
2
11
3,536
2
0
2011-05-31T07:18:04.573000
2011-05-31T09:52:41.953000
6,184,193
6,184,233
Merging entities in hibernate
what is the best way to do this: I have some entities stored as Hibernate entities and they contain some fields that needs to be unique for single row. So when i create another entity with that set of fields equal to already persisted one, I want to override old record with new, else create new record. What would be th...
If this is the primary key of your entity, you can use session.merge(entity) or session.saveOrUpdate(entity) If it is another unique constraint you'd have to handle this manually - first try to find an entity with that value (with a query), and if it doesn't exist, save the new one, otherwise, transfer all the fields (...
Merging entities in hibernate what is the best way to do this: I have some entities stored as Hibernate entities and they contain some fields that needs to be unique for single row. So when i create another entity with that set of fields equal to already persisted one, I want to override old record with new, else creat...
TITLE: Merging entities in hibernate QUESTION: what is the best way to do this: I have some entities stored as Hibernate entities and they contain some fields that needs to be unique for single row. So when i create another entity with that set of fields equal to already persisted one, I want to override old record wi...
[ "java", "hibernate" ]
0
3
4,106
2
0
2011-05-31T07:18:16.523000
2011-05-31T07:22:47.113000
6,184,199
6,185,142
AS3: Simulating RotationX with Matrix
I have to use Flash CS3, so I can't use the properties rotationX, roationY and rotationZ. I have a movieclip, that looks like this. It is now flat, no 3D rotation or shearing But what I want is that this movieclip has a rotationX, or that it is a bit in perspective like this: As I said, I can't use rotationX, so I have...
Make your life easier and just download a 3D engine for flash 9: http://away3d.com/downloads Either that or you can modify your CS3 installation to produce SWF files that target flash 10+
AS3: Simulating RotationX with Matrix I have to use Flash CS3, so I can't use the properties rotationX, roationY and rotationZ. I have a movieclip, that looks like this. It is now flat, no 3D rotation or shearing But what I want is that this movieclip has a rotationX, or that it is a bit in perspective like this: As I ...
TITLE: AS3: Simulating RotationX with Matrix QUESTION: I have to use Flash CS3, so I can't use the properties rotationX, roationY and rotationZ. I have a movieclip, that looks like this. It is now flat, no 3D rotation or shearing But what I want is that this movieclip has a rotationX, or that it is a bit in perspectiv...
[ "actionscript-3", "flash", "animation", "rotation" ]
2
0
1,324
3
0
2011-05-31T07:18:44.057000
2011-05-31T08:55:11.813000
6,184,203
6,184,297
Initiate change of a DependencyProperty of a ViewModel with a Event of another Thread
I want to change a DependencyProperty of my ViewModel from a class which connects the application to a database. This class raises events which should initiate a change of some properties in my ViewModel. How can I realize that? I don't have the Dispatcher of the View.
I'm assuming you don't really have dependency properties on your viewmodels but rather normal C# properties which raises the PropertyChanged event. If so, you should be fine already. Modify your properties from your background thread (normal concurrency issues apply obviously) and when they are bound to a WPF element's...
Initiate change of a DependencyProperty of a ViewModel with a Event of another Thread I want to change a DependencyProperty of my ViewModel from a class which connects the application to a database. This class raises events which should initiate a change of some properties in my ViewModel. How can I realize that? I don...
TITLE: Initiate change of a DependencyProperty of a ViewModel with a Event of another Thread QUESTION: I want to change a DependencyProperty of my ViewModel from a class which connects the application to a database. This class raises events which should initiate a change of some properties in my ViewModel. How can I r...
[ "wpf", "multithreading", "events", "dependency-properties" ]
0
2
497
2
0
2011-05-31T07:19:00.250000
2011-05-31T07:29:42.547000
6,184,217
6,191,760
Why does Xcode 4 compile test target when I build non-test target
Xcode 4 project contains two targets: " normal " application target and " test " target. When I select "normal" target scheme and do build, I get compile errors and warnings from both targets. "Normal" application target dependency is empty, test target is depending on normal app. What do I need to do to build only nor...
Choose Product > Build For > Build For Running to build the application target only.
Why does Xcode 4 compile test target when I build non-test target Xcode 4 project contains two targets: " normal " application target and " test " target. When I select "normal" target scheme and do build, I get compile errors and warnings from both targets. "Normal" application target dependency is empty, test target ...
TITLE: Why does Xcode 4 compile test target when I build non-test target QUESTION: Xcode 4 project contains two targets: " normal " application target and " test " target. When I select "normal" target scheme and do build, I get compile errors and warnings from both targets. "Normal" application target dependency is e...
[ "iphone", "build", "xcode4", "target" ]
0
2
95
1
0
2011-05-31T07:20:49.440000
2011-05-31T18:18:47.950000
6,184,221
6,184,253
Importance of a design pattern?
I am learning C++ I don't know much about this stuff except the fact that programming design pattern is neccesary when actually working in large projects.I hope its correct to some extent. Is this common to all object oriented languages or do I need to look specifically into C++ design patterns. Also How does it helps ...
Design patterns are often misunderstood. They are really a way for experienced users to have shorthand for describing common situations. You don't need to worry about them too much while you are learning C++.
Importance of a design pattern? I am learning C++ I don't know much about this stuff except the fact that programming design pattern is neccesary when actually working in large projects.I hope its correct to some extent. Is this common to all object oriented languages or do I need to look specifically into C++ design p...
TITLE: Importance of a design pattern? QUESTION: I am learning C++ I don't know much about this stuff except the fact that programming design pattern is neccesary when actually working in large projects.I hope its correct to some extent. Is this common to all object oriented languages or do I need to look specifically...
[ "c++", "design-patterns" ]
3
5
1,090
6
0
2011-05-31T07:21:40.410000
2011-05-31T07:24:47.133000
6,184,222
6,184,639
How to retrieve value from linkedhashmap using iterators in Struts2......?
I have function which return LinkedHashMap in Struts2 and i just came to know that we cannot use for loop in struts2 instead we have to use Iterators, and am new to struts can any on help me to retrieve value from linkedhashmap using iterators, below is how values are lined up in hashmap: LinkedHashMap > topSuppliers =...
You should iterate over List of Map instead of Map of List Example: @Getter private List listOfMap = Lists.newArrayList(); public String execute() { while (resultset.next()) { final Map map = Maps.newHashMap(); map.put("manufId", resultset.getString("manufacturer_id")); map.put("manufLogo", resultset.getString("SUPP...
How to retrieve value from linkedhashmap using iterators in Struts2......? I have function which return LinkedHashMap in Struts2 and i just came to know that we cannot use for loop in struts2 instead we have to use Iterators, and am new to struts can any on help me to retrieve value from linkedhashmap using iterators, ...
TITLE: How to retrieve value from linkedhashmap using iterators in Struts2......? QUESTION: I have function which return LinkedHashMap in Struts2 and i just came to know that we cannot use for loop in struts2 instead we have to use Iterators, and am new to struts can any on help me to retrieve value from linkedhashmap...
[ "struts2", "iterator", "linkedhashmap" ]
0
1
1,791
2
0
2011-05-31T07:21:44.430000
2011-05-31T08:04:51.697000
6,184,223
6,184,695
Http POST in BlackBerry
Greetings, I am trying to setup a server connection from my BlackBerry Application. I was able to get a response code on the status of the server. Now i have a few values which i have to POST to the server Its like a registration page values(username, password, age ) have to be sent to the server. ConnectionFactory con...
... httpConn = (HttpConnection)connDesc.getConnection(); httpConn.setRequestMethod(HttpConnection.POST); httpConn.setRequestProperty("username",name); httpConn.setRequestProperty("password",pass);....
Http POST in BlackBerry Greetings, I am trying to setup a server connection from my BlackBerry Application. I was able to get a response code on the status of the server. Now i have a few values which i have to POST to the server Its like a registration page values(username, password, age ) have to be sent to the serve...
TITLE: Http POST in BlackBerry QUESTION: Greetings, I am trying to setup a server connection from my BlackBerry Application. I was able to get a response code on the status of the server. Now i have a few values which i have to POST to the server Its like a registration page values(username, password, age ) have to be...
[ "java", "blackberry", "blackberry-simulator", "blackberry-eclipse-plugin", "blackberry-jde" ]
4
1
3,796
2
0
2011-05-31T07:21:48.297000
2011-05-31T08:11:12.603000
6,184,229
6,184,341
Are there "official" Javadocs available for MySQL JDBC Connector?
Are there javadocs available for MySQL JDBC connector? If so, where can I find them? Googling around, I've come across links such as Class MysqlDataSource. But it is that official? I guess I'm looking for something that came from mysql.com or affiliates. Is there such thing?
The official documentation of Connector/J is here. It does not, as far as I know, contain any JavaDoc. The reason for this is that you should not need to directly refer to any of those classes. You should be able to use only the java.sql.* classes to access the DB.
Are there "official" Javadocs available for MySQL JDBC Connector? Are there javadocs available for MySQL JDBC connector? If so, where can I find them? Googling around, I've come across links such as Class MysqlDataSource. But it is that official? I guess I'm looking for something that came from mysql.com or affiliates....
TITLE: Are there "official" Javadocs available for MySQL JDBC Connector? QUESTION: Are there javadocs available for MySQL JDBC connector? If so, where can I find them? Googling around, I've come across links such as Class MysqlDataSource. But it is that official? I guess I'm looking for something that came from mysql....
[ "documentation", "javadoc", "mysql-connector" ]
16
14
9,321
2
0
2011-05-31T07:22:24.260000
2011-05-31T07:35:08.883000
6,184,240
6,234,777
Map doesn't respond on mouse clicks with Google Maps API V3 and QWebView
EDIT 4 All this while I was thinking that it is the markers problem, that they do not get dragged! Now I have realized, that NO mouse click works on the map when it is displayed in Qt widget. The following code, I pasted in an HTML file and opened through Firefox, this worked flawlessly! and the same doesn't respond wh...
Found the solution: Add this class in the source file where you are "loading" the HTML file (containing Javascript API) in the Qt widget. class myWebPage: public QWebPage { virtual QString userAgentForUrl(const QUrl& url) const { return "Chrome/1.0"; } }; Then in your own class in the same source file, add the setPage ...
Map doesn't respond on mouse clicks with Google Maps API V3 and QWebView EDIT 4 All this while I was thinking that it is the markers problem, that they do not get dragged! Now I have realized, that NO mouse click works on the map when it is displayed in Qt widget. The following code, I pasted in an HTML file and opened...
TITLE: Map doesn't respond on mouse clicks with Google Maps API V3 and QWebView QUESTION: EDIT 4 All this while I was thinking that it is the markers problem, that they do not get dragged! Now I have realized, that NO mouse click works on the map when it is displayed in Qt widget. The following code, I pasted in an HT...
[ "google-maps", "google-maps-api-3", "google-maps-markers", "qwebview" ]
1
1
2,078
3
0
2011-05-31T07:23:51.987000
2011-06-04T04:52:04.740000
6,184,242
6,184,396
iPad local data storage limit
Can anyone tell me what is the maximum size that can be download from the web and can be stored locally.
The limit is 5 MB. See also this S.O. post. You could also have a look at this if you are interested in going beyond that limit. EDIT: after your comment I see you are not referring to local web storage. Local web storage is a new possibility offered by HTML5 to store key-value pairs. This has got the limitation I was ...
iPad local data storage limit Can anyone tell me what is the maximum size that can be download from the web and can be stored locally.
TITLE: iPad local data storage limit QUESTION: Can anyone tell me what is the maximum size that can be download from the web and can be stored locally. ANSWER: The limit is 5 MB. See also this S.O. post. You could also have a look at this if you are interested in going beyond that limit. EDIT: after your comment I se...
[ "ipad" ]
1
1
3,876
1
0
2011-05-31T07:23:57.867000
2011-05-31T07:39:58.137000
6,184,257
6,184,434
Surprising output of Python program
I am just started learning Python am getting bit confused after seeing the output of following program: #!/usr/bin/python # Function definition is here def changeme( mylist ): "This changes a passed list into this function" mylist = [1,2,3,4]; # This would assig new reference in mylist print "Values inside the function...
By assigning a value, you are defining a new list, not updating the old one. You can check by using the id() function on them.
Surprising output of Python program I am just started learning Python am getting bit confused after seeing the output of following program: #!/usr/bin/python # Function definition is here def changeme( mylist ): "This changes a passed list into this function" mylist = [1,2,3,4]; # This would assig new reference in myli...
TITLE: Surprising output of Python program QUESTION: I am just started learning Python am getting bit confused after seeing the output of following program: #!/usr/bin/python # Function definition is here def changeme( mylist ): "This changes a passed list into this function" mylist = [1,2,3,4]; # This would assig new...
[ "python" ]
0
3
207
3
0
2011-05-31T07:25:02.937000
2011-05-31T07:44:00.023000
6,184,260
6,186,159
Using CSS to style a Sencha Touch form - how do I find the elements?
I'm starting out with Sencha Touch, and I am getting a pretty decent handle on the Javascript elements of this powerful tool. But I've recently come to the CSS portion, and I'm afraid I can't figure out how to style it accurately. I can guess at some of the elements, and I know some of the others because I created them...
Hey StormShadow. To edit the style of Sencha components you shuld learn SASS, in fact, Sencha Touch, exactlly like the new Ext 4 framework, uses SASS and COMPASS to create theyre themes and you can do the same creating your own. I know that at the beginning you could be "scared" about to use these new technologies, but...
Using CSS to style a Sencha Touch form - how do I find the elements? I'm starting out with Sencha Touch, and I am getting a pretty decent handle on the Javascript elements of this powerful tool. But I've recently come to the CSS portion, and I'm afraid I can't figure out how to style it accurately. I can guess at some ...
TITLE: Using CSS to style a Sencha Touch form - how do I find the elements? QUESTION: I'm starting out with Sencha Touch, and I am getting a pretty decent handle on the Javascript elements of this powerful tool. But I've recently come to the CSS portion, and I'm afraid I can't figure out how to style it accurately. I ...
[ "css", "forms", "sencha-touch" ]
2
3
2,212
2
0
2011-05-31T07:25:19.817000
2011-05-31T10:24:49.610000
6,184,262
6,184,552
Multiple arguments with around advice
I am given a method in a class like this.. public int foo(String a,String b){} Now I want to apply a pointcut at this point and using around advice I want to alter the second argument. public aspect Aspect { int around(String s): call(int foo(Object,String)) && args(i) { int i = proceed(i.concat("hello")); return i; } ...
Your proceed() and around() don't match. proceed() should be called with both arguments.
Multiple arguments with around advice I am given a method in a class like this.. public int foo(String a,String b){} Now I want to apply a pointcut at this point and using around advice I want to alter the second argument. public aspect Aspect { int around(String s): call(int foo(Object,String)) && args(i) { int i = pr...
TITLE: Multiple arguments with around advice QUESTION: I am given a method in a class like this.. public int foo(String a,String b){} Now I want to apply a pointcut at this point and using around advice I want to alter the second argument. public aspect Aspect { int around(String s): call(int foo(Object,String)) && ar...
[ "java", "aspectj" ]
0
0
591
1
0
2011-05-31T07:25:26.273000
2011-05-31T07:55:35.980000
6,184,275
6,184,450
Rails pagination of subset of a class
I have a rails app and I'm trying to set up pagination for a view of the Essays class. I'm new to rails... so I can do this for ALL of them, but I only want certain ones to be in this list (where all the essays are contained in Essay.find(Ranking.where(:user_id=>current_user.id).essay_id) ). home.html.erb contains (amo...
This should work: Essay.joins(:rankings).where(:rankings => {:user_id => current_user.id}).paginate(:page => params[:page])
Rails pagination of subset of a class I have a rails app and I'm trying to set up pagination for a view of the Essays class. I'm new to rails... so I can do this for ALL of them, but I only want certain ones to be in this list (where all the essays are contained in Essay.find(Ranking.where(:user_id=>current_user.id).es...
TITLE: Rails pagination of subset of a class QUESTION: I have a rails app and I'm trying to set up pagination for a view of the Essays class. I'm new to rails... so I can do this for ALL of them, but I only want certain ones to be in this list (where all the essays are contained in Essay.find(Ranking.where(:user_id=>c...
[ "ruby-on-rails", "ruby-on-rails-3" ]
1
2
264
3
0
2011-05-31T07:27:02.197000
2011-05-31T07:45:24.017000
6,184,277
6,184,376
what's wrong in this Nsarray definition
I want to initialize an array of nsstrings I use the following code @interface Modalities: UITableViewController { NSArray * Modalities; NSArray* SelectedOnes; } @property (nonatomic, retain) NSArray * Modalities; @end - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line to preserve selectio...
You used the name of the Class for your field, this will cause a collision. Change names of the field to NSArray * modalities; and then: modalities = [NSArray arrayWithObjects: @"XA", @"CT", @"RF", @"PR", @"US", @"OT", @"SR", @"MG", @"MR", @"NM", @"CR", nil];
what's wrong in this Nsarray definition I want to initialize an array of nsstrings I use the following code @interface Modalities: UITableViewController { NSArray * Modalities; NSArray* SelectedOnes; } @property (nonatomic, retain) NSArray * Modalities; @end - (void)viewDidLoad { [super viewDidLoad]; // Uncomment...
TITLE: what's wrong in this Nsarray definition QUESTION: I want to initialize an array of nsstrings I use the following code @interface Modalities: UITableViewController { NSArray * Modalities; NSArray* SelectedOnes; } @property (nonatomic, retain) NSArray * Modalities; @end - (void)viewDidLoad { [super viewDidLo...
[ "iphone", "objective-c", "ios", "ipad", "nsarray" ]
0
2
267
1
0
2011-05-31T07:27:10.003000
2011-05-31T07:38:02.067000
6,184,282
6,184,343
Is there better way to write this in Javascript and JQuery?
some title some views some up time some category some duration $(document).ready(function () { $(".video").hover( function () { $(this).oneTime(1000, "hide", function () { $(".videoThumb").children("img").show(); $("object").remove(); $(this).children(".videoThumb").children("img").hide(); var href = $(this).children("...
I would use a jquery template in this instance. Check out my answer here How to prepend a big DIV? for an example usage.
Is there better way to write this in Javascript and JQuery? some title some views some up time some category some duration $(document).ready(function () { $(".video").hover( function () { $(this).oneTime(1000, "hide", function () { $(".videoThumb").children("img").show(); $("object").remove(); $(this).children(".videoT...
TITLE: Is there better way to write this in Javascript and JQuery? QUESTION: some title some views some up time some category some duration $(document).ready(function () { $(".video").hover( function () { $(this).oneTime(1000, "hide", function () { $(".videoThumb").children("img").show(); $("object").remove(); $(this)...
[ "javascript", "jquery" ]
0
0
159
1
0
2011-05-31T07:27:50.353000
2011-05-31T07:35:29.790000
6,184,290
6,188,043
Best library/framework for web analysis and automation?
I am asking a pretty high-level question here in order to hopefully get to know some of the pitfalls before setting out. I am planning an application that will visit specific web sites to collect, process and format tabular data. It must then somehow take certain web browser actions (follow a link, post a form, click a...
I suggest you look at mechanize in combination with beautifulsoup it's perl or python but it's exactly what you need.
Best library/framework for web analysis and automation? I am asking a pretty high-level question here in order to hopefully get to know some of the pitfalls before setting out. I am planning an application that will visit specific web sites to collect, process and format tabular data. It must then somehow take certain ...
TITLE: Best library/framework for web analysis and automation? QUESTION: I am asking a pretty high-level question here in order to hopefully get to know some of the pitfalls before setting out. I am planning an application that will visit specific web sites to collect, process and format tabular data. It must then som...
[ "browser", "automation", "libraries" ]
1
1
137
1
0
2011-05-31T07:28:57.700000
2011-05-31T13:07:42.643000
6,184,291
6,184,363
Choose file download location
I need to allow users to download a file to their machine in my vb.net web app. I need them to browse to the download location themselves through some kind of navigation window. For uploads I simply use a type="file":
For downloads you usually create a link: and in the code behind you stream the file to the response: Protected Sub BtnDownloadClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DownloadButton.Click Response.ContentType = "application/pdf" Response.AppendHeader("Content-Disposition", "attachment; filenam...
Choose file download location I need to allow users to download a file to their machine in my vb.net web app. I need them to browse to the download location themselves through some kind of navigation window. For uploads I simply use a type="file":
TITLE: Choose file download location QUESTION: I need to allow users to download a file to their machine in my vb.net web app. I need them to browse to the download location themselves through some kind of navigation window. For uploads I simply use a type="file": ANSWER: For downloads you usually create a link: and ...
[ "asp.net", "vb.net", "download" ]
0
2
3,328
1
0
2011-05-31T07:29:08.093000
2011-05-31T07:37:10.847000
6,184,305
6,184,330
How to get current page URL for multisite wordpress deployment
I'm trying to find the URL of the current page on wordpress. I have been using this so far - $cur_page_url = (!empty($_SERVER['HTTPS']))? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']: "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; But this doesn't work in a multisite deployment where the websi...
you can use HTTP_HOST instead of SERVER_NAME $_SERVER['HTTP_HOST']
How to get current page URL for multisite wordpress deployment I'm trying to find the URL of the current page on wordpress. I have been using this so far - $cur_page_url = (!empty($_SERVER['HTTPS']))? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']: "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ...
TITLE: How to get current page URL for multisite wordpress deployment QUESTION: I'm trying to find the URL of the current page on wordpress. I have been using this so far - $cur_page_url = (!empty($_SERVER['HTTPS']))? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']: "http://".$_SERVER['SERVER_NAME'].$_SERVE...
[ "php", "wordpress" ]
1
1
1,347
1
0
2011-05-31T07:30:51.653000
2011-05-31T07:33:46.903000
6,184,318
6,184,419
Sending variable from fla to document class and then accessing it
I want to find out whether my swf was loaded locally or from another swf. For this purpose I have declared a variable 'parentType' in my fla. var parentType:String = String(parent); There is a function in the document class that determines whether swf was loaded locally or from another swf. The name of the function in ...
According to your trace, pollResize is called before externalOrInternal, where you set swfParentType, so it is normal it traces null at first. Also, your constructor is badly called, it reads Main1 when it should be Main, although that won't solve your problem.
Sending variable from fla to document class and then accessing it I want to find out whether my swf was loaded locally or from another swf. For this purpose I have declared a variable 'parentType' in my fla. var parentType:String = String(parent); There is a function in the document class that determines whether swf wa...
TITLE: Sending variable from fla to document class and then accessing it QUESTION: I want to find out whether my swf was loaded locally or from another swf. For this purpose I have declared a variable 'parentType' in my fla. var parentType:String = String(parent); There is a function in the document class that determi...
[ "flash", "actionscript-3" ]
0
3
192
1
0
2011-05-31T07:32:29.307000
2011-05-31T07:42:24.937000
6,184,321
6,184,507
Where can I find some beautiful iPhone buttons?
Don't need image background, just good-looking color is enough.
Jeff LaMarche has some very iOS-looking and simple-to-use programmatic gradient buttons here. You just need to add a.h and.m file to your project and you are good to go.
Where can I find some beautiful iPhone buttons? Don't need image background, just good-looking color is enough.
TITLE: Where can I find some beautiful iPhone buttons? QUESTION: Don't need image background, just good-looking color is enough. ANSWER: Jeff LaMarche has some very iOS-looking and simple-to-use programmatic gradient buttons here. You just need to add a.h and.m file to your project and you are good to go.
[ "iphone", "ios", "uibutton" ]
5
4
3,607
3
0
2011-05-31T07:32:54.173000
2011-05-31T07:52:04.540000
6,184,322
6,184,357
MAMP Returning 404 When URL Too Long
I'm working with a GET request that is about 987 characters long and when I'm developing the application locally (PHP), I am seeing a 404 error even though on my web server, the exact application works just fine. I'm guessing this is a MAMP specific thing because the same application works on the web server. Interestin...
This looks like your MAMP Server has AcceptPathInfo disabled which is necessary to parse URLs in the /index.php/something/else form. Enable it in your server configuration.
MAMP Returning 404 When URL Too Long I'm working with a GET request that is about 987 characters long and when I'm developing the application locally (PHP), I am seeing a 404 error even though on my web server, the exact application works just fine. I'm guessing this is a MAMP specific thing because the same applicatio...
TITLE: MAMP Returning 404 When URL Too Long QUESTION: I'm working with a GET request that is about 987 characters long and when I'm developing the application locally (PHP), I am seeing a 404 error even though on my web server, the exact application works just fine. I'm guessing this is a MAMP specific thing because t...
[ "php", "apache", "url", "mamp" ]
0
0
1,384
1
0
2011-05-31T07:33:03.580000
2011-05-31T07:36:39.673000
6,184,324
6,197,016
share option with new version of tweeter
The tweeter sharing option on my site with twitter old version is working fine. but with new version it puts plus sign between words. I already used Server.Urlencode method to encode the string. With New version of tweeter url becomes http://twitter.com/#!/?status=Contribute+to+GeoInvesting+Board+-+Ask+Bob+-+GEO%27s+PR...
I solved the problem myself. use http://twitter.com/intent/tweet?text=status instead of using http://twitter.com/home/?status=status Hope this will help someone.
share option with new version of tweeter The tweeter sharing option on my site with twitter old version is working fine. but with new version it puts plus sign between words. I already used Server.Urlencode method to encode the string. With New version of tweeter url becomes http://twitter.com/#!/?status=Contribute+to+...
TITLE: share option with new version of tweeter QUESTION: The tweeter sharing option on my site with twitter old version is working fine. but with new version it puts plus sign between words. I already used Server.Urlencode method to encode the string. With New version of tweeter url becomes http://twitter.com/#!/?sta...
[ "javascript", "jquery" ]
1
0
198
1
0
2011-05-31T07:33:14.613000
2011-06-01T06:15:31.393000
6,184,332
6,184,595
Passenger server upgrade: Processor (CPU) Cores VS Ram?
I went through documentation of Passenger to find out how many application instances it can run with respect to hardware configuration. Documentation only talks about RAM The optimal value depends on your system’s hardware and the server’s average load. You should experiment with different values. But generally speakin...
Quick Answer Depends on what resources are the bottleneck for your app. Long answer You'll need to factor in a few things: How much CPU time does your app need? How much RAM does any given instance of your app use at peak load? Does your app spend a lot of time doing IO intensive tasks? (ie: db and file reads/writes, n...
Passenger server upgrade: Processor (CPU) Cores VS Ram? I went through documentation of Passenger to find out how many application instances it can run with respect to hardware configuration. Documentation only talks about RAM The optimal value depends on your system’s hardware and the server’s average load. You should...
TITLE: Passenger server upgrade: Processor (CPU) Cores VS Ram? QUESTION: I went through documentation of Passenger to find out how many application instances it can run with respect to hardware configuration. Documentation only talks about RAM The optimal value depends on your system’s hardware and the server’s averag...
[ "ruby-on-rails", "ruby", "passenger" ]
3
3
936
1
0
2011-05-31T07:33:59.953000
2011-05-31T07:59:48.767000
6,184,334
6,184,493
Reg. Search engine optimization for my blog
I'm on the way of creating a blog through ASP.NET MVC framework. All the articles I'm going to submit have the same layout only the main content differs. So I created a common view that dynamically loads the content from a physical file(contains only the particular article markup) in a section. So all the url requests ...
I think you need to rewrite the url like in http://www.cricandcric.com/Cricket-News/4182/Cricket-West-Indies-:-I-am-sure-that-West-Indies-will-bounce-back-,-said-Hooper.html If you obesrve this I have done the URL Rewriting, which will be user friendly for the search engines. You can find good references at following u...
Reg. Search engine optimization for my blog I'm on the way of creating a blog through ASP.NET MVC framework. All the articles I'm going to submit have the same layout only the main content differs. So I created a common view that dynamically loads the content from a physical file(contains only the particular article ma...
TITLE: Reg. Search engine optimization for my blog QUESTION: I'm on the way of creating a blog through ASP.NET MVC framework. All the articles I'm going to submit have the same layout only the main content differs. So I created a common view that dynamically loads the content from a physical file(contains only the par...
[ "asp.net-mvc", "seo", "search-engine" ]
0
0
110
1
0
2011-05-31T07:34:07.013000
2011-05-31T07:50:41.920000
6,184,335
6,184,425
Properties.store() - suppress timestamp comment
Is it possible to force Properties not to add the date comment in front? I mean something like the first line here: #Thu May 26 09:43:52 CEST 2011 main=pkg.ClientMain args=myargs I would like to get rid of it altogether. I need my config files to be diff-identical unless there is a meaningful change.
Given the source code or Properties, no, it's not possible. BTW, since Properties is in fact a hash table and since its keys are thus not sorted, you can't rely on the properties to be always in the same order anyway. I would use a custom algorithm to store the properties if I had this requirement. Use the source code ...
Properties.store() - suppress timestamp comment Is it possible to force Properties not to add the date comment in front? I mean something like the first line here: #Thu May 26 09:43:52 CEST 2011 main=pkg.ClientMain args=myargs I would like to get rid of it altogether. I need my config files to be diff-identical unless ...
TITLE: Properties.store() - suppress timestamp comment QUESTION: Is it possible to force Properties not to add the date comment in front? I mean something like the first line here: #Thu May 26 09:43:52 CEST 2011 main=pkg.ClientMain args=myargs I would like to get rid of it altogether. I need my config files to be diff...
[ "java", "properties" ]
36
10
13,897
7
0
2011-05-31T07:34:10.810000
2011-05-31T07:43:07.020000
6,184,337
6,184,893
Best practice: PHP Magic Methods __set and __get
Possible Duplicate: Are Magic Methods Best practice in PHP? These are simple examples, but imagine you have more properties than two in your class. What would be best practice? a) Using __get and __set class MyClass { private $firstField; private $secondField; public function __get($property) { if (property_exists($th...
I have been exactly in your case in the past. And I went for magic methods. This was a mistake, the last part of your question says it all: this is slower (than getters/setters) there is no auto-completion (and this is a major problem actually), and type management by the IDE for refactoring and code-browsing (under Ze...
Best practice: PHP Magic Methods __set and __get Possible Duplicate: Are Magic Methods Best practice in PHP? These are simple examples, but imagine you have more properties than two in your class. What would be best practice? a) Using __get and __set class MyClass { private $firstField; private $secondField; public fu...
TITLE: Best practice: PHP Magic Methods __set and __get QUESTION: Possible Duplicate: Are Magic Methods Best practice in PHP? These are simple examples, but imagine you have more properties than two in your class. What would be best practice? a) Using __get and __set class MyClass { private $firstField; private $secon...
[ "php", "magic-methods" ]
130
171
132,663
9
0
2011-05-31T07:34:31.873000
2011-05-31T08:30:57.733000
6,184,346
6,193,500
Transform Webservice Request into internal representation?
I am implementing a SOAP-Webservice which receives different Requests. Should my Manager-class transform this Request objects into an internal representation before delegating them to implementation classes? I think this would be a good idea concerning decoupling. But doing this I have to create a copy of each RequestO...
It makes sense if you intend to reuse those implementation classes which I would call your business layer. In your current setup, you have the business layer exposed as a web service. The skeleton of the web service is - if you will - a client for your business layer. Now the question that arises is: should your busine...
Transform Webservice Request into internal representation? I am implementing a SOAP-Webservice which receives different Requests. Should my Manager-class transform this Request objects into an internal representation before delegating them to implementation classes? I think this would be a good idea concerning decoupli...
TITLE: Transform Webservice Request into internal representation? QUESTION: I am implementing a SOAP-Webservice which receives different Requests. Should my Manager-class transform this Request objects into an internal representation before delegating them to implementation classes? I think this would be a good idea c...
[ "java", "web-services", "soap", "decoupling" ]
1
1
224
1
0
2011-05-31T07:35:38.147000
2011-05-31T21:00:45.813000
6,184,355
6,199,915
Cameras and Modelview in OpenGL ES (WebGL)
I'm having a little trouble with my OpenGL transformations -- I have a vertex shader that sets gl_Position to projection * view * model * vertex. I have code that generates a view matrix by inverting the model matrix of a camera in space, but when I set the object the camera is looking at to rotate in space, it seems a...
Apparently I had projection * model * view * vertex instead. Oops!
Cameras and Modelview in OpenGL ES (WebGL) I'm having a little trouble with my OpenGL transformations -- I have a vertex shader that sets gl_Position to projection * view * model * vertex. I have code that generates a view matrix by inverting the model matrix of a camera in space, but when I set the object the camera i...
TITLE: Cameras and Modelview in OpenGL ES (WebGL) QUESTION: I'm having a little trouble with my OpenGL transformations -- I have a vertex shader that sets gl_Position to projection * view * model * vertex. I have code that generates a view matrix by inverting the model matrix of a camera in space, but when I set the o...
[ "opengl-es", "matrix", "camera", "webgl", "model-view" ]
1
2
730
1
0
2011-05-31T07:36:25.327000
2011-06-01T10:45:36.623000
6,184,369
6,184,398
Opening a new jframe with the same properties as the closed one
How can I have the newly open jframe have the same properties like Size and position on screen. Thanks
If you are only interested in size and position JFrame.getBounds returns these properties: newFrame.setBounds(oldFrame.getBounds()); public static void main(String args[]) throws Exception { final JFrame oldFrame = new JFrame("Test"); oldFrame.addWindowListener(new WindowAdapter() { @Override public void windowClosin...
Opening a new jframe with the same properties as the closed one How can I have the newly open jframe have the same properties like Size and position on screen. Thanks
TITLE: Opening a new jframe with the same properties as the closed one QUESTION: How can I have the newly open jframe have the same properties like Size and position on screen. Thanks ANSWER: If you are only interested in size and position JFrame.getBounds returns these properties: newFrame.setBounds(oldFrame.getBoun...
[ "java", "swing", "positioning", "jframe", "sizing" ]
0
1
1,085
2
0
2011-05-31T07:37:29.493000
2011-05-31T07:40:13.727000
6,184,381
6,184,418
Log4Net - Process Lock on Files
We're using Log4Net with a FileAppender to log errors during a process. As the process is finishing, we want to email the log file but we can't do that as it Log4Net still has a lock on the file and we get a message that the file is in use by another process. Any ideas? We're using a config like this:
I assume log is from some kind of service, so the log will be locked until service is running. You probably want to use shared lock while reading the file for sending. Or you can copy the file and send the copy.
Log4Net - Process Lock on Files We're using Log4Net with a FileAppender to log errors during a process. As the process is finishing, we want to email the log file but we can't do that as it Log4Net still has a lock on the file and we get a message that the file is in use by another process. Any ideas? We're using a con...
TITLE: Log4Net - Process Lock on Files QUESTION: We're using Log4Net with a FileAppender to log errors during a process. As the process is finishing, we want to email the log file but we can't do that as it Log4Net still has a lock on the file and we get a message that the file is in use by another process. Any ideas?...
[ "log4net", "log4net-configuration" ]
3
4
2,387
2
0
2011-05-31T07:38:37.480000
2011-05-31T07:42:19.457000
6,184,383
6,184,498
Official list of countries for In-app Billing android?
Hello I am currently in Pakistan and when I start Google sample in-app billing application it says that "Can't Make Purchase: The market billing service is not available at this time. You can continue to use this app but you won't be able to make purchases." Please if any body know that complete list of supported count...
you go here you country is not there http://www.google.com/support/androidmarket/developer/bin/answer.py?answer=150324 think thats the problem
Official list of countries for In-app Billing android? Hello I am currently in Pakistan and when I start Google sample in-app billing application it says that "Can't Make Purchase: The market billing service is not available at this time. You can continue to use this app but you won't be able to make purchases." Please...
TITLE: Official list of countries for In-app Billing android? QUESTION: Hello I am currently in Pakistan and when I start Google sample in-app billing application it says that "Can't Make Purchase: The market billing service is not available at this time. You can continue to use this app but you won't be able to make ...
[ "android", "in-app-purchase", "in-app-billing" ]
8
5
11,604
2
0
2011-05-31T07:38:45.890000
2011-05-31T07:51:02.977000
6,184,395
6,191,196
gdata to java object mapping
hi I started learning google data api. I have one question What will be the best way of parsing xml google data xml? 1 > Should I go with manually parsing xml? Or 2 > XML to java object mapping technique? I am thinking about going with 2 way, As it will require writing less code from my side. But I don't know how slow ...
How slow is xml to java mapping technique? The answer to this question depends on what you are comparing the xml to Java mapping technique to. Many object-to-XML solutions have been around for quite a while and have learned a number of tricks to do this conversion. Is there any other better way to parse gdata xml? Note...
gdata to java object mapping hi I started learning google data api. I have one question What will be the best way of parsing xml google data xml? 1 > Should I go with manually parsing xml? Or 2 > XML to java object mapping technique? I am thinking about going with 2 way, As it will require writing less code from my sid...
TITLE: gdata to java object mapping QUESTION: hi I started learning google data api. I have one question What will be the best way of parsing xml google data xml? 1 > Should I go with manually parsing xml? Or 2 > XML to java object mapping technique? I am thinking about going with 2 way, As it will require writing les...
[ "java", "xml", "gdata-api" ]
1
1
256
2
0
2011-05-31T07:39:42.947000
2011-05-31T17:25:20.023000
6,184,399
6,184,668
Add additional param to post data using jqGrid when adding new row with modal form
I need to add additional dynamic parameter to jqGrid's POST data when I'm adding new record with modal form. I tried: $('#table').setPostData({group: id}); $('#table').setPostDataItem('group', id); $('#table').setGridParam('group', id); and nothing worked out.
you can use editData parameter of the editGridRow method. In the most cases you use editGridRow not directly, but using Navigator. In the case you can define editData as the part of prmEdit or prmAdd of the navGrid: $('#table').jqGrid('navGrid','#pager', {/*navGrid options*/}, {/*Edit options*/ editData: { group: funct...
Add additional param to post data using jqGrid when adding new row with modal form I need to add additional dynamic parameter to jqGrid's POST data when I'm adding new record with modal form. I tried: $('#table').setPostData({group: id}); $('#table').setPostDataItem('group', id); $('#table').setGridParam('group', id); ...
TITLE: Add additional param to post data using jqGrid when adding new row with modal form QUESTION: I need to add additional dynamic parameter to jqGrid's POST data when I'm adding new record with modal form. I tried: $('#table').setPostData({group: id}); $('#table').setPostDataItem('group', id); $('#table').setGridPa...
[ "javascript", "jquery", "jqgrid" ]
5
10
23,266
2
0
2011-05-31T07:40:14.527000
2011-05-31T08:08:44.920000
6,184,408
6,184,449
CSS curve border in IE not working
Curve border is working on Firefox,Google Chrome but not working on IE?any idea how to do make it work? -moz-border-radius-bottomleft:2px; -moz-border-radius-bottomright:92px; -moz-border-radius-topleft:92px; -moz-border-radius-topright:2px; -webkit-border-bottom-left-radius: 2px; -webkit-border-bottom-right-radius: 92...
Unfortunately IE6-IE8 do not support rounded borders. Instead you would need to use something like CSS3PIE. IE9 however DOES understand border-radius Update further to comment that it 'won't work' - here is a quick step-by-step (this is a very simple, high-level sample. Download CSS3PIE at http://css3pie.com/download-l...
CSS curve border in IE not working Curve border is working on Firefox,Google Chrome but not working on IE?any idea how to do make it work? -moz-border-radius-bottomleft:2px; -moz-border-radius-bottomright:92px; -moz-border-radius-topleft:92px; -moz-border-radius-topright:2px; -webkit-border-bottom-left-radius: 2px; -we...
TITLE: CSS curve border in IE not working QUESTION: Curve border is working on Firefox,Google Chrome but not working on IE?any idea how to do make it work? -moz-border-radius-bottomleft:2px; -moz-border-radius-bottomright:92px; -moz-border-radius-topleft:92px; -moz-border-radius-topright:2px; -webkit-border-bottom-lef...
[ "css" ]
1
4
3,317
3
0
2011-05-31T07:40:59.057000
2011-05-31T07:45:01.713000
6,184,420
6,184,500
C++ XML to C++ Object Mapping library?
Is there any good automatic xml to C++ object library? With good benchmark and Multi - Platform support (if not at-least linux ) Edit: More Description I want to library like http://www.codesynthesis.com/products/xsd/ where I can use any xml as c++ object. XMLOBJECT x=new XMLOBJECT("my.xml"); x->root x->root->child Me...
I think that you refer to what is called XML Data Binding. gsoap is a free tool that does it. There are of course many commercial tools - XML Spy and others. Here is a nice list of resources.
C++ XML to C++ Object Mapping library? Is there any good automatic xml to C++ object library? With good benchmark and Multi - Platform support (if not at-least linux ) Edit: More Description I want to library like http://www.codesynthesis.com/products/xsd/ where I can use any xml as c++ object. XMLOBJECT x=new XMLOBJEC...
TITLE: C++ XML to C++ Object Mapping library? QUESTION: Is there any good automatic xml to C++ object library? With good benchmark and Multi - Platform support (if not at-least linux ) Edit: More Description I want to library like http://www.codesynthesis.com/products/xsd/ where I can use any xml as c++ object. XMLOBJ...
[ "c++" ]
8
7
8,902
6
0
2011-05-31T07:42:32.807000
2011-05-31T07:51:18.737000
6,184,422
6,185,300
Ambiguous Struct Constructors in D
I'm having some trouble understanding how to deal with ambiguity of constructors in D. struct mydta { int a = 2; int b = 3; this(int c) { a = c / 2; b = c * 2; } this(float c) { a = cast(int) c / 2; b = cast(int) c * 2; } static mydta afvec = mydta(4.3); static mydta aivec = mydta(5); } afvec has the data values 2 an...
That looks like a bug to me. If you do this: mydta foo = mydta(5); writeln(foo.b); You get 10 as expected. There were a lot of changes to CTFE for version 2.053, so something may have been broken as a result. Please post it as a bug at the D issue tracking system.
Ambiguous Struct Constructors in D I'm having some trouble understanding how to deal with ambiguity of constructors in D. struct mydta { int a = 2; int b = 3; this(int c) { a = c / 2; b = c * 2; } this(float c) { a = cast(int) c / 2; b = cast(int) c * 2; } static mydta afvec = mydta(4.3); static mydta aivec = mydta(5...
TITLE: Ambiguous Struct Constructors in D QUESTION: I'm having some trouble understanding how to deal with ambiguity of constructors in D. struct mydta { int a = 2; int b = 3; this(int c) { a = c / 2; b = c * 2; } this(float c) { a = cast(int) c / 2; b = cast(int) c * 2; } static mydta afvec = mydta(4.3); static myd...
[ "constructor", "struct", "initialization", "d", "ambiguity" ]
6
5
149
1
0
2011-05-31T07:42:43.043000
2011-05-31T09:06:38.437000
6,184,431
6,184,549
Words not between odds
I have strings like: "article.DOS = 998 and article.des = 'toto.tata' or article.des = "ot.o"" NB: the whole string is a single string. I'd like to put every word.word in upper case, but not words beginning and ending with ' or " My current regex is: Regex rgx = new Regex(@"\S+\.\S+"); In the end, my string should be: ...
private static string MeToUpper(Match m) { return ((m.Value[0]!= '\'') && (m.Value[0]!= '\"'))? m.Value.ToUpper(): m.Value; } internal static string ToUpper(string codeSql) { Regex rgx = new Regex("(\'|\")?\\S+\\.\\S+"); return rgx.Replace(codeSql, new MatchEvaluator(MeToUpper)); }
Words not between odds I have strings like: "article.DOS = 998 and article.des = 'toto.tata' or article.des = "ot.o"" NB: the whole string is a single string. I'd like to put every word.word in upper case, but not words beginning and ending with ' or " My current regex is: Regex rgx = new Regex(@"\S+\.\S+"); In the end...
TITLE: Words not between odds QUESTION: I have strings like: "article.DOS = 998 and article.des = 'toto.tata' or article.des = "ot.o"" NB: the whole string is a single string. I'd like to put every word.word in upper case, but not words beginning and ending with ' or " My current regex is: Regex rgx = new Regex(@"\S+\...
[ "c#", "regex", "parsing" ]
1
2
100
2
0
2011-05-31T07:43:34.093000
2011-05-31T07:55:18.283000
6,184,436
6,184,548
Using Gantt charts to track progress when working alone / with others
I wonder if anybody here uses gantt charts to track / improve own progress when working in a programming project alone or with others and what is the approach you use and which software
Gantt charts can still be useful even when working solo, since they show the critical path and easily update with new completion dates if and when things blow out (or, in those rare occasions, complete early). Having said that, I don't usually use the charts very often any more. They're a nice picture for upper managem...
Using Gantt charts to track progress when working alone / with others I wonder if anybody here uses gantt charts to track / improve own progress when working in a programming project alone or with others and what is the approach you use and which software
TITLE: Using Gantt charts to track progress when working alone / with others QUESTION: I wonder if anybody here uses gantt charts to track / improve own progress when working in a programming project alone or with others and what is the approach you use and which software ANSWER: Gantt charts can still be useful even...
[ "tracking", "progress", "gantt-chart" ]
0
1
601
2
0
2011-05-31T07:44:02.387000
2011-05-31T07:55:17.363000
6,184,445
6,184,511
<noscript> or something else
I have a site that relies heavily on JavaScript and uses jQuery throughout. I'm not going to attempt to make the site work for those who don't have JavaScript enabled. However, I would like to show a banner at the top of the page which tells them the site is intended for use with JavaScript enabled and perhaps a modern...
is the way to go. You should also provide links to other, better browsers in the tag if you can detect that's a browser without JavaScript. If you wish to be more drastic about it, start with the markup and, onload remove that class with JavaScript. You could then have body.nojs #wrapper { display: none; }, body.nojs #...
<noscript> or something else I have a site that relies heavily on JavaScript and uses jQuery throughout. I'm not going to attempt to make the site work for those who don't have JavaScript enabled. However, I would like to show a banner at the top of the page which tells them the site is intended for use with JavaScript...
TITLE: <noscript> or something else QUESTION: I have a site that relies heavily on JavaScript and uses jQuery throughout. I'm not going to attempt to make the site work for those who don't have JavaScript enabled. However, I would like to show a banner at the top of the page which tells them the site is intended for u...
[ "javascript", "cross-browser", "graceful-degradation" ]
3
7
4,067
3
0
2011-05-31T07:44:38.283000
2011-05-31T07:52:28.023000
6,184,453
6,184,468
How to make javascript ignore escape ( \ ) character?
qAnswersR[90430] = []; qAnswersR[90430].push("[math]k: \frac{(x+20)^{2}}{256}+\frac{(y-15)^{2}}{81}=1[/math]"); And I need to get the value into variable, but when I console.log out the array like this: console.log(qAnswersR[90430]); I get: [math]k: rac{(x+20)^{2}}{256}+rac{(y-15)^{2}}{81}=1[/math],[math]k: 81(x+20)^{2...
But the escape tag "\" disappears, but I need it there, what should I do? You need to escape the backslash, i.e., use \\ instead of just \: "[math]k: \\frac{(x+20)^{2}}{256}+\\frac{(y-15)^{2}}{81}=1[/math]" ^ ^
How to make javascript ignore escape ( \ ) character? qAnswersR[90430] = []; qAnswersR[90430].push("[math]k: \frac{(x+20)^{2}}{256}+\frac{(y-15)^{2}}{81}=1[/math]"); And I need to get the value into variable, but when I console.log out the array like this: console.log(qAnswersR[90430]); I get: [math]k: rac{(x+20)^{2}}{...
TITLE: How to make javascript ignore escape ( \ ) character? QUESTION: qAnswersR[90430] = []; qAnswersR[90430].push("[math]k: \frac{(x+20)^{2}}{256}+\frac{(y-15)^{2}}{81}=1[/math]"); And I need to get the value into variable, but when I console.log out the array like this: console.log(qAnswersR[90430]); I get: [math]k...
[ "javascript", "escaping" ]
9
5
28,458
3
0
2011-05-31T07:45:36.553000
2011-05-31T07:47:44.740000
6,184,467
6,191,226
Sorting node attributes and keeping structure in XSLT
I have following problem. I worked two days on a solution but I cannot find one. I have a list with uncommon level-attribute (lists are only represented with margins in GDocs) and I want to re-level (sort) the nodes without restructuring the XML. My input: 1 2 3 4 5 6 7 This output would be ok: 1 2 3 4 5 6 7 My desired...
It seems I answer my question myself. Here is the solution. Keep in mind that the level difference between two lists will be maximum +-1.
Sorting node attributes and keeping structure in XSLT I have following problem. I worked two days on a solution but I cannot find one. I have a list with uncommon level-attribute (lists are only represented with margins in GDocs) and I want to re-level (sort) the nodes without restructuring the XML. My input: 1 2 3 4 5...
TITLE: Sorting node attributes and keeping structure in XSLT QUESTION: I have following problem. I worked two days on a solution but I cannot find one. I have a list with uncommon level-attribute (lists are only represented with margins in GDocs) and I want to re-level (sort) the nodes without restructuring the XML. M...
[ "xml", "xslt", "sorting", "xpath", "xslt-grouping" ]
0
0
359
1
0
2011-05-31T07:47:27.633000
2011-05-31T17:28:15.910000
6,184,477
6,196,933
How to Stop "Auto Input Suggestion" in Android Emulator in Android 2.1 "permanently"
When I am running my app in Android Emulator and then on providing input through keyboard it displays the auto text in japanese or english and also the fullstop '.' doesn't work. I made a solution by going through settings->Language&Keyboard option and then disabled the japanese as well as auto keyboard suggestion. But...
One Thing we can do in our Activity that on selecting Edit Text press Escape Button to avoid Android KeyBoard and then long press the mouse left button on that Edit Text. So it will show the Context Menu to Select the input Type, then select Android Text input will solve our problem...
How to Stop "Auto Input Suggestion" in Android Emulator in Android 2.1 "permanently" When I am running my app in Android Emulator and then on providing input through keyboard it displays the auto text in japanese or english and also the fullstop '.' doesn't work. I made a solution by going through settings->Language&Ke...
TITLE: How to Stop "Auto Input Suggestion" in Android Emulator in Android 2.1 "permanently" QUESTION: When I am running my app in Android Emulator and then on providing input through keyboard it displays the auto text in japanese or english and also the fullstop '.' doesn't work. I made a solution by going through set...
[ "android-emulator" ]
1
1
571
1
0
2011-05-31T07:49:05.057000
2011-06-01T06:03:20.333000
6,184,478
6,184,496
Wiring Spring bean through annotations and xml context
I've got the following Spring service: @Service public class Worker { @Autowired private MyExecutorService executor; @Autowired private IRun run; private Integer startingPoint; // Remainder omitted } Now I want to load the startingPoint through a.properties file. Is it possible to wire a Spring service through ann...
Yes! This is most definitely possible, and it's a good way to go if you can't get around using a little bit of XML. Just leave all your annotated fields unspecified, and they'll get injected auto-magically. Though just to be clear, I believe that you'll have to provide a setter for your Integer field. Spring doesn't wa...
Wiring Spring bean through annotations and xml context I've got the following Spring service: @Service public class Worker { @Autowired private MyExecutorService executor; @Autowired private IRun run; private Integer startingPoint; // Remainder omitted } Now I want to load the startingPoint through a.properties fi...
TITLE: Wiring Spring bean through annotations and xml context QUESTION: I've got the following Spring service: @Service public class Worker { @Autowired private MyExecutorService executor; @Autowired private IRun run; private Integer startingPoint; // Remainder omitted } Now I want to load the startingPoint throu...
[ "java", "spring", "annotations", "ejb" ]
3
3
2,262
1
0
2011-05-31T07:49:05.650000
2011-05-31T07:50:59.220000
6,184,481
6,185,942
How to format a Date variable in LWUIT?
I have an object whose class has a getter method, and this getter method returns a Date value. I want to show this value in a Label in the format DD/MM/YYYY. How to achieve that with LWUIT? Thank you very much indeed
You can use this code to convert date to string format and pass the this string value to label. public static String dateToString (long date) { Calendar c = Calendar.getInstance(); c.setTime(new Date(date)); int y = c.get(Calendar.YEAR); int m = c.get(Calendar.MONTH) + 1; int d = c.get(Calendar.DATE); String t = (d<10?...
How to format a Date variable in LWUIT? I have an object whose class has a getter method, and this getter method returns a Date value. I want to show this value in a Label in the format DD/MM/YYYY. How to achieve that with LWUIT? Thank you very much indeed
TITLE: How to format a Date variable in LWUIT? QUESTION: I have an object whose class has a getter method, and this getter method returns a Date value. I want to show this value in a Label in the format DD/MM/YYYY. How to achieve that with LWUIT? Thank you very much indeed ANSWER: You can use this code to convert dat...
[ "java-me", "lwuit" ]
1
2
929
2
0
2011-05-31T07:49:34.430000
2011-05-31T10:02:52.900000
6,184,491
6,184,556
Database Based Job scheduler
I need a job scheduler (a library) that queries a db every 5 minutes and, based on time, triggers events which have expired and rerun on failure. It should be in Python or PHP. I researched and came up with Advanced Python Scheduler but it is not appropriate because it only schedules the jobs in its job store. Instead,...
Here's a possible solution - a script, either in php or python performing your database tasks - a scheduler: Cron for linux, or the windows task scheduler; where you set the frequency of your jobs. I'm using this solution for multiple projects. Very easy to set up.
Database Based Job scheduler I need a job scheduler (a library) that queries a db every 5 minutes and, based on time, triggers events which have expired and rerun on failure. It should be in Python or PHP. I researched and came up with Advanced Python Scheduler but it is not appropriate because it only schedules the jo...
TITLE: Database Based Job scheduler QUESTION: I need a job scheduler (a library) that queries a db every 5 minutes and, based on time, triggers events which have expired and rerun on failure. It should be in Python or PHP. I researched and came up with Advanced Python Scheduler but it is not appropriate because it onl...
[ "php", "python", "database" ]
0
1
748
2
0
2011-05-31T07:50:39.363000
2011-05-31T07:55:59.920000
6,184,494
6,184,527
xml maxLength for decimal type
I tried the following to set the maximum length for a decimal: but this is not valid syntax. Can I use maxLength for decimal?
You can use minInclusive and maxInclusive instead. An example from W3Schools: There are also minExclusive, maxExclusive and totalDigits restrictions.
xml maxLength for decimal type I tried the following to set the maximum length for a decimal: but this is not valid syntax. Can I use maxLength for decimal?
TITLE: xml maxLength for decimal type QUESTION: I tried the following to set the maximum length for a decimal: but this is not valid syntax. Can I use maxLength for decimal? ANSWER: You can use minInclusive and maxInclusive instead. An example from W3Schools: There are also minExclusive, maxExclusive and totalDigits ...
[ "xml", "xsd" ]
1
1
3,533
3
0
2011-05-31T07:50:44.743000
2011-05-31T07:53:52.230000
6,184,509
6,185,156
How to check in an entered value is from autocomplete?
I have a jquery's autocomplete texbox and, upon a click of a button, I need to check if the value entered has come from the autocomplete or is it a completely new value. The problems is that my code constantly gives me 'alert("no")'... maybe I shouldn't be checking against 'cache', but something else? /////////////////...
This is how I make it on a project of mine function lookup(inputString) { $.post('/getSuggestions', { queryString: ""+inputString+"" }, function(data){ if(data.length >0) { $("#suggestions").show(); $("#autoSuggestionsList").html(data); } }); } function fill(thisValue,thisID) { $("#inputString").val(thisValue); $("#id...
How to check in an entered value is from autocomplete? I have a jquery's autocomplete texbox and, upon a click of a button, I need to check if the value entered has come from the autocomplete or is it a completely new value. The problems is that my code constantly gives me 'alert("no")'... maybe I shouldn't be checking...
TITLE: How to check in an entered value is from autocomplete? QUESTION: I have a jquery's autocomplete texbox and, upon a click of a button, I need to check if the value entered has come from the autocomplete or is it a completely new value. The problems is that my code constantly gives me 'alert("no")'... maybe I sho...
[ "jquery" ]
0
1
1,518
3
0
2011-05-31T07:52:14.350000
2011-05-31T08:56:08.887000
6,184,529
6,216,806
How to wrap a static class in a non-static instance object (dynamically)
I have an interesting problem. I need to wrap static classes dynamically. I.e. return a non-static instance to my callers. e.g.: public object CreateInstance(string className) { Type t = assembly.GetType(className); if (IsStatic(t)) { return CreateStaticWrapper(t); } else { return Activator.CreateInstance(t); } } So wh...
I'd say go for IL generation. Creating a proxy is a pretty simple scenario. I actually wrote a blog post about it: einarwh.posterous.com/patching-polymorphic-pain-at-runtime. The scenario is different, but the solution almost identical. You can basically do exactly as in the blog post, except you don't need to load the...
How to wrap a static class in a non-static instance object (dynamically) I have an interesting problem. I need to wrap static classes dynamically. I.e. return a non-static instance to my callers. e.g.: public object CreateInstance(string className) { Type t = assembly.GetType(className); if (IsStatic(t)) { return Creat...
TITLE: How to wrap a static class in a non-static instance object (dynamically) QUESTION: I have an interesting problem. I need to wrap static classes dynamically. I.e. return a non-static instance to my callers. e.g.: public object CreateInstance(string className) { Type t = assembly.GetType(className); if (IsStatic(...
[ "c#", ".net", "instance", "non-static", "static-class" ]
13
2
2,909
4
0
2011-05-31T07:53:59.780000
2011-06-02T15:39:14.733000
6,184,531
6,185,216
Reusing codes between in two similar subclasses Objective C
I have a bit of code that I use to draw a border around a NSTextField when mousing over it, and while editing it, as well as to have it resize vertically when the user is typing. I want to use this code on an NSTokenFieldCell now. I've gotten it to work fine, and the implementation is identical for both NSTextField and...
I ended up pulling all my custom functionality out into a separate NSObject class, and then gave both my NSTextField and NSTokenField classes an instance of it, then I just proxied all of the custom logic into my "logic" object using - (id)forwardingTargetForSelector:(SEL)aSelector It's not perfect as I still need to m...
Reusing codes between in two similar subclasses Objective C I have a bit of code that I use to draw a border around a NSTextField when mousing over it, and while editing it, as well as to have it resize vertically when the user is typing. I want to use this code on an NSTokenFieldCell now. I've gotten it to work fine, ...
TITLE: Reusing codes between in two similar subclasses Objective C QUESTION: I have a bit of code that I use to draw a border around a NSTextField when mousing over it, and while editing it, as well as to have it resize vertically when the user is typing. I want to use this code on an NSTokenFieldCell now. I've gotten...
[ "objective-c", "inheritance", "code-reuse" ]
0
0
181
1
0
2011-05-31T07:54:04.787000
2011-05-31T08:59:28.970000
6,184,535
6,197,892
Java Profilers That Display Per Request Statistics and Program Flow
I'm looking for profilers that support per request profiling statistics, ideally along the programs flow (not the usual thread call stack). So basically a profiler call stack + sequential calls view for each single request, something like this: doGet 100ms + doFilter 95ms + doFilter2 90ms + validateValues 20ms + calcul...
You could try btrace to do selective measurements. It is somewhat similar to dtrace, which you could also use if you are on a supported platform, Solaris, BSD, OS X.
Java Profilers That Display Per Request Statistics and Program Flow I'm looking for profilers that support per request profiling statistics, ideally along the programs flow (not the usual thread call stack). So basically a profiler call stack + sequential calls view for each single request, something like this: doGet 1...
TITLE: Java Profilers That Display Per Request Statistics and Program Flow QUESTION: I'm looking for profilers that support per request profiling statistics, ideally along the programs flow (not the usual thread call stack). So basically a profiler call stack + sequential calls view for each single request, something ...
[ "java", "performance", "profiler", "analysis", "program-flow" ]
3
1
784
3
0
2011-05-31T07:54:31.323000
2011-06-01T07:50:08.987000
6,184,541
6,184,581
Precise String.Split
I have a file that contains SQL statements that is delimited by semicolons, is there a way to make sure that strings in my file that have semicolons inside values to be inserted won't be affected by String.Split? Example: Insert Into items(Description) Values('Anti Surge T; LBC Slow Blow 6.3 x 32mm 7A / 250V'); Insert ...
I dont think so something like that is available but you can try " RegularExpression " not sure but may resolve your issue.
Precise String.Split I have a file that contains SQL statements that is delimited by semicolons, is there a way to make sure that strings in my file that have semicolons inside values to be inserted won't be affected by String.Split? Example: Insert Into items(Description) Values('Anti Surge T; LBC Slow Blow 6.3 x 32mm...
TITLE: Precise String.Split QUESTION: I have a file that contains SQL statements that is delimited by semicolons, is there a way to make sure that strings in my file that have semicolons inside values to be inserted won't be affected by String.Split? Example: Insert Into items(Description) Values('Anti Surge T; LBC Sl...
[ "c#", "sql", "syntax" ]
0
2
115
3
0
2011-05-31T07:54:55.200000
2011-05-31T07:58:09.967000
6,184,544
6,184,653
How to convert string to float in objective-c
I have string and I want to convert into double value. I have written code but sometimes my program is being crashed. double left_operand=[operand_1 doubleValue]; Here operand_1 is NSString variable and i want to convert it into double value. Sometimes above code is crashing my program (automatically closed simulator) ...
You may be getting this error because operand_1 is not accessible here because probably you are releasing it above this line or if you are using auto release then you are not retaining it, check for it by NSLog(@"%@",operand_1); before the above line if you are getting same error then i m right.
How to convert string to float in objective-c I have string and I want to convert into double value. I have written code but sometimes my program is being crashed. double left_operand=[operand_1 doubleValue]; Here operand_1 is NSString variable and i want to convert it into double value. Sometimes above code is crashin...
TITLE: How to convert string to float in objective-c QUESTION: I have string and I want to convert into double value. I have written code but sometimes my program is being crashed. double left_operand=[operand_1 doubleValue]; Here operand_1 is NSString variable and i want to convert it into double value. Sometimes abo...
[ "objective-c" ]
0
0
835
2
0
2011-05-31T07:55:03.850000
2011-05-31T08:06:21.133000
6,184,550
6,184,717
Miller-Rabin test: bug in my code
I've written a Miller-Rabin primality test based on the following pseudo code: Input: n > 2, an odd integer to be tested for primality; k, a parameter that determines the accuracy of the test Output: composite if n is composite, otherwise probably prime write n − 1 as 2s·d with d odd by factoring powers of 2 from n − 1...
In this statement ulong x = (a ^^ d) % n; the quantity (a ^^ d) is probably overflowing before the mod operation can take place. The modpow version wouldn't suffer from this problem, since that algorithm avoids the need for arbitrarily large intermediate values.
Miller-Rabin test: bug in my code I've written a Miller-Rabin primality test based on the following pseudo code: Input: n > 2, an odd integer to be tested for primality; k, a parameter that determines the accuracy of the test Output: composite if n is composite, otherwise probably prime write n − 1 as 2s·d with d odd b...
TITLE: Miller-Rabin test: bug in my code QUESTION: I've written a Miller-Rabin primality test based on the following pseudo code: Input: n > 2, an odd integer to be tested for primality; k, a parameter that determines the accuracy of the test Output: composite if n is composite, otherwise probably prime write n − 1 as...
[ "d" ]
3
5
554
1
0
2011-05-31T07:55:22.977000
2011-05-31T08:13:30.547000
6,184,557
6,199,709
inline assembly error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
I have an inline AT&T style assembly block, which works with XMM registers and there are no problems in Release configuration of my XCode project, however I've stumbled upon this strange error (which is supposedly a GCC bug) in Debug configuration... Can I fix it somehow? There is nothing special in assembly code, but ...
Not a complete answer, sorry, but the comments section is too short for this... Can you post a sample asm("...":::) line that demonstrates the problem? The use of XMM registers is not the issue, the error message indicates that GCC wanted to create code like, say: movdqa (%rax),%xmm0 i.e. memory loads/stores through po...
inline assembly error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' I have an inline AT&T style assembly block, which works with XMM registers and there are no problems in Release configuration of my XCode project, however I've stumbled upon this strange error (which is supposedly a GCC bug) in D...
TITLE: inline assembly error: can't find a register in class 'GENERAL_REGS' while reloading 'asm' QUESTION: I have an inline AT&T style assembly block, which works with XMM registers and there are no problems in Release configuration of my XCode project, however I've stumbled upon this strange error (which is supposed...
[ "xcode", "gcc", "assembly", "constraints", "inline-assembly" ]
0
0
1,378
2
0
2011-05-31T07:56:08.767000
2011-06-01T10:27:29.487000
6,184,559
6,184,603
thread stoping "his brothers" when its job is done
giving the following import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MB5Returner extends Thread { private int startPoint; private int endPoint; public void run() { for (int i = startPoint; i < endPoint; i++) { try { String val = Words.allPo...
The simplest solution is probably to create an AtomicBoolean (call it keepRunning or something similar). Pass it as a reference to the constructor of MB5Returner: public class MB5Returner extends Thread { //... private AtomicBoolean keepRunning; MB5Returner(AtomicBoolean keepRunning) { this.keepRunning = keepRunning;...
thread stoping "his brothers" when its job is done giving the following import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MB5Returner extends Thread { private int startPoint; private int endPoint; public void run() { for (int i = startPoint; ...
TITLE: thread stoping "his brothers" when its job is done QUESTION: giving the following import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MB5Returner extends Thread { private int startPoint; private int endPoint; public void run() { for (in...
[ "java", "multithreading" ]
0
4
81
2
0
2011-05-31T07:56:33.680000
2011-05-31T08:00:50.857000
6,184,561
6,184,602
Density (from dip to pixel)
I design my UI with Density-independent pixel as units of measurement. I have same icons 18x18 dip. What should be the phisical dimension of the png icons for ldpi, mdpi and hdpi? I try 9x9, 12x12 and 18x18 but the emulator enlarge them.
Try this answer. Dips are equivalent to pixels at 160 dpi. Anything else, just scale it.
Density (from dip to pixel) I design my UI with Density-independent pixel as units of measurement. I have same icons 18x18 dip. What should be the phisical dimension of the png icons for ldpi, mdpi and hdpi? I try 9x9, 12x12 and 18x18 but the emulator enlarge them.
TITLE: Density (from dip to pixel) QUESTION: I design my UI with Density-independent pixel as units of measurement. I have same icons 18x18 dip. What should be the phisical dimension of the png icons for ldpi, mdpi and hdpi? I try 9x9, 12x12 and 18x18 but the emulator enlarge them. ANSWER: Try this answer. Dips are e...
[ "android", "icons", "resolution" ]
0
2
4,773
1
0
2011-05-31T07:56:52.057000
2011-05-31T08:00:50.610000
6,184,563
6,193,997
howto handel a couple of asp.net pages with nearly the same code?
hi i have a problem, i'm working on a aps.net page which have a couple of sites. the sites are nearly eqal but have e.g. a other count of labels the but the method names are the same. what would be the best design strategy to keep all this sites easy to handle?
Derive a base class from System.Web.UI.Page, and inherit from this for your specific pages. public class MyApplicationBasePage: System.Web.UI.Page { // common methods/fields here } public partial class SpecificPage_1: MyApplicationBasePage { } public partial class SpecificPage_2: MyApplicationBasePage { }...etc Have a...
howto handel a couple of asp.net pages with nearly the same code? hi i have a problem, i'm working on a aps.net page which have a couple of sites. the sites are nearly eqal but have e.g. a other count of labels the but the method names are the same. what would be the best design strategy to keep all this sites easy to ...
TITLE: howto handel a couple of asp.net pages with nearly the same code? QUESTION: hi i have a problem, i'm working on a aps.net page which have a couple of sites. the sites are nearly eqal but have e.g. a other count of labels the but the method names are the same. what would be the best design strategy to keep all t...
[ "asp.net" ]
1
0
55
2
0
2011-05-31T07:57:09.687000
2011-05-31T21:52:05.543000
6,184,564
6,184,864
What permissions are needed to start a service through ASP.NET?
I was wondering what privileges I needed to let a user start a service on our server. The situation is as follows, some people on our website can start a certain service on the server (Windows 2008 and IIS7). The way that worked so far with me was specifying the application pool I created with my user account (the impe...
You have to set identity impersonate to true in your web.config and if you are using windows authentication then need to set that up in IIS. if you are using a WCF service in between you may have to look at Impersonation in WCF.
What permissions are needed to start a service through ASP.NET? I was wondering what privileges I needed to let a user start a service on our server. The situation is as follows, some people on our website can start a certain service on the server (Windows 2008 and IIS7). The way that worked so far with me was specifyi...
TITLE: What permissions are needed to start a service through ASP.NET? QUESTION: I was wondering what privileges I needed to let a user start a service on our server. The situation is as follows, some people on our website can start a certain service on the server (Windows 2008 and IIS7). The way that worked so far wi...
[ "c#", "asp.net", "windows-services", "privileges", "application-pool" ]
1
0
1,570
3
0
2011-05-31T07:57:11.713000
2011-05-31T08:28:01.137000
6,184,566
6,195,891
Moq verify method fails even though method will be called
I have some troubles using Moq. Following unit test throws an exception, even though the according method will be called. [TestMethod] public void CreateFinishTest() { // mock methods factoryMock.Setup(f => f.LoadPlan("TestPlanDoNotUse")).Returns(testPlan).Verifiable(); factoryMock.Setup(f => f.CreateFinish(It.IsAny ()...
On the Verifiable not being called, it's important that the arguments in your expectation match the arguments that are being used by the production code. Regarding the use of Thread.Sleep, avoid it wherever possible as it will only slow down the tests to meet your slowest machine. I typically introduce WaitHandles into...
Moq verify method fails even though method will be called I have some troubles using Moq. Following unit test throws an exception, even though the according method will be called. [TestMethod] public void CreateFinishTest() { // mock methods factoryMock.Setup(f => f.LoadPlan("TestPlanDoNotUse")).Returns(testPlan).Verif...
TITLE: Moq verify method fails even though method will be called QUESTION: I have some troubles using Moq. Following unit test throws an exception, even though the according method will be called. [TestMethod] public void CreateFinishTest() { // mock methods factoryMock.Setup(f => f.LoadPlan("TestPlanDoNotUse")).Retur...
[ "c#", ".net", "unit-testing", "mocking", "moq" ]
8
7
7,937
3
0
2011-05-31T07:57:15.070000
2011-06-01T03:15:45.233000
6,184,570
6,184,896
Store and Parse XML from the internet
I'm trying to find the best way to store XML files from the internet, so that i can parse them at a later date. I have no problems with downloading an xml file, and storing it in the /data/data/package_name/files folder. However i'm not sure how to read this file after it has been saved there, and to pass that read fil...
Store it in the cache directory. getCacheDir(); so you can say filename = getCacheDir() + file123.xml;
Store and Parse XML from the internet I'm trying to find the best way to store XML files from the internet, so that i can parse them at a later date. I have no problems with downloading an xml file, and storing it in the /data/data/package_name/files folder. However i'm not sure how to read this file after it has been ...
TITLE: Store and Parse XML from the internet QUESTION: I'm trying to find the best way to store XML files from the internet, so that i can parse them at a later date. I have no problems with downloading an xml file, and storing it in the /data/data/package_name/files folder. However i'm not sure how to read this file ...
[ "android" ]
1
2
468
2
0
2011-05-31T07:57:30.390000
2011-05-31T08:31:08.083000
6,184,573
6,204,952
Can't set member variable twice (NSManagedObject)
I am getting the EXC_BAD_ACCESS error when trying to set a value inside a subclass of NSManagedObject for the second time. I am using zombies but nothing is showing up in the console. Printing out the object using GDB I see that the object has the same memory address both times I try to set the value - not sure why tho...
I just realized my problem. I had been assigning values to the entity through with normal '=' assignment: self.currentPiece.piece_last_viewed = [[NSNumber alloc] initWithDouble:[[NSDate date] timeIntervalSince1970]]; When it should have been done: [self setCurrentPiece.piece_last_viewed:[[NSNumber alloc] initWithDouble...
Can't set member variable twice (NSManagedObject) I am getting the EXC_BAD_ACCESS error when trying to set a value inside a subclass of NSManagedObject for the second time. I am using zombies but nothing is showing up in the console. Printing out the object using GDB I see that the object has the same memory address bo...
TITLE: Can't set member variable twice (NSManagedObject) QUESTION: I am getting the EXC_BAD_ACCESS error when trying to set a value inside a subclass of NSManagedObject for the second time. I am using zombies but nothing is showing up in the console. Printing out the object using GDB I see that the object has the same...
[ "iphone", "objective-c", "memory-management", "nsmanagedobject" ]
0
0
445
1
0
2011-05-31T07:57:41.363000
2011-06-01T17:01:42.623000
6,184,576
6,184,891
How to create SQL Server add-in?
i try to develop an add-in for SQL Server Management Studio like this: http://aspalliance.com/1374_Extend_Functionality_in_SQL_Server_2005_Management_Studio_with_Addins.all But: I've searched in google about SSMS add-ins. I've found a link which is great but I can not find it today:( May be you can give some best advis...
http://blogs.microsoft.co.il/blogs/shair/archive/2008/07/28/how-to-create-sql-server-management-studio-addin.aspx I'm feeling lucky:)
How to create SQL Server add-in? i try to develop an add-in for SQL Server Management Studio like this: http://aspalliance.com/1374_Extend_Functionality_in_SQL_Server_2005_Management_Studio_with_Addins.all But: I've searched in google about SSMS add-ins. I've found a link which is great but I can not find it today:( Ma...
TITLE: How to create SQL Server add-in? QUESTION: i try to develop an add-in for SQL Server Management Studio like this: http://aspalliance.com/1374_Extend_Functionality_in_SQL_Server_2005_Management_Studio_with_Addins.all But: I've searched in google about SSMS add-ins. I've found a link which is great but I can not ...
[ "sql-server", "sql-server-2008", "ssms", "ssms-addin" ]
5
9
4,733
1
0
2011-05-31T07:57:51.373000
2011-05-31T08:30:55.423000
6,184,577
6,184,628
Saving Values in Session or Cache - Difference? ASP.NET
I'd like to know when exactly I should use the Session and when exactly I should use the cache. Are there differences in performance? Can one of them handle a lot of data better? Should the Cache only be used for stuff that's associated with the Application whilst the Session should only be used for stuff that's associ...
Some differences between session and cache: The session is per user while the cache is per application You can store the session data out-of-process (SessionServer or SqlServer) e.g. when using a web farm What you put into the session stays there until the session is terminated/abandoned or times-out With the cache, yo...
Saving Values in Session or Cache - Difference? ASP.NET I'd like to know when exactly I should use the Session and when exactly I should use the cache. Are there differences in performance? Can one of them handle a lot of data better? Should the Cache only be used for stuff that's associated with the Application whilst...
TITLE: Saving Values in Session or Cache - Difference? ASP.NET QUESTION: I'd like to know when exactly I should use the Session and when exactly I should use the cache. Are there differences in performance? Can one of them handle a lot of data better? Should the Cache only be used for stuff that's associated with the ...
[ "c#", "asp.net", "session", "caching" ]
2
6
6,018
1
0
2011-05-31T07:57:52.507000
2011-05-31T08:03:52.173000
6,184,579
6,184,785
Problems with bookmarklet for adding CSS to IE9
I have made a bookmarklet to add a custom CSS file to any page. Works fine in FF and in Safari, but i can't make it work in IE9. Nothing happens in the DOM inspertor, and i get no error...:( I have tried to execute it directly in the console, but same problem there... Any help is appreciated. This is my code: (function...
Try this - as suggested by ghommey - If you have issues due to different origins, then IE has tightened security (makes sense since css can do a lot of stuff) and you will need to use a proxy. That said: Have a look at IE9 Not applying linked style sheets (function(d,u){ if(d.createStyleSheet) { d.createStyleSheet( u ...
Problems with bookmarklet for adding CSS to IE9 I have made a bookmarklet to add a custom CSS file to any page. Works fine in FF and in Safari, but i can't make it work in IE9. Nothing happens in the DOM inspertor, and i get no error...:( I have tried to execute it directly in the console, but same problem there... Any...
TITLE: Problems with bookmarklet for adding CSS to IE9 QUESTION: I have made a bookmarklet to add a custom CSS file to any page. Works fine in FF and in Safari, but i can't make it work in IE9. Nothing happens in the DOM inspertor, and i get no error...:( I have tried to execute it directly in the console, but same pr...
[ "javascript", "internet-explorer-9" ]
2
1
947
2
0
2011-05-31T07:57:58.733000
2011-05-31T08:19:59.360000
6,184,586
6,184,644
Different proxy class when adding WCF service as web reference and service reference
There is a web service written with WCF that I'm adding as reference. Proxy class generator works flawlessly when I add it to as service reference but it generates a slightly different class when I add it as web reference using service.svc?WSDL. Here's are the differences: //service reference public partial class TestS...
Nothing is wrong here. Service Reference is the "new" way to use a WCF Service, it removes overhead such as the "Specified"-parameter, "Result"-parameter and "Result Specificed"-parameter. You can still use other properties/methods to check if a parameter is specified or if there is a result. But before WCF, it changed...
Different proxy class when adding WCF service as web reference and service reference There is a web service written with WCF that I'm adding as reference. Proxy class generator works flawlessly when I add it to as service reference but it generates a slightly different class when I add it as web reference using service...
TITLE: Different proxy class when adding WCF service as web reference and service reference QUESTION: There is a web service written with WCF that I'm adding as reference. Proxy class generator works flawlessly when I add it to as service reference but it generates a slightly different class when I add it as web refer...
[ "c#", ".net", "wcf", "web-services" ]
0
2
2,075
2
0
2011-05-31T07:58:43.807000
2011-05-31T08:05:26.970000
6,184,587
6,184,630
Creating a mask out of a custom shape drawn with sprites using action script 3
I'm trying to create a mask out of a custom shape, is there any way to convert the shape object to a mask object? The shape is drawn dynamically in code using as3. I can't seem to find any links to do something like this. Here's the code to create the application: var numPoints:Number = 0; // Number of points placed. /...
Add the Shape to the display list with addChild(maskShape) and set it as a mask for your clip targetClip.mask = maskShape also you may have to set.cacheAsBitmap = true for booth clips (regarding of its contents). targetClip and maskShape should have the same parent. PS: please post only code snippets where you have pro...
Creating a mask out of a custom shape drawn with sprites using action script 3 I'm trying to create a mask out of a custom shape, is there any way to convert the shape object to a mask object? The shape is drawn dynamically in code using as3. I can't seem to find any links to do something like this. Here's the code to ...
TITLE: Creating a mask out of a custom shape drawn with sprites using action script 3 QUESTION: I'm trying to create a mask out of a custom shape, is there any way to convert the shape object to a mask object? The shape is drawn dynamically in code using as3. I can't seem to find any links to do something like this. H...
[ "flash", "actionscript-3" ]
0
2
595
1
0
2011-05-31T07:58:44.207000
2011-05-31T08:04:09.787000
6,184,589
6,184,748
jquery text rotation
I've got a simple text inside a div, something like the following; This is an example text I want the text inside the div to be rotated 20-30 degrees. I've already found this topic on stackoverflow about it and it gives me the desired result in Firefox and Chrome but not in IE7, IE8 and IE9. I also tried jquery rotate,...
In standards-compliant browsers, you can use the CSS3 property transform, though it's probably a good idea to use vendor prefixes, e.g.: -o-transform: rotate(5deg); -khtml-transform: rotate(5deg); -webkit-transform: rotate(5deg); -moz-transform: rotate(5deg); In Internet Explorer 6 and 7, things get tricky. You can use...
jquery text rotation I've got a simple text inside a div, something like the following; This is an example text I want the text inside the div to be rotated 20-30 degrees. I've already found this topic on stackoverflow about it and it gives me the desired result in Firefox and Chrome but not in IE7, IE8 and IE9. I also...
TITLE: jquery text rotation QUESTION: I've got a simple text inside a div, something like the following; This is an example text I want the text inside the div to be rotated 20-30 degrees. I've already found this topic on stackoverflow about it and it gives me the desired result in Firefox and Chrome but not in IE7, I...
[ "javascript", "jquery", "css", "text-rotation" ]
13
14
32,003
5
0
2011-05-31T07:59:29.297000
2011-05-31T08:16:20.420000
6,184,592
6,184,618
error: object cannot be set - either readonly property or no setter found
I'm trying to call a window using the following code self.Modality = [[Modalities alloc]initWithNibName:@"Modalities" bundle:nil]; [self presentModalViewController:self.Modality animated:YES]; where modality is object of modalities (class) I get the following errors error: object cannot be set - either readonly proper...
Declare you Modality property as nonatomic retain but not readonly. @property (nonatomic, retain) NSArray* Modality; And use below in your.m files @synthesize Modality;
error: object cannot be set - either readonly property or no setter found I'm trying to call a window using the following code self.Modality = [[Modalities alloc]initWithNibName:@"Modalities" bundle:nil]; [self presentModalViewController:self.Modality animated:YES]; where modality is object of modalities (class) I get...
TITLE: error: object cannot be set - either readonly property or no setter found QUESTION: I'm trying to call a window using the following code self.Modality = [[Modalities alloc]initWithNibName:@"Modalities" bundle:nil]; [self presentModalViewController:self.Modality animated:YES]; where modality is object of modali...
[ "iphone", "objective-c", "ipad" ]
0
2
585
2
0
2011-05-31T07:59:40.140000
2011-05-31T08:03:01.510000
6,184,601
6,184,703
Check if an url is blocked by robots.txt using Perl
Can anybody tell me sample code to check if an url has been blocked by robots.txt? We can specify full url or directory in the robots.txt. Is there any helper function in Perl?
Check out WWW::RobotRules: The following methods are provided: $rules = WWW::RobotRules->new($robot_name) This is the constructor for WWW::RobotRules objects. The first argument given to new() is the name of the robot. $rules->parse($robot_txt_url, $content, $fresh_until) The parse() method takes as arguments the URL...
Check if an url is blocked by robots.txt using Perl Can anybody tell me sample code to check if an url has been blocked by robots.txt? We can specify full url or directory in the robots.txt. Is there any helper function in Perl?
TITLE: Check if an url is blocked by robots.txt using Perl QUESTION: Can anybody tell me sample code to check if an url has been blocked by robots.txt? We can specify full url or directory in the robots.txt. Is there any helper function in Perl? ANSWER: Check out WWW::RobotRules: The following methods are provided: ...
[ "perl" ]
0
4
1,416
5
0
2011-05-31T08:00:38.883000
2011-05-31T08:11:59.880000
6,184,607
6,184,803
Run windows GUI application in synchronized mode?
I am debugging GUI app on windows and I want to find out who is the sender of some message. On linux, I can run app in synchronized mode and find the sender in call stack. Is there any equivalent mode in windows?
AFAIK there's no built-in ability to do this. But let's first investigate the problem. You want to know who's the sender of the message. You should know however that windows message processing can be classified by the following criterias: Posted vs Sent messages ( PostMessage vs SendMessage ). Messages sent to the wind...
Run windows GUI application in synchronized mode? I am debugging GUI app on windows and I want to find out who is the sender of some message. On linux, I can run app in synchronized mode and find the sender in call stack. Is there any equivalent mode in windows?
TITLE: Run windows GUI application in synchronized mode? QUESTION: I am debugging GUI app on windows and I want to find out who is the sender of some message. On linux, I can run app in synchronized mode and find the sender in call stack. Is there any equivalent mode in windows? ANSWER: AFAIK there's no built-in abil...
[ "c++", "windows", "linux", "debugging", "user-interface" ]
0
1
218
2
0
2011-05-31T08:01:26.517000
2011-05-31T08:21:20.143000
6,184,627
6,184,783
pthread - How to start running a new thread without calling join?
I want to start a new thread from the main thread. I can't use join since I don't want to wait for the thread to exit and than resume execution. Basically what I need is something like pthread_start(...), can't find it though. Edit: As all of the answers suggested create_thread should start thread the problem is that i...
The function to start the thread is pthread_create, not pthread_join. You only use pthread_join when you are ready to wait, and resynchronize, and if you detach the thread, there's no need to use it at all. You can also join from a different thread. Before exiting (either by calling exit or by returning from main ), yo...
pthread - How to start running a new thread without calling join? I want to start a new thread from the main thread. I can't use join since I don't want to wait for the thread to exit and than resume execution. Basically what I need is something like pthread_start(...), can't find it though. Edit: As all of the answers...
TITLE: pthread - How to start running a new thread without calling join? QUESTION: I want to start a new thread from the main thread. I can't use join since I don't want to wait for the thread to exit and than resume execution. Basically what I need is something like pthread_start(...), can't find it though. Edit: As ...
[ "c++", "c", "linux", "multithreading", "pthreads" ]
15
22
37,648
7
0
2011-05-31T08:03:51.477000
2011-05-31T08:19:41.330000
6,184,631
6,184,947
Using Spring (3.0.5) in Eclipse (3.6 Helios)
I just got a book from Apress (Spring Recipes), and I started to learn the Spring framework and now I have a problem. I followed the steps in the book to add the Spring.jar-s to the build path. Everything seems to work fine, but the code I have just doesn't work. My question is that: do you know about a good tutorial f...
STS helps hugely (you can get it from the Eclipse Marketplace for free). The features of it I particularly like? Here's a few: As a user of XML-based configuration I love having the bean graph visualized – it's great for reports – but the content assist when filling out bean properties is invaluable, both for names and...
Using Spring (3.0.5) in Eclipse (3.6 Helios) I just got a book from Apress (Spring Recipes), and I started to learn the Spring framework and now I have a problem. I followed the steps in the book to add the Spring.jar-s to the build path. Everything seems to work fine, but the code I have just doesn't work. My question...
TITLE: Using Spring (3.0.5) in Eclipse (3.6 Helios) QUESTION: I just got a book from Apress (Spring Recipes), and I started to learn the Spring framework and now I have a problem. I followed the steps in the book to add the Spring.jar-s to the build path. Everything seems to work fine, but the code I have just doesn't...
[ "java", "eclipse", "spring", "jakarta-ee" ]
2
2
1,815
3
0
2011-05-31T08:04:09.927000
2011-05-31T08:36:32.537000
6,184,651
6,207,008
How to add warning text in Drupal comment form
I want a warning message displayed in the comment form when people try to add comments: "Please write comments in correct grammatical English, otherwise they will not published" How can I do it?
Here is how you can do it by using hook_form_alter in your own module: function mymodule_form_alter(&$form, &$form_state, $form_id) { switch ($form_id) { case "comment_form": $form['#prefix'].= " Show some text before the comment form. "; break; } }
How to add warning text in Drupal comment form I want a warning message displayed in the comment form when people try to add comments: "Please write comments in correct grammatical English, otherwise they will not published" How can I do it?
TITLE: How to add warning text in Drupal comment form QUESTION: I want a warning message displayed in the comment form when people try to add comments: "Please write comments in correct grammatical English, otherwise they will not published" How can I do it? ANSWER: Here is how you can do it by using hook_form_alter ...
[ "drupal", "drupal-6" ]
1
2
1,252
4
0
2011-05-31T08:06:11.127000
2011-06-01T20:06:21.870000
6,184,654
6,185,032
how to start Android example project from command-line?
I dislike using Eclipse and wish to start an example Android project from the command-line, how can i do this? Is there a way to use "android create project" command to automatically pull in example code from the SDK? A similar method to the following perhaps? android create project --package com.example.helloandroid \...
Here is an example how to build and run ApiDemos sample project. Go to your SDK folder, then to../samples/android-#/ApiDemos, where # is API Level. Start terminal in this folder. Run android list targets and find target with API Level that is equal or higher then what you've chosen for # on step 1. Lets call this targe...
how to start Android example project from command-line? I dislike using Eclipse and wish to start an example Android project from the command-line, how can i do this? Is there a way to use "android create project" command to automatically pull in example code from the SDK? A similar method to the following perhaps? and...
TITLE: how to start Android example project from command-line? QUESTION: I dislike using Eclipse and wish to start an example Android project from the command-line, how can i do this? Is there a way to use "android create project" command to automatically pull in example code from the SDK? A similar method to the foll...
[ "android" ]
1
4
3,507
1
0
2011-05-31T08:06:40.800000
2011-05-31T08:44:45.277000
6,184,656
6,184,762
How to change a variable from a method
This question is a common issue, and I have tried to look at some thread as Is Java "pass-by-reference" or "pass-by-value"? or How to change an attribute of a public variable from outside the class but in my case I need to modify a boolean variable, with a Singleton instance. So far I have a class, and a method which c...
If I understand your requirement - this can solve your problem: public interface IUpdatable { public void setB(boolean newValue); } public class Test implements IUpdatable { private boolean b; public String getb(){} public void setB(boolean newValue) {this.b = newValue;} } public class ClassSingleton { public String ...
How to change a variable from a method This question is a common issue, and I have tried to look at some thread as Is Java "pass-by-reference" or "pass-by-value"? or How to change an attribute of a public variable from outside the class but in my case I need to modify a boolean variable, with a Singleton instance. So f...
TITLE: How to change a variable from a method QUESTION: This question is a common issue, and I have tried to look at some thread as Is Java "pass-by-reference" or "pass-by-value"? or How to change an attribute of a public variable from outside the class but in my case I need to modify a boolean variable, with a Single...
[ "java", "class", "global-variables" ]
1
1
4,454
5
0
2011-05-31T08:07:01.917000
2011-05-31T08:17:55.990000
6,184,658
6,184,757
Where's the balance between thread amount and thread block times?
Elongated question: When having more blocking threads then CPU cores, where's the balance between thread amount and thread block times to maximize CPU efficiency by reducing context switch overhead? I have a wide variety of IO devices that I need to control on Windows 7, with a x64 multi-core processor: PCI devices, ne...
First, it sounds like these tasks should be performed using asynchronous I/O (IO Completion Ports, preferably), rather than with separate threads. Blocking threads are generally the wrong way to do I/O. Second, blocked threads shouldn't affect context switching. The scheduler has to juggle all the active threads, and s...
Where's the balance between thread amount and thread block times? Elongated question: When having more blocking threads then CPU cores, where's the balance between thread amount and thread block times to maximize CPU efficiency by reducing context switch overhead? I have a wide variety of IO devices that I need to cont...
TITLE: Where's the balance between thread amount and thread block times? QUESTION: Elongated question: When having more blocking threads then CPU cores, where's the balance between thread amount and thread block times to maximize CPU efficiency by reducing context switch overhead? I have a wide variety of IO devices t...
[ "c++", "multithreading", "windows-7", "qt4" ]
1
3
381
4
0
2011-05-31T08:07:05.940000
2011-05-31T08:17:32.350000
6,184,662
6,185,136
Prolog Counter Problem
I am trying to write a procedure order(List,Result) that has a List as input and returns a list Result of ordered pairs such that: the first element of the ordered pair is the position of the pair in the list, and the second element of the ordered pair is the element from List n the corresponding position. Example: if ...
The two clauses: NewCount is Count + 1 and increment(NewCount,Count) basically have the same meaning. You didn't make clear that Count is an input variable and it has a base case of 1, so Prolog didn't know where to start unifying values for it. For example, you should use Count as an input argument as follows (it does...
Prolog Counter Problem I am trying to write a procedure order(List,Result) that has a List as input and returns a list Result of ordered pairs such that: the first element of the ordered pair is the position of the pair in the list, and the second element of the ordered pair is the element from List n the corresponding...
TITLE: Prolog Counter Problem QUESTION: I am trying to write a procedure order(List,Result) that has a List as input and returns a list Result of ordered pairs such that: the first element of the ordered pair is the position of the pair in the list, and the second element of the ordered pair is the element from List n...
[ "prolog" ]
2
5
3,927
3
0
2011-05-31T08:07:43.537000
2011-05-31T08:54:52.617000
6,184,663
6,201,348
file_field not saving path in google chrome
I have a file field element in a view to save path of the file as follows: <%= file_field (:def,:sset) %> Later I am accessing this file path as params[:def][:sset]. It works fine in Internet Explorer but Google Chrome is only saving the filename not file path. Is there any alternative to save file path too in Chrome?
Found the answer myself. I had to put:multipart=>true in the form_tag.
file_field not saving path in google chrome I have a file field element in a view to save path of the file as follows: <%= file_field (:def,:sset) %> Later I am accessing this file path as params[:def][:sset]. It works fine in Internet Explorer but Google Chrome is only saving the filename not file path. Is there any a...
TITLE: file_field not saving path in google chrome QUESTION: I have a file field element in a view to save path of the file as follows: <%= file_field (:def,:sset) %> Later I am accessing this file path as params[:def][:sset]. It works fine in Internet Explorer but Google Chrome is only saving the filename not file pa...
[ "html", "ruby-on-rails-3", "internet-explorer", "google-chrome" ]
0
0
174
1
0
2011-05-31T08:07:49.120000
2011-06-01T12:45:54.503000
6,184,666
6,198,111
Django site runs with dev server but not on Apache mod_wsgi
I have some Django websites and I want to place them on the webserver Apache2 with mod_wsgi. The webserver works and one Django website works correctly, but the other one doesn't (it shows the Internal Server Error page). But the strange thing is that the website works perfect on the develop server. This is my vhost co...
It was a very, very simple thing.. The project folder name is case sensitive. I have changed the folder name to the orginal dev name and the project works like a charm. Thanks for the help!
Django site runs with dev server but not on Apache mod_wsgi I have some Django websites and I want to place them on the webserver Apache2 with mod_wsgi. The webserver works and one Django website works correctly, but the other one doesn't (it shows the Internal Server Error page). But the strange thing is that the webs...
TITLE: Django site runs with dev server but not on Apache mod_wsgi QUESTION: I have some Django websites and I want to place them on the webserver Apache2 with mod_wsgi. The webserver works and one Django website works correctly, but the other one doesn't (it shows the Internal Server Error page). But the strange thin...
[ "django", "apache2", "mod-wsgi" ]
1
0
569
2
0
2011-05-31T08:08:05.660000
2011-06-01T08:09:37.110000
6,184,667
6,185,972
Overflow problem with winsock in vb6
I have built a simple project which use "Winsock" Tool. When I receive any data I put it in a variable because i cann't put it in a textbox because it is a file not a text. But if i send a big file it gets me an error. "Overflow" Are there any way to fix this problem?
A VB variable-length string can only in theory be 2GB in size, it's actual maximum size is depending on available virtual memory which is also limited to 2GB for the entire application. But since VB stores the string in unicode format it means that it can only contain 1GB of text. ( maximum length for string in VB6 ) I...
Overflow problem with winsock in vb6 I have built a simple project which use "Winsock" Tool. When I receive any data I put it in a variable because i cann't put it in a textbox because it is a file not a text. But if i send a big file it gets me an error. "Overflow" Are there any way to fix this problem?
TITLE: Overflow problem with winsock in vb6 QUESTION: I have built a simple project which use "Winsock" Tool. When I receive any data I put it in a variable because i cann't put it in a textbox because it is a file not a text. But if i send a big file it gets me an error. "Overflow" Are there any way to fix this probl...
[ "vb6", "winsock" ]
0
0
1,079
3
0
2011-05-31T08:08:35.757000
2011-05-31T10:05:54.143000
6,184,682
6,237,075
How to implement projects in Backbone.js TODOS-app?
Hey! I'm trying out Backbone.js and have followed the annotated source of the TODO's app. I fail (don't know how this should be done) when trying to implement projects, which has tasks as "children". So that i can change project and view different lists of tasks. How should i do this? Some tips for beginner tutorials w...
The backbone docs mention a pattern for doing something like this: http://documentcloud.github.com/backbone/#FAQ-nested So, I would create a new model called a project that has a property called 'tasks' which is an instance of a TodoList collection. I can't speak to storing the data, as I've never looked at the localSt...
How to implement projects in Backbone.js TODOS-app? Hey! I'm trying out Backbone.js and have followed the annotated source of the TODO's app. I fail (don't know how this should be done) when trying to implement projects, which has tasks as "children". So that i can change project and view different lists of tasks. How ...
TITLE: How to implement projects in Backbone.js TODOS-app? QUESTION: Hey! I'm trying out Backbone.js and have followed the annotated source of the TODO's app. I fail (don't know how this should be done) when trying to implement projects, which has tasks as "children". So that i can change project and view different li...
[ "model-view-controller", "javascript", "backbone.js" ]
0
0
496
1
0
2011-05-31T08:10:13.923000
2011-06-04T13:44:49.767000
6,184,685
6,184,760
Nested Query how to
ALTER PROCEDURE dbo.updateadmin ( @ReportRead char(10), @Date date,@EmpName varchar(50), @Subject nchar(50) ) AS insert into Emp_ReportUpdate (ReportRead,[Date],EmpName,Subject) values(@ReportRead,@Date,@EmpName,@Subject) RETURN This is my procedure and in @EmpName I need to use as a select statement so that to get dat...
ALTER PROCEDURE dbo.updateadmin ( @ReportRead char(10), @Date date, @EmpName varchar(50), @Subject nchar(50) ) AS SELECT @EmpName = somecol FROM OTHERTABLE insert into Emp_ReportUpdate (ReportRead, [Date], EmpName, Subject) VALUES (@ReportRead, @Date, @EmpName, @Subject) RETURN
Nested Query how to ALTER PROCEDURE dbo.updateadmin ( @ReportRead char(10), @Date date,@EmpName varchar(50), @Subject nchar(50) ) AS insert into Emp_ReportUpdate (ReportRead,[Date],EmpName,Subject) values(@ReportRead,@Date,@EmpName,@Subject) RETURN This is my procedure and in @EmpName I need to use as a select statemen...
TITLE: Nested Query how to QUESTION: ALTER PROCEDURE dbo.updateadmin ( @ReportRead char(10), @Date date,@EmpName varchar(50), @Subject nchar(50) ) AS insert into Emp_ReportUpdate (ReportRead,[Date],EmpName,Subject) values(@ReportRead,@Date,@EmpName,@Subject) RETURN This is my procedure and in @EmpName I need to use as...
[ "sql", "t-sql", "sql-server-2008" ]
0
0
58
3
0
2011-05-31T08:10:36.643000
2011-05-31T08:17:37.763000
6,184,688
6,184,739
c#.net how to get a HtmlGenricControll to show a RadioButtonList item
I have a HtmlGenericController and to this I want to add RadioButtons. My radiobuttons come from a RadioButtonList an hence the objects are Listitems. How do I get my genericcontroller to show the radiobuttons? This is my code private HtmlGenericControl generateCells(String domainName) { HtmlGenericControl container = ...
var radioButton = new HtmlGenericControl("input"); radioButton.Attributes["type"] = "radio"; radioButton.Attributes["name"] = "groupName"; radioButton.Attributes["value"] = "buttonValue"; That will only render the round radiobutton itself, though. To add a label, you'll have to render for example a span besides it. Or,...
c#.net how to get a HtmlGenricControll to show a RadioButtonList item I have a HtmlGenericController and to this I want to add RadioButtons. My radiobuttons come from a RadioButtonList an hence the objects are Listitems. How do I get my genericcontroller to show the radiobuttons? This is my code private HtmlGenericCont...
TITLE: c#.net how to get a HtmlGenricControll to show a RadioButtonList item QUESTION: I have a HtmlGenericController and to this I want to add RadioButtons. My radiobuttons come from a RadioButtonList an hence the objects are Listitems. How do I get my genericcontroller to show the radiobuttons? This is my code priva...
[ "c#", "radiobuttonlist", "htmlgenericcontrol" ]
0
2
916
1
0
2011-05-31T08:10:44.660000
2011-05-31T08:15:50.947000
6,184,691
6,184,712
if statement for throwing Exception?
Hi I wanted to ask because I'm not sure if is it propriete using of Exception: public int Method(int a, int b) { if(a can I throw Exception after if statement? or should I always use try - catch when it goes with the exceptions?
That is perfectly valid. That is exactly what exceptions are used for, to check for "Exceptions" in your logic, things that weren't suppose to be. The idea behind catching an exception is that when you pass data somewhere and process it, you might not always know if the result will be valid, that is when you want to ca...
if statement for throwing Exception? Hi I wanted to ask because I'm not sure if is it propriete using of Exception: public int Method(int a, int b) { if(a can I throw Exception after if statement? or should I always use try - catch when it goes with the exceptions?
TITLE: if statement for throwing Exception? QUESTION: Hi I wanted to ask because I'm not sure if is it propriete using of Exception: public int Method(int a, int b) { if(a can I throw Exception after if statement? or should I always use try - catch when it goes with the exceptions? ANSWER: That is perfectly valid. Th...
[ "c#", "exception" ]
24
27
48,266
7
0
2011-05-31T08:11:02.317000
2011-05-31T08:12:51.667000