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,202,621
6,202,950
How to create static JNI Environment Pointer?
Here I create a class in JAVA in which I have function (callback) which I must call from C file. class DSMInitializeClassParameter { /** * Callback function for DSM Initialize. */ public void DSMInitializeCallback( ) { // Write Message To Logs. System.out.println( "Dsm Initialize Callback called." ); } } For that I h...
It's generally unsafe to cache a JNIEnv* instance and keep using it, as it varies depending on the currently active thread. You can save a JavaVM* instance, which will never change. In a native initializer function, call GetJavaVM and pass it the address of a JavaVM pointer: static JavaVM *jvm; JNIEXPORT void JNICALL J...
How to create static JNI Environment Pointer? Here I create a class in JAVA in which I have function (callback) which I must call from C file. class DSMInitializeClassParameter { /** * Callback function for DSM Initialize. */ public void DSMInitializeCallback( ) { // Write Message To Logs. System.out.println( "Dsm In...
TITLE: How to create static JNI Environment Pointer? QUESTION: Here I create a class in JAVA in which I have function (callback) which I must call from C file. class DSMInitializeClassParameter { /** * Callback function for DSM Initialize. */ public void DSMInitializeCallback( ) { // Write Message To Logs. System.ou...
[ "callback", "java-native-interface" ]
11
26
11,175
2
0
2011-06-01T14:14:26.693000
2011-06-01T14:37:56.803000
6,202,628
6,203,062
iOS Task Completion pattern for asynchronous downloads and uploads
I'm working on a project that interfaces with Google Data APIs. I have several independent classes for HTTP GET and HTTP POST for interacting with Google, and they are all asynchronous. I'm concerned that a user might touch the home button before operations are finished, thus causing rifts in server/client sync parity....
I recommend to queue all the HTTP Requests using a NSOperationQueue and then only use one background task. You can specify how many operations are allowed to run in parallel with setMaxConcurrentOperationCount. When you use ASIHTTPRequest framework, this is very easy with ASINetworkQueue, a subclass of NSOperationQueue...
iOS Task Completion pattern for asynchronous downloads and uploads I'm working on a project that interfaces with Google Data APIs. I have several independent classes for HTTP GET and HTTP POST for interacting with Google, and they are all asynchronous. I'm concerned that a user might touch the home button before operat...
TITLE: iOS Task Completion pattern for asynchronous downloads and uploads QUESTION: I'm working on a project that interfaces with Google Data APIs. I have several independent classes for HTTP GET and HTTP POST for interacting with Google, and they are all asynchronous. I'm concerned that a user might touch the home bu...
[ "iphone", "objective-c", "ios", "background" ]
1
2
1,058
2
0
2011-06-01T14:15:01.477000
2011-06-01T14:45:50.157000
6,202,633
6,204,313
Flex 3: Key press combination to trigger an event/function
Within a specific canvas, I would like a user to be able to press a combination of keys which will trigger an event.(a bit like a cheat in an old megadrive game). Not sure where to start though. Anyone know if it is possible and if so could you give me a clue with how to start? Thanks in advance!
You can add an eventListener to the top level application for the KeyboardEvent.KEY_DOWN event and check for key combinations there. From this article: private function init():void{ this.addEventListener(MouseEvent.CLICK, clickHandler); this.addEventListener(KeyboardEvent.KEY_DOWN,keyPressed); } private function clickH...
Flex 3: Key press combination to trigger an event/function Within a specific canvas, I would like a user to be able to press a combination of keys which will trigger an event.(a bit like a cheat in an old megadrive game). Not sure where to start though. Anyone know if it is possible and if so could you give me a clue w...
TITLE: Flex 3: Key press combination to trigger an event/function QUESTION: Within a specific canvas, I would like a user to be able to press a combination of keys which will trigger an event.(a bit like a cheat in an old megadrive game). Not sure where to start though. Anyone know if it is possible and if so could yo...
[ "apache-flex", "flex3", "keyboard", "keypress", "combinations" ]
1
2
2,242
2
0
2011-06-01T14:15:56.080000
2011-06-01T16:12:40.837000
6,202,635
6,212,310
A website sells three types of components. What's a good way to make an interactive component compatability checker for visitors?
A company sells a variety of component As, a variety of component Bs and a variety of component Cs (for example CPUs, motherboards and RAM). They want some kind of web app that allows a visitor to select A3000, B64 and C24, and see if that combination will is compatible. Their website is built in Joomla. What would be ...
For computer hardware there are some solutions available as plugin for oscommerce and descendants (aka dedicated e-commerce software). But their use is quite limited since the logic for this kind of solution is usualy quite complex. Its mostly not select everything and then... but select one and only the compatible sel...
A website sells three types of components. What's a good way to make an interactive component compatability checker for visitors? A company sells a variety of component As, a variety of component Bs and a variety of component Cs (for example CPUs, motherboards and RAM). They want some kind of web app that allows a visi...
TITLE: A website sells three types of components. What's a good way to make an interactive component compatability checker for visitors? QUESTION: A company sells a variety of component As, a variety of component Bs and a variety of component Cs (for example CPUs, motherboards and RAM). They want some kind of web app ...
[ "joomla", "compatibility" ]
0
0
155
1
0
2011-06-01T14:15:57.473000
2011-06-02T08:46:57.120000
6,202,639
6,213,403
Rails 3 form_tag opens javascript in a new page instead of loading it in the current page
View: form_tag(url_for(:controller =>:matchers,:action =>:show_matched_alarms_list),:remote => true,:method =>:get,:class => "matcher_ajax_form") do |f| Controller: layout 'application',:except=>[:show_matched_alarms_list] def show_matched_alarms_list @matcher=... render:update do |page| page.replace('matched_alarms_li...
I have fixed this. The problem was that I submiting the form using the form.submit() method, which apparently doesn not work fine when using a remote form. I replaced it for the form.request() method and it worked as expected.
Rails 3 form_tag opens javascript in a new page instead of loading it in the current page View: form_tag(url_for(:controller =>:matchers,:action =>:show_matched_alarms_list),:remote => true,:method =>:get,:class => "matcher_ajax_form") do |f| Controller: layout 'application',:except=>[:show_matched_alarms_list] def sho...
TITLE: Rails 3 form_tag opens javascript in a new page instead of loading it in the current page QUESTION: View: form_tag(url_for(:controller =>:matchers,:action =>:show_matched_alarms_list),:remote => true,:method =>:get,:class => "matcher_ajax_form") do |f| Controller: layout 'application',:except=>[:show_matched_al...
[ "ruby-on-rails", "ruby", "ajax", "ruby-on-rails-3" ]
1
0
339
1
0
2011-06-01T14:16:11.700000
2011-06-02T10:37:05.023000
6,202,649
6,202,854
How would I write this LINQ query?
I'm trying to wrap my head around this "new concept" called LINQ. Ever heard of it? LOL Anyway, I've read enough to know this can be written much clearer using LINQ, but I don't understand how I'd write it: DataTable table = MySqlDateTimeQueryResult(); for (int i = 0; i < table.Rows.Count; i++) { DataRow r = table.Rows...
I'm not sure you really need LINQ in this case, but if you really want to express what you are doing using LINQ, try this: var query = from DataRow r in table.Rows select r["Date"]; foreach (var q in query) { Console.WriteLine(q.ToString()); }
How would I write this LINQ query? I'm trying to wrap my head around this "new concept" called LINQ. Ever heard of it? LOL Anyway, I've read enough to know this can be written much clearer using LINQ, but I don't understand how I'd write it: DataTable table = MySqlDateTimeQueryResult(); for (int i = 0; i < table.Rows.C...
TITLE: How would I write this LINQ query? QUESTION: I'm trying to wrap my head around this "new concept" called LINQ. Ever heard of it? LOL Anyway, I've read enough to know this can be written much clearer using LINQ, but I don't understand how I'd write it: DataTable table = MySqlDateTimeQueryResult(); for (int i = 0...
[ "c#", "linq" ]
2
2
193
5
0
2011-06-01T14:16:58.480000
2011-06-01T14:31:27.583000
6,202,653
6,202,721
Difference between Oracle jdbc driver classes?
I'm using Oracle's ojdbc5.jar and noticed that it includes two JDBC driver classes. What is the difference between oracle.jdbc.driver.OracleDriver vs. oracle.jdbc.OracleDriver? Which one should I use in my Java project?
For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather than oracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release. -- http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-...
Difference between Oracle jdbc driver classes? I'm using Oracle's ojdbc5.jar and noticed that it includes two JDBC driver classes. What is the difference between oracle.jdbc.driver.OracleDriver vs. oracle.jdbc.OracleDriver? Which one should I use in my Java project?
TITLE: Difference between Oracle jdbc driver classes? QUESTION: I'm using Oracle's ojdbc5.jar and noticed that it includes two JDBC driver classes. What is the difference between oracle.jdbc.driver.OracleDriver vs. oracle.jdbc.OracleDriver? Which one should I use in my Java project? ANSWER: For Oracle 9i onwards you ...
[ "java", "oracle", "jdbc" ]
67
84
55,509
2
0
2011-06-01T14:17:43.643000
2011-06-01T14:23:04.597000
6,202,655
6,203,475
Boost asio ConstBufferSequence - c++ Templates
I am hoping for some guidance regarding C++ templates. I have been using the boost::asio library for communication over TCP. Thus far, I have been using storage containers built into the boost::asio library. For instance: boost::array buf; boost::system::error_code error; size_t len = socket.read_some(boost::asio::buff...
boost::asio::buffer returns objects implementing the ConstBufferSequence and MutableBufferSequence concepts; it doesn't expect you to implement them. The concrete types you're allowed to pass to buffer are listed here.
Boost asio ConstBufferSequence - c++ Templates I am hoping for some guidance regarding C++ templates. I have been using the boost::asio library for communication over TCP. Thus far, I have been using storage containers built into the boost::asio library. For instance: boost::array buf; boost::system::error_code error; ...
TITLE: Boost asio ConstBufferSequence - c++ Templates QUESTION: I am hoping for some guidance regarding C++ templates. I have been using the boost::asio library for communication over TCP. Thus far, I have been using storage containers built into the boost::asio library. For instance: boost::array buf; boost::system::...
[ "c++", "templates", "boost", "boost-asio" ]
8
7
6,413
2
0
2011-06-01T14:17:56.610000
2011-06-01T15:14:29.507000
6,202,656
6,202,802
Maths behind sliding scale pricing
I'm trying to work out a simple calculation for the following: a phone model has the maximum sale price of £85.00 and this is if only 1 unit is purchased and a minimum sales price of £50.00 - this is if 150 units and over are purchased in one. How can I work out a way of the price if between 2 and 149 units are purchas...
Formula: Y = 50 + ((85 - 50) / (150 - 1)) * (X - 1) Result: X = 1 --> Y = 85 X = 33 --> Y = 57.52 X = 150 --> Y = 50
Maths behind sliding scale pricing I'm trying to work out a simple calculation for the following: a phone model has the maximum sale price of £85.00 and this is if only 1 unit is purchased and a minimum sales price of £50.00 - this is if 150 units and over are purchased in one. How can I work out a way of the price if ...
TITLE: Maths behind sliding scale pricing QUESTION: I'm trying to work out a simple calculation for the following: a phone model has the maximum sale price of £85.00 and this is if only 1 unit is purchased and a minimum sales price of £50.00 - this is if 150 units and over are purchased in one. How can I work out a wa...
[ "php", "math" ]
5
6
2,633
2
0
2011-06-01T14:17:58.467000
2011-06-01T14:28:11.693000
6,202,666
6,202,723
Where I can find the Python `pwd` module for MS Windows?
I use the Python standard library pwd module on GNU+Linux, but now I try to run my application in Microsoft Windows and can not find it. I'm using python 2.6.6. Where can I find the pwd module for use in Python on MS Windows?
From the docs: Platforms: Unix You will need to go digging around in PyWin32 and MSDN for the Windows equivalents.
Where I can find the Python `pwd` module for MS Windows? I use the Python standard library pwd module on GNU+Linux, but now I try to run my application in Microsoft Windows and can not find it. I'm using python 2.6.6. Where can I find the pwd module for use in Python on MS Windows?
TITLE: Where I can find the Python `pwd` module for MS Windows? QUESTION: I use the Python standard library pwd module on GNU+Linux, but now I try to run my application in Microsoft Windows and can not find it. I'm using python 2.6.6. Where can I find the pwd module for use in Python on MS Windows? ANSWER: From the d...
[ "python", "windows", "passwd" ]
1
3
2,592
1
0
2011-06-01T14:18:29.860000
2011-06-01T14:23:11.557000
6,202,667
6,202,857
How to use subscripts in ggplot2 legends [R]
Can I use subscripts in ggplot2 legends? I see this question on greek letters in legends and elsewhere, but I can't figure out how to adapt it. I thought that using expression(), which works in axis labels, would do the trick. But my attempt below fails. Thanks! library(ggplot2) temp <- data.frame(a = rep(1:4, each = 1...
The following should work (remove your line with names(temp) <-...): ggplot(temp.m, aes(x = value, linetype = variable)) + geom_density() + facet_wrap(~ a) + scale_linetype_discrete(breaks=levels(temp.m$variable), labels=c(expression(b[1]), expression(c[1]))) See help(scale_linetype_discrete) for available customizatio...
How to use subscripts in ggplot2 legends [R] Can I use subscripts in ggplot2 legends? I see this question on greek letters in legends and elsewhere, but I can't figure out how to adapt it. I thought that using expression(), which works in axis labels, would do the trick. But my attempt below fails. Thanks! library(ggpl...
TITLE: How to use subscripts in ggplot2 legends [R] QUESTION: Can I use subscripts in ggplot2 legends? I see this question on greek letters in legends and elsewhere, but I can't figure out how to adapt it. I thought that using expression(), which works in axis labels, would do the trick. But my attempt below fails. Th...
[ "r", "ggplot2" ]
30
30
24,926
2
0
2011-06-01T14:18:34.973000
2011-06-01T14:31:37.090000
6,202,670
6,202,928
Why is my instance counter display 0 in this Python code?
I made a simple code to demonstrate and understand classes - however when I run this, my lists show that they are empty, containing "None" values instead of the strings that the user enters as names. #Static methods do not require the object to be initiated. Can be remotely accessed from outside the function. #Countin...
There are a few errors in your code. First in the way you use lists. Second, in the way you call methods on your objects. The combination of errors explains why you have a list of None at the end. List name list = [] Don't name a list list. It is already the name of, well..., the list class, i.e. in Python you can do m...
Why is my instance counter display 0 in this Python code? I made a simple code to demonstrate and understand classes - however when I run this, my lists show that they are empty, containing "None" values instead of the strings that the user enters as names. #Static methods do not require the object to be initiated. Can...
TITLE: Why is my instance counter display 0 in this Python code? QUESTION: I made a simple code to demonstrate and understand classes - however when I run this, my lists show that they are empty, containing "None" values instead of the strings that the user enters as names. #Static methods do not require the object to...
[ "python", "debugging", "class" ]
0
6
425
4
0
2011-06-01T14:18:37.270000
2011-06-01T14:36:30.930000
6,202,671
6,202,777
Weird <!--php tags form database
Has anyone had this issue when i pull data out from the database it looks like below, it looks fine in the actually database table. I am using wordpress. Any suggestion scratching my head. these are the tags
It's just a bad way of commenting out some PHP code, except since it's an HTML quote, the raw code will be sent to the client. In functional terms: and both disable the echo call, but the HTML quote version will send the commented-out code to the browser, whereas using /* */ will just send.
Weird <!--php tags form database Has anyone had this issue when i pull data out from the database it looks like below, it looks fine in the actually database table. I am using wordpress. Any suggestion scratching my head. these are the tags
TITLE: Weird <!--php tags form database QUESTION: Has anyone had this issue when i pull data out from the database it looks like below, it looks fine in the actually database table. I am using wordpress. Any suggestion scratching my head. these are the tags ANSWER: It's just a bad way of commenting out some PHP code,...
[ "php", "database", "wordpress", "formatting" ]
0
6
83
1
0
2011-06-01T14:18:45.517000
2011-06-01T14:26:17.577000
6,202,682
6,236,773
Is it possible to get the controller and the action (NOT THEIR NAME!!) based on the url?
I have found a dozens of threads about getting the name of the controller and method based on the url, I managed that just as well. Can I get the MethodInfo of the method based on their name automatically from the MVC engine, or do I have to do Type.GetType("Namespace.Controllers."+cname+"Controller").GetMethod(mname)?...
I found out that it was totally wrong approach. I tried to find the type of the controller based on the name, when instead I had the type all along. So instead of @Url.Action("SomeAction","SomeController") I'll use @Url.MyAction((SomeController c)=>c.SomeAction()), so I won't even have to find the controller.
Is it possible to get the controller and the action (NOT THEIR NAME!!) based on the url? I have found a dozens of threads about getting the name of the controller and method based on the url, I managed that just as well. Can I get the MethodInfo of the method based on their name automatically from the MVC engine, or do...
TITLE: Is it possible to get the controller and the action (NOT THEIR NAME!!) based on the url? QUESTION: I have found a dozens of threads about getting the name of the controller and method based on the url, I managed that just as well. Can I get the MethodInfo of the method based on their name automatically from the...
[ "asp.net-mvc", "asp.net-mvc-3", "asp.net-mvc-routing", "url-routing" ]
1
0
293
2
0
2011-06-01T14:19:47.907000
2011-06-04T12:38:17.157000
6,202,685
6,202,910
how to build an autosuggestion for text box
i want to build an autosuggestion for a text box which queries the database and returns the suggestions and then the user can select from the suggestions or types a fresh query. there are over 20 text boxes where i want to have the same autosuggestion.
Here is a tutorial to get you started: http://www.nodstrum.com/2007/09/19/autocompleter/
how to build an autosuggestion for text box i want to build an autosuggestion for a text box which queries the database and returns the suggestions and then the user can select from the suggestions or types a fresh query. there are over 20 text boxes where i want to have the same autosuggestion.
TITLE: how to build an autosuggestion for text box QUESTION: i want to build an autosuggestion for a text box which queries the database and returns the suggestions and then the user can select from the suggestions or types a fresh query. there are over 20 text boxes where i want to have the same autosuggestion. ANSW...
[ "php", "ajax", "autocomplete", "autosuggest" ]
0
0
2,318
1
0
2011-06-01T14:20:09.093000
2011-06-01T14:35:24.487000
6,202,696
6,202,770
KeyValuePair - no parameterless constructor?
I have an object that has a KeyValuePair type property. I would like to read some data from a database and store results in this KeyValuePair type field. myObject.KeyValuePairs = ctx.ExecuteQuery > ("Select " + "[" + q.Name + "] As [Key]" + ", Count([" + q.Name + "]) As [Value] From SomeTable" + " Group By [" + q.Name ...
It does have a public parameterless constructor because KeyValuePair is a struct and all struct have implicit public parameterless constructor. The issue is that EF can't find it by reflection because reflection does not return the default constructor for struct. This is why EF is reporting that it can't find it (it ca...
KeyValuePair - no parameterless constructor? I have an object that has a KeyValuePair type property. I would like to read some data from a database and store results in this KeyValuePair type field. myObject.KeyValuePairs = ctx.ExecuteQuery > ("Select " + "[" + q.Name + "] As [Key]" + ", Count([" + q.Name + "]) As [Val...
TITLE: KeyValuePair - no parameterless constructor? QUESTION: I have an object that has a KeyValuePair type property. I would like to read some data from a database and store results in this KeyValuePair type field. myObject.KeyValuePairs = ctx.ExecuteQuery > ("Select " + "[" + q.Name + "] As [Key]" + ", Count([" + q....
[ "c#", ".net" ]
5
14
4,563
1
0
2011-06-01T14:21:13.753000
2011-06-01T14:25:44.377000
6,202,701
6,204,358
multiple levels of associated db objects to YAML
I need to create a 'List' object from the following db tables. I've already done this in a rails/datamapper application, but now I have a need to get specific lists into and out of a db through YAML. List Categories Items Item choices e.g. given a list identifier, pull the initial list, the categories for that list, th...
The included to_json ( doc ) method already allows you to easily nest related records, and choose what you want to output: List.all.to_json(:only => {},:include => {:categories => {:only => {},:include => {:items => {:only =>:your_attribute_name } } }) The next step is to convert it to yaml: ActiveSupport::JSON.decode(...
multiple levels of associated db objects to YAML I need to create a 'List' object from the following db tables. I've already done this in a rails/datamapper application, but now I have a need to get specific lists into and out of a db through YAML. List Categories Items Item choices e.g. given a list identifier, pull t...
TITLE: multiple levels of associated db objects to YAML QUESTION: I need to create a 'List' object from the following db tables. I've already done this in a rails/datamapper application, but now I have a need to get specific lists into and out of a db through YAML. List Categories Items Item choices e.g. given a list ...
[ "ruby", "serialization", "yaml" ]
3
2
425
1
0
2011-06-01T14:21:26.170000
2011-06-01T16:15:20.613000
6,202,706
6,206,479
Silverlight dropdown menu in a html page?
I'm not too familiar with silverlight, so I'm pretty sure I am asking a basic question. Is it possible to have a silverlight dropdown menu (like superfish, or so-called dhtml menus) in a web page that will; not use more space in the page than the first level will go over html content when we expand it. I guess that Sil...
It is possible. Silverlight plugin should be set to windowless, so its content can overlap with html. Because Silverlight can not draw outside of its own surface you would have to make as large as biggest menu element or you could resize Silverlight container dynamically through javascript bridge.
Silverlight dropdown menu in a html page? I'm not too familiar with silverlight, so I'm pretty sure I am asking a basic question. Is it possible to have a silverlight dropdown menu (like superfish, or so-called dhtml menus) in a web page that will; not use more space in the page than the first level will go over html c...
TITLE: Silverlight dropdown menu in a html page? QUESTION: I'm not too familiar with silverlight, so I'm pretty sure I am asking a basic question. Is it possible to have a silverlight dropdown menu (like superfish, or so-called dhtml menus) in a web page that will; not use more space in the page than the first level w...
[ "silverlight" ]
0
0
417
1
0
2011-06-01T14:21:56.143000
2011-06-01T19:17:13.063000
6,202,719
6,203,191
NSOperationQueues in Objective C
I am new to programming. I am porting cpp (WIN32) to cocoa framework. I have a method called start(process) from where 2 methods gets called. I want to do the operation in it parallely.I want to do InterThread communication. This can be done by performSelectorOnMainThread:withObject:waitUntilDone. Here I need to call t...
The first thing about Cocoa is that all display code should run on the main thread. So if you are asking how to let the main thread know it needs to do some display work, performSelectorOnMainThread:waitUntilDone: is the right answer. This method works by putting an artificial "event" in the main thread's run loop (the...
NSOperationQueues in Objective C I am new to programming. I am porting cpp (WIN32) to cocoa framework. I have a method called start(process) from where 2 methods gets called. I want to do the operation in it parallely.I want to do InterThread communication. This can be done by performSelectorOnMainThread:withObject:wai...
TITLE: NSOperationQueues in Objective C QUESTION: I am new to programming. I am porting cpp (WIN32) to cocoa framework. I have a method called start(process) from where 2 methods gets called. I want to do the operation in it parallely.I want to do InterThread communication. This can be done by performSelectorOnMainThr...
[ "objective-c" ]
0
1
197
1
0
2011-06-01T14:22:38.067000
2011-06-01T14:54:11.683000
6,202,727
6,212,809
NSIS concatenating part of two strings
I am trying to sort of merge two strings together in NSIS. I have two strings 2.1.3.0 and 0.0.0.27269 and the string I want to create from them is 2.1.3.27269 My attempts thus far haven't worked, here is what I tried:;;$VERSION is defined with 2.1.3.0;;$FILEVERSION2 is defined with 0.0.0.27269;;debug DetailPrint ${VERS...
To concatenate variables in NSIS you need to wrap them in quote marks.;;$VERSION is defined with 2.1.3.0;;$FILEVERSION2 is defined with 0.0.0.27269;;debug DetailPrint ${VERSION} DetailPrint ${FILEVERSION} StrCpy $R0 ${FILEVERSION2} 5 -5 StrCpy $R1 ${VERSION} -2; This concatenates the strings together with a dot StrCpy...
NSIS concatenating part of two strings I am trying to sort of merge two strings together in NSIS. I have two strings 2.1.3.0 and 0.0.0.27269 and the string I want to create from them is 2.1.3.27269 My attempts thus far haven't worked, here is what I tried:;;$VERSION is defined with 2.1.3.0;;$FILEVERSION2 is defined wit...
TITLE: NSIS concatenating part of two strings QUESTION: I am trying to sort of merge two strings together in NSIS. I have two strings 2.1.3.0 and 0.0.0.27269 and the string I want to create from them is 2.1.3.27269 My attempts thus far haven't worked, here is what I tried:;;$VERSION is defined with 2.1.3.0;;$FILEVERSI...
[ "installation", "nsis", "nsis-mui" ]
2
4
3,135
1
0
2011-06-01T14:23:20.103000
2011-06-02T09:42:18.323000
6,202,735
6,202,805
ASP.NET MVC model binder parse decimal differently with GET and POST requests
The server is hosting Asp.net mvc3 app and the Browser culture is set to da (Danish) GET request url: /get?d=1.1 (note that the decimal separator is.) return: da;1,1 (note that the decimal separator is,) GET request url: /get?d=1,1 (the decimal separator is,) return: Exception Details: System.ArgumentException: The pa...
When you send the data through a post, the locales take effect. When you send the data through a GET, it always uses the invariant locale. It seems this is done because you could copy and paste an URL, and send it to someone in another country. If the language of the browser was considered when a parameter is included ...
ASP.NET MVC model binder parse decimal differently with GET and POST requests The server is hosting Asp.net mvc3 app and the Browser culture is set to da (Danish) GET request url: /get?d=1.1 (note that the decimal separator is.) return: da;1,1 (note that the decimal separator is,) GET request url: /get?d=1,1 (the deci...
TITLE: ASP.NET MVC model binder parse decimal differently with GET and POST requests QUESTION: The server is hosting Asp.net mvc3 app and the Browser culture is set to da (Danish) GET request url: /get?d=1.1 (note that the decimal separator is.) return: da;1,1 (note that the decimal separator is,) GET request url: /g...
[ "asp.net-mvc", "asp.net-mvc-3", "modelbinders" ]
2
2
1,672
1
0
2011-06-01T14:23:38.723000
2011-06-01T14:28:20.140000
6,202,739
6,202,871
How to create XML schema allowing a node or a node wrapped by another one
I stuck into creating an XSD schema allowing only next sequence of elements:... or......... i.e. a number of node, some of them could be wrapped, and some - not. Here's what I already have:
Am I missing something or wouldn't just a simple be suitable
How to create XML schema allowing a node or a node wrapped by another one I stuck into creating an XSD schema allowing only next sequence of elements:... or......... i.e. a number of node, some of them could be wrapped, and some - not. Here's what I already have:
TITLE: How to create XML schema allowing a node or a node wrapped by another one QUESTION: I stuck into creating an XSD schema allowing only next sequence of elements:... or......... i.e. a number of node, some of them could be wrapped, and some - not. Here's what I already have: ANSWER: Am I missing something or wou...
[ "xml", "xsd" ]
0
1
1,061
1
0
2011-06-01T14:23:55.427000
2011-06-01T14:32:52.130000
6,202,742
6,202,834
Should the web.config file be kept updated in a VCS?
Should developers keep the web.config file updated and commit it to a VCS such as SVN? At my company we very rarely update it via SVN; instead somebody will create an "instructions" text file in our deployment scripts (SQL scripts and the like, plus batch files to compile the ASPX files as individual DLLs for deploymen...
Absolutely, web config must be in source control, and you can define differences beetween various versions of web.config with web.config configurations for example we have one for local development server, one for test IIS server, and one for production IIS server. And we can set solution configuration and publish from...
Should the web.config file be kept updated in a VCS? Should developers keep the web.config file updated and commit it to a VCS such as SVN? At my company we very rarely update it via SVN; instead somebody will create an "instructions" text file in our deployment scripts (SQL scripts and the like, plus batch files to co...
TITLE: Should the web.config file be kept updated in a VCS? QUESTION: Should developers keep the web.config file updated and commit it to a VCS such as SVN? At my company we very rarely update it via SVN; instead somebody will create an "instructions" text file in our deployment scripts (SQL scripts and the like, plus...
[ "asp.net", "web-config" ]
0
2
107
2
0
2011-06-01T14:24:12.537000
2011-06-01T14:30:02.287000
6,202,743
6,203,408
How to unload iPhone images to free up memory
I have an iPhone game that uses images to display things such as buttons on screen to control the game. The images aren't huge, but I want to load them "lazily" and unload them from memory when they are not being used. I have a function that loads images as follows: void loadImageRef(NSString *name, GLuint location, CG...
You should avoid using the [UIImage imageNamed:name] method at all costs if you want to ensure things don't stay cached. imageNamed caches all images it pulls through. You want to use UIImage *image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileNameWithoutExtension ofType:fileName...
How to unload iPhone images to free up memory I have an iPhone game that uses images to display things such as buttons on screen to control the game. The images aren't huge, but I want to load them "lazily" and unload them from memory when they are not being used. I have a function that loads images as follows: void lo...
TITLE: How to unload iPhone images to free up memory QUESTION: I have an iPhone game that uses images to display things such as buttons on screen to control the game. The images aren't huge, but I want to load them "lazily" and unload them from memory when they are not being used. I have a function that loads images a...
[ "iphone", "image", "memory-management", "cgimageref" ]
1
1
958
1
0
2011-06-01T14:24:12.537000
2011-06-01T15:10:06.517000
6,202,744
6,202,839
How to select null values with LINQ to SQL and DbLinq?
When I bool? isApproved = null; db.Table.Where(item => item.IsApproved == isApproved).Count(); the last line value is 0. But when I db.Table.Where(item => item.IsApproved == null).Count(); the value is correct. I'm using SQLite, DbLinq and DbMetal.
I have seen it done like this: db.Table.Where( item => item.IsApproved.HasValue == isApproved.HasValue && (!item.IsApproved.HasValue || item.IsApproved.Value==isApproved.Value ) ).Count();
How to select null values with LINQ to SQL and DbLinq? When I bool? isApproved = null; db.Table.Where(item => item.IsApproved == isApproved).Count(); the last line value is 0. But when I db.Table.Where(item => item.IsApproved == null).Count(); the value is correct. I'm using SQLite, DbLinq and DbMetal.
TITLE: How to select null values with LINQ to SQL and DbLinq? QUESTION: When I bool? isApproved = null; db.Table.Where(item => item.IsApproved == isApproved).Count(); the last line value is 0. But when I db.Table.Where(item => item.IsApproved == null).Count(); the value is correct. I'm using SQLite, DbLinq and DbMetal...
[ "c#", ".net", "linq-to-sql", "sqlite", "dblinq" ]
4
2
3,412
5
0
2011-06-01T14:24:13.160000
2011-06-01T14:30:15.127000
6,202,745
6,202,954
Confused by use of host name in WSDL file in C# Web Service
I have created a WCF web service in C# deployed in a Windows Service EXE which is largely working the way I want. I am using it in a self-hosted manner (not within IIS). In order to make a WSDL file available to the calling Java webservice, I added ServiceMetadataBehavior to the host creation. i.e: ServiceHost host = n...
It is created dynamically, not every call IIRC, but on first request to the metadata endpoint. I'm not sure why your seeing your DEV server name on the non-DEV machine, but, because you're specifying localhost only in your endpoint address it's going to resolve DNS using the primary network address for the server. You ...
Confused by use of host name in WSDL file in C# Web Service I have created a WCF web service in C# deployed in a Windows Service EXE which is largely working the way I want. I am using it in a self-hosted manner (not within IIS). In order to make a WSDL file available to the calling Java webservice, I added ServiceMeta...
TITLE: Confused by use of host name in WSDL file in C# Web Service QUESTION: I have created a WCF web service in C# deployed in a Windows Service EXE which is largely working the way I want. I am using it in a self-hosted manner (not within IIS). In order to make a WSDL file available to the calling Java webservice, I...
[ "c#", "web-services", "wsdl" ]
6
3
3,696
2
0
2011-06-01T14:24:15.070000
2011-06-01T14:38:14.823000
6,202,747
6,203,047
Is OAuth a "two-way" street?
What I mean is, let's say I have two organizations ACME and Boring Corp. A user at ACME wants to login to Boring Corp. to access some content that will be viewed through Boring Corps website. They go to Boring.com and it redirects them to ACME to login. Once verified, they are redirected back to Boring Corp to do XYZ a...
I think you are confusing two things: authentication and authorization. Authentication has to do with credentials, authorization with access permissions. OAuth itself handles only authorization, so I assume you're using OpenID or something to perform the authentication phase. In this situation, you have: authentication...
Is OAuth a "two-way" street? What I mean is, let's say I have two organizations ACME and Boring Corp. A user at ACME wants to login to Boring Corp. to access some content that will be viewed through Boring Corps website. They go to Boring.com and it redirects them to ACME to login. Once verified, they are redirected ba...
TITLE: Is OAuth a "two-way" street? QUESTION: What I mean is, let's say I have two organizations ACME and Boring Corp. A user at ACME wants to login to Boring Corp. to access some content that will be viewed through Boring Corps website. They go to Boring.com and it redirects them to ACME to login. Once verified, they...
[ "oauth" ]
4
2
1,086
2
0
2011-06-01T14:24:22.083000
2011-06-01T14:44:56.810000
6,202,748
6,202,850
Android - Customizing the title bar
I want to customize the title bar for an Android application. I have the following layout: android:gravity="center_vertical" > I also have a the following code in the targeted activity: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE...
According to this article, you should create a custom style for this. See if it works for you.
Android - Customizing the title bar I want to customize the title bar for an Android application. I have the following layout: android:gravity="center_vertical" > I also have a the following code in the targeted activity: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindo...
TITLE: Android - Customizing the title bar QUESTION: I want to customize the title bar for an Android application. I have the following layout: android:gravity="center_vertical" > I also have a the following code in the targeted activity: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceSt...
[ "android", "android-layout", "android-titlebar" ]
2
1
3,083
3
0
2011-06-01T14:24:22.053000
2011-06-01T14:31:11.787000
6,202,756
6,202,783
How to sort/order an array by it's keys?
This array has no [0] and [2] keys. Array ( [1] => 5.2836 [3] => 2.5749 [4] => 134.19 [5] => 5.8773 [6] => 1.3504.... How can I change it to: Array ( [0] => 5.2836 [1] => 2.5749 [2] => 134.19 [3] => 5.8773 [4] => 1.3504.... Is there any inbuilt function for such a task in php?
Use array_values().... returns all the values from the input array and indexes numerically the array. Note this is not sorting or ordering the keys, it is reindexing the array.
How to sort/order an array by it's keys? This array has no [0] and [2] keys. Array ( [1] => 5.2836 [3] => 2.5749 [4] => 134.19 [5] => 5.8773 [6] => 1.3504.... How can I change it to: Array ( [0] => 5.2836 [1] => 2.5749 [2] => 134.19 [3] => 5.8773 [4] => 1.3504.... Is there any inbuilt function for such a task i...
TITLE: How to sort/order an array by it's keys? QUESTION: This array has no [0] and [2] keys. Array ( [1] => 5.2836 [3] => 2.5749 [4] => 134.19 [5] => 5.8773 [6] => 1.3504.... How can I change it to: Array ( [0] => 5.2836 [1] => 2.5749 [2] => 134.19 [3] => 5.8773 [4] => 1.3504.... Is there any inbuilt function...
[ "php", "arrays", "sorting", "key" ]
0
8
107
2
0
2011-06-01T14:24:57.577000
2011-06-01T14:26:29.417000
6,202,762
6,208,328
Pthread create as detached
I have a problem creating a thread as detached. Here's the code I wrote: void* testFunction() { pthread_attr_t attr; int chk,rc; pthread_attr_init(&attr); printf("thread_attr_init: %d\n",rc); pthread_attr_getdetachstate(&attr, &chk); printf("thread_attr_getdetachedstate: %d\n",rc); if(chk == PTHREAD_CREATE_DETACHED...
Your testFunction is not examining anything about the current thread, rather just the initially-detached flag of a completely new attribute object you just created. Moreover, it is completely impossible, in the POSIX threads API, to recover the attributes a thread was created with or determine if a thread is detached o...
Pthread create as detached I have a problem creating a thread as detached. Here's the code I wrote: void* testFunction() { pthread_attr_t attr; int chk,rc; pthread_attr_init(&attr); printf("thread_attr_init: %d\n",rc); pthread_attr_getdetachstate(&attr, &chk); printf("thread_attr_getdetachedstate: %d\n",rc); if(chk...
TITLE: Pthread create as detached QUESTION: I have a problem creating a thread as detached. Here's the code I wrote: void* testFunction() { pthread_attr_t attr; int chk,rc; pthread_attr_init(&attr); printf("thread_attr_init: %d\n",rc); pthread_attr_getdetachstate(&attr, &chk); printf("thread_attr_getdetachedstate: ...
[ "c", "pthreads", "detach" ]
4
7
39,121
4
0
2011-06-01T14:25:07.583000
2011-06-01T22:09:03.573000
6,202,766
6,204,464
What Data Structure would you use for a Curriculum of a Department in a University?
For my homework, I'm implementing a course registration system for a university and I implemented a simple class for Curriculum with list of semesters and other properties like name of the department, total credits etc. But I'm wondering if I can inherit this class from a Graph Data Structure with Edges and vertices. A...
As an enterprise architect I would absolutely not use a graph structure for this data. This data is a list and nothing more. For a problem similar to this, the only reason I would ever consider using a graph structure would be to potentially create the relationship of course requirements and prerequisites. This way you...
What Data Structure would you use for a Curriculum of a Department in a University? For my homework, I'm implementing a course registration system for a university and I implemented a simple class for Curriculum with list of semesters and other properties like name of the department, total credits etc. But I'm wonderin...
TITLE: What Data Structure would you use for a Curriculum of a Department in a University? QUESTION: For my homework, I'm implementing a course registration system for a university and I implemented a simple class for Curriculum with list of semesters and other properties like name of the department, total credits etc...
[ "c#" ]
8
2
684
2
0
2011-06-01T14:25:13.023000
2011-06-01T16:22:05.827000
6,202,768
6,223,869
disallow some domain names, allow others
For example there are URLs http://www.subdomain1.domain.com.uk and http://www.subdomain2.domain.uk, from these URLs I need to extract only the name subdomain1 or subdomain2. But if I receive http://www.subdomain3.co.uk or http://www.subdomain4.com I need to get the whole URL like subdomain3.co.uk or subdomain4.com. My ...
finally found solution: http:\/\/(?:www\.)?((?:(?!domain.com.uk|domain.uk)[^\s.]+)(?:\.(?!domain.com.uk|domain.uk)[^\s.]+)*)
disallow some domain names, allow others For example there are URLs http://www.subdomain1.domain.com.uk and http://www.subdomain2.domain.uk, from these URLs I need to extract only the name subdomain1 or subdomain2. But if I receive http://www.subdomain3.co.uk or http://www.subdomain4.com I need to get the whole URL lik...
TITLE: disallow some domain names, allow others QUESTION: For example there are URLs http://www.subdomain1.domain.com.uk and http://www.subdomain2.domain.uk, from these URLs I need to extract only the name subdomain1 or subdomain2. But if I receive http://www.subdomain3.co.uk or http://www.subdomain4.com I need to get...
[ "regex" ]
0
0
104
2
0
2011-06-01T14:25:18.957000
2011-06-03T06:45:15.550000
6,202,771
6,202,949
analyze show copywithzone is leaking, is it false alarm?
In my app I want to copy a custom class from one array to another array. So I implemented copyWithZone for this class. Xcode analyze warning me that every line with [alloc] or [copy] are leaking memory. How can I tell if it's really leaking or it's the copied instance that I need? @implementation MyClass - (id)copyWit...
Is your uniqueId property declared as a retain property? If so, this line is leaking: copy.uniqueId = [uniqueId copy]; Change it to: copy.uniqueId = [[uniqueId copy] autorelease];
analyze show copywithzone is leaking, is it false alarm? In my app I want to copy a custom class from one array to another array. So I implemented copyWithZone for this class. Xcode analyze warning me that every line with [alloc] or [copy] are leaking memory. How can I tell if it's really leaking or it's the copied ins...
TITLE: analyze show copywithzone is leaking, is it false alarm? QUESTION: In my app I want to copy a custom class from one array to another array. So I implemented copyWithZone for this class. Xcode analyze warning me that every line with [alloc] or [copy] are leaking memory. How can I tell if it's really leaking or i...
[ "iphone", "objective-c", "cocoa-touch" ]
0
3
288
2
0
2011-06-01T14:25:47.187000
2011-06-01T14:37:53.827000
6,202,774
6,202,789
need help understanding why this line in the code
this code in book jQuery in action page 99 Why he wrote this line var current = this; DOM Level 0 Bubbling Example
He did that so that the this value could be preserved and used inside a nested lexical scope. Each function call to any function involves (internally) setting this to refer to some object, based on the details of the invocation. Thus, inside a nested function (a function declared inside another function, as in this cas...
need help understanding why this line in the code this code in book jQuery in action page 99 Why he wrote this line var current = this; DOM Level 0 Bubbling Example
TITLE: need help understanding why this line in the code QUESTION: this code in book jQuery in action page 99 Why he wrote this line var current = this; DOM Level 0 Bubbling Example ANSWER: He did that so that the this value could be preserved and used inside a nested lexical scope. Each function call to any function...
[ "javascript", "jquery" ]
2
7
153
5
0
2011-06-01T14:26:13.527000
2011-06-01T14:27:23.440000
6,202,775
6,202,861
Document-based application, or not?
I am building a beer recipe application in Cocoa. It's has one main window, with a couple of textfields, tableviews etc. I want to be able to Open and Save recipes in XML format. I found some examples of reading/writing XML. Should my application be a document-based application? What are the benefits? All examples I fi...
The file format used with document based applications doesn't matter at all. You can read and write XML if you like. The advantages of NSDocument are that open, save, save as and the close button are handled for you, as well as a "Save before quit"-message and various other things. I can think of two solutions for a re...
Document-based application, or not? I am building a beer recipe application in Cocoa. It's has one main window, with a couple of textfields, tableviews etc. I want to be able to Open and Save recipes in XML format. I found some examples of reading/writing XML. Should my application be a document-based application? What...
TITLE: Document-based application, or not? QUESTION: I am building a beer recipe application in Cocoa. It's has one main window, with a couple of textfields, tableviews etc. I want to be able to Open and Save recipes in XML format. I found some examples of reading/writing XML. Should my application be a document-based...
[ "xml", "cocoa", "document-based" ]
0
1
320
1
0
2011-06-01T14:26:13.957000
2011-06-01T14:31:44.633000
6,202,778
6,202,946
Am i doing the Servlet-Filter correctly?
Good day! I am trying to disable access on pages that are not part of successful login. I stored the login username in a session so that i could determine if the session is null or not. I have several pages so I've decided to create a filter in xml and filter servlet so I don't need to put the if(session == null) code ...
You're only checking if the session has been created, not if the user has been logged in. This is wrong. The session can already be created long before the user logs in. When you login an user, you should set it as a session attribute request.getSession().setAttribute("user", user); In the filter you should check on th...
Am i doing the Servlet-Filter correctly? Good day! I am trying to disable access on pages that are not part of successful login. I stored the login username in a session so that i could determine if the session is null or not. I have several pages so I've decided to create a filter in xml and filter servlet so I don't ...
TITLE: Am i doing the Servlet-Filter correctly? QUESTION: Good day! I am trying to disable access on pages that are not part of successful login. I stored the login username in a session so that i could determine if the session is null or not. I have several pages so I've decided to create a filter in xml and filter s...
[ "jsp", "servlets", "servlet-filters" ]
1
1
295
1
0
2011-06-01T14:26:19.870000
2011-06-01T14:37:26.993000
6,202,780
6,202,869
Convert Hashtable to xml string and back to HashTable without using .NET Serializer
Does anyone know how to convert a Hashtable to an XML String then back to a HashTable without using the.NET based XMLSerializer. The XMLSerializer poses some security concerns when code runs inside of IE and the browser's protected mode is turned on - So basically I am looking for an easy way to convert that Hashtable ...
You could use the DataContractSerializer class: using System; using System.Collections; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Xml; public class MyClass { public string Foo { get; set; } public string Bar { get; set; } } class Program { static void Main() { var table = ne...
Convert Hashtable to xml string and back to HashTable without using .NET Serializer Does anyone know how to convert a Hashtable to an XML String then back to a HashTable without using the.NET based XMLSerializer. The XMLSerializer poses some security concerns when code runs inside of IE and the browser's protected mode...
TITLE: Convert Hashtable to xml string and back to HashTable without using .NET Serializer QUESTION: Does anyone know how to convert a Hashtable to an XML String then back to a HashTable without using the.NET based XMLSerializer. The XMLSerializer poses some security concerns when code runs inside of IE and the browse...
[ "c#", "hashtable" ]
5
6
7,668
2
0
2011-06-01T14:26:25.767000
2011-06-01T14:32:39.077000
6,202,794
6,202,888
Host Not Found Error AsyncTask
I have the following code to download a file in the notification system. But it doesn't seem to working... I'm not sure why, everything looks good to me. The debugger is giving me an unknown host error? 06-02 00:21:15.308: WARN/System.err(4115): java.net.UnknownHostException: phobos.emuparadise.org 06-02 00:21:15.308: ...
The URL it is trying to connect (phobos.emuparadise.org) shows a 403 Forbidden (try with a browser). If you solve this, you should be good.
Host Not Found Error AsyncTask I have the following code to download a file in the notification system. But it doesn't seem to working... I'm not sure why, everything looks good to me. The debugger is giving me an unknown host error? 06-02 00:21:15.308: WARN/System.err(4115): java.net.UnknownHostException: phobos.emupa...
TITLE: Host Not Found Error AsyncTask QUESTION: I have the following code to download a file in the notification system. But it doesn't seem to working... I'm not sure why, everything looks good to me. The debugger is giving me an unknown host error? 06-02 00:21:15.308: WARN/System.err(4115): java.net.UnknownHostExcep...
[ "android" ]
0
1
1,049
1
0
2011-06-01T14:27:43.207000
2011-06-01T14:33:46.873000
6,202,803
6,203,201
Swing - replacement for Qt signal/slots
In Qt GUIs it is very convenient use signals & slots - it decouple events passing. When I create some widget that throw signal, I don't have to know in advance who can get it, and later with connect I specify connections. What is parallel in Java/Swing? Can you point to good resources on this issue?
If none of the existing EventListener implementations meet your requirements, you can create your own custom event. Every JComponent contains a field of type EventListenerList. You can use the approach outlined in the EventListenerList API to enable your custom JComponent subclass to fire your custom event. Regarding t...
Swing - replacement for Qt signal/slots In Qt GUIs it is very convenient use signals & slots - it decouple events passing. When I create some widget that throw signal, I don't have to know in advance who can get it, and later with connect I specify connections. What is parallel in Java/Swing? Can you point to good reso...
TITLE: Swing - replacement for Qt signal/slots QUESTION: In Qt GUIs it is very convenient use signals & slots - it decouple events passing. When I create some widget that throw signal, I don't have to know in advance who can get it, and later with connect I specify connections. What is parallel in Java/Swing? Can you ...
[ "java", "swing", "qt", "pyqt", "signals-slots" ]
6
5
3,540
2
0
2011-06-01T14:28:13.160000
2011-06-01T14:55:04.327000
6,202,808
6,230,197
Benefits (and tips) of an upgrade from JBoss 4.2.x to JBoss 5.x, 6.x, 7.x and WildFly 8.x?
Please assume that I do not need to worry about development time and costs: I am interested in general technical benefits (improved performance? improved APIs?) and new features. I am currently working on products using 4.2.x, and we consider a major shift for versions that are a long time ahead and need to converge. I...
I've upgraded from JBoss 4 to 5 and from experience the following are the most important to note: JBoss 5 (and 6 and 7) are not as forgiving as JBoss 4 with XML files. You must make sure that all your deployment descriptor XML files are valid. You may be using DTDs in some files - I recommend upgrading these to use XML...
Benefits (and tips) of an upgrade from JBoss 4.2.x to JBoss 5.x, 6.x, 7.x and WildFly 8.x? Please assume that I do not need to worry about development time and costs: I am interested in general technical benefits (improved performance? improved APIs?) and new features. I am currently working on products using 4.2.x, an...
TITLE: Benefits (and tips) of an upgrade from JBoss 4.2.x to JBoss 5.x, 6.x, 7.x and WildFly 8.x? QUESTION: Please assume that I do not need to worry about development time and costs: I am interested in general technical benefits (improved performance? improved APIs?) and new features. I am currently working on produc...
[ "java", "jakarta-ee", "jboss", "migration", "wildfly" ]
31
24
20,446
5
0
2011-06-01T14:28:32.607000
2011-06-03T16:56:36.213000
6,202,816
6,204,064
Hibernate discriminator column with table per subclass
Right now I am using a table per subclass approach to model my data. A simplification of my hierarchy is: abstract class Abstract { /* common data stored in abstract */ } class ConcreteTypeA1 extends Abstract { /* extra data stored in concrete_type_a_1 */ } class ConcreteTypeA2 extends Abstract { /* extra data stored...
Used answer from this question as per Vincents' advice. How to mix inheritance strategies with JPA annotations and Hibernate?
Hibernate discriminator column with table per subclass Right now I am using a table per subclass approach to model my data. A simplification of my hierarchy is: abstract class Abstract { /* common data stored in abstract */ } class ConcreteTypeA1 extends Abstract { /* extra data stored in concrete_type_a_1 */ } class...
TITLE: Hibernate discriminator column with table per subclass QUESTION: Right now I am using a table per subclass approach to model my data. A simplification of my hierarchy is: abstract class Abstract { /* common data stored in abstract */ } class ConcreteTypeA1 extends Abstract { /* extra data stored in concrete_ty...
[ "java", "hibernate" ]
2
1
13,689
2
0
2011-06-01T14:28:51.723000
2011-06-01T15:55:22.383000
6,202,817
6,232,037
XML parsing in Chrome vs IE and Firefox
I'm using JQuery to parse some XML returned from a server, and using it to populate a table; unfortunately, this only works in Firefox and IE, but not Chrome. Relevant code below: var xmlDoc = $.parseXML(xml); $(xmlDoc).find('z\\:row').each ( function () {//this stuff never gets executed in Chrome} I've tried using $(x...
Problem resolved. Turns out whoever posted the nodeName syntax on the site I was looking at posted invalid syntax. It needs to be '[nodeName="z:row"]' to be a self-contained string, all quotes mandatory. * shakes head *
XML parsing in Chrome vs IE and Firefox I'm using JQuery to parse some XML returned from a server, and using it to populate a table; unfortunately, this only works in Firefox and IE, but not Chrome. Relevant code below: var xmlDoc = $.parseXML(xml); $(xmlDoc).find('z\\:row').each ( function () {//this stuff never gets ...
TITLE: XML parsing in Chrome vs IE and Firefox QUESTION: I'm using JQuery to parse some XML returned from a server, and using it to populate a table; unfortunately, this only works in Firefox and IE, but not Chrome. Relevant code below: var xmlDoc = $.parseXML(xml); $(xmlDoc).find('z\\:row').each ( function () {//this...
[ "jquery", "xml", "internet-explorer", "firefox", "google-chrome" ]
1
0
3,625
2
0
2011-06-01T14:28:54.970000
2011-06-03T20:00:49.143000
6,202,818
6,202,907
Initializing multiple variables to the same value in Java
I'm looking for a clean and efficient method of declaring multiple variables of the same type and of the same value. Right now I have: String one = "", two = "", three = "" etc... But I'm looking for something like: String one,two,three = "" Is this something that is possible to do in java? Keeping efficiency in mind.
String one, two, three; one = two = three = ""; This should work with immutable objects. It doesn't make any sense for mutable objects for example: Person firstPerson, secondPerson, thirdPerson; firstPerson = secondPerson = thirdPerson = new Person(); All the variables would be pointing to the same instance. Probably w...
Initializing multiple variables to the same value in Java I'm looking for a clean and efficient method of declaring multiple variables of the same type and of the same value. Right now I have: String one = "", two = "", three = "" etc... But I'm looking for something like: String one,two,three = "" Is this something th...
TITLE: Initializing multiple variables to the same value in Java QUESTION: I'm looking for a clean and efficient method of declaring multiple variables of the same type and of the same value. Right now I have: String one = "", two = "", three = "" etc... But I'm looking for something like: String one,two,three = "" Is...
[ "java", "variables", "initialization", "declaration" ]
268
389
475,159
7
0
2011-06-01T14:29:04.020000
2011-06-01T14:35:12.020000
6,202,825
6,202,913
Class Definition Instance Instantiation Question
I have a class imgmanager that allows me to load all my images exactly once, it's quite nice, and while prototyping I had all of my files in one place, so I didn't have to worry about cyclical definitions. However after separating all of my classes I have a problem. My Header File #ifndef IMAGEMANAGER_H #define IMAGEMA...
Don't create object instances in headers. Create your object instance in one source file. If you need to access it across multiple Translation Units, put this in your header: extern imgmanager imagemgr; // declaration This will inform all code that can "see" the header that there exists a so-named object; but it will s...
Class Definition Instance Instantiation Question I have a class imgmanager that allows me to load all my images exactly once, it's quite nice, and while prototyping I had all of my files in one place, so I didn't have to worry about cyclical definitions. However after separating all of my classes I have a problem. My H...
TITLE: Class Definition Instance Instantiation Question QUESTION: I have a class imgmanager that allows me to load all my images exactly once, it's quite nice, and while prototyping I had all of my files in one place, so I didn't have to worry about cyclical definitions. However after separating all of my classes I ha...
[ "c++" ]
0
4
604
2
0
2011-06-01T14:29:26.207000
2011-06-01T14:35:39.997000
6,202,841
6,202,904
Sorting a gridview that has paging enabled
I have a list binding on a gridview. HistoryGrid.DataSource = objGrid; HistoryGrid.DataBind(); AllowSorting="true" AllowPaging="True" This doesn`t work. What else do I need?
If you use a list object as DataSource then your sorting function will not work. You can use a DataTable as DataSource to your Gridview and then it will work. You can get more ideas from this thread: How to convert a GridView to DataTable and sort the DataTable?
Sorting a gridview that has paging enabled I have a list binding on a gridview. HistoryGrid.DataSource = objGrid; HistoryGrid.DataBind(); AllowSorting="true" AllowPaging="True" This doesn`t work. What else do I need?
TITLE: Sorting a gridview that has paging enabled QUESTION: I have a list binding on a gridview. HistoryGrid.DataSource = objGrid; HistoryGrid.DataBind(); AllowSorting="true" AllowPaging="True" This doesn`t work. What else do I need? ANSWER: If you use a list object as DataSource then your sorting function will not ...
[ "c#", "asp.net", "gridview" ]
2
2
137
1
0
2011-06-01T14:30:25.860000
2011-06-01T14:35:02.657000
6,202,852
6,202,892
How many messages can I send to a queue?
I have a Queue configured in my appserver. Is there a limit on how many messages I can send to the queue?
The answer to your question is yes. Computers have a finite amount of memory, so eventually you'll hit a limit. Without further information (size of data, type of application, JVM memory limits, etc) it's impossible to answer your question more in depth.
How many messages can I send to a queue? I have a Queue configured in my appserver. Is there a limit on how many messages I can send to the queue?
TITLE: How many messages can I send to a queue? QUESTION: I have a Queue configured in my appserver. Is there a limit on how many messages I can send to the queue? ANSWER: The answer to your question is yes. Computers have a finite amount of memory, so eventually you'll hit a limit. Without further information (size ...
[ "jakarta-ee", "queue" ]
0
1
124
1
0
2011-06-01T14:31:21.433000
2011-06-01T14:33:58.177000
6,202,856
6,211,414
How to create rich domain objects while maintaing persistence ignorance?
First off, I am using web forms without any ORM framework. I have been struggling with how to make my domain objects as "smart" and "rich" as they can be without allowing them access to my service and repository layer. My most recent attempt was in creating a model for gift certificates for a online store. The main rec...
More and more logic keeps being introduced in the service layer (...) Even object validation is in the service layer (...) Validation is not the best candidate as domain model element. Input (my personal preference is that it's represented as commands) should be validated at application service level. Domain logic shou...
How to create rich domain objects while maintaing persistence ignorance? First off, I am using web forms without any ORM framework. I have been struggling with how to make my domain objects as "smart" and "rich" as they can be without allowing them access to my service and repository layer. My most recent attempt was i...
TITLE: How to create rich domain objects while maintaing persistence ignorance? QUESTION: First off, I am using web forms without any ORM framework. I have been struggling with how to make my domain objects as "smart" and "rich" as they can be without allowing them access to my service and repository layer. My most re...
[ "c#", "asp.net", "architecture", "domain-driven-design", "repository-pattern" ]
6
4
1,493
3
0
2011-06-01T14:31:30.617000
2011-06-02T06:56:43.433000
6,202,873
6,203,526
Rails 3 Rendering Binary Content
I need to render binary content(images) on web page. I'm saving images in the database with datatype binary. Now I need to iterate available images from the database and render on webpage. Please check the below code that I'm doing. Icon is the image column name in material. // iterating all materials <% @materials.eac...
You need to add an action to your controller along these lines ( cribbed from here ): def image @material = Material.find(params[:id]) send_data @material.icon,:type => 'image/png',:disposition => 'inline' end Then call the path to that action in your image_tag. You obviously need to make sure the:type field has the ri...
Rails 3 Rendering Binary Content I need to render binary content(images) on web page. I'm saving images in the database with datatype binary. Now I need to iterate available images from the database and render on webpage. Please check the below code that I'm doing. Icon is the image column name in material. // iteratin...
TITLE: Rails 3 Rendering Binary Content QUESTION: I need to render binary content(images) on web page. I'm saving images in the database with datatype binary. Now I need to iterate available images from the database and render on webpage. Please check the below code that I'm doing. Icon is the image column name in mat...
[ "ruby-on-rails-3", "blob", "binaryfiles" ]
10
27
8,147
1
0
2011-06-01T14:32:54.803000
2011-06-01T15:17:29.900000
6,202,874
6,203,622
unterminated string literal
Yet again, another one of these errors.. I've tried searching around to get this resolved before asking, but couldn't find anything that would fix this issue. So I've got:( Updated ) I've tried escaping the "text\/javascript" and the <\/script>, but it'll either not work at all and not show the error anymore because it...
The error means that one of the single quotes in $('.episodes').live('click',function(){ isn't a single quote but something else (probably a back quote). Try to replace all of them with double quotes ( " ) because the ASCII encoding only contains one double quote but three different single quotes ('´`).
unterminated string literal Yet again, another one of these errors.. I've tried searching around to get this resolved before asking, but couldn't find anything that would fix this issue. So I've got:( Updated ) I've tried escaping the "text\/javascript" and the <\/script>, but it'll either not work at all and not show ...
TITLE: unterminated string literal QUESTION: Yet again, another one of these errors.. I've tried searching around to get this resolved before asking, but couldn't find anything that would fix this issue. So I've got:( Updated ) I've tried escaping the "text\/javascript" and the <\/script>, but it'll either not work at...
[ "javascript", "jquery" ]
0
4
8,651
5
0
2011-06-01T14:33:02.433000
2011-06-01T15:22:35.057000
6,202,893
6,202,963
NullReferenceException on DropDownListFor after [HttpPost]
In my application I'am populating a dropdownlist from database using ADO Entity Framework, after this when i try to submit the form the value of the dropdown list it is giving Null reference exception. Error Code (in INDEX.ASPX) <%: Html.DropDownListFor(model => model.race, Model.Races, "--Select--")%> <--error <%: Htm...
In the POST method you have to give the same type of model to the view. [HttpPost] public ActionResult Index(Person person) { if (ModelState.IsValid) { personRepo.Add(person); personRepo.Save(); } return View(new PersonFormViewModel(person)); }
NullReferenceException on DropDownListFor after [HttpPost] In my application I'am populating a dropdownlist from database using ADO Entity Framework, after this when i try to submit the form the value of the dropdown list it is giving Null reference exception. Error Code (in INDEX.ASPX) <%: Html.DropDownListFor(model =...
TITLE: NullReferenceException on DropDownListFor after [HttpPost] QUESTION: In my application I'am populating a dropdownlist from database using ADO Entity Framework, after this when i try to submit the form the value of the dropdown list it is giving Null reference exception. Error Code (in INDEX.ASPX) <%: Html.DropD...
[ "c#", "asp.net-mvc", "ado.net", "nullreferenceexception" ]
0
1
2,057
2
0
2011-06-01T14:34:10.133000
2011-06-01T14:38:42.060000
6,202,895
6,308,284
Visual Studio Solution -- Any way to create a "special" folder?
Basically, I want one of my folders to appear above the other folders as a type of "special folder", similar to how Properties has it's own special place even though it's a folder, same with App_Data, etc. Is this possible?
By default, Visual Studio doesn't support adding special project folders. The Properties folder is hard-coded to behave the way that it does. However, anything is possible with code. You could build an extension to do this, but it wouldn't be simple. You'd probably need to mess around with the IVsHierarchy or even impl...
Visual Studio Solution -- Any way to create a "special" folder? Basically, I want one of my folders to appear above the other folders as a type of "special folder", similar to how Properties has it's own special place even though it's a folder, same with App_Data, etc. Is this possible?
TITLE: Visual Studio Solution -- Any way to create a "special" folder? QUESTION: Basically, I want one of my folders to appear above the other folders as a type of "special folder", similar to how Properties has it's own special place even though it's a folder, same with App_Data, etc. Is this possible? ANSWER: By de...
[ "visual-studio-2010", "msbuild", "project", "special-folders", "solution-explorer" ]
11
4
2,121
4
0
2011-06-01T14:34:22.677000
2011-06-10T15:08:26.257000
6,202,933
6,204,072
C++ Array Intersection
Does anyone know if it's possible to turn this from O(m * n) to O(m + n)? vector theFirst; vector theSecond; vector theMatch; theFirst.push_back( -2147483648 ); theFirst.push_back(2); theFirst.push_back(44); theFirst.push_back(1); theFirst.push_back(22); theFirst.push_back(1); theSecond.push_back(1); theSecond.push_b...
Put the contents of the first vector into a hash set, such as std::unordered_set. That is O(m). Scan the second vector, checking if the values are in the unordered_set and keeping a tally of those that are. That is n lookups of a hash structure, so O(n). So, O(m+n). If you have l elements in the overlap, you may count ...
C++ Array Intersection Does anyone know if it's possible to turn this from O(m * n) to O(m + n)? vector theFirst; vector theSecond; vector theMatch; theFirst.push_back( -2147483648 ); theFirst.push_back(2); theFirst.push_back(44); theFirst.push_back(1); theFirst.push_back(22); theFirst.push_back(1); theSecond.push_ba...
TITLE: C++ Array Intersection QUESTION: Does anyone know if it's possible to turn this from O(m * n) to O(m + n)? vector theFirst; vector theSecond; vector theMatch; theFirst.push_back( -2147483648 ); theFirst.push_back(2); theFirst.push_back(44); theFirst.push_back(1); theFirst.push_back(22); theFirst.push_back(1); ...
[ "c++", "stl", "hashtable", "intersection" ]
2
5
3,349
6
0
2011-06-01T14:36:43.423000
2011-06-01T15:55:43.690000
6,202,937
6,203,030
What is the equivalent NSBox from AppKit to be used in Cocoa Touch environment?
Is there a similar to NSBox class from AppKit for MAC in UIKit for iPad?
Not really. You will have to customize a UIView, but its not that hard. You can easily make a UIView that looks completely identical, and the best part is that when you remove the uiview, all the containing items inside it are removed. in effect, all items (like uibutton and uiscrollview) are actually children of UIvie...
What is the equivalent NSBox from AppKit to be used in Cocoa Touch environment? Is there a similar to NSBox class from AppKit for MAC in UIKit for iPad?
TITLE: What is the equivalent NSBox from AppKit to be used in Cocoa Touch environment? QUESTION: Is there a similar to NSBox class from AppKit for MAC in UIKit for iPad? ANSWER: Not really. You will have to customize a UIView, but its not that hard. You can easily make a UIView that looks completely identical, and th...
[ "iphone", "objective-c", "cocoa-touch", "ipad", "appkit" ]
3
2
838
1
0
2011-06-01T14:36:57.803000
2011-06-01T14:43:21.083000
6,202,939
6,202,996
Multiple Threads calling static helper method
I have a web application running on Tomcat. There are several calculations that need to be done on multiple places in the web application. Can I make those calculations static helper functions? If the server has enough processor cores, can multiple calls to that static function (resulting from multiple requests to diff...
can i make those calculations static helper functions? if the server has enough processor cores, can multiple calls to that static function (resulting from multiple requests to different servlets) run parallel? Yes, and yes. do i have to make the whole static functions synchronized That will work. or just the block whe...
Multiple Threads calling static helper method I have a web application running on Tomcat. There are several calculations that need to be done on multiple places in the web application. Can I make those calculations static helper functions? If the server has enough processor cores, can multiple calls to that static func...
TITLE: Multiple Threads calling static helper method QUESTION: I have a web application running on Tomcat. There are several calculations that need to be done on multiple places in the web application. Can I make those calculations static helper functions? If the server has enough processor cores, can multiple calls t...
[ "java", "multithreading", "static", "static-methods" ]
12
6
13,503
7
0
2011-06-01T14:37:05.640000
2011-06-01T14:41:06.807000
6,202,953
6,203,448
Obtaining "this" tab ID from content script in Chrome extension?
From a content script, is it possible to access that tab's id? I want to send a message to the background page from the content script that tells my extension to "do something with this tab" using the chrome.tabs.* API. A tabID is needed, and there is no point in doing a bunch of logic in the background page to hunt fo...
Tab id is automatically passed inside MessageSender object: chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { console.log("sent from tab.id=", sender.tab.id); }); Note: According to docs, this property is not always available: This property will only be present when the connection was opene...
Obtaining "this" tab ID from content script in Chrome extension? From a content script, is it possible to access that tab's id? I want to send a message to the background page from the content script that tells my extension to "do something with this tab" using the chrome.tabs.* API. A tabID is needed, and there is no ...
TITLE: Obtaining "this" tab ID from content script in Chrome extension? QUESTION: From a content script, is it possible to access that tab's id? I want to send a message to the background page from the content script that tells my extension to "do something with this tab" using the chrome.tabs.* API. A tabID is needed...
[ "javascript", "google-chrome-extension", "content-script" ]
82
130
47,484
6
0
2011-06-01T14:38:11.007000
2011-06-01T15:12:39.630000
6,202,966
6,203,056
Hide Page navigator in a jquery grid
How I can hide View text and page navigation in a jQuery grid navigator? Thanks a lot!
You can use the viewrecords option to hide the view text: viewrecords: false You can set the following pager options to false to disable page navigation: pgbuttons: false, pginput: false,
Hide Page navigator in a jquery grid How I can hide View text and page navigation in a jQuery grid navigator? Thanks a lot!
TITLE: Hide Page navigator in a jquery grid QUESTION: How I can hide View text and page navigation in a jQuery grid navigator? Thanks a lot! ANSWER: You can use the viewrecords option to hide the view text: viewrecords: false You can set the following pager options to false to disable page navigation: pgbuttons: fals...
[ "javascript", "jquery", "jqgrid" ]
1
3
281
1
0
2011-06-01T14:39:02.063000
2011-06-01T14:45:27.770000
6,202,976
6,203,883
Why should I prefer to create an NSManagedObjectContext for every new thread or NSOperation instead of calling Core Data on the Main thread?
Some developers already told me that I can create a new NSManagedObjectContext instance for every new thread, to make Core Data thread-safe. Then I would just have to take care of the merging afterwards. For me, this sounds like A LOT of extra code and overhead. Is there a reason why this solution would be bad? Here it...
"Disk access is expensive" - we've been told... If you fetch or save lots of data, there is an advantage of using a separate MOC on a NSThread/NSOperation. Coupled with a view transition, this can well improve the perception of "speed" in your application, since the main thread is left to perform only the UI transition...
Why should I prefer to create an NSManagedObjectContext for every new thread or NSOperation instead of calling Core Data on the Main thread? Some developers already told me that I can create a new NSManagedObjectContext instance for every new thread, to make Core Data thread-safe. Then I would just have to take care of...
TITLE: Why should I prefer to create an NSManagedObjectContext for every new thread or NSOperation instead of calling Core Data on the Main thread? QUESTION: Some developers already told me that I can create a new NSManagedObjectContext instance for every new thread, to make Core Data thread-safe. Then I would just ha...
[ "iphone", "multithreading", "ios", "core-data", "concurrency" ]
4
1
1,116
2
0
2011-06-01T14:39:18.040000
2011-06-01T15:41:54.123000
6,202,982
6,203,805
How to programmatically update specific row in GWT CellTable
I have 5 rows in GWT CellTable. The table has 2 columns id, value. I have gwt timer which must periodically update value for specific id. So in timer implementation i call something like that:.... double value = calcValueForId(id); update(id, value);..... private void update(int id, double value) { // here i have acces...
You have to retrieve the item (of the type you used to parameterize your CellTable ) and then you can call updateRowData of your AsyncDataProvider (or setRowData on the CellTable ) with the item's index. This will tell that the items (actually only one in your case) starting at the given index have changed, so the tabl...
How to programmatically update specific row in GWT CellTable I have 5 rows in GWT CellTable. The table has 2 columns id, value. I have gwt timer which must periodically update value for specific id. So in timer implementation i call something like that:.... double value = calcValueForId(id); update(id, value);..... pri...
TITLE: How to programmatically update specific row in GWT CellTable QUESTION: I have 5 rows in GWT CellTable. The table has 2 columns id, value. I have gwt timer which must periodically update value for specific id. So in timer implementation i call something like that:.... double value = calcValueForId(id); update(id...
[ "gwt", "gwt-2.2-celltable" ]
2
3
7,665
1
0
2011-06-01T14:39:58.167000
2011-06-01T15:34:52.987000
6,202,987
6,203,018
asp.net 4 dropdownlist findByText not working for dynamic list
I have a dropdownlist, whose datasource is from SQL server. I want to prepopulate the value in the list. i use DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue(YourValueHere)). but it's not working. it gives me a null from DropDownList.Items.FindByValue(YourValueHere). The same cod...
What about directly using the SelectedValue property of the dropdown: DropDownList.SelectedValue = YourValueHere;? Edit: I got your problem, you have to Select DropDownList Class instead of the id of your dropdownlist control. The code below code is working, I tested it. ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items....
asp.net 4 dropdownlist findByText not working for dynamic list I have a dropdownlist, whose datasource is from SQL server. I want to prepopulate the value in the list. i use DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue(YourValueHere)). but it's not working. it gives me a null f...
TITLE: asp.net 4 dropdownlist findByText not working for dynamic list QUESTION: I have a dropdownlist, whose datasource is from SQL server. I want to prepopulate the value in the list. i use DropDownList.SelectedIndex = DropDownList.Items.IndexOf(DropDownList.Items.FindByValue(YourValueHere)). but it's not working. it...
[ "c#", "asp.net", "drop-down-menu" ]
1
1
5,616
3
0
2011-06-01T14:40:20.580000
2011-06-01T14:42:50.720000
6,202,988
6,203,757
Action/Lambda Expression Memory Management Question
I'm storing an action in a local variable, then I'm using after that local variable is out of scope. Is it in danger of being cleaned up before I use it? Here is an example: public List GetMaps() { Action baseMap = (Customer1 c1, Customer2 c2) => { c2.FirstName = c1.FirstName; }; var list = new List () { new Action ()...
I refer you to section 5.1.7 of the C# 4 spec, which says: If the local variable is captured by an anonymous function, its lifetime extends at least until the delegate or expression tree created from the anonymous function, along with any other objects that come to reference the captured variable, are eligible for garb...
Action/Lambda Expression Memory Management Question I'm storing an action in a local variable, then I'm using after that local variable is out of scope. Is it in danger of being cleaned up before I use it? Here is an example: public List GetMaps() { Action baseMap = (Customer1 c1, Customer2 c2) => { c2.FirstName = c1.F...
TITLE: Action/Lambda Expression Memory Management Question QUESTION: I'm storing an action in a local variable, then I'm using after that local variable is out of scope. Is it in danger of being cleaned up before I use it? Here is an example: public List GetMaps() { Action baseMap = (Customer1 c1, Customer2 c2) => { c...
[ "c#", "memory-management", ".net-4.0" ]
8
13
2,440
4
0
2011-06-01T14:40:23.340000
2011-06-01T15:31:04.247000
6,202,992
6,203,253
codeigniter 2.0 and ajax
I just want to store a variable from jQuery into a session. js file: $.post("controller/ajaxtest","hello"); I am able to see this post request in firebug. How can I access this variable or store it in the session?
Change the data you are sending to a JSON object or a query string, then you can access it in PHP via $_POST or CodeIgniter's $this->input->post $.post("controller/ajaxtest","var=hello"); OR $.post("controller/ajaxtest",{"var":"hello"}); Then in ajaxtest, you can access it via $this->input->post('var'). NOTE: If you do...
codeigniter 2.0 and ajax I just want to store a variable from jQuery into a session. js file: $.post("controller/ajaxtest","hello"); I am able to see this post request in firebug. How can I access this variable or store it in the session?
TITLE: codeigniter 2.0 and ajax QUESTION: I just want to store a variable from jQuery into a session. js file: $.post("controller/ajaxtest","hello"); I am able to see this post request in firebug. How can I access this variable or store it in the session? ANSWER: Change the data you are sending to a JSON object or a ...
[ "ajax", "session", "codeigniter" ]
1
1
592
1
0
2011-06-01T14:40:32.093000
2011-06-01T14:58:20.240000
6,202,997
6,209,919
table.addItem is not adding the value to my table
When I add the table.addContainerProperty manually (all of them) it works, adding all items i ask for. When I use a for to create the table.addContainerProperty I cannot add values using my button, or with the for that should add all my values. Why? I cannot find it anywhere... package br.com.Metrics; import com.vaadi...
I found out why... when inserting data in a table using.addItem the array that you must provide to this method MUST have the exact same number of itens as the table columns. otherwise it will not add them or tell you that.
table.addItem is not adding the value to my table When I add the table.addContainerProperty manually (all of them) it works, adding all items i ask for. When I use a for to create the table.addContainerProperty I cannot add values using my button, or with the for that should add all my values. Why? I cannot find it any...
TITLE: table.addItem is not adding the value to my table QUESTION: When I add the table.addContainerProperty manually (all of them) it works, adding all items i ask for. When I use a for to create the table.addContainerProperty I cannot add values using my button, or with the for that should add all my values. Why? I ...
[ "vaadin" ]
1
3
8,769
1
0
2011-06-01T14:41:08.970000
2011-06-02T02:55:54.250000
6,203,007
6,203,133
Extracting beats out of MP3 music with Python
What kind of solutions are there to analyze beats out of MP3 music in Python? The purpose of this would be to use rhythm information to time the keyframes of generated animation, export animation as video file and and mix the video and audio together.
Check this: The Echo Nest Remix API # You can manipulate the beats in a song as a native python list beats = audio_file.analysis.beats beats.reverse()
Extracting beats out of MP3 music with Python What kind of solutions are there to analyze beats out of MP3 music in Python? The purpose of this would be to use rhythm information to time the keyframes of generated animation, export animation as video file and and mix the video and audio together.
TITLE: Extracting beats out of MP3 music with Python QUESTION: What kind of solutions are there to analyze beats out of MP3 music in Python? The purpose of this would be to use rhythm information to time the keyframes of generated animation, export animation as video file and and mix the video and audio together. ANS...
[ "python", "video", "audio", "signal-processing" ]
7
4
3,558
1
0
2011-06-01T14:41:56.100000
2011-06-01T14:49:52.940000
6,203,008
6,203,040
How do I open a generated pdf on a form post?
I want the user to submit a form and get a pdf back. Like you would if you just pressed a link to a pdf. I'm going through a few steps before the pdf is generated. First I interrupt a form post with JQuery: $("#reportForm").submit(function (event) { event.preventDefault(); $.post("/Registry/Persons/Report", $(this).ser...
Don't use AJAX to download files. You can't do this with AJAX. In the success callback of your ajax call you will get the results of the controller action which represents the PDF file but obviously you can't do absolutely nothing with it as due to security reasons javascript forbids you to write to the client computer...
How do I open a generated pdf on a form post? I want the user to submit a form and get a pdf back. Like you would if you just pressed a link to a pdf. I'm going through a few steps before the pdf is generated. First I interrupt a form post with JQuery: $("#reportForm").submit(function (event) { event.preventDefault(); ...
TITLE: How do I open a generated pdf on a form post? QUESTION: I want the user to submit a form and get a pdf back. Like you would if you just pressed a link to a pdf. I'm going through a few steps before the pdf is generated. First I interrupt a form post with JQuery: $("#reportForm").submit(function (event) { event....
[ "jquery", "asp.net-mvc" ]
0
2
4,337
1
0
2011-06-01T14:42:06.280000
2011-06-01T14:44:37.923000
6,203,013
6,203,993
When is a 404 not a 404?
I'm using this jQuery below call to load a.php file located on the same server. However, using Chrome's javascript console, its reporting "404 not found" on the php file I'm trying to load. Although, I can load the file directly, just by clicking on the file right there from within the console. Also, I can copy the URL...
As described in another answer, loading wp-blog-header.php bootstraps the entire WordPress request handling process. Given that your script isn't actually a WordPress post, this process sets the 404 header to indicate that it couldn't find the content you were looking for. Since it looks like what you really want is ju...
When is a 404 not a 404? I'm using this jQuery below call to load a.php file located on the same server. However, using Chrome's javascript console, its reporting "404 not found" on the php file I'm trying to load. Although, I can load the file directly, just by clicking on the file right there from within the console....
TITLE: When is a 404 not a 404? QUESTION: I'm using this jQuery below call to load a.php file located on the same server. However, using Chrome's javascript console, its reporting "404 not found" on the php file I'm trying to load. Although, I can load the file directly, just by clicking on the file right there from w...
[ "php", "jquery", "apache", "http-status-code-404" ]
8
13
2,892
6
0
2011-06-01T14:42:30.383000
2011-06-01T15:50:51.763000
6,203,015
6,203,029
Automatically generate a uml diagram of my c++ code
Some time ago I was a TA in a introductory programming course on Java. We used an IDE called BlueJ which had the nice feature that the overview of your development files was a light-weight UML diagram with 'usage' pointers and inheritance pointers drawn in, this made it easy to see the structure of the program. My ques...
Do you know about Doxygen and its many options? In fact, Google's number two hit for Doxygen and UML is this previous StackOverflow question.
Automatically generate a uml diagram of my c++ code Some time ago I was a TA in a introductory programming course on Java. We used an IDE called BlueJ which had the nice feature that the overview of your development files was a light-weight UML diagram with 'usage' pointers and inheritance pointers drawn in, this made ...
TITLE: Automatically generate a uml diagram of my c++ code QUESTION: Some time ago I was a TA in a introductory programming course on Java. We used an IDE called BlueJ which had the nice feature that the overview of your development files was a light-weight UML diagram with 'usage' pointers and inheritance pointers dr...
[ "c++", "oop", "macos", "uml" ]
3
3
10,243
2
0
2011-06-01T14:42:39.283000
2011-06-01T14:43:19.453000
6,203,016
6,203,283
Why does my UITableView lose it's fluidity when I scroll during an asynchronous reload data?
Here is my problem... I'm making an asynchronous call to the service I'm working with, which returns search results back to me. When that's done, it reloads my table, and the async is done. The problem is, when I try scrolling on my table view before the async call is done, the table loses that fluid feeling that all s...
Calling [tableView reloadData] will reload your ENTIRE table, which is the reason you are seeing the choppy UITableView. It forces all visible cells to refresh, so as you are scrolling, the visible cells are refreshing and repainting themselves. You'll need to reevaluate your strategy for updating the UITableView as yo...
Why does my UITableView lose it's fluidity when I scroll during an asynchronous reload data? Here is my problem... I'm making an asynchronous call to the service I'm working with, which returns search results back to me. When that's done, it reloads my table, and the async is done. The problem is, when I try scrolling ...
TITLE: Why does my UITableView lose it's fluidity when I scroll during an asynchronous reload data? QUESTION: Here is my problem... I'm making an asynchronous call to the service I'm working with, which returns search results back to me. When that's done, it reloads my table, and the async is done. The problem is, whe...
[ "iphone", "ios", "asynchronous", "uitableview" ]
0
2
1,856
3
0
2011-06-01T14:42:43.617000
2011-06-01T14:59:46.113000
6,203,019
6,203,658
No call stack in VS2010 debugger
I've got an app that loads a DLL, and subsequently crashes. I modified the IDE's working directory to be the solution build directory, so that I could run the debugger on the built DLL which is built from another project in this solution. When the app gets an access violation, I can see the current function, but nothin...
Having the debugger work when it hits a break point and fails when you break after an access violation in native code usually a sign that the access violation is preceded or accompanied by a corruption of the stack. The debugger depends on certain values in the stack being properly set in order for it to both build the...
No call stack in VS2010 debugger I've got an app that loads a DLL, and subsequently crashes. I modified the IDE's working directory to be the solution build directory, so that I could run the debugger on the built DLL which is built from another project in this solution. When the app gets an access violation, I can see...
TITLE: No call stack in VS2010 debugger QUESTION: I've got an app that loads a DLL, and subsequently crashes. I modified the IDE's working directory to be the solution build directory, so that I could run the debugger on the built DLL which is built from another project in this solution. When the app gets an access vi...
[ "c++", "visual-studio", "visual-studio-2010", "debugging" ]
5
4
2,003
1
0
2011-06-01T14:42:52.947000
2011-06-01T15:25:17.237000
6,203,023
6,205,012
Nine patch on a custom viewgroup
I made a nine-patch, and a custom viewgroup, then I made the background of that viewgroup to be the nine-patch. The problem is: The nine-patch is ignoring the "content area" settings. So: How I use a nine-patch properly in a custom view? OR: How I grab the content area from the nine-patch so I can use it on the OnMeasu...
Also use boolean getPadding(Rect padding) on the NinePatchDrawable to get the padding for the content (your content + 9patch padding = total group dize)
Nine patch on a custom viewgroup I made a nine-patch, and a custom viewgroup, then I made the background of that viewgroup to be the nine-patch. The problem is: The nine-patch is ignoring the "content area" settings. So: How I use a nine-patch properly in a custom view? OR: How I grab the content area from the nine-pat...
TITLE: Nine patch on a custom viewgroup QUESTION: I made a nine-patch, and a custom viewgroup, then I made the background of that viewgroup to be the nine-patch. The problem is: The nine-patch is ignoring the "content area" settings. So: How I use a nine-patch properly in a custom view? OR: How I grab the content area...
[ "android", "custom-view", "viewgroup", "nine-patch" ]
4
6
1,007
3
0
2011-06-01T14:43:03.080000
2011-06-01T17:06:01.237000
6,203,026
6,203,059
How to concatenate multiple ternary operator in PHP?
I use ternary operators alot but I can't seem to stack multiple ternary operator inside each other. I am aware that stacking multiple ternary operator would make the code less readable but in some case I would like to do it. This is what I've tried so far: $foo = 1; $bar = ( $foo == 1 )? "1": ( $foo == 2 )? "2": "other...
Those parenthesis are what I think is getting you. Try $foo = 1; $bar = ($foo == 1)? "1": (($foo == 2)? "2": "other"); echo $bar;
How to concatenate multiple ternary operator in PHP? I use ternary operators alot but I can't seem to stack multiple ternary operator inside each other. I am aware that stacking multiple ternary operator would make the code less readable but in some case I would like to do it. This is what I've tried so far: $foo = 1; ...
TITLE: How to concatenate multiple ternary operator in PHP? QUESTION: I use ternary operators alot but I can't seem to stack multiple ternary operator inside each other. I am aware that stacking multiple ternary operator would make the code less readable but in some case I would like to do it. This is what I've tried ...
[ "php", "ternary-operator" ]
29
70
45,178
8
0
2011-06-01T14:43:13.963000
2011-06-01T14:45:37.137000
6,203,033
6,203,886
IE9 jQuery Ajax Not Working
I am using jQuery 1.6.1 and IE9. I am running the page on my machine trying to request data from a server. My Javascript looks like this: var baseURL = "http://1.1.1.1/cgi-bin/ipcxml.cgi?"; var path = "scm:scm/data/system_names"; var fullURL = baseURL + path; $.ajax ( { url: fullURL, cache: true, context: $("#" + eleme...
I don't know if it's the root cause of your problem, but colon (: ) and slash ( / ) characters have to be encoded when used in query strings. Try: var fullURL = baseURL + encodeURIComponent(path);
IE9 jQuery Ajax Not Working I am using jQuery 1.6.1 and IE9. I am running the page on my machine trying to request data from a server. My Javascript looks like this: var baseURL = "http://1.1.1.1/cgi-bin/ipcxml.cgi?"; var path = "scm:scm/data/system_names"; var fullURL = baseURL + path; $.ajax ( { url: fullURL, cache: ...
TITLE: IE9 jQuery Ajax Not Working QUESTION: I am using jQuery 1.6.1 and IE9. I am running the page on my machine trying to request data from a server. My Javascript looks like this: var baseURL = "http://1.1.1.1/cgi-bin/ipcxml.cgi?"; var path = "scm:scm/data/system_names"; var fullURL = baseURL + path; $.ajax ( { url...
[ "jquery", "cross-domain", "internet-explorer-9" ]
3
1
12,217
2
0
2011-06-01T14:43:37.957000
2011-06-01T15:41:58.537000
6,203,042
6,203,112
How do I prevent a click handler being triggered when a child element is clicked?
I have two div tags, first div is the father and the second div is son Inside the father like this And I've added an event (onclick) in div father like this My question is why the son inherits the father in the event. I want when I click on the Father div implement the event, but when i click on the son does not implem...
You can pass the event as one of the arguments in the closeFather function, then check whether the event target is the father element. See this example function closeFather(e) { if(e.target == document.getElementById('father')) { //do stuff } }; Then in the HTML you just need to add the event argument to the javascript...
How do I prevent a click handler being triggered when a child element is clicked? I have two div tags, first div is the father and the second div is son Inside the father like this And I've added an event (onclick) in div father like this My question is why the son inherits the father in the event. I want when I click ...
TITLE: How do I prevent a click handler being triggered when a child element is clicked? QUESTION: I have two div tags, first div is the father and the second div is son Inside the father like this And I've added an event (onclick) in div father like this My question is why the son inherits the father in the event. I ...
[ "javascript", "events" ]
10
8
10,752
5
0
2011-06-01T14:44:42.093000
2011-06-01T14:48:17.370000
6,203,045
6,203,121
PHP Curl Extension not working
I wrote a piece which was fetching data for me correctly when I was trying it on my localhost. Its also working fine on another server. But when I transferred it to server it is showing a warning msg... Warning: (null)(): 4 is not a valid cURL handle resource in Unknown on line 0. Can anyone suggest what changes I have...
That doesn't mean that the cURL extension isn't working, quite the opposite. CURL is working, however when you are trying to access the options which you pass to curl, you aren't passing the curl resource handler. For example, $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); You need to use the $ch as your handl...
PHP Curl Extension not working I wrote a piece which was fetching data for me correctly when I was trying it on my localhost. Its also working fine on another server. But when I transferred it to server it is showing a warning msg... Warning: (null)(): 4 is not a valid cURL handle resource in Unknown on line 0. Can any...
TITLE: PHP Curl Extension not working QUESTION: I wrote a piece which was fetching data for me correctly when I was trying it on my localhost. Its also working fine on another server. But when I transferred it to server it is showing a warning msg... Warning: (null)(): 4 is not a valid cURL handle resource in Unknown ...
[ "php", ".htaccess", "curl" ]
0
1
980
1
0
2011-06-01T14:44:55.157000
2011-06-01T14:48:52.270000
6,203,058
6,214,401
Creating a Windows XP Junction
I need to create a Junction point (directory symbolic link) from C:\x to C:\xxx\yyy\zzz\aaa\bbb since I am running up against the Windows XP maximum file path length when adding files to this directory and I have no control over the directory structure. I was reading that creating Junction points is not built-in to Win...
Marc B had the right idea but did not post an answer so I will post this one. This Windows article details the linkd utility: http://support.microsoft.com/kb/205524/en-us Linkd.exe Grafts any target folder onto a Windows 2000 version of NTFS folder This EXE can be download via Windows Server 2003 Resource Kit Tools: ht...
Creating a Windows XP Junction I need to create a Junction point (directory symbolic link) from C:\x to C:\xxx\yyy\zzz\aaa\bbb since I am running up against the Windows XP maximum file path length when adding files to this directory and I have no control over the directory structure. I was reading that creating Junctio...
TITLE: Creating a Windows XP Junction QUESTION: I need to create a Junction point (directory symbolic link) from C:\x to C:\xxx\yyy\zzz\aaa\bbb since I am running up against the Windows XP maximum file path length when adding files to this directory and I have no control over the directory structure. I was reading tha...
[ "java", "windows" ]
2
2
2,700
3
0
2011-06-01T14:45:30.910000
2011-06-02T12:18:52.950000
6,203,079
6,203,123
Can I preventDefault(); inside of an ajax callback?
I'm doing some form validation, and I'm having trouble with what I'm trying to accomplish. I want to be able to validate my zip code on blur of the field, but also call the same function to validate zip on submit of the form, and prevent the form from being submitted if the zip code is invalid. My code (generically) go...
No, by the time the callback from the AJAX event fires, the event will have already bubbled and the form submitted. One way you could accomplish this is cancel the form from submitting and then submit it manually if it passes the requirements from the AJAX request.
Can I preventDefault(); inside of an ajax callback? I'm doing some form validation, and I'm having trouble with what I'm trying to accomplish. I want to be able to validate my zip code on blur of the field, but also call the same function to validate zip on submit of the form, and prevent the form from being submitted ...
TITLE: Can I preventDefault(); inside of an ajax callback? QUESTION: I'm doing some form validation, and I'm having trouble with what I'm trying to accomplish. I want to be able to validate my zip code on blur of the field, but also call the same function to validate zip on submit of the form, and prevent the form fro...
[ "javascript", "jquery", "validation" ]
12
8
5,851
3
0
2011-06-01T14:46:31.717000
2011-06-01T14:49:08.390000
6,203,086
6,210,531
Choosing flash/openGL/other animation for an android app?
I need to add some animation to the UI of my application. Something similar to the Talking Tom application that is all the rage these days. I am a complete noob to animation, so had the following questions to zero in on a particular platform before I began with any development. Out of Flash/Rendered Images/OpenGL which...
Talking Tom is a 3D animation. You will not be able to get that to work on a mobile device with flash. Adobe has an update pending - Air 2.7 - that promises great performance improvements and support for Open GL ES. That might to the trick when that comes along. ANd designers are comfortable with the adobe toolset. How...
Choosing flash/openGL/other animation for an android app? I need to add some animation to the UI of my application. Something similar to the Talking Tom application that is all the rage these days. I am a complete noob to animation, so had the following questions to zero in on a particular platform before I began with ...
TITLE: Choosing flash/openGL/other animation for an android app? QUESTION: I need to add some animation to the UI of my application. Something similar to the Talking Tom application that is all the rage these days. I am a complete noob to animation, so had the following questions to zero in on a particular platform be...
[ "android", "flash", "opengl", "animation" ]
1
1
1,495
2
0
2011-06-01T14:46:49.360000
2011-06-02T04:49:54.183000
6,203,089
6,204,138
Stop Blob URL from expiring
I am uploading images to the blob store. I have copied the example from here. The only problem I encounter is: If I load the page with the form, and not immediately submit the image. The URL can expire and when I do try and load the image I get an error page. How can I check to see if the URL has expired and refresh th...
It seems the work around is getting the Blob URL when the user submits the form. This way you know that the URL can't expire. Using JQuery: $.get("/blobUrl", function(data){ $("#changeProfilePictureForm").attr('action', data); $("#changeProfilePictureForm").submit(); $("#changeProfilePictureForm").hide(); $("#loadingIm...
Stop Blob URL from expiring I am uploading images to the blob store. I have copied the example from here. The only problem I encounter is: If I load the page with the form, and not immediately submit the image. The URL can expire and when I do try and load the image I get an error page. How can I check to see if the UR...
TITLE: Stop Blob URL from expiring QUESTION: I am uploading images to the blob store. I have copied the example from here. The only problem I encounter is: If I load the page with the form, and not immediately submit the image. The URL can expire and when I do try and load the image I get an error page. How can I chec...
[ "java", "google-app-engine", "blobstore" ]
3
4
2,395
3
0
2011-06-01T14:46:54.083000
2011-06-01T15:59:12.563000
6,203,094
6,206,890
Zend passing string containing "Zero" to form-element Description
Zend talk. I built a Zend_Form class. I noticed that if I pass the string '0' the method setDescription of my form-element will consider it as NULL and I can't get to echo out its value in the element description. //this is how I set the element description in Myform class: $element->setDescription('0'); How can I avoi...
According to http://php.net/manual/en/function.empty.php, php recognizes '0' as empty. The Description decorator render() function checks to see if the description is empty(). There doesn't currently appear to be a way to display just a '0'. I'd suggest filing a bug report at http://framework.zend.com/issues Until that...
Zend passing string containing "Zero" to form-element Description Zend talk. I built a Zend_Form class. I noticed that if I pass the string '0' the method setDescription of my form-element will consider it as NULL and I can't get to echo out its value in the element description. //this is how I set the element descript...
TITLE: Zend passing string containing "Zero" to form-element Description QUESTION: Zend talk. I built a Zend_Form class. I noticed that if I pass the string '0' the method setDescription of my form-element will consider it as NULL and I can't get to echo out its value in the element description. //this is how I set th...
[ "php", "zend-framework", "forms", "zend-decorators" ]
1
1
231
3
0
2011-06-01T14:47:08.177000
2011-06-01T19:55:55.130000
6,203,096
6,203,802
Quick check on the heap?
I have a rooted Evo as a test device. Now I have been testing my app on it all the time and lately (relatively) I have had constant memory leaks or over assignment. So on a whim, I decided to test it on a tablet I have at work. The app ran fine. Not even a hint of memory issues. So I begin to wonder if in rooting my de...
To get the actual allowed heap on your phone you can use http://developer.android.com/reference/android/app/ActivityManager.html#getMemoryClass () which will return an integer representing the amount of MB that is the max heap per application. And you cannot change this as a developer of an app (You can change the max ...
Quick check on the heap? I have a rooted Evo as a test device. Now I have been testing my app on it all the time and lately (relatively) I have had constant memory leaks or over assignment. So on a whim, I decided to test it on a tablet I have at work. The app ran fine. Not even a hint of memory issues. So I begin to w...
TITLE: Quick check on the heap? QUESTION: I have a rooted Evo as a test device. Now I have been testing my app on it all the time and lately (relatively) I have had constant memory leaks or over assignment. So on a whim, I decided to test it on a tablet I have at work. The app ran fine. Not even a hint of memory issue...
[ "android", "memory", "heap-memory", "device" ]
0
1
637
1
0
2011-06-01T14:47:15.763000
2011-06-01T15:34:42.903000
6,203,100
6,203,183
PHP: Query Exceeding Max Time (How to handle this)
Ok. I have my query written finally for my php file (which will write the query to a txt file). However, when I was testing the file earlier I apparently am excending the maximum execution time. I was using just one large query to do the work, but now I am wondering if it would be best to use multiple smaller queries. ...
Multiple queries, if anything, will just slow things down. It means compiling/executing multiple queries, so you end up with more overhead. Use explain on your query to see what indexes are (and aren't) being used, and add more indexing where required. And in some cases, things will just naturally be slow. You are, aft...
PHP: Query Exceeding Max Time (How to handle this) Ok. I have my query written finally for my php file (which will write the query to a txt file). However, when I was testing the file earlier I apparently am excending the maximum execution time. I was using just one large query to do the work, but now I am wondering if...
TITLE: PHP: Query Exceeding Max Time (How to handle this) QUESTION: Ok. I have my query written finally for my php file (which will write the query to a txt file). However, when I was testing the file earlier I apparently am excending the maximum execution time. I was using just one large query to do the work, but now...
[ "php", "mysql", "variables", "join", "performance" ]
0
4
442
2
0
2011-06-01T14:47:27.153000
2011-06-01T14:53:38.277000
6,203,101
6,203,707
Change GWT CellTable style only for concrete table
How to change gwt cell table style. I am not using ui binder.
See http://code.google.com/p/google-web-toolkit/issues/detail?id=6144 (which is not a bug, but there's the full explanation there, and even some sample code). Add a comment if you need more details and I'll update my anwer.
Change GWT CellTable style only for concrete table How to change gwt cell table style. I am not using ui binder.
TITLE: Change GWT CellTable style only for concrete table QUESTION: How to change gwt cell table style. I am not using ui binder. ANSWER: See http://code.google.com/p/google-web-toolkit/issues/detail?id=6144 (which is not a bug, but there's the full explanation there, and even some sample code). Add a comment if you ...
[ "gwt", "coding-style", "gwt-2.2-celltable" ]
0
0
1,515
1
0
2011-06-01T14:47:28.337000
2011-06-01T15:28:16.767000
6,203,102
6,203,150
strcmp for empty string
I was reviewing some code and I saw someone do a if (0 == strcmp(foo,"")) I am curious because I think it would be faster to do a if (foo[0] == '\0') Is this correct or is strcmp optimized enough to make them the same. (I realize that even if there was some difference it would be small, but am thinking you save at leas...
You're right: since calling strcmp() adds up the stack management and the memory jump to the actual strcmp instructions, you'll gain a few instructions by just checking the first byte of your string. For your curiosity, you can check the strcmp() code here: http://sourceware.org/git/?p=glibc.git;a=blob;f=string/strcmp....
strcmp for empty string I was reviewing some code and I saw someone do a if (0 == strcmp(foo,"")) I am curious because I think it would be faster to do a if (foo[0] == '\0') Is this correct or is strcmp optimized enough to make them the same. (I realize that even if there was some difference it would be small, but am t...
TITLE: strcmp for empty string QUESTION: I was reviewing some code and I saw someone do a if (0 == strcmp(foo,"")) I am curious because I think it would be faster to do a if (foo[0] == '\0') Is this correct or is strcmp optimized enough to make them the same. (I realize that even if there was some difference it would ...
[ "c", "strcmp" ]
31
11
34,435
8
0
2011-06-01T14:47:28.830000
2011-06-01T14:50:54.633000
6,203,108
6,205,104
How do you create an F# WCF client? I keep getting an app.config error
I've been working on creating a self hosted application server in F#. I have the app server up and running and I can connect using a C# client, but some of the things that I want to do are better served using F#. The problem is that I can't seem to get the F# client to work properly. I've found a few examples, but I ca...
I dunno what the contract="*" thing is (maybe some newer feature of WCF). Anyway the 'PrevisionAppServer.Main+IPrevisionAppServer' bit in the diagnostic, where is this type defined? (F# code, C# code, a reference DLL, what?) It looks like a nested type, I wonder if that is affecting things too... I am just fishing. (Th...
How do you create an F# WCF client? I keep getting an app.config error I've been working on creating a self hosted application server in F#. I have the app server up and running and I can connect using a C# client, but some of the things that I want to do are better served using F#. The problem is that I can't seem to ...
TITLE: How do you create an F# WCF client? I keep getting an app.config error QUESTION: I've been working on creating a self hosted application server in F#. I have the app server up and running and I can connect using a C# client, but some of the things that I want to do are better served using F#. The problem is tha...
[ "wcf", "f#" ]
6
2
1,284
2
0
2011-06-01T14:47:55.570000
2011-06-01T17:13:24.133000
6,203,109
6,203,329
loading NSBundle files on iOS
I'd like to create a project that has a very flexible graphical user interface ( skinnable ). In order to make this possible, I'd like to load a NSBundle from an external resource, e.g. a website. The bundle should contain nibs that correspond to some properties and methods in the main project (IBOutlets & IBActions) I...
untested. You can distribute all the content in a zip file, unzip using SSZipArchive. NSBundle* bundle = [NSBundle bundleWithPath:absolutePathToNibFile]. UIViewController* vc = [[[MyViewController alloc] initWithNibName:@"mycustomnib" bundle:bundle] autorelease];
loading NSBundle files on iOS I'd like to create a project that has a very flexible graphical user interface ( skinnable ). In order to make this possible, I'd like to load a NSBundle from an external resource, e.g. a website. The bundle should contain nibs that correspond to some properties and methods in the main pro...
TITLE: loading NSBundle files on iOS QUESTION: I'd like to create a project that has a very flexible graphical user interface ( skinnable ). In order to make this possible, I'd like to load a NSBundle from an external resource, e.g. a website. The bundle should contain nibs that correspond to some properties and metho...
[ "ios", "loading", "nsbundle" ]
27
12
18,036
2
0
2011-06-01T14:47:56.537000
2011-06-01T15:02:55.887000
6,203,118
6,234,725
How I can listen for a tcp port in kernel space (freebsd)?
As the title says, How I can work with tcp sockets in kernel space? Is there any tricky notes?
I found a post on linuxjournal.com about networking in kernel. May be helpful.
How I can listen for a tcp port in kernel space (freebsd)? As the title says, How I can work with tcp sockets in kernel space? Is there any tricky notes?
TITLE: How I can listen for a tcp port in kernel space (freebsd)? QUESTION: As the title says, How I can work with tcp sockets in kernel space? Is there any tricky notes? ANSWER: I found a post on linuxjournal.com about networking in kernel. May be helpful.
[ "sockets", "tcp", "kernel", "freebsd" ]
3
0
1,259
2
0
2011-06-01T14:48:43.970000
2011-06-04T04:39:10.203000
6,203,120
6,215,229
sharepoint 2010 sitemap duplicate node urls
Is there any way at all to disable a link on a node? For example, I would like to disable the "Dashboards" menu item/node, ie, clicking on it on the site will do nothing. Is this possible? thanks, KS
Ok, so I settled for second best. What is second best? Well, I set the main menu item to the same url as the first option beneath it. But you cannot have duplicate urls in the sitemap nodes I hear you say! Bypassed this by appending a querystring parameter to the end of the url. I changed dashboards like so: Not very e...
sharepoint 2010 sitemap duplicate node urls Is there any way at all to disable a link on a node? For example, I would like to disable the "Dashboards" menu item/node, ie, clicking on it on the site will do nothing. Is this possible? thanks, KS
TITLE: sharepoint 2010 sitemap duplicate node urls QUESTION: Is there any way at all to disable a link on a node? For example, I would like to disable the "Dashboards" menu item/node, ie, clicking on it on the site will do nothing. Is this possible? thanks, KS ANSWER: Ok, so I settled for second best. What is second ...
[ "sharepoint-2010", "sitemap" ]
0
0
675
1
0
2011-06-01T14:48:50.607000
2011-06-02T13:33:13.770000
6,203,124
6,203,403
(Not) Pointer Adjusting ruining my day and the heap? (C++)
-edit2- I was going down the wrong path. I solved it by correcting one typo and adding one line to fix an oversight that allowed me to write 4 bytes to many over an array. -edit- maybe i am running through a wrong path. Maybe VS is showing me incorrect data but still runs the code properly (after all my code does show ...
If you are using linux you might be able to use Valgrind. This is an exellent tool for finding heap related issues.
(Not) Pointer Adjusting ruining my day and the heap? (C++) -edit2- I was going down the wrong path. I solved it by correcting one typo and adding one line to fix an oversight that allowed me to write 4 bytes to many over an array. -edit- maybe i am running through a wrong path. Maybe VS is showing me incorrect data but...
TITLE: (Not) Pointer Adjusting ruining my day and the heap? (C++) QUESTION: -edit2- I was going down the wrong path. I solved it by correcting one typo and adding one line to fix an oversight that allowed me to write 4 bytes to many over an array. -edit- maybe i am running through a wrong path. Maybe VS is showing me ...
[ "c++", "casting", "heap-memory", "heap-corruption" ]
0
1
171
2
0
2011-06-01T14:49:08.680000
2011-06-01T15:09:50.963000
6,203,126
6,203,514
Type for ObservableCollection<T> to hold generic interface
Assume the following classes: public interface ITabViewModel {} public class FooTabViewModel: ITabViewModel {} public class BarTabViewModel: ITabViewModel {} public class MainWindowViewModel { private readonly ObservableCollection _tabs; public MainWindowViewModel( ITabViewModel fooTabViewModel ITabViewModel barTab...
There are two questions which you need to address: What value do you plan to get out of ITabViewModel if it doesn't have any members? How do you plan on using the Tabs property? My guess is that Tabs exposes a list of view models to the UI so it can create a view-specific representation of a tab for each. In that case,...
Type for ObservableCollection<T> to hold generic interface Assume the following classes: public interface ITabViewModel {} public class FooTabViewModel: ITabViewModel {} public class BarTabViewModel: ITabViewModel {} public class MainWindowViewModel { private readonly ObservableCollection _tabs; public MainWindowVi...
TITLE: Type for ObservableCollection<T> to hold generic interface QUESTION: Assume the following classes: public interface ITabViewModel {} public class FooTabViewModel: ITabViewModel {} public class BarTabViewModel: ITabViewModel {} public class MainWindowViewModel { private readonly ObservableCollection _tabs; p...
[ "c#", "generics", "interface", "dependency-injection" ]
2
3
2,051
1
0
2011-06-01T14:49:17.393000
2011-06-01T15:16:46.337000
6,203,155
6,203,233
IE-only text field background image
I'm attempting to fix my CSS to allow older IE's to view my web site as best as possible. I'm using 'border-radius' to style form fields giving them rounded corners. For the older IE's I'm using the background image below-- http://studio.allanbendy.com/sites/all/themes/studio_allanbendy_7/i/form-textfield-bg.gif.form-t...
Remove the background-attachment: fixed;. Because IE6 ignores this for non scrollable elements it's displayed there. But at all the attachment definition makes no sense, if you want to style a single element.
IE-only text field background image I'm attempting to fix my CSS to allow older IE's to view my web site as best as possible. I'm using 'border-radius' to style form fields giving them rounded corners. For the older IE's I'm using the background image below-- http://studio.allanbendy.com/sites/all/themes/studio_allanbe...
TITLE: IE-only text field background image QUESTION: I'm attempting to fix my CSS to allow older IE's to view my web site as best as possible. I'm using 'border-radius' to style form fields giving them rounded corners. For the older IE's I'm using the background image below-- http://studio.allanbendy.com/sites/all/the...
[ "css", "internet-explorer-8", "internet-explorer-7", "internet-explorer-6" ]
1
1
951
2
0
2011-06-01T14:51:25.500000
2011-06-01T14:57:22.387000
6,203,159
6,203,205
fscanf() only picking up first line of file
I have a tab delimited file that I am trying to convert to a tab delimited file. I am using C. I am getting stuck on trying to read the second line of the file. Now I just have an tens of thousand of lines repeating the first line. #include #include #define SELLERCODE A2LQ9QFN82X636 int main () { typedef char* string;...
Prefer fgets() to read the input and parse the lines in your program, using, for example, sscanf() or strtok(). fscanf is notoriously difficult to use. Your fscanf is not performing any conversions after the first line. It reads characters up to a TAB, then ignores the TAB, and reads more characters up to the next TAB....
fscanf() only picking up first line of file I have a tab delimited file that I am trying to convert to a tab delimited file. I am using C. I am getting stuck on trying to read the second line of the file. Now I just have an tens of thousand of lines repeating the first line. #include #include #define SELLERCODE A2LQ9QF...
TITLE: fscanf() only picking up first line of file QUESTION: I have a tab delimited file that I am trying to convert to a tab delimited file. I am using C. I am getting stuck on trying to read the second line of the file. Now I just have an tens of thousand of lines repeating the first line. #include #include #define ...
[ "c", "text-files", "scanf" ]
2
4
10,202
3
0
2011-06-01T14:51:47.533000
2011-06-01T14:55:19.360000
6,203,160
6,203,303
Can I put some tabs to the left and others to the right in a JTabbedPane?
Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs? Thanks!
No, unfortunately, those behaviors are not supported by Swing (or SWT, for that matter). (My interpretation of your question, since there seems to be some confusion, is that you were looking for behavior like this: )
Can I put some tabs to the left and others to the right in a JTabbedPane? Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs? Thanks!
TITLE: Can I put some tabs to the left and others to the right in a JTabbedPane? QUESTION: Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs? Thanks! ANSWER: No, unfortunately, those behaviors are not supported by S...
[ "java", "swing", "jtabbedpane" ]
3
2
635
3
0
2011-06-01T14:51:49.090000
2011-06-01T15:00:56.237000
6,203,162
6,224,108
Streaming MIDI API in Android
I am a MIDI based musical application author. In my application I am generating a.midi file with a small lib that I wrote and play it on MediaPlayer and that's enough for that app. However in the future app I plan to have more interactivity and that's where I would probably need a streaming API. As far as I know Androi...
You should check out libpd, which is a native port of PureData for both Android and iOS. It will provide you with access to the MIDI drivers of the system while still being able to prototype your software with very high-level tools.
Streaming MIDI API in Android I am a MIDI based musical application author. In my application I am generating a.midi file with a small lib that I wrote and play it on MediaPlayer and that's enough for that app. However in the future app I plan to have more interactivity and that's where I would probably need a streamin...
TITLE: Streaming MIDI API in Android QUESTION: I am a MIDI based musical application author. In my application I am generating a.midi file with a small lib that I wrote and play it on MediaPlayer and that's enough for that app. However in the future app I plan to have more interactivity and that's where I would probab...
[ "android", "midi" ]
1
3
4,920
3
0
2011-06-01T14:51:52.633000
2011-06-03T07:15:14.013000
6,203,164
6,203,215
Facebook "like" button which likes another page/URL
I have a list of links and on each individual page there's a "like" button to "like" that page. But I want a "like" button next to each link in the list which will like the URL of the link next to it (just like it would if you clicked on the link and then the "like" button). How do I do this? To create the button on ea...
You can use the iframe version of the Like Button, rather than FBML. The iframe requires that you pass the url as part of the query string. You can generate the iframe code here.
Facebook "like" button which likes another page/URL I have a list of links and on each individual page there's a "like" button to "like" that page. But I want a "like" button next to each link in the list which will like the URL of the link next to it (just like it would if you clicked on the link and then the "like" b...
TITLE: Facebook "like" button which likes another page/URL QUESTION: I have a list of links and on each individual page there's a "like" button to "like" that page. But I want a "like" button next to each link in the list which will like the URL of the link next to it (just like it would if you clicked on the link and...
[ "php", "facebook", "facebook-graph-api", "facebook-like" ]
3
6
7,001
4
0
2011-06-01T14:52:02.480000
2011-06-01T14:55:50.943000
6,203,169
6,203,346
What kind of validations should I use in my db models?
My form validators are pretty good, and if a form passes is_valid, all data should be ok to insert in the db. Should I still validate something on the db model? What else could there be validated on the db side? Because right now, except maybe for uniqueness ( which I can't do from my FormModel ), I can't think of anyt...
All data should be validated in the database if possible whether you validate from the front end or not. The first validation should be the datatype, for instance using a date datatype will ensure that no nondates can ever get into your database. If you have relationships between tables these absolutely must be enforce...
What kind of validations should I use in my db models? My form validators are pretty good, and if a form passes is_valid, all data should be ok to insert in the db. Should I still validate something on the db model? What else could there be validated on the db side? Because right now, except maybe for uniqueness ( whic...
TITLE: What kind of validations should I use in my db models? QUESTION: My form validators are pretty good, and if a form passes is_valid, all data should be ok to insert in the db. Should I still validate something on the db model? What else could there be validated on the db side? Because right now, except maybe for...
[ "django", "django-models" ]
0
2
81
2
0
2011-06-01T14:52:41.573000
2011-06-01T15:04:56.890000
6,203,173
6,203,225
Hover over label change rectangle background gradient
I have a rectange with several labels and images over it, and I have it so that when the user hovers their mouse over the rectangle the background changes to a gradient: However, when I hover over one of the labels that is over the rectangle the background gradient does not show. I want to make it so that the gradient ...
If by "over" you mean overlayed and not above you can wrap the contents in a Grid (for above you could do this as well i guess, but you should define rows & columns) and use a DataTrigger which triggers if the mouse is over the wrapping grid and not only the rectangle itself, e.g.: Alternatively if the label is overlay...
Hover over label change rectangle background gradient I have a rectange with several labels and images over it, and I have it so that when the user hovers their mouse over the rectangle the background changes to a gradient: However, when I hover over one of the labels that is over the rectangle the background gradient ...
TITLE: Hover over label change rectangle background gradient QUESTION: I have a rectange with several labels and images over it, and I have it so that when the user hovers their mouse over the rectangle the background changes to a gradient: However, when I hover over one of the labels that is over the rectangle the ba...
[ "c#", "wpf", "triggers", "styles" ]
0
1
1,172
2
0
2011-06-01T14:53:05.723000
2011-06-01T14:56:47.353000
6,203,187
6,204,038
How to make ribbon have different buttons enabled in different workbooks?
There is only one ribbon object in the add-in, so it's shared between all workbooks. How I can make different ribbon buttons enabled in different workbooks?
I assume you are talking about Ribbon XML as the designer tries to make it seem like the ribbon is more based on the document. If you are using Ribbon XML as I suspect, then this is very difficult and I would suggest two options. Either switch to the Ribbon Designer, which you can handle the Loaded and other events and...
How to make ribbon have different buttons enabled in different workbooks? There is only one ribbon object in the add-in, so it's shared between all workbooks. How I can make different ribbon buttons enabled in different workbooks?
TITLE: How to make ribbon have different buttons enabled in different workbooks? QUESTION: There is only one ribbon object in the add-in, so it's shared between all workbooks. How I can make different ribbon buttons enabled in different workbooks? ANSWER: I assume you are talking about Ribbon XML as the designer trie...
[ "excel", "vsto", "add-in" ]
0
1
231
1
0
2011-06-01T14:54:02.727000
2011-06-01T15:54:07.733000
6,203,189
6,203,344
Strange border on tabIndex on <p> element
I'm currently trying to make some show/hide content more accessible on a large site (in excess of 30,000 pages) and I've come across a weird bug when adding tabindex where a dotted border appears when clicking on the control to open the hidden content. The set up with p tag which you click to fadeIn a div which shows t...
whats about: #content div.showHide p.showHideTitle { outline: none!important; } You are setting the outline style for the pseudo class:focus but this may be "to late". Here a simple jsFiddle
Strange border on tabIndex on <p> element I'm currently trying to make some show/hide content more accessible on a large site (in excess of 30,000 pages) and I've come across a weird bug when adding tabindex where a dotted border appears when clicking on the control to open the hidden content. The set up with p tag whi...
TITLE: Strange border on tabIndex on <p> element QUESTION: I'm currently trying to make some show/hide content more accessible on a large site (in excess of 30,000 pages) and I've come across a weird bug when adding tabindex where a dotted border appears when clicking on the control to open the hidden content. The set...
[ "jquery", "html", "css", "tabindex" ]
15
23
14,761
6
0
2011-06-01T14:54:07.853000
2011-06-01T15:04:33.400000
6,203,193
6,204,170
how do I change the order of treenodes
I would like to change the order of System.Windows.Forms.TreeNodes on the same level. any suggestions on how this might be done in.net-2.0.
void MoveNodeUp(TreeNode node) { TreeNode parentNode = node.Parent; int originalIndex = node.Index; if (node.Index == 0) return; TreeNode ClonedNode = (TreeNode)node.Clone(); node.Remove(); parentNode.Nodes.Insert(originalIndex - 1, ClonedNode); parentNode.TreeView.SelectedNode = ClonedNode; }
how do I change the order of treenodes I would like to change the order of System.Windows.Forms.TreeNodes on the same level. any suggestions on how this might be done in.net-2.0.
TITLE: how do I change the order of treenodes QUESTION: I would like to change the order of System.Windows.Forms.TreeNodes on the same level. any suggestions on how this might be done in.net-2.0. ANSWER: void MoveNodeUp(TreeNode node) { TreeNode parentNode = node.Parent; int originalIndex = node.Index; if (node.Index...
[ "c#" ]
7
4
7,377
4
0
2011-06-01T14:54:23.880000
2011-06-01T16:01:34.747000
6,203,200
6,203,284
How to call javascript function from asp.net button click event
How do I call the showDialog from a asp.net button click event. My page is a contentpage that has a masterpage associated with it. I have tried the following I am also going to have to call this same function from a gridview template button to modify the record on the dialog. Tried to call the jquery dialog from a grid...
If you don't need to initiate a post back when you press this button, then making the overhead of a server control isn't necesary. If you still need to be able to do a post back, you can conditionally stop the rest of the button actions with a little different code:
How to call javascript function from asp.net button click event How do I call the showDialog from a asp.net button click event. My page is a contentpage that has a masterpage associated with it. I have tried the following I am also going to have to call this same function from a gridview template button to modify the r...
TITLE: How to call javascript function from asp.net button click event QUESTION: How do I call the showDialog from a asp.net button click event. My page is a contentpage that has a masterpage associated with it. I have tried the following I am also going to have to call this same function from a gridview template butt...
[ "javascript", "jquery", "asp.net", "content-pages" ]
5
9
113,469
2
0
2011-06-01T14:54:57.967000
2011-06-01T14:59:51.160000
6,203,216
6,230,658
iPhone app crashes due to KVO
My app is crashing occasionally and when I see the crash logs this is what i see, i have truncated the rest because the rest of the stuff changes based on where my app is crashing. 0 libobjc.A.dylib 0x32da1c98 objc_msgSend + 16 1 Foundation 0x338530ac NSKVOPendingNotificationCreate + 184 2 Foundation 0x33852fc8 NSKeyVa...
i figured out that i wasn't removing one of the observer in my class D dealloc.
iPhone app crashes due to KVO My app is crashing occasionally and when I see the crash logs this is what i see, i have truncated the rest because the rest of the stuff changes based on where my app is crashing. 0 libobjc.A.dylib 0x32da1c98 objc_msgSend + 16 1 Foundation 0x338530ac NSKVOPendingNotificationCreate + 184 2...
TITLE: iPhone app crashes due to KVO QUESTION: My app is crashing occasionally and when I see the crash logs this is what i see, i have truncated the rest because the rest of the stuff changes based on where my app is crashing. 0 libobjc.A.dylib 0x32da1c98 objc_msgSend + 16 1 Foundation 0x338530ac NSKVOPendingNotifica...
[ "iphone", "crash", "key-value-observing" ]
1
5
3,420
1
0
2011-06-01T14:55:52.383000
2011-06-03T17:41:20.030000