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,290,024
6,290,318
Search with pivot functionality in mysql
I need to implement a search in a MySQL table. It stores data in different rows, so I have used the pivot functionality in MySQL to fetch the data. It was working well when I need to search only one value (The table structure is below). | id | lead_id | form_id | field_number | value | =================================...
I don't fully understand conditions, but try to use a subquery. For example - SELECT * FROM ( SELECT lead_id, MAX(IF(ROUND(field_number, 1) = '2.3', value, 0)) AS 'Name', MAX(IF(ROUND(field_number, 1) = '4.3', value, 0)) AS 'City', MAX(IF(ROUND(field_number, 1) = '4.4', value, 0)) AS 'State', MAX(IF(ROUND(field_number,...
Search with pivot functionality in mysql I need to implement a search in a MySQL table. It stores data in different rows, so I have used the pivot functionality in MySQL to fetch the data. It was working well when I need to search only one value (The table structure is below). | id | lead_id | form_id | field_number | ...
TITLE: Search with pivot functionality in mysql QUESTION: I need to implement a search in a MySQL table. It stores data in different rows, so I have used the pivot functionality in MySQL to fetch the data. It was working well when I need to search only one value (The table structure is below). | id | lead_id | form_id...
[ "mysql", "search", "pivot" ]
0
2
161
1
0
2011-06-09T08:25:36.757000
2011-06-09T08:55:37.850000
6,290,029
6,290,100
editing data from an html table
I'm doing a Java ee "online shop" project for my uni, and one of the requirements is that an admin user should be able to edit products details. I have a html table that represents all products in my online store. The content for the table is taken from the database table. It looks like: ${product.name} ${product.price...
Not from a static html table per say that I know of, but you could provide a button that says edit, which leads to opening of an HTML form for your needs - http://www.w3schools.com/html/html_forms.asp Then use POST or GET request to send the data to the server.
editing data from an html table I'm doing a Java ee "online shop" project for my uni, and one of the requirements is that an admin user should be able to edit products details. I have a html table that represents all products in my online store. The content for the table is taken from the database table. It looks like:...
TITLE: editing data from an html table QUESTION: I'm doing a Java ee "online shop" project for my uni, and one of the requirements is that an admin user should be able to edit products details. I have a html table that represents all products in my online store. The content for the table is taken from the database tab...
[ "java", "html", "jsp" ]
0
0
3,544
5
0
2011-06-09T08:25:58.733000
2011-06-09T08:33:47.050000
6,290,037
6,291,072
Refactoring: Render buttons and wrap with div
Many of my pages contains an actions element like the example below. I was wondering if it would be possible to refactor this into a helper or partial. At first it looks very simple - just create a helper that wraps the button div. However I can't figure out how I can wrap the actions div when all the buttons has been ...
Is this the kind of thing you're after? Your view: <% render 'button',:custom_class => "customclass1",:button_text => "button1" %> <% render 'button',:custom_class => "customclass2",:button_text => "button2" %>... etc. _button.html.erb: <%= button_text %> You could then refactor further if you wished by creating a help...
Refactoring: Render buttons and wrap with div Many of my pages contains an actions element like the example below. I was wondering if it would be possible to refactor this into a helper or partial. At first it looks very simple - just create a helper that wraps the button div. However I can't figure out how I can wrap ...
TITLE: Refactoring: Render buttons and wrap with div QUESTION: Many of my pages contains an actions element like the example below. I was wondering if it would be possible to refactor this into a helper or partial. At first it looks very simple - just create a helper that wraps the button div. However I can't figure o...
[ "ruby-on-rails", "ruby" ]
0
1
792
1
0
2011-06-09T08:27:13.900000
2011-06-09T09:59:38.677000
6,290,038
6,290,268
How to pass parameter to custom Action script in InstallShield?
I made the following script "[SystemFolder]cmd.exe" /c "netsh advfirewall firewall add rule name="RuleName" action=allow protocol=TCP dir=in localport=399" and i made a dialog in setup that take the Port number and set it to a property called ServerPort.. now my question is how to pass this value to this script?
First you should change the property name to SERVER_PORT so it's public. Properties with lowercase letters do not pass their modified values to InstallExecuteSequence. After that, you can try something like this: "[SystemFolder]cmd.exe" /c "netsh advfirewall firewall add rule name="RuleName" action=allow protocol=TCP d...
How to pass parameter to custom Action script in InstallShield? I made the following script "[SystemFolder]cmd.exe" /c "netsh advfirewall firewall add rule name="RuleName" action=allow protocol=TCP dir=in localport=399" and i made a dialog in setup that take the Port number and set it to a property called ServerPort.. ...
TITLE: How to pass parameter to custom Action script in InstallShield? QUESTION: I made the following script "[SystemFolder]cmd.exe" /c "netsh advfirewall firewall add rule name="RuleName" action=allow protocol=TCP dir=in localport=399" and i made a dialog in setup that take the Port number and set it to a property ca...
[ "installshield" ]
0
2
2,830
1
0
2011-06-09T08:27:26.163000
2011-06-09T08:50:32.490000
6,290,039
6,290,080
how application's icon should show todays date
I am developing a calendar application. The icon of application must be updated each day based on the day's date. for example if today is 27 Aug, so the application's icon must show 27 and tomorrow show 28. Could you please help me that it is possible in iphone or not. thanks!
It is not possible on iPhone (at the moment). Application can have only the constant icon. However, you can show badge with digit (27, 28), that's not that nice of course.
how application's icon should show todays date I am developing a calendar application. The icon of application must be updated each day based on the day's date. for example if today is 27 Aug, so the application's icon must show 27 and tomorrow show 28. Could you please help me that it is possible in iphone or not. tha...
TITLE: how application's icon should show todays date QUESTION: I am developing a calendar application. The icon of application must be updated each day based on the day's date. for example if today is 27 Aug, so the application's icon must show 27 and tomorrow show 28. Could you please help me that it is possible in ...
[ "iphone", "objective-c", "xcode" ]
3
3
268
2
0
2011-06-09T08:27:30.193000
2011-06-09T08:31:51.893000
6,290,053
6,290,385
Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method
I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com. If I try to call it, I get the expected...: Origin http://someothersite.com is not allowed by Access-Control-Allow-Origin. I know of two ways to get around this: JSONP and creati...
For plain ASP.NET MVC Controllers Create a new attribute public class AllowCrossSiteJsonAttribute: ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { filterContext.RequestContext.HttpContext.Response.AddHeader("Access-Control-Allow-Origin", "*"); base.OnActionExecutin...
Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com. If I try to call it, I get the expected...: Origin http://someothersite.com is not allowed by Access...
TITLE: Setting Access-Control-Allow-Origin in ASP.Net MVC - simplest possible method QUESTION: I have a simple actionmethod, that returns some json. It runs on ajax.example.com. I need to access this from another site someothersite.com. If I try to call it, I get the expected...: Origin http://someothersite.com is not...
[ "json", "asp.net-mvc-3", "cors", "asp.net-ajax" ]
222
409
194,461
15
0
2011-06-09T08:29:18.883000
2011-06-09T09:00:12.120000
6,290,057
6,290,325
How decision tree calculate the splitting attribute?
When we are using any decision tree algorithm and our data set consists of numerical values. I have found that the results provided by the program splits the node on values that are not even exist in the data set Example: Classifications Results attrib2 <= 3.761791861252009: groupA attrib2 > 3.761791861252009: groupB w...
There are several ways to choose an attribute. And not all of them choose values in the data set. A common one (though a bit simplistic) is to take the mean. It is possible that 3.76179... is the mean of all attrib2 of your data set. For example, if your data set is 1 dimensional, and is made of the value -10, -9,.. -2...
How decision tree calculate the splitting attribute? When we are using any decision tree algorithm and our data set consists of numerical values. I have found that the results provided by the program splits the node on values that are not even exist in the data set Example: Classifications Results attrib2 <= 3.76179186...
TITLE: How decision tree calculate the splitting attribute? QUESTION: When we are using any decision tree algorithm and our data set consists of numerical values. I have found that the results provided by the program splits the node on values that are not even exist in the data set Example: Classifications Results att...
[ "machine-learning", "data-mining", "decision-tree" ]
5
8
10,172
3
0
2011-06-09T08:29:33.010000
2011-06-09T08:56:02.820000
6,290,073
6,290,244
Password stretching - a way to mitigate CPU flood
I'm now using password stretching for all user account passwords throughout all my websites. In the db I store an iteration count and randomly assigned salt along with the final hash. I'm using SHA512 as the hash algorithm. I'm using C# in.Net 3.5 and 4.0 (dual framework library) for this. For accounts that only ever g...
The idea of password stretching is to have the attacker do the heavy work: When a client wants to log in, the server presents a challenge. The client performs the resource-intensive calculations and sends a response to the server. The server should be able to determine whether the response is valid or not with very few...
Password stretching - a way to mitigate CPU flood I'm now using password stretching for all user account passwords throughout all my websites. In the db I store an iteration count and randomly assigned salt along with the final hash. I'm using SHA512 as the hash algorithm. I'm using C# in.Net 3.5 and 4.0 (dual framewor...
TITLE: Password stretching - a way to mitigate CPU flood QUESTION: I'm now using password stretching for all user account passwords throughout all my websites. In the db I store an iteration count and randomly assigned salt along with the final hash. I'm using SHA512 as the hash algorithm. I'm using C# in.Net 3.5 and ...
[ "c#", "security", "passwords" ]
4
3
1,370
4
0
2011-06-09T08:31:19.047000
2011-06-09T08:48:37.477000
6,290,081
6,290,207
removing table border
I cannot get rid of this table border. The initial HTML/CSS is from the ASP.NET MVC default. I removed a lot of code and added a table on top. @ViewBag.Title @Html.Partial("_LogOnPartial") @RenderBody() I've tried commenting out ALL the CSS, but I can't get rid of it. My only guess is that one of the cryptic.js files i...
Use Firebug to inspect the table in question, and see where does it inherit the border from. (check the right column). Try setting on-the-fly inline style border:none; to see if you get rid of it. Could also be the browsers default stylesheets. In this case, use a CSS reset. http://developer.yahoo.com/yui/reset/
removing table border I cannot get rid of this table border. The initial HTML/CSS is from the ASP.NET MVC default. I removed a lot of code and added a table on top. @ViewBag.Title @Html.Partial("_LogOnPartial") @RenderBody() I've tried commenting out ALL the CSS, but I can't get rid of it. My only guess is that one of ...
TITLE: removing table border QUESTION: I cannot get rid of this table border. The initial HTML/CSS is from the ASP.NET MVC default. I removed a lot of code and added a table on top. @ViewBag.Title @Html.Partial("_LogOnPartial") @RenderBody() I've tried commenting out ALL the CSS, but I can't get rid of it. My only gue...
[ "html", "css", "asp.net-mvc-3" ]
19
3
215,190
10
0
2011-06-09T08:31:57.777000
2011-06-09T08:45:31.053000
6,290,088
6,290,223
Struts2 Java Util date conversion problem
In my application i have one textfield which maps to date in action class. If i entered 15/12/2011 (MM/dd/yyyy) it automatically converts it to 03/12/2012(MM/dd/yyyy). My code is: jsp Page: Action class: private Date drDt; public Date getDrDt() { return drDt; } public void setDrDt(Date drDt) { this.drDt = drDt; } Prob...
This is the "default" behaviour. Otherwise, set dateFormat.setLenient() to false. Setting that to false will throw Exception upon encountering invalid date like the one in your example. You need to handle that gracefully. Perhaps, show a message to the user that the date entered is not correct or invalid. Precisely, ad...
Struts2 Java Util date conversion problem In my application i have one textfield which maps to date in action class. If i entered 15/12/2011 (MM/dd/yyyy) it automatically converts it to 03/12/2012(MM/dd/yyyy). My code is: jsp Page: Action class: private Date drDt; public Date getDrDt() { return drDt; } public void set...
TITLE: Struts2 Java Util date conversion problem QUESTION: In my application i have one textfield which maps to date in action class. If i entered 15/12/2011 (MM/dd/yyyy) it automatically converts it to 03/12/2012(MM/dd/yyyy). My code is: jsp Page: Action class: private Date drDt; public Date getDrDt() { return drDt; ...
[ "java", "struts2" ]
0
1
1,226
2
0
2011-06-09T08:32:36.463000
2011-06-09T08:46:50.130000
6,290,090
6,290,143
Check if an URL is a valid Google search URL
I'd like to check if an URL is a valid Google search URL (e.g. http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=car&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=8f6073eaa2ffaabc&biw=1280&bih=868 is a valid URL for a Google search for the word "car" whereas http://www.google.com/#sclient=psy&hl=en&site=&...
Just check for the presence of the q parameter: /[?&]q=[^&]+/ Wrap in parenthesis if you need to extract the search term: /[?&]q=([^&]+)/ Demo EDIT Actually, the correct regex is this, since the "query string" is in the hash of the URL: /[#&]q=([^&]+)/ Demo
Check if an URL is a valid Google search URL I'd like to check if an URL is a valid Google search URL (e.g. http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=car&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=8f6073eaa2ffaabc&biw=1280&bih=868 is a valid URL for a Google search for the word "car" whereas ht...
TITLE: Check if an URL is a valid Google search URL QUESTION: I'd like to check if an URL is a valid Google search URL (e.g. http://www.google.com/#sclient=psy&hl=en&site=&source=hp&q=car&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=8f6073eaa2ffaabc&biw=1280&bih=868 is a valid URL for a Google search for the wor...
[ "regex", "validation", "url" ]
3
2
828
1
0
2011-06-09T08:32:44.303000
2011-06-09T08:38:28.727000
6,290,093
6,290,334
What kind of computations can be offloaded to the GPU?
I've seen software being labeled as "GPU accelerated", but I wonder what that means in practice. I read that graphics(duh) and number crunching are good use cases, but by what criteria? In the end, graphics are just arrays of bits visualized. So could you use the GPU for linear algebra, or maybe even MapReduce? Number ...
I read that graphics(duh) and number crunching are good use cases, but by what criteria? Recent GPUs tend to have hundreds of core, many more than CPU. This would boost program performance when used efficiently (read: correctly parallelized). So could you use the GPU for linear algebra, or maybe even MapReduce? Number ...
What kind of computations can be offloaded to the GPU? I've seen software being labeled as "GPU accelerated", but I wonder what that means in practice. I read that graphics(duh) and number crunching are good use cases, but by what criteria? In the end, graphics are just arrays of bits visualized. So could you use the G...
TITLE: What kind of computations can be offloaded to the GPU? QUESTION: I've seen software being labeled as "GPU accelerated", but I wonder what that means in practice. I read that graphics(duh) and number crunching are good use cases, but by what criteria? In the end, graphics are just arrays of bits visualized. So c...
[ "optimization", "gpu" ]
0
1
516
2
0
2011-06-09T08:33:03.703000
2011-06-09T08:56:30.703000
6,290,094
6,290,299
Android disable screen saver
I'd like to disable screen saver while my appliction is running. How it can be done? Where is the best place to disable / enable the screen saver? in the first activity? in the application.java?
The wake lock permission must be specified in the manifest. Then in the activity use the following to keep the screen on while the activity is running. getWindow().addFlags(LayoutParams.FLAG_KEEP_SCREEN_ON); Remember that unnecessarily keeping the screen on unnecessarily drains power from the user's device.
Android disable screen saver I'd like to disable screen saver while my appliction is running. How it can be done? Where is the best place to disable / enable the screen saver? in the first activity? in the application.java?
TITLE: Android disable screen saver QUESTION: I'd like to disable screen saver while my appliction is running. How it can be done? Where is the best place to disable / enable the screen saver? in the first activity? in the application.java? ANSWER: The wake lock permission must be specified in the manifest. Then in t...
[ "android", "screensaver" ]
10
20
15,991
2
0
2011-06-09T08:33:11.490000
2011-06-09T08:53:26.570000
6,290,097
6,290,825
Is it possible to push a view controller without navigation controller?
i've just started to write an application and i want to write it without navigation controller thereis going to be some viewController EX: aviewController, bviewController... Is it possible to push to b class's view controller (bviewController) from aViewController wiyhout using navigation controller? With otherwords, ...
You could use a UINavigationController and push it, and hide the navigationbar.
Is it possible to push a view controller without navigation controller? i've just started to write an application and i want to write it without navigation controller thereis going to be some viewController EX: aviewController, bviewController... Is it possible to push to b class's view controller (bviewController) fro...
TITLE: Is it possible to push a view controller without navigation controller? QUESTION: i've just started to write an application and i want to write it without navigation controller thereis going to be some viewController EX: aviewController, bviewController... Is it possible to push to b class's view controller (bv...
[ "iphone", "objective-c", "xcode", "ipad", "uiviewcontroller" ]
2
4
10,163
3
0
2011-06-09T08:33:41.420000
2011-06-09T09:38:28.643000
6,290,105
6,290,211
Traversing a "list" tree and get the type(item) list with same structure in python?
"tree" structured list: [(1,1,(1,1,(1,"1"))),(1,1,1),(1,),1,(1,(1,("1")))] # may be more complex How to traversing it and print each item - I means the 1 and the "1"? How to generate type list with same structure? [('int','int',('int','int',('int','str'))),('int','int','int'),('int',),'int',('int',('int',('str')))] the...
You can create a generator that will traverse the tree for you for (1). def traverse(o, tree_types=(list, tuple)): if isinstance(o, tree_types): for value in o: for subvalue in traverse(value): yield subvalue else: yield o data = [(1,1,(1,1,(1,"1"))),(1,1,1),(1,),1,(1,(1,("1",)))] print list(traverse(data)) # prints [...
Traversing a "list" tree and get the type(item) list with same structure in python? "tree" structured list: [(1,1,(1,1,(1,"1"))),(1,1,1),(1,),1,(1,(1,("1")))] # may be more complex How to traversing it and print each item - I means the 1 and the "1"? How to generate type list with same structure? [('int','int',('int','...
TITLE: Traversing a "list" tree and get the type(item) list with same structure in python? QUESTION: "tree" structured list: [(1,1,(1,1,(1,"1"))),(1,1,1),(1,),1,(1,(1,("1")))] # may be more complex How to traversing it and print each item - I means the 1 and the "1"? How to generate type list with same structure? [('i...
[ "python", "list", "tree", "traversal" ]
2
4
2,473
3
0
2011-06-09T08:34:35.327000
2011-06-09T08:45:48.680000
6,290,109
6,290,212
Javascript inactivity timeout monitor
I am trying to implement an inactivity timeout monitor into my page so that when people are working from home, we can see whether they are actually at their desk or not. I'm using this Jquery plugin http://plugins.jquery.com/project/timeout which sets a timer running when the page is loaded, and if no ajax calls have b...
You can't, javascript alert() is blocking all scripts and input until they are dismissed. To do what you want, have a look at jQuery UI Dialog, or show your message as part of the DOM yourself.
Javascript inactivity timeout monitor I am trying to implement an inactivity timeout monitor into my page so that when people are working from home, we can see whether they are actually at their desk or not. I'm using this Jquery plugin http://plugins.jquery.com/project/timeout which sets a timer running when the page ...
TITLE: Javascript inactivity timeout monitor QUESTION: I am trying to implement an inactivity timeout monitor into my page so that when people are working from home, we can see whether they are actually at their desk or not. I'm using this Jquery plugin http://plugins.jquery.com/project/timeout which sets a timer runn...
[ "javascript", "jquery", "html", "ajax", "jquery-plugins" ]
0
1
931
2
0
2011-06-09T08:34:41.240000
2011-06-09T08:45:50.240000
6,290,114
6,290,192
"deadlock victim" in transaction, how to change the priority?
i have logged an exception thrown by an ASP.NET-Application. Message: Transaction (Process ID 56) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I'm sure that the reason for it was, that i was running some selects directly ...
SET DEADLOCK_PRIORITY allows you to fine tune the precedence You can specify this in your SSMS session (per query window) or globally:
"deadlock victim" in transaction, how to change the priority? i have logged an exception thrown by an ASP.NET-Application. Message: Transaction (Process ID 56) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction. I'm sure that th...
TITLE: "deadlock victim" in transaction, how to change the priority? QUESTION: i have logged an exception thrown by an ASP.NET-Application. Message: Transaction (Process ID 56) was deadlocked on lock | communication buffer resources with another process and has been chosen as the deadlock victim. Rerun the transaction...
[ "sql-server", "t-sql", "deadlock", "ssms", "database-deadlocks" ]
4
5
6,279
1
0
2011-06-09T08:35:13.757000
2011-06-09T08:43:58.133000
6,290,117
6,290,154
printf flush problem
I am modifying a big C code. For test purposes I had to redirect stdout to a file. I used this code snipped for this purpose: fp=freopen("OUT", "w",stdout) Now all printf calls will write to fp. It is a big code so I do not want to search all of the exit points and close the file before each exit. What happens if do no...
setvbuf is probably the way to go: setvbuf (fp, NULL, _IONBF, 0); This will turn off buffering altogether. Just be prepared for the inevitable performance hit. You also need to be aware that this will flush only at the runtime-library level in many systems, it will not necessarily cause a flush to the storage medium, a...
printf flush problem I am modifying a big C code. For test purposes I had to redirect stdout to a file. I used this code snipped for this purpose: fp=freopen("OUT", "w",stdout) Now all printf calls will write to fp. It is a big code so I do not want to search all of the exit points and close the file before each exit. ...
TITLE: printf flush problem QUESTION: I am modifying a big C code. For test purposes I had to redirect stdout to a file. I used this code snipped for this purpose: fp=freopen("OUT", "w",stdout) Now all printf calls will write to fp. It is a big code so I do not want to search all of the exit points and close the file ...
[ "c" ]
0
4
838
2
0
2011-06-09T08:35:32.563000
2011-06-09T08:39:41.650000
6,290,119
6,290,218
JQuery drop down list filter
I have first drop down list ddl1 which contains these values: Car Van and the second drop down list ddl2 contains: Car Honda Car BMW Van Golf I need a script that filters the second ddl for example when I choose Car, the second ddl should only show these two fields: Car Honda - Car BMW My code:
you will want something like this: Each List Item value in the second list should start with the same value of the item in the first list. This is so it can be filtered by the value of the first. EDIT: Items in drop downs. List 1: Car -Value = 001 Truck -Value = 002 Van -Value = 003 List 2: Car option 1 - Value = 00100...
JQuery drop down list filter I have first drop down list ddl1 which contains these values: Car Van and the second drop down list ddl2 contains: Car Honda Car BMW Van Golf I need a script that filters the second ddl for example when I choose Car, the second ddl should only show these two fields: Car Honda - Car BMW My c...
TITLE: JQuery drop down list filter QUESTION: I have first drop down list ddl1 which contains these values: Car Van and the second drop down list ddl2 contains: Car Honda Car BMW Van Golf I need a script that filters the second ddl for example when I choose Car, the second ddl should only show these two fields: Car Ho...
[ "jquery", "dom-manipulation" ]
0
0
946
1
0
2011-06-09T08:35:56.053000
2011-06-09T08:46:29.107000
6,290,124
6,290,248
Is there a way to compare two branches for differences/file versions in VS2010?
Does anyone know if there is a way to check if code from production hotfix branch is not newer than mainstream branch via diff tool of some sort? (hotfix1 vs thrunk) \src \thrunk \releases \hotfix1 I'm using vs2010 with TFS, but the branches have a lot of files, and all I came up with was comparing one file at a time, ...
Using the command line tool tf.exe you can compare two revisions of arbitrary files, but both have to be in your workspace. See online help on tf diff for details (and here for specifying versions). NB. In VS use Tools | Options | Source Control | Visual Studio Team Foundation Server | Configure User Tools to define wh...
Is there a way to compare two branches for differences/file versions in VS2010? Does anyone know if there is a way to check if code from production hotfix branch is not newer than mainstream branch via diff tool of some sort? (hotfix1 vs thrunk) \src \thrunk \releases \hotfix1 I'm using vs2010 with TFS, but the branche...
TITLE: Is there a way to compare two branches for differences/file versions in VS2010? QUESTION: Does anyone know if there is a way to check if code from production hotfix branch is not newer than mainstream branch via diff tool of some sort? (hotfix1 vs thrunk) \src \thrunk \releases \hotfix1 I'm using vs2010 with TF...
[ "visual-studio-2010", "tfs", "diff", "tfvc" ]
39
5
40,247
7
0
2011-06-09T08:36:28.027000
2011-06-09T08:49:00.230000
6,290,132
6,290,234
Why price changes on iTunesConnect are not being reflected on the App Store?
I want to change the price of my app from $0.99 to free. I changed price tier to free on iTunesConnect and saved, but this is not affecting the price shown on the App Store for my app. Why is this happening?
You should wait some time before the change will appear on the App Store. Apple says it could take few hours for changes to appear correctly. If things do not change after 24 hour you should contact the official Apple Support team.
Why price changes on iTunesConnect are not being reflected on the App Store? I want to change the price of my app from $0.99 to free. I changed price tier to free on iTunesConnect and saved, but this is not affecting the price shown on the App Store for my app. Why is this happening?
TITLE: Why price changes on iTunesConnect are not being reflected on the App Store? QUESTION: I want to change the price of my app from $0.99 to free. I changed price tier to free on iTunesConnect and saved, but this is not affecting the price shown on the App Store for my app. Why is this happening? ANSWER: You shou...
[ "iphone", "app-store", "app-store-connect" ]
21
25
9,289
2
0
2011-06-09T08:37:25.623000
2011-06-09T08:47:53.583000
6,290,136
6,290,204
YouTube API for a channel from a specific user
I was looking at channels in YouTube and saw this link below and other stackoverflow messages. http://code.google.com/apis/youtube/2.0/developers_guide_protocol_channel_search.html My question is, is it possible to return a YouTube channel from a specific user? For instance, say I wanted the channel of.. http://www.you...
You could search by author. See: http://code.google.com/apis/youtube/2.0/developers_guide_protocol_api_query_parameters.html#authorsp Example API uri: http://gdata.youtube.com/feeds/api/videos?author=NationalGeographic&v=2&alt=json
YouTube API for a channel from a specific user I was looking at channels in YouTube and saw this link below and other stackoverflow messages. http://code.google.com/apis/youtube/2.0/developers_guide_protocol_channel_search.html My question is, is it possible to return a YouTube channel from a specific user? For instanc...
TITLE: YouTube API for a channel from a specific user QUESTION: I was looking at channels in YouTube and saw this link below and other stackoverflow messages. http://code.google.com/apis/youtube/2.0/developers_guide_protocol_channel_search.html My question is, is it possible to return a YouTube channel from a specific...
[ "youtube-api" ]
2
8
14,085
1
0
2011-06-09T08:37:41.603000
2011-06-09T08:45:17.290000
6,290,146
6,290,210
How to split a path properly in PHP
What is the best way to do the following: I get a path with an AJAX request e.g. dir1/dir2/dir3/dir4 I need to present it like this on my webpage: dir1 >> dir2 >> dir3 >> dir4 each of them being html anchor tags with the href attribute being /dir1 /dir1/dir2 /dir1/dir2/dir3 /dir1/dir2/dir3/dir4 respectively What is ...
Something like this maybe (if I got your intention right): $chunk) { $output[] = sprintf( ' %s ', implode('/', array_slice($chunks, 0, $i + 1)), $chunk ); } echo implode(' >> ', $output); Output: dir1 >> dir2 >> dir3 >> dir4
How to split a path properly in PHP What is the best way to do the following: I get a path with an AJAX request e.g. dir1/dir2/dir3/dir4 I need to present it like this on my webpage: dir1 >> dir2 >> dir3 >> dir4 each of them being html anchor tags with the href attribute being /dir1 /dir1/dir2 /dir1/dir2/dir3 /dir1/...
TITLE: How to split a path properly in PHP QUESTION: What is the best way to do the following: I get a path with an AJAX request e.g. dir1/dir2/dir3/dir4 I need to present it like this on my webpage: dir1 >> dir2 >> dir3 >> dir4 each of them being html anchor tags with the href attribute being /dir1 /dir1/dir2 /dir1...
[ "php", "path", "split" ]
14
14
23,840
5
0
2011-06-09T08:39:00.527000
2011-06-09T08:45:42.597000
6,290,150
6,290,313
List elements matching on their type
I've got a code similar to one below: def walkTree(list:List[Command]) { list match { case Command1::rest => doSomething(); walkTree(rest) case Command2::rest => doSomethingElse(); walkTree(rest) case Nil =>; } } I also know that you can pattern match on specific type and assign a variable at the same time: try {... } ...
Yes, just use parentheses like this (see example below): def walkTree(list:List[Command]) { list match { case (cmd1:Command1)::rest => doSomething(); walkTree(rest) case (cmd2:Command2)::rest => doSomethingElse(); walkTree(rest) case Nil =>; } } However, can't you use foreach for this: scala> List(A(1), B(2), A(3), B(4...
List elements matching on their type I've got a code similar to one below: def walkTree(list:List[Command]) { list match { case Command1::rest => doSomething(); walkTree(rest) case Command2::rest => doSomethingElse(); walkTree(rest) case Nil =>; } } I also know that you can pattern match on specific type and assign a v...
TITLE: List elements matching on their type QUESTION: I've got a code similar to one below: def walkTree(list:List[Command]) { list match { case Command1::rest => doSomething(); walkTree(rest) case Command2::rest => doSomethingElse(); walkTree(rest) case Nil =>; } } I also know that you can pattern match on specific t...
[ "list", "scala", "pattern-matching" ]
9
18
5,277
2
0
2011-06-09T08:39:27.993000
2011-06-09T08:54:35.003000
6,290,156
6,290,208
a char coding problem with apache httpclient and servlet
hi i'm communicating between an http client post techniq and a servlet. if i send english chars there is no problem but if i send in hebrew i get????? instead of hebrew, and i use UTF-8. here is the client's code HttpPost post = new HttpPost("http://localhost:8080/dropboxweb/Delete"); try { List nameValuePairs = new A...
Refer to this, (it helped me) What can you recommend to just make everything work? (How to use UTF-8 everywhere) http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q3
a char coding problem with apache httpclient and servlet hi i'm communicating between an http client post techniq and a servlet. if i send english chars there is no problem but if i send in hebrew i get????? instead of hebrew, and i use UTF-8. here is the client's code HttpPost post = new HttpPost("http://localhost:808...
TITLE: a char coding problem with apache httpclient and servlet QUESTION: hi i'm communicating between an http client post techniq and a servlet. if i send english chars there is no problem but if i send in hebrew i get????? instead of hebrew, and i use UTF-8. here is the client's code HttpPost post = new HttpPost("ht...
[ "servlets", "character-encoding" ]
0
0
2,844
3
0
2011-06-09T08:39:58.123000
2011-06-09T08:45:35
6,290,161
6,290,434
How to apply open-closed principle when creating objects
I'm busy parsing xml documents (google docs api) and putting individual documents into objects. There are different types of documents (documents, spreadsheets, presentations). Most information about these documents is the same, but some is different. The idea was to create a base document class which holds all the sha...
Updated answer with your code example Here is your new factory: public static function factory(SimpleXMLElement $element) { $element->registerXPathNamespace("d", "http://www.w3.org/2005/Atom"); $category = $element->xpath("d:category[@scheme='http://schemas.google.com/g/2005#kind']"); $className = 'Model_Google_ '.$cat...
How to apply open-closed principle when creating objects I'm busy parsing xml documents (google docs api) and putting individual documents into objects. There are different types of documents (documents, spreadsheets, presentations). Most information about these documents is the same, but some is different. The idea wa...
TITLE: How to apply open-closed principle when creating objects QUESTION: I'm busy parsing xml documents (google docs api) and putting individual documents into objects. There are different types of documents (documents, spreadsheets, presentations). Most information about these documents is the same, but some is diff...
[ "php", "open-closed-principle" ]
4
4
511
3
0
2011-06-09T08:40:43.483000
2011-06-09T09:05:44.887000
6,290,172
6,290,201
Qt smart pointer equivalent to Boost::shared_ptr ?
I have used Boost::shared_ptr in my previous projects and now I want to find a smart-pointer in Qt which does the same/similar thing. Since there are many smart-pointer classes in Qt I was wondering which one to use. Is it QSharedPointer?
You want QSharedPointer. You'll find a comparison of all the pointer classes offered by Qt in the detailed description of QSharedPointer.
Qt smart pointer equivalent to Boost::shared_ptr ? I have used Boost::shared_ptr in my previous projects and now I want to find a smart-pointer in Qt which does the same/similar thing. Since there are many smart-pointer classes in Qt I was wondering which one to use. Is it QSharedPointer?
TITLE: Qt smart pointer equivalent to Boost::shared_ptr ? QUESTION: I have used Boost::shared_ptr in my previous projects and now I want to find a smart-pointer in Qt which does the same/similar thing. Since there are many smart-pointer classes in Qt I was wondering which one to use. Is it QSharedPointer? ANSWER: You...
[ "c++", "boost", "qt4", "smart-pointers", "qsharedpointer" ]
4
5
2,349
3
0
2011-06-09T08:41:51.757000
2011-06-09T08:44:52.930000
6,290,173
6,290,190
Regex pattern for capital letters and numbers only, with possible 'List'
What is the regex to match words that have the pattern: Number or Capital in any order * 3 (+possible 'List' on the end) For example, OP3 G6H ZZAList 349 127List are all valid, whereas a3G P-0List HYiList def YHr are all invalid.
You can use the regex: ^[A-Z0-9]{3}(?:List)?$ Explanation: ^: Start anchor [A-Z0-9]: Char class to match any one of the uppercase letter or digit {3}: Quantifier for previous sub-regex (?:List): A literal 'List' enclosed in non-capturing paranthesis?: To make the 'List' optional $: End anchor See it
Regex pattern for capital letters and numbers only, with possible 'List' What is the regex to match words that have the pattern: Number or Capital in any order * 3 (+possible 'List' on the end) For example, OP3 G6H ZZAList 349 127List are all valid, whereas a3G P-0List HYiList def YHr are all invalid.
TITLE: Regex pattern for capital letters and numbers only, with possible 'List' QUESTION: What is the regex to match words that have the pattern: Number or Capital in any order * 3 (+possible 'List' on the end) For example, OP3 G6H ZZAList 349 127List are all valid, whereas a3G P-0List HYiList def YHr are all invalid....
[ "regex", "numbers", "capitalization" ]
44
80
106,680
2
0
2011-06-09T08:41:51.823000
2011-06-09T08:43:52.257000
6,290,177
6,291,150
Why many local ports were opened in simple sql connection?
I have an application that simply opens an SqlConnection to a remote host. My code is something like this: SqlConnection sc = new SqlConnection(); sc.ConnectionString = sConnectionString; sc.Open(); I ran the application while my network monitoring tool is open. I noticed that there were 4 local ports opened that commu...
If you have permissions to see the open database connections in the remote database server, compare this to the tcp/ip connections open in the machine hosting the application. If the number of connections open on the database server match with the corresponding tcp/ip connections, you can be sure that there are multipl...
Why many local ports were opened in simple sql connection? I have an application that simply opens an SqlConnection to a remote host. My code is something like this: SqlConnection sc = new SqlConnection(); sc.ConnectionString = sConnectionString; sc.Open(); I ran the application while my network monitoring tool is open...
TITLE: Why many local ports were opened in simple sql connection? QUESTION: I have an application that simply opens an SqlConnection to a remote host. My code is something like this: SqlConnection sc = new SqlConnection(); sc.ConnectionString = sConnectionString; sc.Open(); I ran the application while my network monit...
[ ".net", "connection", "network-traffic" ]
1
1
380
2
0
2011-06-09T08:41:55.373000
2011-06-09T10:07:36.457000
6,290,197
6,290,849
MATLAB conditional code execution based on cputime
I have a MATLAB code which for some of the input cases takes an infinite time to execute. I would like to exluce from the execution of my code those input values which make my MATLAB function to take more than X minutes to execute, as MATLAB realises the execution is taking too long. Do you know any way of doing this? ...
If you're running in a loop that you have some control over, you can use tic and toc to find out how long you've been going for, and stop if that was too long: start = tic; for i=1:1000000 if (mod(i,1000)==0) if (toc(start) > 2) % here, 2 seconds error('Took toooo loooong'); end end end
MATLAB conditional code execution based on cputime I have a MATLAB code which for some of the input cases takes an infinite time to execute. I would like to exluce from the execution of my code those input values which make my MATLAB function to take more than X minutes to execute, as MATLAB realises the execution is t...
TITLE: MATLAB conditional code execution based on cputime QUESTION: I have a MATLAB code which for some of the input cases takes an infinite time to execute. I would like to exluce from the execution of my code those input values which make my MATLAB function to take more than X minutes to execute, as MATLAB realises ...
[ "matlab", "concurrency" ]
1
3
1,089
1
0
2011-06-09T08:44:37.387000
2011-06-09T09:40:06.590000
6,290,198
6,290,508
Rails 3 - saving data with using CONTROLLER.new(params[:controller])
I am newbie in Rails and now I am solving situation, how to most effectively save data into database. My form contains 10 inputs (= 10 columns in table) and the 11th input is for file. If I'll used @mail = Mail.find(params[:id]).save So I'll get something like this to my table (colum): ---!ruby/object:ActionDispatch::H...
There is a standard way of assigning attributes to models: @mail = Mail.find(params[:id]) @mail.attributes = params[:mail] if @mail.save #...and so on. You may define all the necessary accessors, which do not need to be the same as the columns in the database, and you may want to read about accepts_nested_attributes_fo...
Rails 3 - saving data with using CONTROLLER.new(params[:controller]) I am newbie in Rails and now I am solving situation, how to most effectively save data into database. My form contains 10 inputs (= 10 columns in table) and the 11th input is for file. If I'll used @mail = Mail.find(params[:id]).save So I'll get somet...
TITLE: Rails 3 - saving data with using CONTROLLER.new(params[:controller]) QUESTION: I am newbie in Rails and now I am solving situation, how to most effectively save data into database. My form contains 10 inputs (= 10 columns in table) and the 11th input is for file. If I'll used @mail = Mail.find(params[:id]).save...
[ "database", "ruby-on-rails-3", "file-upload" ]
0
1
831
1
0
2011-06-09T08:44:37.383000
2011-06-09T09:10:33.233000
6,290,214
6,290,315
SqlException: Incorrect syntax near the keyword 'AS'
I checked the parameters, and fields, nothing is mispelled,But I still get that error.. StringBuilder sb = new StringBuilder(); sb.Append("SELECT u.Name,t.ThreadTitle,t.Date, t.Views,t.Replies,p.Theme,p.Topics,t.PageNumber"); sb.Append("FROM Users AS u"); sb.Append("INNER JOIN Threads AS t ON u.UserID=t.UserID"); sb.Ap...
Try this: StringBuilder sb = new StringBuilder(); sb.Append("SELECT u.Name,t.ThreadTitle,t.Date, t.Views,t.Replies,p.Theme,p.Topics,t.PageNumber"); sb.Append(" FROM Users AS u"); sb.Append(" INNER JOIN Threads AS t ON u.UserID=t.UserID"); sb.Append(" INNER JOIN Topics AS p ON p.TopicID=t.TopicID"); sb.Append(" WHERE u....
SqlException: Incorrect syntax near the keyword 'AS' I checked the parameters, and fields, nothing is mispelled,But I still get that error.. StringBuilder sb = new StringBuilder(); sb.Append("SELECT u.Name,t.ThreadTitle,t.Date, t.Views,t.Replies,p.Theme,p.Topics,t.PageNumber"); sb.Append("FROM Users AS u"); sb.Append("...
TITLE: SqlException: Incorrect syntax near the keyword 'AS' QUESTION: I checked the parameters, and fields, nothing is mispelled,But I still get that error.. StringBuilder sb = new StringBuilder(); sb.Append("SELECT u.Name,t.ThreadTitle,t.Date, t.Views,t.Replies,p.Theme,p.Topics,t.PageNumber"); sb.Append("FROM Users A...
[ "c#", "asp.net", "sql" ]
0
0
1,537
3
0
2011-06-09T08:46:02.010000
2011-06-09T08:55:12.710000
6,290,222
6,290,283
Numpy - square root of -1 leaves a small real part
Perhaps this is an algorithmic issue, but the following piece of code numpy.power((-1+0j),0.5) produces the following output (6.1230317691118863e-17+1j) Analogous expressions e.g. numpy.power(complex(-1),.5) yield the same result, however - numpy.sqrt(complex(-1)) yields the expected result of 1j. Clearly the result sh...
It's a side effect of the implementation of numpy.power() for complex numbers. The stdlib exhibits the same issue. >>> numpy.power(-1+0j, 0.5) (6.123233995736766e-17+1j) >>> cmath.exp(cmath.log(-1)/2) (6.123233995736766e-17+1j)
Numpy - square root of -1 leaves a small real part Perhaps this is an algorithmic issue, but the following piece of code numpy.power((-1+0j),0.5) produces the following output (6.1230317691118863e-17+1j) Analogous expressions e.g. numpy.power(complex(-1),.5) yield the same result, however - numpy.sqrt(complex(-1)) yiel...
TITLE: Numpy - square root of -1 leaves a small real part QUESTION: Perhaps this is an algorithmic issue, but the following piece of code numpy.power((-1+0j),0.5) produces the following output (6.1230317691118863e-17+1j) Analogous expressions e.g. numpy.power(complex(-1),.5) yield the same result, however - numpy.sqrt...
[ "python", "numpy", "floating-point", "square-root" ]
14
9
2,819
3
0
2011-06-09T08:46:47.650000
2011-06-09T08:51:26.020000
6,290,225
6,290,426
Can be displayed a vector-graphic image on a webpage?
I have read about SVG object that are supported in some browsers. What about full vector-graphic images?
In order to display a CorelDraw image on a web page, the web browser needs to understand the CDR image format. Since it is a complex, proprietary (not open) format, an out-of-the-box web browser will very likely not be able to understand it, hence not be able to display it. If the user has a browser plugin installed th...
Can be displayed a vector-graphic image on a webpage? I have read about SVG object that are supported in some browsers. What about full vector-graphic images?
TITLE: Can be displayed a vector-graphic image on a webpage? QUESTION: I have read about SVG object that are supported in some browsers. What about full vector-graphic images? ANSWER: In order to display a CorelDraw image on a web page, the web browser needs to understand the CDR image format. Since it is a complex, ...
[ "html", "svg" ]
0
0
919
1
0
2011-06-09T08:47:06.980000
2011-06-09T09:05:05.083000
6,290,228
6,290,275
epoll message server
I want to create a message server using epoll. Several devices will connect to the server and exchange simple text messages. I don't have that much experience with this and I will be very appreciated if you guys can provide me any references or tutorials related to this. I would like to work with C. Thanks in advance. ...
I would suggest you start by taking a look here, and keeping this close as a reference.
epoll message server I want to create a message server using epoll. Several devices will connect to the server and exchange simple text messages. I don't have that much experience with this and I will be very appreciated if you guys can provide me any references or tutorials related to this. I would like to work with C...
TITLE: epoll message server QUESTION: I want to create a message server using epoll. Several devices will connect to the server and exchange simple text messages. I don't have that much experience with this and I will be very appreciated if you guys can provide me any references or tutorials related to this. I would l...
[ "c", "epoll" ]
2
0
3,638
3
0
2011-06-09T08:47:26.283000
2011-06-09T08:51:01.790000
6,290,230
6,290,322
How to make a UIBarButtonItem like this
How can I make a UIBarButtonItem like this: I can't find it in the SystemItem values. Thanks
That's probably using something like: [[UIBarButtonItem alloc] initWithImage:@"info.png" style:UIBarButtonItemStyleBordered target:nil action:nil] I tried with: UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:[UIButton buttonWithType:UIButtonTypeInfoLight]]; item.style = UIBarButtonItemStyleBordered...
How to make a UIBarButtonItem like this How can I make a UIBarButtonItem like this: I can't find it in the SystemItem values. Thanks
TITLE: How to make a UIBarButtonItem like this QUESTION: How can I make a UIBarButtonItem like this: I can't find it in the SystemItem values. Thanks ANSWER: That's probably using something like: [[UIBarButtonItem alloc] initWithImage:@"info.png" style:UIBarButtonItemStyleBordered target:nil action:nil] I tried with:...
[ "objective-c", "cocoa-touch", "ios", "uibarbuttonitem" ]
3
7
6,360
3
0
2011-06-09T08:47:31.753000
2011-06-09T08:55:56.103000
6,290,235
6,290,356
jquery expanding menu how to?
I want to build a menu like this: http://wearebuild.com/ Try to click "Selected Works" How can I make a div with child elements grow like it does in the menu? Can anyone point me in a starting direction?
Start by looking at the way they do it. The script is in there: http://wearebuild.com/wp-content/themes/build-2.5/js/wearebuild.min.js. It is minified but legible enough to find out which jQuery methods they are using.
jquery expanding menu how to? I want to build a menu like this: http://wearebuild.com/ Try to click "Selected Works" How can I make a div with child elements grow like it does in the menu? Can anyone point me in a starting direction?
TITLE: jquery expanding menu how to? QUESTION: I want to build a menu like this: http://wearebuild.com/ Try to click "Selected Works" How can I make a div with child elements grow like it does in the menu? Can anyone point me in a starting direction? ANSWER: Start by looking at the way they do it. The script is in th...
[ "jquery", "jquery-ui" ]
0
1
129
1
0
2011-06-09T08:47:57.493000
2011-06-09T08:58:16.750000
6,290,253
6,290,538
Can you tell PHP to send headers (like 500) when an error occurs?
In my current project I'm querying PHP with normal HTTP-request but also via AJAX where I sometimes return JSON-formatted data and sometimes normal text. When an error occurs, in a normal request, you see the error-message and can do something about it. With AJAX-requests on the other hand you cannot be sure if you get...
i prefer using Exceptions for handling errors. First, you need to install error-to-exception error handler (http://php.net/manual/en/class.errorexception.php, example 1), then wrap your main application code in a try-catch block and send appropriate headers in the catch part. For example: try { $myApplication->run(); }...
Can you tell PHP to send headers (like 500) when an error occurs? In my current project I'm querying PHP with normal HTTP-request but also via AJAX where I sometimes return JSON-formatted data and sometimes normal text. When an error occurs, in a normal request, you see the error-message and can do something about it. ...
TITLE: Can you tell PHP to send headers (like 500) when an error occurs? QUESTION: In my current project I'm querying PHP with normal HTTP-request but also via AJAX where I sometimes return JSON-formatted data and sometimes normal text. When an error occurs, in a normal request, you see the error-message and can do so...
[ "php", "error-handling" ]
3
7
6,233
5
0
2011-06-09T08:49:13.920000
2011-06-09T09:12:35.037000
6,290,264
6,290,578
Confusion on health monitoring in asp.net
Even i set enabled="false" in healthMonitoring element in machine-level web.config, asp.net captures the unhandled exception and does the entry on windows event log. So, can you please tell me. Can we enable / disable the health monitoring in machine-level? Your answers is appreciated.
I think this is the normal behavior for any ASP.NET website when any unhandled exception occur. if you are not handling it with your code, or at least providing a 404 page for non-exisitng resources, the event will bubble up to WIndows event log. you can use any of the following methods in order to prevent Windows even...
Confusion on health monitoring in asp.net Even i set enabled="false" in healthMonitoring element in machine-level web.config, asp.net captures the unhandled exception and does the entry on windows event log. So, can you please tell me. Can we enable / disable the health monitoring in machine-level? Your answers is appr...
TITLE: Confusion on health monitoring in asp.net QUESTION: Even i set enabled="false" in healthMonitoring element in machine-level web.config, asp.net captures the unhandled exception and does the entry on windows event log. So, can you please tell me. Can we enable / disable the health monitoring in machine-level? Yo...
[ "asp.net" ]
2
1
866
1
0
2011-06-09T08:50:18.647000
2011-06-09T09:16:33.300000
6,290,284
6,290,342
Create own function that checks for null value and returns an empty string
If I have a class like below, how would I create the function nullToEmptyString()? If object is DBNull.Value then return an empty string, otherwise return the value. The function should work on every object in person. public class Person { public object surname { get; set; } public object lastname { get; set; } public ...
public static string nullToEmptyString(this string dbStr) { return (dbStr == null || dbStr == "")? "": dbStr; } foreach (var person in listFromDB) { Response.Write(person.surname.nullToEmptyString()); Response.Write(person.lastname.nullToEmptyString()); } Hope this helps.
Create own function that checks for null value and returns an empty string If I have a class like below, how would I create the function nullToEmptyString()? If object is DBNull.Value then return an empty string, otherwise return the value. The function should work on every object in person. public class Person { publi...
TITLE: Create own function that checks for null value and returns an empty string QUESTION: If I have a class like below, how would I create the function nullToEmptyString()? If object is DBNull.Value then return an empty string, otherwise return the value. The function should work on every object in person. public cl...
[ "asp.net-mvc", "function" ]
0
1
159
2
0
2011-06-09T08:51:35.637000
2011-06-09T08:57:10.107000
6,290,301
6,291,564
SSRS Calculated field problem
I'm trying to add a calculated field in a dataset with the following formula: =iif(Fields!Stocabil.Value,Fields!ValoareFacturat.Value,0) but using this formula, I'm not getting 0 values on false condition (Stocabil field is boolean), it's returning null probably. I found a workaround that resolve my problem but I reall...
As I said, I can't reproduce your problem, and I can't see why what you've done shouldn't work. As discussed in the comments, though, a workaround is to use CDbl(), which will force the value to a double, and should display a zero for you.
SSRS Calculated field problem I'm trying to add a calculated field in a dataset with the following formula: =iif(Fields!Stocabil.Value,Fields!ValoareFacturat.Value,0) but using this formula, I'm not getting 0 values on false condition (Stocabil field is boolean), it's returning null probably. I found a workaround that ...
TITLE: SSRS Calculated field problem QUESTION: I'm trying to add a calculated field in a dataset with the following formula: =iif(Fields!Stocabil.Value,Fields!ValoareFacturat.Value,0) but using this formula, I'm not getting 0 values on false condition (Stocabil field is boolean), it's returning null probably. I found ...
[ "reporting-services" ]
0
1
2,188
2
0
2011-06-09T08:53:29.577000
2011-06-09T10:44:25.837000
6,290,302
6,290,415
Usercontrol for reusable Listview in WPF
I am a programmer for winforms and asp.net. A new-comer to WPF application development. I wish to thank in advance for any help rendered to my query, I am working on a application for Banking. My job profile is to develop reusable usercontrols for the application. An example would be to make a Simple numeric input box ...
My approach to this problem would be: Create a UserControl that hosts a DataGrid Add a ColumnNames dependency property to the UserControl. In the PropertyChanged event handler, parse the CSV and update the DataGrid.Column accordingly. Add a Data dependency property to the UserControl - and when this changes, parse the ...
Usercontrol for reusable Listview in WPF I am a programmer for winforms and asp.net. A new-comer to WPF application development. I wish to thank in advance for any help rendered to my query, I am working on a application for Banking. My job profile is to develop reusable usercontrols for the application. An example wou...
TITLE: Usercontrol for reusable Listview in WPF QUESTION: I am a programmer for winforms and asp.net. A new-comer to WPF application development. I wish to thank in advance for any help rendered to my query, I am working on a application for Banking. My job profile is to develop reusable usercontrols for the applicati...
[ "wpf", "listview", "observablecollection" ]
0
0
780
1
0
2011-06-09T08:53:36.447000
2011-06-09T09:03:32.967000
6,290,305
6,290,414
c# Anonymous method, class property value rollbacks between function calls
I have code like this: public class SomeClass { private bool Flag; public void OnBar() //this is called from DoSomething(); { if (Flag) //For some reason Flag=false } public void OnFoo() //this is called from some anonymous method (not mine) { Flag = true; DoSomething(); } } The Callstack looks like this: AnonymousMe...
That definitively has nothing to do with anonymous methods. It must be something that happens inside DoSomething. There are basically two possibilities: 1) Flag is re-set in DoSomething: private void DoSomething() { Flag = false; OnBar(); } 2) DoSomething creates a new instance of SomeClass and calls OnBar on that: pri...
c# Anonymous method, class property value rollbacks between function calls I have code like this: public class SomeClass { private bool Flag; public void OnBar() //this is called from DoSomething(); { if (Flag) //For some reason Flag=false } public void OnFoo() //this is called from some anonymous method (not mine) {...
TITLE: c# Anonymous method, class property value rollbacks between function calls QUESTION: I have code like this: public class SomeClass { private bool Flag; public void OnBar() //this is called from DoSomething(); { if (Flag) //For some reason Flag=false } public void OnFoo() //this is called from some anonymous m...
[ "c#" ]
0
3
139
1
0
2011-06-09T08:53:57.833000
2011-06-09T09:03:21.310000
6,290,306
6,291,448
Partial eager loading child entity (load specific fileds)
I searched a bit and understands that I can use projection to partially load an entity, the question becomes is there a way to partially eager loading a child? Say I have the following Entity A has Id Name EntityB and Entity B has Id StuffToBeLoaded1 StuffToBeLoaded2 OtherStuffNotToBeLoaded How can I load A with B, and...
You must use custom query with a projection. If EntityB property represents collection you can use something like: var query = from a in context.EntitiesA select new { a.Id, a.Name, Bs = a.EntityB.Select(b => new { b.StuffToBeLoaded1, b.StuffToBeLoaded2 }) }; If EntityB is not a collection navigation property you can s...
Partial eager loading child entity (load specific fileds) I searched a bit and understands that I can use projection to partially load an entity, the question becomes is there a way to partially eager loading a child? Say I have the following Entity A has Id Name EntityB and Entity B has Id StuffToBeLoaded1 StuffToBeLo...
TITLE: Partial eager loading child entity (load specific fileds) QUESTION: I searched a bit and understands that I can use projection to partially load an entity, the question becomes is there a way to partially eager loading a child? Say I have the following Entity A has Id Name EntityB and Entity B has Id StuffToBeL...
[ "c#", ".net", "ado.net", "entity-framework-4" ]
0
3
371
1
0
2011-06-09T08:53:59.737000
2011-06-09T10:34:00.733000
6,290,307
6,290,544
android runtime command problem
i'm trying to reboot my android device (doing android porting) for test. my code: try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("reboot"); InputStream is = proc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while ((line...
you can't do this on non-rooted phones: How to boot android phone programmatically?
android runtime command problem i'm trying to reboot my android device (doing android porting) for test. my code: try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("reboot"); InputStream is = proc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(...
TITLE: android runtime command problem QUESTION: i'm trying to reboot my android device (doing android porting) for test. my code: try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("reboot"); InputStream is = proc.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = n...
[ "android" ]
2
1
1,512
2
0
2011-06-09T08:53:59.753000
2011-06-09T09:13:19.537000
6,290,310
6,290,330
Oracle SQL Syntax: Select
Are the following sql statement valid in Oracle SQL? 1) select 1 2) select test from (select 1 as test) 3) select test from (select 1 as test) s Thanks in advance! Best, Will
None of them are valid. These are the correct statements: 1) select 1 from dual 2) select test from (select 1 as test from dual) 3) select test from (select 1 as test from dual) s -- or also select s.test from (select 1 as test from dual) s
Oracle SQL Syntax: Select Are the following sql statement valid in Oracle SQL? 1) select 1 2) select test from (select 1 as test) 3) select test from (select 1 as test) s Thanks in advance! Best, Will
TITLE: Oracle SQL Syntax: Select QUESTION: Are the following sql statement valid in Oracle SQL? 1) select 1 2) select test from (select 1 as test) 3) select test from (select 1 as test) s Thanks in advance! Best, Will ANSWER: None of them are valid. These are the correct statements: 1) select 1 from dual 2) select te...
[ "sql", "oracle", "select" ]
1
6
347
1
0
2011-06-09T08:54:27.720000
2011-06-09T08:56:18.793000
6,290,314
6,290,458
Is there any way to give numbering to all the co-ordinates of the line chart in FUSION CHARTS FREE
I created a fusion line chart using the following: var chart = new FusionCharts("Charts/FCF_MSLine.swf", "chart_id", "600", "500"); chart.setDataXML(XmlData); chart.render("divDisplay"); I am getting a line chart which is having many co-ordinates but the co=ordinate points are not named. ** The co-ordinate point values...
Please try once using showValues='1' in or in if you wish to show all the values of the anchors (co-ordinate points) of each line. If you already have showValues='0' in or in please set to 1. Hope this helps. Additionally, please provide here the XML which you use for debugging the issue. Please try the XML shown below...
Is there any way to give numbering to all the co-ordinates of the line chart in FUSION CHARTS FREE I created a fusion line chart using the following: var chart = new FusionCharts("Charts/FCF_MSLine.swf", "chart_id", "600", "500"); chart.setDataXML(XmlData); chart.render("divDisplay"); I am getting a line chart which is...
TITLE: Is there any way to give numbering to all the co-ordinates of the line chart in FUSION CHARTS FREE QUESTION: I created a fusion line chart using the following: var chart = new FusionCharts("Charts/FCF_MSLine.swf", "chart_id", "600", "500"); chart.setDataXML(XmlData); chart.render("divDisplay"); I am getting a l...
[ "graph", "fusioncharts" ]
1
1
239
1
0
2011-06-09T08:54:46.390000
2011-06-09T09:07:15.330000
6,290,316
6,290,361
how to check if PHP variable contains non-numbers?
I just want to know the method to check a PHP variable for any non-numbers and if it also detects spaces between characters? Need to make sure nothing weird gets put into my form fields. Thanks in advance.
If you mean that you only want a value to contain digits then you can use ctype_digit().
how to check if PHP variable contains non-numbers? I just want to know the method to check a PHP variable for any non-numbers and if it also detects spaces between characters? Need to make sure nothing weird gets put into my form fields. Thanks in advance.
TITLE: how to check if PHP variable contains non-numbers? QUESTION: I just want to know the method to check a PHP variable for any non-numbers and if it also detects spaces between characters? Need to make sure nothing weird gets put into my form fields. Thanks in advance. ANSWER: If you mean that you only want a val...
[ "php", "string", "forms", "variables" ]
33
41
70,283
9
0
2011-06-09T08:55:15.527000
2011-06-09T08:58:31.700000
6,290,329
6,290,764
Why is my UDP broadcast failing?
I'm trying to send a UDP broadcast but wireshark isn't reporting any traffic. Here's the snippet that does the sending: void SendBroadcast() { String^ ip = "255.255.255.255"; int port = 30718; String^ message = "test"; UdpClient^ udpClient = gcnew UdpClient(); udpClient->EnableBroadcast = true; IPEndPoint^ ipDest = gc...
Windows 7 handles 255.255.255.255 broadcast in a different way. More info here: Send UDP broadcast on Windows 7
Why is my UDP broadcast failing? I'm trying to send a UDP broadcast but wireshark isn't reporting any traffic. Here's the snippet that does the sending: void SendBroadcast() { String^ ip = "255.255.255.255"; int port = 30718; String^ message = "test"; UdpClient^ udpClient = gcnew UdpClient(); udpClient->EnableBroadcas...
TITLE: Why is my UDP broadcast failing? QUESTION: I'm trying to send a UDP broadcast but wireshark isn't reporting any traffic. Here's the snippet that does the sending: void SendBroadcast() { String^ ip = "255.255.255.255"; int port = 30718; String^ message = "test"; UdpClient^ udpClient = gcnew UdpClient(); udpClie...
[ ".net", "c++-cli", "udp", "broadcast", "multicast" ]
4
4
5,518
1
0
2011-06-09T08:56:19.173000
2011-06-09T09:32:50.553000
6,290,331
6,290,656
Best method to check user login and minimize database queries?
How can I let a user sign in, then check his cookies to see if they are okay to proceed; the cookie has his user ID and encrypted password. Can I check that on every page? Without using MySQL every time? Edit: Session USED
First, obtain the username and password and validate them. Verify that the username and password are present in the database. Set a flag on the session if the username/password is valid. Confirm that the flag is set to true on every new page. The code goes here... // start the session // session_start(); // create one...
Best method to check user login and minimize database queries? How can I let a user sign in, then check his cookies to see if they are okay to proceed; the cookie has his user ID and encrypted password. Can I check that on every page? Without using MySQL every time? Edit: Session USED
TITLE: Best method to check user login and minimize database queries? QUESTION: How can I let a user sign in, then check his cookies to see if they are okay to proceed; the cookie has his user ID and encrypted password. Can I check that on every page? Without using MySQL every time? Edit: Session USED ANSWER: First, ...
[ "php", "mysql" ]
0
1
1,307
3
0
2011-06-09T08:56:22.227000
2011-06-09T09:22:51.763000
6,290,339
6,291,015
Output a multidimensional array in groups
I have an multidimensional array of data which represents the list of users that are connected to our servers. Each array contains information about a connection. The same user could be connected to any number of ports on different servers. Array( [0] => Array( [0] => serverA [1] => port1, [2] => user1, [3] => ip1 ), [...
You can create a new array where you summarize the data and then print it in the required format: $newArr = array(); foreach($arr as $k => $v) { if(!isset($newArr[$v[0]][$v[1]])) { $newArr[$v[0]][$v[1]] = array(); } $newArr[$v[0]][$v[1]][] = array($v[2],$v[3]); } foreach($newArr as $k => $v) { echo $k,"\n"; foreach($...
Output a multidimensional array in groups I have an multidimensional array of data which represents the list of users that are connected to our servers. Each array contains information about a connection. The same user could be connected to any number of ports on different servers. Array( [0] => Array( [0] => serverA [...
TITLE: Output a multidimensional array in groups QUESTION: I have an multidimensional array of data which represents the list of users that are connected to our servers. Each array contains information about a connection. The same user could be connected to any number of ports on different servers. Array( [0] => Array...
[ "php", "arrays", "multidimensional-array" ]
3
2
253
4
0
2011-06-09T08:57:01.073000
2011-06-09T09:54:35.997000
6,290,344
6,290,413
How do I embed a FLV file (stored in the HD) into my web application?
I am developing a MVC3 application with C# and Razor. I want to create a web page where an FLV file, stored in the hard disk, is played. I found a lot of material on how to do it in WordPress but there is no link that explains how to do it in normal HTML. May anybody help me or provide me resources in order to perform ...
You need a player to play.flv file on HTML page. You cannot play.flv files out of the box in HTML page without any flash application that can playback those files. this is player i would advice you to use JW player this is short example how to embed a file div with player id is where your player will be rendered. jwpla...
How do I embed a FLV file (stored in the HD) into my web application? I am developing a MVC3 application with C# and Razor. I want to create a web page where an FLV file, stored in the hard disk, is played. I found a lot of material on how to do it in WordPress but there is no link that explains how to do it in normal ...
TITLE: How do I embed a FLV file (stored in the HD) into my web application? QUESTION: I am developing a MVC3 application with C# and Razor. I want to create a web page where an FLV file, stored in the hard disk, is played. I found a lot of material on how to do it in WordPress but there is no link that explains how t...
[ "c#", "asp.net-mvc-3", "flv" ]
0
2
1,193
1
0
2011-06-09T08:57:27.220000
2011-06-09T09:03:05.477000
6,290,348
6,290,419
How to change add in file paths in VS2010
In VS2010 in Tools --> Options --> Environment --> Add-in/Macro Security is it possible to change the file path variables? Or at least see where they point to? I'm trying to add a new extension but I get an error saying that the network drive is not available. I think one of these variables is pointing to a network dri...
There is a list on MSDN %ALLUSERSDOCUMENTS% %PUBLIC%\Documents %ALLUSERSPROFILE% %ALLUSERSPROFILE% (defined by OS) %APPDATA% %USERPROFILE%\AppData %VSAPPDATA% %USERPROFILE%\AppData\Roaming\Microsoft\Visual Studio\ --OR-- %USERPROFILE%\AppData\Local\Microsoft\Visual Studio\ %VSCOMMONAPPDATA% %ProgramData%\Microsoft\...
How to change add in file paths in VS2010 In VS2010 in Tools --> Options --> Environment --> Add-in/Macro Security is it possible to change the file path variables? Or at least see where they point to? I'm trying to add a new extension but I get an error saying that the network drive is not available. I think one of th...
TITLE: How to change add in file paths in VS2010 QUESTION: In VS2010 in Tools --> Options --> Environment --> Add-in/Macro Security is it possible to change the file path variables? Or at least see where they point to? I'm trying to add a new extension but I get an error saying that the network drive is not available....
[ "visual-studio", "visual-studio-2010" ]
0
6
3,801
2
0
2011-06-09T08:57:39.100000
2011-06-09T09:04:29.417000
6,290,350
6,290,583
Qt qspinbox editingFinished signal on value changed
According to the Qt documentation: void QAbstractSpinBox::editingFinished () [signal] This signal is emitted editing is finished. This happens when the spinbox loses focus and when enter is pressed. Is it possible (preferably out-of-the-box) to have this signal fire on every change of the spinbox, not just enter or los...
That is different. You can use valueChanged() signal instead.
Qt qspinbox editingFinished signal on value changed According to the Qt documentation: void QAbstractSpinBox::editingFinished () [signal] This signal is emitted editing is finished. This happens when the spinbox loses focus and when enter is pressed. Is it possible (preferably out-of-the-box) to have this signal fire o...
TITLE: Qt qspinbox editingFinished signal on value changed QUESTION: According to the Qt documentation: void QAbstractSpinBox::editingFinished () [signal] This signal is emitted editing is finished. This happens when the spinbox loses focus and when enter is pressed. Is it possible (preferably out-of-the-box) to have ...
[ "qt" ]
1
4
7,946
1
0
2011-06-09T08:57:56.147000
2011-06-09T09:16:59.227000
6,290,386
6,291,105
OPENXML, Xsi:nil and Decimals
I have some XML containing xsi:nil="true" for certain string and numeric elements. Here's an example: declare @data xml set @data = ' foo ' I want to query that XML in SQL Server 2008 R2. I'm using OPENXML but it's not playing nicely with decimal types. Here's the code I'd like to write: declare @doc int exec sp_xml_p...
xsi:nil is an XML Schema feature and OpenXML was designed before it's existance and does not support xsi:nil. Since you use SQL Server 2008, one way to make this to work is to: constrain the XML with the appropriate XML Schema that validates the data and will recognize the xsi:nil and map it to the empty value. use the...
OPENXML, Xsi:nil and Decimals I have some XML containing xsi:nil="true" for certain string and numeric elements. Here's an example: declare @data xml set @data = ' foo ' I want to query that XML in SQL Server 2008 R2. I'm using OPENXML but it's not playing nicely with decimal types. Here's the code I'd like to write: ...
TITLE: OPENXML, Xsi:nil and Decimals QUESTION: I have some XML containing xsi:nil="true" for certain string and numeric elements. Here's an example: declare @data xml set @data = ' foo ' I want to query that XML in SQL Server 2008 R2. I'm using OPENXML but it's not playing nicely with decimal types. Here's the code I...
[ "sql-server", "xml", "sql-server-2008", "openxml", "xml-nil" ]
1
2
3,101
3
0
2011-06-09T09:00:16.800000
2011-06-09T10:03:31.623000
6,290,403
6,290,816
What IP will google analytics see for internally hosted site
One of our sites that we want to use google analytics on is hosted inside our network. We would like to exclude the administrators own traffic from the reports, but I am wandering how analytics obtains the users IP address. If it uses the address which the analytics script is requested from (the HTTP request for the js...
It will see the IP that requests the __utm.gif image, then the IP of your internet gateway(s) You can define a filter to exclude each of your IPs, or your IP range
What IP will google analytics see for internally hosted site One of our sites that we want to use google analytics on is hosted inside our network. We would like to exclude the administrators own traffic from the reports, but I am wandering how analytics obtains the users IP address. If it uses the address which the an...
TITLE: What IP will google analytics see for internally hosted site QUESTION: One of our sites that we want to use google analytics on is hosted inside our network. We would like to exclude the administrators own traffic from the reports, but I am wandering how analytics obtains the users IP address. If it uses the ad...
[ "google-analytics", "analytics" ]
1
1
270
1
0
2011-06-09T09:02:02.770000
2011-06-09T09:38:02.387000
6,290,408
6,290,497
Couldn't get the values from the cells in GridView using check box in ASP.net
protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Server=ILLUMINATI;" + "Database=DB;Integrated Security= true"); SqlCommand comm = new SqlCommand("Select * from FileUpload where UploadedBy='"+NAME+"'",conn); try { conn.Open(); SqlDataReader rdr = comm.ExecuteReader(); if (...
Put your page load code under if(!IsPostBack){yourCode....} so when you click the button your page load event will be called before the click handler and it will rebind the gridview. protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { SqlConnection conn = new SqlConnection("Server=ILLUMINATI;" + "...
Couldn't get the values from the cells in GridView using check box in ASP.net protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Server=ILLUMINATI;" + "Database=DB;Integrated Security= true"); SqlCommand comm = new SqlCommand("Select * from FileUpload where UploadedBy='"+NAME...
TITLE: Couldn't get the values from the cells in GridView using check box in ASP.net QUESTION: protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection("Server=ILLUMINATI;" + "Database=DB;Integrated Security= true"); SqlCommand comm = new SqlCommand("Select * from FileUpload where ...
[ "c#", ".net", "asp.net", "gridview" ]
1
2
398
2
0
2011-06-09T09:02:24.117000
2011-06-09T09:09:31.180000
6,290,420
6,290,620
Selecting a <td> within a table, li, ul and div to change the background colors
I am trying to access the following td 'dayContent' and change the background color to #a43802. I have tried several ways with no success. This td exists within a tr and table, which is surrounded by a div, a li, a ul and then another div.:( The content for the dayContent is generated from my backend code. Currently, i...
Lets start with defining some of the problems you are having with your code. 1) DOM elements must have a unique ID. You are using #testSpot here a few times, and that's bad and will make your code behave weird. 2) When doing this: $('td.dayContent', this).css("background-color", "#a43802"); you are searching for a with...
Selecting a <td> within a table, li, ul and div to change the background colors I am trying to access the following td 'dayContent' and change the background color to #a43802. I have tried several ways with no success. This td exists within a tr and table, which is surrounded by a div, a li, a ul and then another div.:...
TITLE: Selecting a <td> within a table, li, ul and div to change the background colors QUESTION: I am trying to access the following td 'dayContent' and change the background color to #a43802. I have tried several ways with no success. This td exists within a tr and table, which is surrounded by a div, a li, a ul and ...
[ "jquery", "css", "html", "background-color" ]
0
1
1,739
3
0
2011-06-09T09:04:35.150000
2011-06-09T09:20:13.610000
6,290,430
6,290,569
C# Prevent my .exe win application on being renamed?
Hi is it possible to prevent my.exe application on being renamed..? here is the senario(my problem) After i Run my program, (lets say i run MyApp.exe) a unfriendly user suddenly for fun, renamed my MyApp.exe to... lets say Goodtime.exe after that. he log-off windows(xp) and then when my program is attempting to run on ...
That is not possible. However there is an alternative to do that. You can set the user to have limited rights on his user account to the computer. In that case he cannot rename files in such a way he wanted. This is a restriction provided by the operating system in which only the administrators of the computer can set ...
C# Prevent my .exe win application on being renamed? Hi is it possible to prevent my.exe application on being renamed..? here is the senario(my problem) After i Run my program, (lets say i run MyApp.exe) a unfriendly user suddenly for fun, renamed my MyApp.exe to... lets say Goodtime.exe after that. he log-off windows(...
TITLE: C# Prevent my .exe win application on being renamed? QUESTION: Hi is it possible to prevent my.exe application on being renamed..? here is the senario(my problem) After i Run my program, (lets say i run MyApp.exe) a unfriendly user suddenly for fun, renamed my MyApp.exe to... lets say Goodtime.exe after that. h...
[ "c#", "exe", "file-rename" ]
0
1
1,443
8
0
2011-06-09T09:05:20.340000
2011-06-09T09:15:47.350000
6,290,438
6,290,521
Displaying Images from a folder in PHP
I am currently creating an e-commerce website where I retrieve the vehicle details from the database and search for its image in a folder. I used the code below for searching the folder for the image, but it only show the name of the JPG file and not the image of it. Could anyone help to to determine how I could displa...
You have to put html tags around the result. Try: echo " "; where PATH_TO_IMAGE is the relative/absolute url address to your images folder Ex echo " ";
Displaying Images from a folder in PHP I am currently creating an e-commerce website where I retrieve the vehicle details from the database and search for its image in a folder. I used the code below for searching the folder for the image, but it only show the name of the JPG file and not the image of it. Could anyone ...
TITLE: Displaying Images from a folder in PHP QUESTION: I am currently creating an e-commerce website where I retrieve the vehicle details from the database and search for its image in a folder. I used the code below for searching the folder for the image, but it only show the name of the JPG file and not the image of...
[ "php", "image", "directory" ]
2
2
2,964
3
0
2011-06-09T09:06:02.090000
2011-06-09T09:11:09.853000
6,290,442
6,290,474
html <input type="text" /> onchange event not working
I am trying to do some experiment. What I want to happen is that everytime the user types in something in the textbox, it will be displayed in a dialog box. I used the onchange event property to make it happen but it doesn't work. I still need to press the submit button to make it work. I read about AJAX and I am think...
onchange is only triggered when the control is blurred. Try onkeypress instead.
html <input type="text" /> onchange event not working I am trying to do some experiment. What I want to happen is that everytime the user types in something in the textbox, it will be displayed in a dialog box. I used the onchange event property to make it happen but it doesn't work. I still need to press the submit bu...
TITLE: html <input type="text" /> onchange event not working QUESTION: I am trying to do some experiment. What I want to happen is that everytime the user types in something in the textbox, it will be displayed in a dialog box. I used the onchange event property to make it happen but it doesn't work. I still need to p...
[ "javascript", "dom-events" ]
102
152
376,098
15
0
2011-06-09T09:06:19.747000
2011-06-09T09:08:04.567000
6,290,448
6,291,007
How to make models connected via ManyToMany relationship editable in two places at the same time in Django admin?
I have two models - News and Subject. News model has a ManyToManyField related to Subject, like that: subjects = models.ManyToManyField(NewsSubject, verbose_name=u'Subjects', blank=True,null=True,related_name='news') And I need to have an ability not only to choose Subjects for News in admin, but also to choose News wh...
I am not sure that it can meet your needs but i've done something similar by using TabularInline. Somethink like this should work (i didn't test the following code). class Subject(models.Model):... class News(models.Model): subject = models.ManyToManyField(Subject, through="NewsSubject") class NewsSubject(models.Mode...
How to make models connected via ManyToMany relationship editable in two places at the same time in Django admin? I have two models - News and Subject. News model has a ManyToManyField related to Subject, like that: subjects = models.ManyToManyField(NewsSubject, verbose_name=u'Subjects', blank=True,null=True,related_na...
TITLE: How to make models connected via ManyToMany relationship editable in two places at the same time in Django admin? QUESTION: I have two models - News and Subject. News model has a ManyToManyField related to Subject, like that: subjects = models.ManyToManyField(NewsSubject, verbose_name=u'Subjects', blank=True,nu...
[ "python", "django", "many-to-many", "admin", "models" ]
1
2
203
1
0
2011-06-09T09:06:37.880000
2011-06-09T09:53:42.333000
6,290,459
6,290,679
Exception in thread "main" java.lang.RuntimeException: Matrix is singular
I'm just trying to create an inverse matrix of a 3x3 matrix following JAMA documentation. But every time it's giving me the following error - Exception in thread "main" java.lang.RuntimeException: Matrix is singular Can anyone help me in this regard?
If you can calculate the determinant of your matrix, you'll find that it's zero (or close to it). You might be able to tell by inspection. If one row is proportional to another, your matrix is not invertible. 3x3 is easy enough to invert by hand. Try it and see where it goes wrong. Try a SVD solution. It'll tell you wh...
Exception in thread "main" java.lang.RuntimeException: Matrix is singular I'm just trying to create an inverse matrix of a 3x3 matrix following JAMA documentation. But every time it's giving me the following error - Exception in thread "main" java.lang.RuntimeException: Matrix is singular Can anyone help me in this reg...
TITLE: Exception in thread "main" java.lang.RuntimeException: Matrix is singular QUESTION: I'm just trying to create an inverse matrix of a 3x3 matrix following JAMA documentation. But every time it's giving me the following error - Exception in thread "main" java.lang.RuntimeException: Matrix is singular Can anyone h...
[ "java", "matrix", "jama" ]
3
2
7,441
3
0
2011-06-09T09:07:19.777000
2011-06-09T09:24:26.093000
6,290,460
6,291,283
if/else statement in SSE intrinsics
I am trying to optimize a small piece of code with SSE intrinsics (I am a complete beginner on the topic), but I am a little stuck on the use of conditionals. My original code is: unsigned long c; unsigned long constant = 0x12345678; unsigned long table[256]; int n, k; for( n = 0; n < 256; n++ ) { c = n; for( k = 0; k...
You can get rid of the if/else entirely. Back in the days when I produced MMX assembly code, that was a common programming activity. Let me start with a series of transformations on the "false" statement: c >>= 1; c = c >> 1; c = 0 ^ (c >> 1); Why did I introduce the exclusive-or? Because exclusive-or is also found i...
if/else statement in SSE intrinsics I am trying to optimize a small piece of code with SSE intrinsics (I am a complete beginner on the topic), but I am a little stuck on the use of conditionals. My original code is: unsigned long c; unsigned long constant = 0x12345678; unsigned long table[256]; int n, k; for( n = 0; n...
TITLE: if/else statement in SSE intrinsics QUESTION: I am trying to optimize a small piece of code with SSE intrinsics (I am a complete beginner on the topic), but I am a little stuck on the use of conditionals. My original code is: unsigned long c; unsigned long constant = 0x12345678; unsigned long table[256]; int n,...
[ "c++", "if-statement", "sse", "intrinsics", "mmx" ]
6
12
3,442
3
0
2011-06-09T09:07:20.180000
2011-06-09T10:18:38.277000
6,290,461
6,291,346
pthread_mutex_lock return not tested
I'm really wondering why all source codes that implement a pthread_mutex_lock never test its return value as defined: documentation of pthread even in books the examples don't test if the lock is in error, codes just do the lock. Is there any reason I missed to let it untested?
Basically, the only “interesting” error is EINVAL, which in most programs will only happen because of memory corruption, or, as I know from my own painful experience, during program shutdown after destructors have already destroyed some mutexes. The way I see it, the only reasonable response to such an error is to abor...
pthread_mutex_lock return not tested I'm really wondering why all source codes that implement a pthread_mutex_lock never test its return value as defined: documentation of pthread even in books the examples don't test if the lock is in error, codes just do the lock. Is there any reason I missed to let it untested?
TITLE: pthread_mutex_lock return not tested QUESTION: I'm really wondering why all source codes that implement a pthread_mutex_lock never test its return value as defined: documentation of pthread even in books the examples don't test if the lock is in error, codes just do the lock. Is there any reason I missed to let...
[ "multithreading", "coding-style", "pthreads" ]
7
3
2,584
2
0
2011-06-09T09:07:22.280000
2011-06-09T10:26:00.517000
6,290,470
6,291,091
Eclipse debugger always blocks on ThreadPoolExecutor without any obvious exception, why?
I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reason, I don't exploit any new feature, I just wanted to try that). Every time I debug my application, it happens that Eclipse debugger pops out like it has reached a ...
The posted stack trace indicates that a RuntimeException was encountered in a Daemon thread. This is typically uncaught at runtime, unless the original developer caught and handled the exception. Typically, the debugger in Eclipse is configured to suspend execution at the location where the exception was thrown, on all...
Eclipse debugger always blocks on ThreadPoolExecutor without any obvious exception, why? I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reason, I don't exploit any new feature, I just wanted to try that). Every time...
TITLE: Eclipse debugger always blocks on ThreadPoolExecutor without any obvious exception, why? QUESTION: I'm working on my usual projects on Eclipse, it's a J2EE application, made with Spring, Hibernate and so on. I'm using Tomcat 7 for this (no particular reason, I don't exploit any new feature, I just wanted to try...
[ "java", "eclipse", "debugging", "tomcat" ]
213
299
65,831
4
0
2011-06-09T09:07:52.653000
2011-06-09T10:01:13.680000
6,290,471
6,290,732
wix: setting RegistryKey Root HKMU
If I set the root attribute to HKMU in the RegistryKey, how do I know where to search (RegistrySearch root = HKCU or HKLM )in my registry for my RegistryValue. Or how can i set the root value dynamically?
Usually this is done by using two searches with the same property: one search for HKLM and another one for HKCU. The following scenarios can then occur: first search finds the value and sets the property; in this case the second search result is ignored because its property was already sets by the first search second s...
wix: setting RegistryKey Root HKMU If I set the root attribute to HKMU in the RegistryKey, how do I know where to search (RegistrySearch root = HKCU or HKLM )in my registry for my RegistryValue. Or how can i set the root value dynamically?
TITLE: wix: setting RegistryKey Root HKMU QUESTION: If I set the root attribute to HKMU in the RegistryKey, how do I know where to search (RegistrySearch root = HKCU or HKLM )in my registry for my RegistryValue. Or how can i set the root value dynamically? ANSWER: Usually this is done by using two searches with the s...
[ "c#", ".net", "wix", "windows-installer" ]
9
5
6,980
2
0
2011-06-09T09:07:57.953000
2011-06-09T09:29:31.037000
6,290,478
6,291,950
How to give different colors to set of rows in gsp table depending on values in fields?
I have gsp table, and I'm filling values in its fields from collection passed from controller using each tag of gsp for each row. Now I want rows which gets same value for billId field should get displayed in different color. How to do that?
Try following: ${row.id} for every odd and even billing id you define a different css style. in you main css file you have to define the class even and odd e.g. with a background color. don't know hwo you output structure looks like, so created a sample code.
How to give different colors to set of rows in gsp table depending on values in fields? I have gsp table, and I'm filling values in its fields from collection passed from controller using each tag of gsp for each row. Now I want rows which gets same value for billId field should get displayed in different color. How to...
TITLE: How to give different colors to set of rows in gsp table depending on values in fields? QUESTION: I have gsp table, and I'm filling values in its fields from collection passed from controller using each tag of gsp for each row. Now I want rows which gets same value for billId field should get displayed in diffe...
[ "grails", "colors", "gsp" ]
0
0
3,456
3
0
2011-06-09T09:08:15.880000
2011-06-09T11:18:26.303000
6,290,483
6,290,560
Changing content of a div with Prototype or JavaScript
I have this code: Button 1 Button 2 Button 3 Content 1 Content 2 Content 3 If I press on the button with navigator_2, navigator_content_1 must be hidden, and navigator_content_2 showed. How can I do this with prototype? (Or javascript if it's too stronger). Unfortunatly I can't use jQuery.
Try this function nav(obj) { document.getElementById("navigator_content_1").style.display = "hidden" document.getElementById("navigator_content_2").style.display = "hidden" document.getElementById("navigator_content_3").style.display = "hidden" obj.style.display = "none"; } Add onclick="nav(this)" to each button eleme...
Changing content of a div with Prototype or JavaScript I have this code: Button 1 Button 2 Button 3 Content 1 Content 2 Content 3 If I press on the button with navigator_2, navigator_content_1 must be hidden, and navigator_content_2 showed. How can I do this with prototype? (Or javascript if it's too stronger). Unfortu...
TITLE: Changing content of a div with Prototype or JavaScript QUESTION: I have this code: Button 1 Button 2 Button 3 Content 1 Content 2 Content 3 If I press on the button with navigator_2, navigator_content_1 must be hidden, and navigator_content_2 showed. How can I do this with prototype? (Or javascript if it's too ...
[ "javascript", "prototypejs" ]
0
0
630
3
0
2011-06-09T09:08:36.623000
2011-06-09T09:15:13.080000
6,290,485
6,290,902
Distributing c# app with access database
I have a C# app which uses an Access database. The database is very simple (only 2 tables) and I have converted it to an mde file. I am using OleDbConnection, OleDbDataReader and OleDbCommand to manipulate the data, using Microsoft.Jet.OLEDB.4.0. Do I need to distribute the Access run-time or will Jet (which is already...
You do not need to distribute any Access or Office runtime. Your application only requires Jet to connect to your database file.
Distributing c# app with access database I have a C# app which uses an Access database. The database is very simple (only 2 tables) and I have converted it to an mde file. I am using OleDbConnection, OleDbDataReader and OleDbCommand to manipulate the data, using Microsoft.Jet.OLEDB.4.0. Do I need to distribute the Acce...
TITLE: Distributing c# app with access database QUESTION: I have a C# app which uses an Access database. The database is very simple (only 2 tables) and I have converted it to an mde file. I am using OleDbConnection, OleDbDataReader and OleDbCommand to manipulate the data, using Microsoft.Jet.OLEDB.4.0. Do I need to d...
[ "c#", "ms-access" ]
1
3
340
3
0
2011-06-09T09:08:40.800000
2011-06-09T09:44:44.720000
6,290,502
6,290,567
codeigniter cookie expiry problem
I'm having a cookie issue, the expiry date on my cookie is always being set to At End Of Session which isn't what I want. I did a bit of goggling and it suggested it set the expire to time()+60*60*24*30 which I've done. //Create basket cookie $cookie = array( 'name' => 'basket_id', 'value' => $basket_id, 'expire' => ti...
Please check out the answer below by @Gowri for how to do it properly. You can try to adjust session expiration time in config.php CI session initially is saved in cookies: /** Session Variables --------------------------------------- | 'session_expiration' = the number of SECONDS you want the session to last. | by def...
codeigniter cookie expiry problem I'm having a cookie issue, the expiry date on my cookie is always being set to At End Of Session which isn't what I want. I did a bit of goggling and it suggested it set the expire to time()+60*60*24*30 which I've done. //Create basket cookie $cookie = array( 'name' => 'basket_id', 'va...
TITLE: codeigniter cookie expiry problem QUESTION: I'm having a cookie issue, the expiry date on my cookie is always being set to At End Of Session which isn't what I want. I did a bit of goggling and it suggested it set the expire to time()+60*60*24*30 which I've done. //Create basket cookie $cookie = array( 'name' =...
[ "codeigniter", "cookies" ]
4
3
13,213
3
0
2011-06-09T09:10:01.913000
2011-06-09T09:15:43.783000
6,290,510
6,290,954
Android: Change the style of RadioButtons programmatically
how can I change the background image of RadioButtons in selected state. I have used the code for checkBoxes and it works, but for RadioButtons doesnt work. Here is my code snippet: RadioGroup radioGroup = new RadioGroup(context); for ( int i = 0; i < lst.size(); i++ ){ // Radiobuttons RadioButton radioButton = new Rad...
You can use a state-list drawable which defines different background images depending on the state of the widget. You can do this instead of changing the background resource programatically. A tutorial on this can be found here.
Android: Change the style of RadioButtons programmatically how can I change the background image of RadioButtons in selected state. I have used the code for checkBoxes and it works, but for RadioButtons doesnt work. Here is my code snippet: RadioGroup radioGroup = new RadioGroup(context); for ( int i = 0; i < lst.size(...
TITLE: Android: Change the style of RadioButtons programmatically QUESTION: how can I change the background image of RadioButtons in selected state. I have used the code for checkBoxes and it works, but for RadioButtons doesnt work. Here is my code snippet: RadioGroup radioGroup = new RadioGroup(context); for ( int i ...
[ "android", "radio-button" ]
0
1
5,455
1
0
2011-06-09T09:10:39.207000
2011-06-09T09:48:35.327000
6,290,512
6,290,642
How tortoise SVN do the Merge?Help Required
I am having a task of SVN Merge. But i am not sure hows SVN perform it. Details: we have Trunk & On Revision 99 we cut a branch called "code_2011". Two different group of developer are working one on Trunk, another on branch. Respective developer are committing their code. Now both Trunk and branch has changed. Now Aft...
It's not logically different when you merge from branch to trunk or vice-verse. Follow these steps for merging code from branch to trunk (Basic merging)- Checkout the working copy of the trunk (Destination, where the merge is to be done). Right Click on the Trunk and select TortoiseSVN > Merge select the First option "...
How tortoise SVN do the Merge?Help Required I am having a task of SVN Merge. But i am not sure hows SVN perform it. Details: we have Trunk & On Revision 99 we cut a branch called "code_2011". Two different group of developer are working one on Trunk, another on branch. Respective developer are committing their code. No...
TITLE: How tortoise SVN do the Merge?Help Required QUESTION: I am having a task of SVN Merge. But i am not sure hows SVN perform it. Details: we have Trunk & On Revision 99 we cut a branch called "code_2011". Two different group of developer are working one on Trunk, another on branch. Respective developer are committ...
[ "tortoisesvn" ]
3
5
774
2
0
2011-06-09T09:10:50.660000
2011-06-09T09:21:55.077000
6,290,516
6,290,875
How to enumerate methods of a class
Is there any way to enumerate methods of one class, for example, I have one class defined like below: @class Foo: NSObject -(void)doStuff1; -(void)doStuff2; @end And I was wondering if there is any way let me access the method "doStuff1" and "doStuff2" with enumerate methods, even before I know the class has two method...
You use the runtime library... class_copyMethodList Check the Apple docs here
How to enumerate methods of a class Is there any way to enumerate methods of one class, for example, I have one class defined like below: @class Foo: NSObject -(void)doStuff1; -(void)doStuff2; @end And I was wondering if there is any way let me access the method "doStuff1" and "doStuff2" with enumerate methods, even be...
TITLE: How to enumerate methods of a class QUESTION: Is there any way to enumerate methods of one class, for example, I have one class defined like below: @class Foo: NSObject -(void)doStuff1; -(void)doStuff2; @end And I was wondering if there is any way let me access the method "doStuff1" and "doStuff2" with enumerat...
[ "objective-c", "ios", "objective-c-runtime" ]
0
1
170
1
0
2011-06-09T09:10:56.477000
2011-06-09T09:42:08.550000
6,290,530
6,298,585
kill() function problem in client-server ipc message using 2 FIFOs
I want to have a message send & receive through 2 uni-direction FIFO Flow of data FIFO1 stdin--->parent(client) writefd--->FIFO1-->child(server) readfd FIFO2 child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout I need to have boundary structed message mesg_len+mesg_type+mesg_data The function is that if...
You open FIFO2 as WRONLY and FIFO1 as RDONLY in both the processes. Opening pipe for read will block until the other side opens for write, and you open for read on both sides - hence deadlocked.
kill() function problem in client-server ipc message using 2 FIFOs I want to have a message send & receive through 2 uni-direction FIFO Flow of data FIFO1 stdin--->parent(client) writefd--->FIFO1-->child(server) readfd FIFO2 child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout I need to have boundary st...
TITLE: kill() function problem in client-server ipc message using 2 FIFOs QUESTION: I want to have a message send & receive through 2 uni-direction FIFO Flow of data FIFO1 stdin--->parent(client) writefd--->FIFO1-->child(server) readfd FIFO2 child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout I need t...
[ "c", "unix", "client-server", "ipc", "fifo" ]
1
0
702
1
0
2011-06-09T09:11:54.787000
2011-06-09T20:04:15.343000
6,290,531
6,290,587
How do I check if my EditText fields are empty?
I have 5 EditTexts in android. I would like to know if I could check if all 5 EditTexts are null. Is there any way to do this??
I did something like this once; EditText usernameEditText = (EditText) findViewById(R.id.editUsername); sUsername = usernameEditText.getText().toString(); if (sUsername.matches("")) { Toast.makeText(this, "You did not enter a username", Toast.LENGTH_SHORT).show(); return; }
How do I check if my EditText fields are empty? I have 5 EditTexts in android. I would like to know if I could check if all 5 EditTexts are null. Is there any way to do this??
TITLE: How do I check if my EditText fields are empty? QUESTION: I have 5 EditTexts in android. I would like to know if I could check if all 5 EditTexts are null. Is there any way to do this?? ANSWER: I did something like this once; EditText usernameEditText = (EditText) findViewById(R.id.editUsername); sUsername = u...
[ "android", "android-edittext" ]
240
405
569,268
30
0
2011-06-09T09:12:01.553000
2011-06-09T09:17:22.753000
6,290,534
6,291,016
Is it possible to create a glow effect in C# 2.0?
I would like to create an outer glow effect on a UserControl derived class in c# 2.0 (WinForms). Is this (easily) possible? If yes, please show me how:) What I mean with "glow effect" is something like this:
Here are a few tutorials on how to easily achieve halo- and special effects on graphical objects in winforms: Text Halo Effect Text Effects Drawing text with a drop shadow effect
Is it possible to create a glow effect in C# 2.0? I would like to create an outer glow effect on a UserControl derived class in c# 2.0 (WinForms). Is this (easily) possible? If yes, please show me how:) What I mean with "glow effect" is something like this:
TITLE: Is it possible to create a glow effect in C# 2.0? QUESTION: I would like to create an outer glow effect on a UserControl derived class in c# 2.0 (WinForms). Is this (easily) possible? If yes, please show me how:) What I mean with "glow effect" is something like this: ANSWER: Here are a few tutorials on how to ...
[ "c#", "winforms", "drawing", "c#-2.0", "glow" ]
2
2
4,560
2
0
2011-06-09T09:12:09.037000
2011-06-09T09:54:43.903000
6,290,539
6,290,616
Deploying item/project VS2010 templates for all users
I know how to deploy VS template to the user's Documents\VS2010\Templates folder, but is it possible to deploy templates globally, so that all users have access to them?
The standard templates are located in: %ProgramFiles%/Microsoft Visual Studio 10.0/Common7/IDE/ProjectTemplates /ItemTemplates
Deploying item/project VS2010 templates for all users I know how to deploy VS template to the user's Documents\VS2010\Templates folder, but is it possible to deploy templates globally, so that all users have access to them?
TITLE: Deploying item/project VS2010 templates for all users QUESTION: I know how to deploy VS template to the user's Documents\VS2010\Templates folder, but is it possible to deploy templates globally, so that all users have access to them? ANSWER: The standard templates are located in: %ProgramFiles%/Microsoft Visua...
[ "visual-studio", "visual-studio-2010", "templates", "deployment" ]
2
2
330
1
0
2011-06-09T09:12:43.410000
2011-06-09T09:20:05.197000
6,290,540
6,290,563
Structure of vectors C++
is there a way to clear a structure of vectors at a time using a single statement? i.e. struct AStruct { vector StringList; vector DistanceList; }A; i want both the vectors using a single statement.
Sure: AStruct a; // stuff a = AStruct(); // clear it However, I would probably give myself a function: struct AStruct { vector StringList; vector DistanceList; } void clear() { StringList.clear(); DistanceList.clear(); } }; You can then say: AStruct a; // stuff a.clear(); // clear it which is perhaps easier to understa...
Structure of vectors C++ is there a way to clear a structure of vectors at a time using a single statement? i.e. struct AStruct { vector StringList; vector DistanceList; }A; i want both the vectors using a single statement.
TITLE: Structure of vectors C++ QUESTION: is there a way to clear a structure of vectors at a time using a single statement? i.e. struct AStruct { vector StringList; vector DistanceList; }A; i want both the vectors using a single statement. ANSWER: Sure: AStruct a; // stuff a = AStruct(); // clear it However, I would...
[ "vector", "struct" ]
0
2
1,808
1
0
2011-06-09T09:13:05.597000
2011-06-09T09:15:25.393000
6,290,545
6,296,286
Facebook C# SDK: OAuth 2 in Silverlight 4 browser app
I'm completely newbie at authentication proccess with OAuth (I'm trying to make use of OAuth 2, exactly), and the example I am following to authenticate by using Facebook SDK latest release says that this code snippet should work for C#.NET environments ( http://blog.prabir.me/post/Facebook-CSharp-SDK-Writing-your-firs...
A suggestion: Why don't you try to parse the WebResponse when you receive it as opposed to listening for the event? I use Facebook OAuth in my web app. It is nothing but a series of URL posts with the correct parameters. Take a look at this post: Login using Facebook Problem after logging out (All the details are in th...
Facebook C# SDK: OAuth 2 in Silverlight 4 browser app I'm completely newbie at authentication proccess with OAuth (I'm trying to make use of OAuth 2, exactly), and the example I am following to authenticate by using Facebook SDK latest release says that this code snippet should work for C#.NET environments ( http://blo...
TITLE: Facebook C# SDK: OAuth 2 in Silverlight 4 browser app QUESTION: I'm completely newbie at authentication proccess with OAuth (I'm trying to make use of OAuth 2, exactly), and the example I am following to authenticate by using Facebook SDK latest release says that this code snippet should work for C#.NET environ...
[ "silverlight-4.0", "oauth", "facebook-c#-sdk" ]
0
0
1,756
1
0
2011-06-09T09:13:28.187000
2011-06-09T16:41:27.120000
6,290,547
6,291,081
OleDbDataAdapter datatype mismatch using Jet
I'm using an OleDbDataAdapter (Microsoft.ACE.OLEDB.12.0 to be precise) to retrieve data from an Excel workbook. For one table I'm using a typed dataset but for another table I can't do that since the number of columns is unknown (the Excel template may generate extra columns). The problem was that if someone enters too...
If you have access to the registry set TypeGuessRows=0 and/or ImportMixedTypes=Text. See here for more info INITIALIZATION SETTINGS
OleDbDataAdapter datatype mismatch using Jet I'm using an OleDbDataAdapter (Microsoft.ACE.OLEDB.12.0 to be precise) to retrieve data from an Excel workbook. For one table I'm using a typed dataset but for another table I can't do that since the number of columns is unknown (the Excel template may generate extra columns...
TITLE: OleDbDataAdapter datatype mismatch using Jet QUESTION: I'm using an OleDbDataAdapter (Microsoft.ACE.OLEDB.12.0 to be precise) to retrieve data from an Excel workbook. For one table I'm using a typed dataset but for another table I can't do that since the number of columns is unknown (the Excel template may gene...
[ "c#", "excel", "dataset", "oledb", "jet" ]
3
2
772
1
0
2011-06-09T09:13:49.230000
2011-06-09T10:00:23.323000
6,290,548
6,290,689
How to stop people having an mp3 play through quicktime
I send out a http link for an mp3 to people and when they click on it they are complaining that the file plays in quictime. Obviously they need to do 'right click' --> 'save target as' but is there a way to do this for them using javascript?
Can't be done using JavaScript. But there are many ways to do that using server side scripts. I only know classic asp: Response.AddHeader "content-disposition","attachment; filename=fname.ext"
How to stop people having an mp3 play through quicktime I send out a http link for an mp3 to people and when they click on it they are complaining that the file plays in quictime. Obviously they need to do 'right click' --> 'save target as' but is there a way to do this for them using javascript?
TITLE: How to stop people having an mp3 play through quicktime QUESTION: I send out a http link for an mp3 to people and when they click on it they are complaining that the file plays in quictime. Obviously they need to do 'right click' --> 'save target as' but is there a way to do this for them using javascript? ANS...
[ "javascript", "quicktime" ]
3
2
126
2
0
2011-06-09T09:14:13.330000
2011-06-09T09:25:47.520000
6,290,559
6,296,661
Failure to Redirect on user Sign-in
I have a rails app. I have created a sessionscontroller and want to redirect to users page '/users' once the user signs in. But the redirect doesnt seem to be happening. class SessionsController < ApplicationController def create user = User.find_or_create_by_fbid(params[:user][:fbid]) #...Success user.update_attribut...
You need to handle the response's redirection in an ajax query. Normally the browser handles, but it won't with ajax. From this SO question (edited slightly for your case) var params = {user:{name:profile.name, email:profile.email,fbid:profile.id}}; $.ajax({ type: "POST", url: "/sessions", data: params, dataType: "json...
Failure to Redirect on user Sign-in I have a rails app. I have created a sessionscontroller and want to redirect to users page '/users' once the user signs in. But the redirect doesnt seem to be happening. class SessionsController < ApplicationController def create user = User.find_or_create_by_fbid(params[:user][:fbi...
TITLE: Failure to Redirect on user Sign-in QUESTION: I have a rails app. I have created a sessionscontroller and want to redirect to users page '/users' once the user signs in. But the redirect doesnt seem to be happening. class SessionsController < ApplicationController def create user = User.find_or_create_by_fbid(...
[ "ruby-on-rails", "view", "controller", "redirect" ]
0
1
215
2
0
2011-06-09T09:15:12.593000
2011-06-09T17:10:54.073000
6,290,564
6,290,809
MS SQL - Joining on two tables with a substringed key in one column
I have a 2 tables I need to join, however on one of the tables I need to extract a key from a varchar field in each row. Table 1 Description (numeric 18,varchar 4000) descriptionid description 1 Blah Blah: Queue 1Blah Blah 2 foobar:Queue 2 3 rem:Queue 2 -This is a note 4 Anotherrow: Queue 3 5 Something else Table 2 Que...
most efficient way Well... don't know about that but it is a way. select T1.descriptionid, T2.queueid from Table1 as T1 left outer join Table2 as T2 on T1.description like '%'+T2.queue+'%' Another way select T1.descriptionid, T2.queueid from Table1 as T1 left outer join Table2 as T2 on charindex(T2.queue, T1.descriptio...
MS SQL - Joining on two tables with a substringed key in one column I have a 2 tables I need to join, however on one of the tables I need to extract a key from a varchar field in each row. Table 1 Description (numeric 18,varchar 4000) descriptionid description 1 Blah Blah: Queue 1Blah Blah 2 foobar:Queue 2 3 rem:Queue ...
TITLE: MS SQL - Joining on two tables with a substringed key in one column QUESTION: I have a 2 tables I need to join, however on one of the tables I need to extract a key from a varchar field in each row. Table 1 Description (numeric 18,varchar 4000) descriptionid description 1 Blah Blah: Queue 1Blah Blah 2 foobar:Qu...
[ "sql", "sql-server-2005", "t-sql", "string", "join" ]
2
3
1,393
3
0
2011-06-09T09:15:35.857000
2011-06-09T09:37:11.420000
6,290,588
6,290,930
WCF MessageInspector on client is showing an other message than the Messageinspector on dthe service
I need to create a (WCF) client that communicates with a service that expects the messages to be signed. Since I'm quite new to WCF I first tried to setup a simple selfhost service and a client that talks to this servive. Both the service and client have message inspectors so I can see what's going over the line. The s...
No you can't control when in the pipeline the message inspectors are called. Instead of using message inspectors to inspect the messages, use WCF message tracing + svctraceviewer.exe instead. http://msdn.microsoft.com/en-us/library/ms733025.aspx http://msdn.microsoft.com/en-us/library/ms732023.aspx
WCF MessageInspector on client is showing an other message than the Messageinspector on dthe service I need to create a (WCF) client that communicates with a service that expects the messages to be signed. Since I'm quite new to WCF I first tried to setup a simple selfhost service and a client that talks to this serviv...
TITLE: WCF MessageInspector on client is showing an other message than the Messageinspector on dthe service QUESTION: I need to create a (WCF) client that communicates with a service that expects the messages to be signed. Since I'm quite new to WCF I first tried to setup a simple selfhost service and a client that ta...
[ "c#", "wcf", "inspector" ]
3
1
909
1
0
2011-06-09T09:17:28.450000
2011-06-09T09:46:43.473000
6,290,592
6,290,845
How to change view on button click in iPhone without navigation controller?
I want to know how to change view on button click in iPhone without navigation controller?
If you're doing this with a UIViewController, you would probably do this like following: - (IBAction)change { UIViewController* viewController = [[UIViewController alloc] init]; [self.view addSubView]; // Save the UIViewController somewhere if necessary, otherwise release it } Not sure why you don't want to use a UINav...
How to change view on button click in iPhone without navigation controller? I want to know how to change view on button click in iPhone without navigation controller?
TITLE: How to change view on button click in iPhone without navigation controller? QUESTION: I want to know how to change view on button click in iPhone without navigation controller? ANSWER: If you're doing this with a UIViewController, you would probably do this like following: - (IBAction)change { UIViewController...
[ "iphone", "objective-c", "view" ]
3
4
17,280
5
0
2011-06-09T09:17:45.923000
2011-06-09T09:39:38.517000
6,290,597
6,290,794
Using putIfAbsent like a short circuit operator
Is it possible to use putIfAbsent or any of its equivalents like a short circuit operator. myConcurrentMap.putIfAbsent(key,calculatedValue) I want that if there is already a calculatedValue it shouldnt be calculated again. by default putIfAbsent would still do the calculation every time even though it will not actually...
You could consider to use a Guava ComputingMap ConcurrentMap myConcurrentMap = new MapMaker().makeComputingMap( new Function () { public Value apply(Key key) { Value calculatedValue = calculateValue(key); return calculatedValue; } });
Using putIfAbsent like a short circuit operator Is it possible to use putIfAbsent or any of its equivalents like a short circuit operator. myConcurrentMap.putIfAbsent(key,calculatedValue) I want that if there is already a calculatedValue it shouldnt be calculated again. by default putIfAbsent would still do the calcula...
TITLE: Using putIfAbsent like a short circuit operator QUESTION: Is it possible to use putIfAbsent or any of its equivalents like a short circuit operator. myConcurrentMap.putIfAbsent(key,calculatedValue) I want that if there is already a calculatedValue it shouldnt be calculated again. by default putIfAbsent would st...
[ "java", "concurrenthashmap" ]
0
0
878
3
0
2011-06-09T09:18:28.677000
2011-06-09T09:35:07.347000
6,290,605
6,290,775
Load R package from character string
I want to create a function which includes loading a package that I make within the function. A short example (which doesn't run!): loadMe <- function(name){ genLib(xxx, libName = name) #make a new library with name "name" library(name) #load the new library... } This does not work! A bit of reproducible code which ill...
Use the character.only argument foo <- "ggplot2" library(foo,character.only=TRUE)
Load R package from character string I want to create a function which includes loading a package that I make within the function. A short example (which doesn't run!): loadMe <- function(name){ genLib(xxx, libName = name) #make a new library with name "name" library(name) #load the new library... } This does not work!...
TITLE: Load R package from character string QUESTION: I want to create a function which includes loading a package that I make within the function. A short example (which doesn't run!): loadMe <- function(name){ genLib(xxx, libName = name) #make a new library with name "name" library(name) #load the new library... } T...
[ "string", "r", "character" ]
39
61
10,649
2
0
2011-06-09T09:19:24.093000
2011-06-09T09:33:51.997000
6,290,680
6,290,776
HTML images mouse over code
I am looking for the code to make this image http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20roll%20over.jpg hover over this one http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20review%202010.jpg on a mouse over. I am trying to link these to http://www.ciob-online-documents.co.uk/AnnualRevi...
Try to open HTML mode in your Drupal WYSIWYG editor. The code for changing an image on hover could be the following: So, when a user is going mouseover image element, it's src attribute will be changed to your second image. As soon as user mouseout src of the image will change again. A link on the top of the image, is ...
HTML images mouse over code I am looking for the code to make this image http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20roll%20over.jpg hover over this one http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20review%202010.jpg on a mouse over. I am trying to link these to http://www.ciob-onlin...
TITLE: HTML images mouse over code QUESTION: I am looking for the code to make this image http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20roll%20over.jpg hover over this one http://www.ciob.org.uk/sites/ciob.org.uk/files/images/annual%20review%202010.jpg on a mouse over. I am trying to link these to htt...
[ "html", "drupal", "wysiwyg" ]
2
1
3,123
1
0
2011-06-09T09:24:30.690000
2011-06-09T09:33:53.013000
6,290,690
6,290,751
Can we use same icon for multiple ios (ipad/iphone) applications?
Can we use same icon image for more than one ios (ipad/iphone) applications? Is there any such rule that each application should have a different icon? Thanks.
There is no such rule, as far as I know. Indeed there are apps in the App Store that have the same icon, and others with very minor variations (e.g., the color tone). Apart from requirements about the size (of the different icon versions you have to submit) that are relevant for approval, the only thing that you should...
Can we use same icon for multiple ios (ipad/iphone) applications? Can we use same icon image for more than one ios (ipad/iphone) applications? Is there any such rule that each application should have a different icon? Thanks.
TITLE: Can we use same icon for multiple ios (ipad/iphone) applications? QUESTION: Can we use same icon image for more than one ios (ipad/iphone) applications? Is there any such rule that each application should have a different icon? Thanks. ANSWER: There is no such rule, as far as I know. Indeed there are apps in t...
[ "iphone", "ipad", "ios4" ]
7
3
1,891
2
0
2011-06-09T09:25:48.147000
2011-06-09T09:31:16.083000
6,290,693
6,290,746
Text size consistancy cross browser / device?
Assuming I make a website's text sizing with em, how much will the sizing vary cross browser and device? Im actually redesigning a site and if I make the text larger with firebug some of the layouts screw up, how much of an issue is this? Thanks
The most reliable way to keep text size consistent across browsers is to use pixels rather than ems. This defeats older browsers text resizing options, but that's a decision you have to make.
Text size consistancy cross browser / device? Assuming I make a website's text sizing with em, how much will the sizing vary cross browser and device? Im actually redesigning a site and if I make the text larger with firebug some of the layouts screw up, how much of an issue is this? Thanks
TITLE: Text size consistancy cross browser / device? QUESTION: Assuming I make a website's text sizing with em, how much will the sizing vary cross browser and device? Im actually redesigning a site and if I make the text larger with firebug some of the layouts screw up, how much of an issue is this? Thanks ANSWER: T...
[ "accessibility", "usability", "text-size" ]
0
1
181
1
0
2011-06-09T09:26:01.297000
2011-06-09T09:30:37.840000
6,290,694
6,298,431
Forcing a TFS2010 workflow build to FAIL instead of PARTIALLY SUCCEED
I currently have a custom workflow activity to run an external process, after the solution has been compiled successfully, that returns an ExitCode <> 0 if the external process has failed. Once I know that the process has failed, I want to set the build status to FAIL (as you would see if code has not compiled) so I ha...
What happened here is that when the build finishes, the workflow manager will overwrite the build status to a value that depends on the combination of statuses of the build process. In your case, the CompilationStatus is Succeeded, but there is a custom activity failure (you set the BuildStatus to Failed), so the overa...
Forcing a TFS2010 workflow build to FAIL instead of PARTIALLY SUCCEED I currently have a custom workflow activity to run an external process, after the solution has been compiled successfully, that returns an ExitCode <> 0 if the external process has failed. Once I know that the process has failed, I want to set the bu...
TITLE: Forcing a TFS2010 workflow build to FAIL instead of PARTIALLY SUCCEED QUESTION: I currently have a custom workflow activity to run an external process, after the solution has been compiled successfully, that returns an ExitCode <> 0 if the external process has failed. Once I know that the process has failed, I ...
[ "build", "workflow" ]
9
4
2,532
2
0
2011-06-09T09:26:05.507000
2011-06-09T19:52:09.480000
6,290,695
6,292,017
Row versioning in MySQL
I would like to include an integer version field in my table, auto-incrementing on each update made to a row. Is it possible to do this in MySQL? Please note that I'm not talking about a TIMESTAMP, which is not reliable as two concurrent updates might happen during the same second.
The only way (I can think of) to do this is a (before-update) trigger that automatically increments the column value.
Row versioning in MySQL I would like to include an integer version field in my table, auto-incrementing on each update made to a row. Is it possible to do this in MySQL? Please note that I'm not talking about a TIMESTAMP, which is not reliable as two concurrent updates might happen during the same second.
TITLE: Row versioning in MySQL QUESTION: I would like to include an integer version field in my table, auto-incrementing on each update made to a row. Is it possible to do this in MySQL? Please note that I'm not talking about a TIMESTAMP, which is not reliable as two concurrent updates might happen during the same sec...
[ "mysql", "versioning", "innodb", "database-versioning" ]
2
2
6,559
2
0
2011-06-09T09:26:07.397000
2011-06-09T11:24:32.783000
6,290,701
6,290,716
jQuery click on table cell event
I have a html code like below Joe White 25 and there is a jQuery code like this: $("tr#info").click(function() { // function_tr $(this).css("background-color","yellow"); }); $("tr#info td").click(function() { // function_td $(this).css("font-weight","bold"); }); When I click on the td, function_td works fine but funct...
You need to use event.stopPropagation() $("tr#info td").click(function(e){ //function_td $(this).css("font-weight","bold"); e.stopPropagation(); });
jQuery click on table cell event I have a html code like below Joe White 25 and there is a jQuery code like this: $("tr#info").click(function() { // function_tr $(this).css("background-color","yellow"); }); $("tr#info td").click(function() { // function_td $(this).css("font-weight","bold"); }); When I click on the td,...
TITLE: jQuery click on table cell event QUESTION: I have a html code like below Joe White 25 and there is a jQuery code like this: $("tr#info").click(function() { // function_tr $(this).css("background-color","yellow"); }); $("tr#info td").click(function() { // function_td $(this).css("font-weight","bold"); }); When ...
[ "jquery", "html-table", "cell" ]
9
12
64,505
2
0
2011-06-09T09:26:29.550000
2011-06-09T09:27:36.117000
6,290,704
6,290,735
Accessing a array of Structs using pointer notation
I am trying to learn C++ on my own and was trying out this. I have a struct one of whose member is an array of another structs. I have a question about alternative notation. The structs that I have defined are struct employeeRecordT { string name; string title; string ssnum; double salary; int withholding; }; struct p...
(payroll.array+i)->name = "Vikas"; array is a member of payroll, so when you were doing payroll.(array+i), the bracket notation (i.e. "do this first") was trying to use a variable array, and not the one within the scope of payroll. Of course, using C++, the better solution is Neils. Use a std::vector instead of your ow...
Accessing a array of Structs using pointer notation I am trying to learn C++ on my own and was trying out this. I have a struct one of whose member is an array of another structs. I have a question about alternative notation. The structs that I have defined are struct employeeRecordT { string name; string title; string...
TITLE: Accessing a array of Structs using pointer notation QUESTION: I am trying to learn C++ on my own and was trying out this. I have a struct one of whose member is an array of another structs. I have a question about alternative notation. The structs that I have defined are struct employeeRecordT { string name; st...
[ "c++" ]
3
7
1,148
2
0
2011-06-09T09:26:31.070000
2011-06-09T09:29:38.753000
6,290,708
6,291,170
Need Help with VNC and its code
What I want to do is suppose open 10 windows of paint application on a Windows 7 computer. I would like to show these 10 different windows on 10 different touch enabled devices. I am planning to use androidVNCviewer on these devices which run android and use VNC server on the windows computer. I want this VNC server to...
It's possible to do what you describe but probably not with any existing vnc servers. You will need to download libvnc, which is essentially a vnc server library. Using it, you provide a buffer to each instance of the library, and each client connects to a single instance.
Need Help with VNC and its code What I want to do is suppose open 10 windows of paint application on a Windows 7 computer. I would like to show these 10 different windows on 10 different touch enabled devices. I am planning to use androidVNCviewer on these devices which run android and use VNC server on the windows com...
TITLE: Need Help with VNC and its code QUESTION: What I want to do is suppose open 10 windows of paint application on a Windows 7 computer. I would like to show these 10 different windows on 10 different touch enabled devices. I am planning to use androidVNCviewer on these devices which run android and use VNC server ...
[ "android", "screen-scraping", "vnc", "desktop-sharing" ]
0
0
505
1
0
2011-06-09T09:26:46.803000
2011-06-09T10:09:35.730000
6,290,709
6,290,773
How to group resources in a resource bundle?
What is the best approach for grouping resources in a resource bundle file? The one I see most common is to group resources by web page, an example would be: # -- company page company.name.lbl=Name: company.address.lbl=Address: # -- contact page contact.name.lbl=Name: contact.email.lbl=Email: The problem with this is ...
I would keep to the former example of grouping by web page, since the text displayed on each page has its own separate context. You could try to keep things DRY and identify all of the common text, but should the context of any page change, you may find yourself creating new resources that you would have already done i...
How to group resources in a resource bundle? What is the best approach for grouping resources in a resource bundle file? The one I see most common is to group resources by web page, an example would be: # -- company page company.name.lbl=Name: company.address.lbl=Address: # -- contact page contact.name.lbl=Name: conta...
TITLE: How to group resources in a resource bundle? QUESTION: What is the best approach for grouping resources in a resource bundle file? The one I see most common is to group resources by web page, an example would be: # -- company page company.name.lbl=Name: company.address.lbl=Address: # -- contact page contact.na...
[ "java", "resourcebundle" ]
3
2
420
2
0
2011-06-09T09:27:00.500000
2011-06-09T09:33:43.260000
6,290,712
6,290,842
Using 'Either' in Haskell
I have two values, t1 and t2, of type Either String Type. The Left -value is used for error handling. These values are used in a function which returns Either String Type. What I want to do is check if both t1 and t2 are Right -values and satisfy p:: Type -> Bool. If they do, I want to return Right (the type inside t1)...
Why monads? test p (Right t1) (Right t2) | p t1 && p t2 = Right t1 | otherwise = Left "nope" test _ (Left t1) _ = Left t1 test _ _ (Left t2) = Left t2
Using 'Either' in Haskell I have two values, t1 and t2, of type Either String Type. The Left -value is used for error handling. These values are used in a function which returns Either String Type. What I want to do is check if both t1 and t2 are Right -values and satisfy p:: Type -> Bool. If they do, I want to return ...
TITLE: Using 'Either' in Haskell QUESTION: I have two values, t1 and t2, of type Either String Type. The Left -value is used for error handling. These values are used in a function which returns Either String Type. What I want to do is check if both t1 and t2 are Right -values and satisfy p:: Type -> Bool. If they do,...
[ "haskell", "monads", "either" ]
9
13
16,403
4
0
2011-06-09T09:27:19.450000
2011-06-09T09:39:24.610000
6,290,729
6,291,061
How to use Ext.define in ExtJS 4?
I'm new to ExtJS 4 and need some help understanding how the Ext.define works, please. In fact what I want to do is something similar to the portlets in the portal example, in my application I will need so many objects to add in my different tabs, so in order to organize my code and not have just one very big script, I ...
Ext.define ( String className, Object data, Function createdFn ): Ext.Base Ext.define is used to define a class. Example: // creates My.computer.NoteBook Class Ext.define('My.computer.NoteBook', { extend:'Ext.panel.Panel', config: { hardware:'Dell', os:'Linux', price:500 }, constructor:function(config) { this.ini...
How to use Ext.define in ExtJS 4? I'm new to ExtJS 4 and need some help understanding how the Ext.define works, please. In fact what I want to do is something similar to the portlets in the portal example, in my application I will need so many objects to add in my different tabs, so in order to organize my code and not...
TITLE: How to use Ext.define in ExtJS 4? QUESTION: I'm new to ExtJS 4 and need some help understanding how the Ext.define works, please. In fact what I want to do is something similar to the portlets in the portal example, in my application I will need so many objects to add in my different tabs, so in order to organi...
[ "extjs", "portlet", "extjs4" ]
22
24
44,751
2
0
2011-06-09T09:29:17.863000
2011-06-09T09:58:43.407000
6,290,733
6,290,767
Short variable for DOM methods
Can a "shortcut" not be made to methods such as document.createElement, document.createTextNode, [element].setSelectionRange etc? var c = document.createElement; var div = c('div'); div.innerHTML = 'blah'; document.body.appendChild(div); When executing the above code Firebug console returns an error: uncaught exceptio...
There are two obvious issues: Calling your aliased functions will not be providing the correct this value (it will be the global object rather than document ), which the DOM method may or may not depend upon; DOM nodes in JavaScript are host objects, which are not subject to the normal rules of native JavaScript object...
Short variable for DOM methods Can a "shortcut" not be made to methods such as document.createElement, document.createTextNode, [element].setSelectionRange etc? var c = document.createElement; var div = c('div'); div.innerHTML = 'blah'; document.body.appendChild(div); When executing the above code Firebug console retu...
TITLE: Short variable for DOM methods QUESTION: Can a "shortcut" not be made to methods such as document.createElement, document.createTextNode, [element].setSelectionRange etc? var c = document.createElement; var div = c('div'); div.innerHTML = 'blah'; document.body.appendChild(div); When executing the above code Fi...
[ "javascript" ]
2
3
434
2
0
2011-06-09T09:29:37.303000
2011-06-09T09:33:01.707000