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,279,890
6,283,333
Cannot remove or find an object in Java's CopyOnWriteArraySet
I use CopyOnWriteArraySet to store one instance of a custom class, which looks like this: public class MyClass{ String _name; public MyClass(String name){ _name = name; } @Override public int hashCode(){ return _name.hashCode(); } @Override public boolean equals(Object obj){ if (obj == this) return true; if ((obj in...
I found the reason for the problem. I'm using Hibernate which creates an own instance of org.hibernate.collection.PersistentSet which replaced my CopyOnWriteArraySet! The fact that.contains() and.remove() didn't work was a bug in Hibernate: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3799 The solution...
Cannot remove or find an object in Java's CopyOnWriteArraySet I use CopyOnWriteArraySet to store one instance of a custom class, which looks like this: public class MyClass{ String _name; public MyClass(String name){ _name = name; } @Override public int hashCode(){ return _name.hashCode(); } @Override public boolean...
TITLE: Cannot remove or find an object in Java's CopyOnWriteArraySet QUESTION: I use CopyOnWriteArraySet to store one instance of a custom class, which looks like this: public class MyClass{ String _name; public MyClass(String name){ _name = name; } @Override public int hashCode(){ return _name.hashCode(); } @Overr...
[ "java", "collections", "set" ]
6
0
1,362
3
0
2011-06-08T13:58:47.927000
2011-06-08T18:17:52.643000
6,279,893
6,280,053
How to access file path for XML file in an assembly folder?
In my.NET assembly I need to access an XML file which is in 'Import' folder off my class assembly project. How do I do this? Almost like ASP.NET Server.MapPath() but for an assembly. I don't want the reflection method of getting the currently executing assembly as this points to the GAC folder. I want the folder of the...
Visual Studio -> item (e.g. XML file) -> Properties -> Build Action -> Embedded Resource Assembly.GetExecutingAssembly().GetManifestResourceStream(path)
How to access file path for XML file in an assembly folder? In my.NET assembly I need to access an XML file which is in 'Import' folder off my class assembly project. How do I do this? Almost like ASP.NET Server.MapPath() but for an assembly. I don't want the reflection method of getting the currently executing assembl...
TITLE: How to access file path for XML file in an assembly folder? QUESTION: In my.NET assembly I need to access an XML file which is in 'Import' folder off my class assembly project. How do I do this? Almost like ASP.NET Server.MapPath() but for an assembly. I don't want the reflection method of getting the currently...
[ "c#", ".net" ]
0
1
1,270
4
0
2011-06-08T13:58:53.820000
2011-06-08T14:09:58.563000
6,279,897
6,279,945
POST Content-Length exceeds the limit
I get similar errors in my error_log in php when users are uploading their files PHP Warning: POST Content-Length of 11933650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 In my php.ini (created custom ini file in public_html) would this solve this problem, how much would I have to set it to around 1GB?...
8388608 bytes is 8M, the default limit in PHP. Those changes to php.ini should indeed solve the problem (make sure your restart your Apache server after making them). Memory limit shouldn't need to be changed here.
POST Content-Length exceeds the limit I get similar errors in my error_log in php when users are uploading their files PHP Warning: POST Content-Length of 11933650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 In my php.ini (created custom ini file in public_html) would this solve this problem, how much...
TITLE: POST Content-Length exceeds the limit QUESTION: I get similar errors in my error_log in php when users are uploading their files PHP Warning: POST Content-Length of 11933650 bytes exceeds the limit of 8388608 bytes in Unknown on line 0 In my php.ini (created custom ini file in public_html) would this solve this...
[ "php" ]
105
102
308,008
10
0
2011-06-08T13:59:15.383000
2011-06-08T14:02:11.920000
6,279,898
6,279,925
Syntax Error when the column name contains underscore
I can compile but can't execute the following code with the error (using Postgres): Fatal database error ERROR: syntax error at or near "as" Position: 13 import java.sql.*; public class JDBCExample { private static final String JDBC_DRIVER = "org.postgresql.Driver"; private static final String URL = "jdbc:postgresql://...
It's not the underscore, it's the fact that the column name starts with a number. You'd need to escape this. For MySQL, use backticks. select `20_5` as name from flowshop_optimums For SQL Server, use square brackets. select [20_5] as name from flowshop_optimums For PostgreSQL, use double quotes. select "20_5" as name f...
Syntax Error when the column name contains underscore I can compile but can't execute the following code with the error (using Postgres): Fatal database error ERROR: syntax error at or near "as" Position: 13 import java.sql.*; public class JDBCExample { private static final String JDBC_DRIVER = "org.postgresql.Driver";...
TITLE: Syntax Error when the column name contains underscore QUESTION: I can compile but can't execute the following code with the error (using Postgres): Fatal database error ERROR: syntax error at or near "as" Position: 13 import java.sql.*; public class JDBCExample { private static final String JDBC_DRIVER = "org.p...
[ "sql", "postgresql" ]
4
7
12,590
4
0
2011-06-08T13:59:17.360000
2011-06-08T14:01:25.520000
6,279,901
6,280,008
Quick Build In Android with eclipse
I have a android project which is huge in size with more than 100 resource files, layouts and lot of codes. It takes about a minute and even more to completely build. Even when I change a single line or just give a space the whole project takes 1 minute to build. But I want it to consider only the changes and build qui...
as long as I know partial builds are not possible. You can disable the "Build Automatically" (not 100% sure about the name, I don't have Eclipse open right now) option from Eclipse and start the build manually.
Quick Build In Android with eclipse I have a android project which is huge in size with more than 100 resource files, layouts and lot of codes. It takes about a minute and even more to completely build. Even when I change a single line or just give a space the whole project takes 1 minute to build. But I want it to con...
TITLE: Quick Build In Android with eclipse QUESTION: I have a android project which is huge in size with more than 100 resource files, layouts and lot of codes. It takes about a minute and even more to completely build. Even when I change a single line or just give a space the whole project takes 1 minute to build. Bu...
[ "android", "eclipse", "eclipse-plugin", "android-build" ]
4
1
385
2
0
2011-06-08T13:59:45.040000
2011-06-08T14:07:00
6,279,903
6,280,250
Memory problems(?) cause crash
I've got an activity, where I initialize some static variable (Menu of the app). In another activity I use these variable in some if-clauses. If I am in the 2nd activity and press "Home" button to get the app to the background and resume it after a few minutes or immediately the app will still work. If I wait for about...
Instead of using the public static of a member variable in your Activity you should consider the use of global variables. In this way your variables will remain as long as your application is alive.
Memory problems(?) cause crash I've got an activity, where I initialize some static variable (Menu of the app). In another activity I use these variable in some if-clauses. If I am in the 2nd activity and press "Home" button to get the app to the background and resume it after a few minutes or immediately the app will ...
TITLE: Memory problems(?) cause crash QUESTION: I've got an activity, where I initialize some static variable (Menu of the app). In another activity I use these variable in some if-clauses. If I am in the 2nd activity and press "Home" button to get the app to the background and resume it after a few minutes or immedia...
[ "android" ]
0
1
598
2
0
2011-06-08T13:59:45.963000
2011-06-08T14:20:23.047000
6,279,907
6,282,839
Using FMOD in multiple classes (iOS)
I am developing an iOS app where I am recording sound from the devices mic, saving it to a wav, then it needs to be accessed and played from a different view controller. As I understand, a FMOD::System object can only be defined in one view controller. What would be the best way to access FMOD in more than one view con...
I ended up making a singleton class and got it working. If anyone would like help doing the same just ask.
Using FMOD in multiple classes (iOS) I am developing an iOS app where I am recording sound from the devices mic, saving it to a wav, then it needs to be accessed and played from a different view controller. As I understand, a FMOD::System object can only be defined in one view controller. What would be the best way to ...
TITLE: Using FMOD in multiple classes (iOS) QUESTION: I am developing an iOS app where I am recording sound from the devices mic, saving it to a wav, then it needs to be accessed and played from a different view controller. As I understand, a FMOD::System object can only be defined in one view controller. What would b...
[ "iphone", "ios", "audio", "singleton", "fmod" ]
1
1
303
1
0
2011-06-08T14:00:10.763000
2011-06-08T17:32:55.547000
6,279,918
6,279,967
PHP : Node depth
I would like to find the maximum depth of this array: Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => ) ) ) ) [children] => Array ( [0] => Array ( [children] => ) ) ) ) In this case it's 3 because one of the nodes contains two children nodes. This is the co...
Try this: $max_depth) { $max_depth = $depth; } } } return $max_depth; }?> In you case with the child nodes, you will need to divide result by 2. Greetz, XpertEase
PHP : Node depth I would like to find the maximum depth of this array: Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => ) ) ) ) [children] => Array ( [0] => Array ( [children] => ) ) ) ) In this case it's 3 because one of the nodes contains two children node...
TITLE: PHP : Node depth QUESTION: I would like to find the maximum depth of this array: Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => Array ( [0] => Array ( [children] => ) ) ) ) [children] => Array ( [0] => Array ( [children] => ) ) ) ) In this case it's 3 because one of the nodes contains...
[ "php", "arrays", "count" ]
1
3
273
1
0
2011-06-08T14:01:05.040000
2011-06-08T14:03:53.047000
6,279,922
6,280,061
Devise is not creating a User.rb model when I run the model generator
[WARNING] You provided devise_for:users but there is no model User defined in your application I've done some googling and it seems this is something do with setting up the ORM configuration for devise.rb in config/initializers which I had done: require 'devise/orm/mongo_mapper' Is there something I am missing? What do...
Don't forget to set Devise.setup do |config| config.orm =:mongo_mapper... end in your initialiser as well.
Devise is not creating a User.rb model when I run the model generator [WARNING] You provided devise_for:users but there is no model User defined in your application I've done some googling and it seems this is something do with setting up the ORM configuration for devise.rb in config/initializers which I had done: requ...
TITLE: Devise is not creating a User.rb model when I run the model generator QUESTION: [WARNING] You provided devise_for:users but there is no model User defined in your application I've done some googling and it seems this is something do with setting up the ORM configuration for devise.rb in config/initializers whic...
[ "ruby-on-rails", "mongodb", "devise", "mongomapper" ]
0
2
370
1
0
2011-06-08T14:01:18.640000
2011-06-08T14:10:09.857000
6,279,940
6,279,994
Creating database in android which stores image
I am a newbie to Android app development. For 1 of my project, I need to store images in a database. So here's what I did. package com.img.db; import java.io.ByteArrayOutputStream; import android.app.Activity; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory;...
The error is pretty self explainatory, you are trying to access a column's table that doesn't exists: table MyImage has no column named Imagebytes
Creating database in android which stores image I am a newbie to Android app development. For 1 of my project, I need to store images in a database. So here's what I did. package com.img.db; import java.io.ByteArrayOutputStream; import android.app.Activity; import android.content.res.Resources; import android.graphic...
TITLE: Creating database in android which stores image QUESTION: I am a newbie to Android app development. For 1 of my project, I need to store images in a database. So here's what I did. package com.img.db; import java.io.ByteArrayOutputStream; import android.app.Activity; import android.content.res.Resources; impo...
[ "android", "database", "image", "sqlite" ]
1
1
6,167
2
0
2011-06-08T14:01:59.860000
2011-06-08T14:05:49.303000
6,279,948
6,280,038
Will using multiple threads speed up my HTML file processing application?
I just finished up my most complex and feature-laden WinForms application to date. It loads a list any number of HTML files, then loads the content of one, uses some RegEx to match some tags and remove or replace them (yes, yes, I've seen this. It works just fine, thanks Cthulu), then writes it to disk. However, I noti...
Yes, you should start by using a Backgroundworker to decouple your work from the GUI. Handling a GUI event should never take too much time. Aim for 20ms, not 20s. Then as a bonus you could see if the processing (CPU intensive part) can be split into independent jobs and execute them as TPL Tasks. There is insufficient ...
Will using multiple threads speed up my HTML file processing application? I just finished up my most complex and feature-laden WinForms application to date. It loads a list any number of HTML files, then loads the content of one, uses some RegEx to match some tags and remove or replace them (yes, yes, I've seen this. I...
TITLE: Will using multiple threads speed up my HTML file processing application? QUESTION: I just finished up my most complex and feature-laden WinForms application to date. It loads a list any number of HTML files, then loads the content of one, uses some RegEx to match some tags and remove or replace them (yes, yes,...
[ "c#", "winforms", "multithreading" ]
3
3
252
5
0
2011-06-08T14:02:16.340000
2011-06-08T14:08:59.897000
6,279,950
6,286,862
Having Issues Uploading WAR File to WebSphere 6.1
I'm trying to deploy a web service onto WebSphere using a WAR file, which I have been told directly is completely possible and has been done many times before. WebSphere allows me to upload the file, specify the context root, and even start the application. However, when I try to access it by specifying my underlying U...
As you suspect your problem is lack for WebSphere support for Jersey (or rather JAX-RS). I don't see JAX-RS in the list of supported APIs by WAS. http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.help.ic.WS.doc/info_sching.html WAS 6.1 runs on J2SE 1.5 (as seen in the URL above) Specificati...
Having Issues Uploading WAR File to WebSphere 6.1 I'm trying to deploy a web service onto WebSphere using a WAR file, which I have been told directly is completely possible and has been done many times before. WebSphere allows me to upload the file, specify the context root, and even start the application. However, whe...
TITLE: Having Issues Uploading WAR File to WebSphere 6.1 QUESTION: I'm trying to deploy a web service onto WebSphere using a WAR file, which I have been told directly is completely possible and has been done many times before. WebSphere allows me to upload the file, specify the context root, and even start the applica...
[ "java", "eclipse", "websphere", "jersey", "war" ]
3
1
2,413
1
0
2011-06-08T14:02:41.650000
2011-06-09T00:34:42.557000
6,279,956
6,280,005
Ruby Exceptions -- Why "else"?
I'm trying to understand exceptions in Ruby but I'm a little confused. The tutorial I'm using says that if an exception occurs that does not match any of the exceptions identified by the rescue statements, you can use an "else" to catch it: begin # - rescue OneTypeOfException # - rescue AnotherTypeOfException # - else ...
The else is for when the block completes without an exception thrown. The ensure is run whether the block completes successfully or not. Example: begin puts "Hello, world!" rescue puts "rescue" else puts "else" ensure puts "ensure" end This will print Hello, world!, then else, then ensure.
Ruby Exceptions -- Why "else"? I'm trying to understand exceptions in Ruby but I'm a little confused. The tutorial I'm using says that if an exception occurs that does not match any of the exceptions identified by the rescue statements, you can use an "else" to catch it: begin # - rescue OneTypeOfException # - rescue A...
TITLE: Ruby Exceptions -- Why "else"? QUESTION: I'm trying to understand exceptions in Ruby but I'm a little confused. The tutorial I'm using says that if an exception occurs that does not match any of the exceptions identified by the rescue statements, you can use an "else" to catch it: begin # - rescue OneTypeOfExce...
[ "ruby", "exception" ]
73
132
25,624
5
0
2011-06-08T14:02:57.617000
2011-06-08T14:06:34.483000
6,279,962
6,280,031
flex regex not matching properly
In my tokenizer (.lex) file I want to match the following pattern: AaBC12/awD41/dfs21 etc... I've written this rule [A-Za-z]+[A-Za-z0-9]*[[/]+[A-Za-z][A-Za-z0-9]*]* {lline = cpflineno;cpflval.str = strdup(cpftext);return K_IDENTIFIER;} This rule seems correct to me but if i have an input like this: TOP/MD1 TOP/MD2 TOP/...
What about this: [A-Za-z]+[A-Za-z0-9]*([/]+[A-Za-z][A-Za-z0-9]*)* Replaced [] with () where you mean a group. Note that it will match foo////bar, if you don't want that remove the second + (and the first + for that matter too, it's useless in this case).
flex regex not matching properly In my tokenizer (.lex) file I want to match the following pattern: AaBC12/awD41/dfs21 etc... I've written this rule [A-Za-z]+[A-Za-z0-9]*[[/]+[A-Za-z][A-Za-z0-9]*]* {lline = cpflineno;cpflval.str = strdup(cpftext);return K_IDENTIFIER;} This rule seems correct to me but if i have an inpu...
TITLE: flex regex not matching properly QUESTION: In my tokenizer (.lex) file I want to match the following pattern: AaBC12/awD41/dfs21 etc... I've written this rule [A-Za-z]+[A-Za-z0-9]*[[/]+[A-Za-z][A-Za-z0-9]*]* {lline = cpflineno;cpflval.str = strdup(cpftext);return K_IDENTIFIER;} This rule seems correct to me but...
[ "regex", "bison", "flex-lexer" ]
0
1
368
1
0
2011-06-08T14:03:31.530000
2011-06-08T14:08:40.433000
6,279,963
6,280,163
How to add arp addresses into /proc/net/arp in C
I would like to add arp bindings into /proc/net/arp in C. Writing into file is not allowed, so trying to do it some other way. Any suggestions? I already know about net-tools, but havent tryed yet
ip neigh add can do this: For example: root@refactor:~# ip neigh show 192.168.1.1 dev wlan0 lladdr 00:1b:da:29:3a:87 REACHABLE root@refactor:~# ip neigh add 192.168.1.2 dev wlan0 lladdr 00:1b:da:29:3a:89 root@refactor:~# ip neigh show 192.168.1.2 dev wlan0 lladdr 00:1b:da:29:3a:89 PERMANENT 192.168.1.1 dev wlan0 lladdr...
How to add arp addresses into /proc/net/arp in C I would like to add arp bindings into /proc/net/arp in C. Writing into file is not allowed, so trying to do it some other way. Any suggestions? I already know about net-tools, but havent tryed yet
TITLE: How to add arp addresses into /proc/net/arp in C QUESTION: I would like to add arp bindings into /proc/net/arp in C. Writing into file is not allowed, so trying to do it some other way. Any suggestions? I already know about net-tools, but havent tryed yet ANSWER: ip neigh add can do this: For example: root@ref...
[ "c", "linux", "arp" ]
0
1
4,158
2
0
2011-06-08T14:03:42.200000
2011-06-08T14:15:57.367000
6,279,968
6,280,207
Pass data back from DetailedView of UITableView
I have a UITextView in a DetailedView of my UITableView. I want to be able to add some text, which is sent to a webservice with POST. If text is added it needs to show an indicator for that cell in the UITableView. When the POST is sent and viewWillDisapear I set the UITextView to empty. So my question is if also reque...
Passing data between view controllers is best achieved by using delegates. See this article on protocols and delegates.... tutorial
Pass data back from DetailedView of UITableView I have a UITextView in a DetailedView of my UITableView. I want to be able to add some text, which is sent to a webservice with POST. If text is added it needs to show an indicator for that cell in the UITableView. When the POST is sent and viewWillDisapear I set the UITe...
TITLE: Pass data back from DetailedView of UITableView QUESTION: I have a UITextView in a DetailedView of my UITableView. I want to be able to add some text, which is sent to a webservice with POST. If text is added it needs to show an indicator for that cell in the UITableView. When the POST is sent and viewWillDisap...
[ "iphone", "objective-c", "uitableview", "detailsview" ]
0
1
393
1
0
2011-06-08T14:03:53.387000
2011-06-08T14:18:16.650000
6,279,972
6,280,320
Get a file link in PHP
We have a VOIP server that stores wav files for call recordings. My intention was to put together a PHP file, where i can pass the calldate and uniqueid value in the URL for the file (since the server stores these as part of the filename) to retrieve a link to the file. However, i get the following error when trying to...
Right, just had another good hard look at this:-p You are missing two curly braces from the bottom of the file above getRecordingLink(): function getRecordingLink($callDate, $uniqueId){ $callDate_arr = explode(' ', $callDate); $removeChar = array('-',':'); foreach($callDate_arr as $value){ $callDate_arr_adj[] = str_r...
Get a file link in PHP We have a VOIP server that stores wav files for call recordings. My intention was to put together a PHP file, where i can pass the calldate and uniqueid value in the URL for the file (since the server stores these as part of the filename) to retrieve a link to the file. However, i get the followi...
TITLE: Get a file link in PHP QUESTION: We have a VOIP server that stores wav files for call recordings. My intention was to put together a PHP file, where i can pass the calldate and uniqueid value in the URL for the file (since the server stores these as part of the filename) to retrieve a link to the file. However,...
[ "php" ]
1
1
200
1
0
2011-06-08T14:03:58.560000
2011-06-08T14:24:44.263000
6,279,997
6,280,072
Remove character from string in VB6
I have some strings (file paths) that sometimes have randomly placed line breaks (CRLF) inside of them that I have to remove. How would I go about doing that?
Have a look at the Replace(..) function. someVariable = Replace(someVariable, vbNewLine, "")
Remove character from string in VB6 I have some strings (file paths) that sometimes have randomly placed line breaks (CRLF) inside of them that I have to remove. How would I go about doing that?
TITLE: Remove character from string in VB6 QUESTION: I have some strings (file paths) that sometimes have randomly placed line breaks (CRLF) inside of them that I have to remove. How would I go about doing that? ANSWER: Have a look at the Replace(..) function. someVariable = Replace(someVariable, vbNewLine, "")
[ "string", "vb6" ]
5
13
19,012
3
0
2011-06-08T14:06:10.357000
2011-06-08T14:10:51.777000
6,279,999
6,280,032
finding a dot on a circle by degree?
Let's say we have a 100x100 coordinate system, like the one below. 0,0 is its left-top corner, 50,50 is its center point, 100,100 is its bottom right corner, etc. Now we need to draw a line from the center outwards. We know the angle of the line, but need to calculate the coordinates of its end point. What do you think...
You need to use the trigonometric functions sin and cos. Something like this: theta = 45 // theta = pi * theta / 180 // convert to radians. radius = 50 centerX = 50 centerY = 50 p.x = centerX + radius * cos(theta) p.y = centerY - radius * sin(theta) Keep in mind that most implementations assume that you're working with...
finding a dot on a circle by degree? Let's say we have a 100x100 coordinate system, like the one below. 0,0 is its left-top corner, 50,50 is its center point, 100,100 is its bottom right corner, etc. Now we need to draw a line from the center outwards. We know the angle of the line, but need to calculate the coordinate...
TITLE: finding a dot on a circle by degree? QUESTION: Let's say we have a 100x100 coordinate system, like the one below. 0,0 is its left-top corner, 50,50 is its center point, 100,100 is its bottom right corner, etc. Now we need to draw a line from the center outwards. We know the angle of the line, but need to calcul...
[ "math", "geometry" ]
9
13
5,497
3
0
2011-06-08T14:06:15.767000
2011-06-08T14:08:41.197000
6,280,007
6,280,319
A variation of the jQuery fadeTo bug in IE
Inspired by an article which I read yesterday, I am striving to add a Konami code-induced Easter egg to my portfolio website. It started out as a bit of fun but, as can be the case when IE gets involved, a seemingly quite simple task has become something of a misery! Using the excellent jqPuzzle plugin, the idea is tha...
All you need to is add this option to shuffle it immediately: shuffle: true
A variation of the jQuery fadeTo bug in IE Inspired by an article which I read yesterday, I am striving to add a Konami code-induced Easter egg to my portfolio website. It started out as a bit of fun but, as can be the case when IE gets involved, a seemingly quite simple task has become something of a misery! Using the...
TITLE: A variation of the jQuery fadeTo bug in IE QUESTION: Inspired by an article which I read yesterday, I am striving to add a Konami code-induced Easter egg to my portfolio website. It started out as a bit of fun but, as can be the case when IE gets involved, a seemingly quite simple task has become something of a...
[ "jquery", "hide", "fadeout", "fadeto" ]
1
0
183
2
0
2011-06-08T14:06:52.450000
2011-06-08T14:24:40.067000
6,280,023
6,280,105
display:none - other options
I have in my form a listbox, encapsulated within a span, which i want to hide but i also want the listbox to be generated because i have a javascript code which reads the options inside that listbox and display the values as a string. When i use listbox code I notice that my js code reading the contents of the listbox ...
If you don't intend to show an input, you should use a instead and manipulate it's value. Inputs which are hidden with display:none, or inside a hidden container, will be parsed into the DOM, but will not be submitted, which I assume is the source of your confusion.
display:none - other options I have in my form a listbox, encapsulated within a span, which i want to hide but i also want the listbox to be generated because i have a javascript code which reads the options inside that listbox and display the values as a string. When i use listbox code I notice that my js code reading...
TITLE: display:none - other options QUESTION: I have in my form a listbox, encapsulated within a span, which i want to hide but i also want the listbox to be generated because i have a javascript code which reads the options inside that listbox and display the values as a string. When i use listbox code I notice that ...
[ "html" ]
1
2
954
2
0
2011-06-08T14:08:02.663000
2011-06-08T14:12:51.097000
6,280,034
6,280,087
HTML input field hint
I want to provide the user with a hint on what he needs to enter into my text field. However, when I set the value, it does not disappear once a user clicks on the text field. How can you make it disappear? Username:
You'd need attach an onFocus event to the input field via Javascript:
HTML input field hint I want to provide the user with a hint on what he needs to enter into my text field. However, when I set the value, it does not disappear once a user clicks on the text field. How can you make it disappear? Username:
TITLE: HTML input field hint QUESTION: I want to provide the user with a hint on what he needs to enter into my text field. However, when I set the value, it does not disappear once a user clicks on the text field. How can you make it disappear? Username: ANSWER: You'd need attach an onFocus event to the input field ...
[ "html", "textfield", "hint" ]
40
24
144,652
10
0
2011-06-08T14:08:48.793000
2011-06-08T14:11:44.683000
6,280,049
6,287,509
Is there an online web interface to manage Mercurial repositories?
My problem is quite simple I'm behind agressive proxy, firewall and every known human way to make a developer's life miserable and I cannot clone a repository from Google Code or any other sort of online repository for that matter. Question, Is there an online tool that allows me at least cloning a mercurial repository...
I doubt you'll be able to get around your network's restrictions with just a tool on your university machine. I asked a sysadmin friend about this, and together we came up a few ideas. These are all rather vague because there really isn't enough information about the university network to give a clear-cut solution. How...
Is there an online web interface to manage Mercurial repositories? My problem is quite simple I'm behind agressive proxy, firewall and every known human way to make a developer's life miserable and I cannot clone a repository from Google Code or any other sort of online repository for that matter. Question, Is there an...
TITLE: Is there an online web interface to manage Mercurial repositories? QUESTION: My problem is quite simple I'm behind agressive proxy, firewall and every known human way to make a developer's life miserable and I cannot clone a repository from Google Code or any other sort of online repository for that matter. Que...
[ "mercurial", "repository" ]
0
3
780
1
0
2011-06-08T14:09:45.710000
2011-06-09T02:37:10.797000
6,280,059
6,280,128
Is this RESTful URL (http://api.twitter.com/1/statuses/retweet/id.format)?
I've come across a Twitter REST API Method: statuses retweet which they say is RESTful. But I am confused now with the knowledge I have about RESTful API. Every URI should contain nouns only not actions, but in this URI I think 'retweet' is an action or a verb in a sense. Is this RESTful or am I missing anything or mis...
I wouldn't get too hung up on what a URI looks like but in this case, you can think of a retweet as a Resource and that you are creating a retweet when you POST to that URI. If you also look at other methods there is a "retweets" resource the GETs all the retweets. Now it would be not considered RESTful style if the we...
Is this RESTful URL (http://api.twitter.com/1/statuses/retweet/id.format)? I've come across a Twitter REST API Method: statuses retweet which they say is RESTful. But I am confused now with the knowledge I have about RESTful API. Every URI should contain nouns only not actions, but in this URI I think 'retweet' is an a...
TITLE: Is this RESTful URL (http://api.twitter.com/1/statuses/retweet/id.format)? QUESTION: I've come across a Twitter REST API Method: statuses retweet which they say is RESTful. But I am confused now with the knowledge I have about RESTful API. Every URI should contain nouns only not actions, but in this URI I think...
[ "rest", "twitter" ]
1
1
579
1
0
2011-06-08T14:10:08.013000
2011-06-08T14:14:21.917000
6,280,062
6,280,172
Substitute ConnectionString for some users on asp.net Web Site
I modify asp.net Web Site. I need use different connection strings for users. Web Site use Entity Framework for data access. How can I substitute settings in runtime? I can instantiate with specified ConnectionString, but it will require multiple changes, because used default constructor everywhere. I find solution for...
You can simply load a new connect string from either your web.config, database, or whereever you use it and assign it to your context object when you create it. See: http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/2efc32f7-23ad-4fad-84cf-279badb394a5
Substitute ConnectionString for some users on asp.net Web Site I modify asp.net Web Site. I need use different connection strings for users. Web Site use Entity Framework for data access. How can I substitute settings in runtime? I can instantiate with specified ConnectionString, but it will require multiple changes, b...
TITLE: Substitute ConnectionString for some users on asp.net Web Site QUESTION: I modify asp.net Web Site. I need use different connection strings for users. Web Site use Entity Framework for data access. How can I substitute settings in runtime? I can instantiate with specified ConnectionString, but it will require m...
[ "asp.net", "entity-framework", "connection-string", "appsettings" ]
0
0
224
1
0
2011-06-08T14:10:11.227000
2011-06-08T14:16:21.340000
6,280,067
6,280,300
Are there any techniques to separate code and markup in WordPress?
I generally work with Python to create web apps and love how I can work separately with the code and presentation layers. I really like working with Jinja2. But, I sometimes have to work with WordPress for my clients. So, I wonder, if there are any ways to make developing for WordPress a less headache with all its head...
Agreed with Denis, Wordpress simply is spaghetti, and there's nothing you can do about that. Nonetheless, if you're writing your own code for Wordpress (we make themes and plugins for our customers), there's nothing stopping you from splitting the concerns out into different files, and we found that it's much easier to...
Are there any techniques to separate code and markup in WordPress? I generally work with Python to create web apps and love how I can work separately with the code and presentation layers. I really like working with Jinja2. But, I sometimes have to work with WordPress for my clients. So, I wonder, if there are any ways...
TITLE: Are there any techniques to separate code and markup in WordPress? QUESTION: I generally work with Python to create web apps and love how I can work separately with the code and presentation layers. I really like working with Jinja2. But, I sometimes have to work with WordPress for my clients. So, I wonder, if ...
[ "php", "python", "model-view-controller", "wordpress" ]
3
3
803
4
0
2011-06-08T14:10:25.613000
2011-06-08T14:23:39.573000
6,280,086
6,280,439
download facebook photos using graph API in JSON Format?
Hi using graph API i am able to get the photos of my albums, now i want to download all the photos in the album to my computer. it returns data in JSon format, how can i filter only the Urls of the images from that json and then download all photos from that url my json is some like this format { "data": [ { "id": "11...
You can use JsonDecode: JsonDecode assume your json string is in a $data variable, you can try something like this: if you look at the source code of the page you'll have a pretty clear idea of how the json is structured, and you can easly use a foreach statement to get only the urls you need
download facebook photos using graph API in JSON Format? Hi using graph API i am able to get the photos of my albums, now i want to download all the photos in the album to my computer. it returns data in JSon format, how can i filter only the Urls of the images from that json and then download all photos from that url ...
TITLE: download facebook photos using graph API in JSON Format? QUESTION: Hi using graph API i am able to get the photos of my albums, now i want to download all the photos in the album to my computer. it returns data in JSon format, how can i filter only the Urls of the images from that json and then download all pho...
[ "php", "facebook", "facebook-graph-api" ]
2
2
1,722
1
0
2011-06-08T14:11:42.943000
2011-06-08T14:31:12.660000
6,280,114
6,280,212
I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView
I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView. I use [self.scrollView addSubview:view]; enter code here scrollView = [[UIScrollView alloc] initWithFrame:scrollViewRect]; -(void)scrollViewDidScroll:(UIScrollView *)sv { int page = [self currentPage]; // Load the visible a...
Are you assigning desired frame to the view before adding it to the scroll view?
I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView. I use [self.scrollView addSubview:view]; enter code here scrollView = [[UIScrollView alloc] initWithFrame:scrollViewRect]; -(vo...
TITLE: I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView QUESTION: I want to set image into UIScrollView, but there is a problem. Image is outside of UIScrollView. I use [self.scrollView addSubview:view]; enter code here scrollView = [[UIScrollView alloc] initWithFrame:scr...
[ "iphone", "uiscrollview" ]
0
1
477
1
0
2011-06-08T14:13:31.040000
2011-06-08T14:18:36.733000
6,280,119
6,280,225
Jquery hasClass for multiple classes
I am having,..checkbox....head.. Now in Jquery I am calling a function like, if($(this).hasClass("fixed")){.... } If I call $(this).hasClass("fixed"), then I need to get only head not checkbox and that is working perfect in Jquery 1.4.2 but now I updated to jquery 1.6.1. Now I am getting checkbox inside if condition. P...
I'd be very surprised if jQuery 1.4.2 gets this wrong jQuery 1.4.2 does not get this wrong. hasClass("fixed") should be true in both cases, in all versions of jQuery. Here's an example using v1.6.1, and the same example using v1.4.2. Both work fine. If you want to check that "fixed" it's the only class on an element, t...
Jquery hasClass for multiple classes I am having,..checkbox....head.. Now in Jquery I am calling a function like, if($(this).hasClass("fixed")){.... } If I call $(this).hasClass("fixed"), then I need to get only head not checkbox and that is working perfect in Jquery 1.4.2 but now I updated to jquery 1.6.1. Now I am ge...
TITLE: Jquery hasClass for multiple classes QUESTION: I am having,..checkbox....head.. Now in Jquery I am calling a function like, if($(this).hasClass("fixed")){.... } If I call $(this).hasClass("fixed"), then I need to get only head not checkbox and that is working perfect in Jquery 1.4.2 but now I updated to jquery ...
[ "javascript", "jquery" ]
6
10
25,664
5
0
2011-06-08T14:14:00.560000
2011-06-08T14:19:01.340000
6,280,136
6,280,267
Why doesn't my ASP.net page display until fully finished?
I'm using.net 2.0. This is a project that I have taken over for another developer. I have a aspx page that can take a long time to display under certain condition due to loading items from the database. What I want to do is to show a loading animation or something to let the user know the page is loading, so I tried to...
You might be able to use Asynchronous Pages to do this http://msdn.microsoft.com/en-us/magazine/cc163725.aspx
Why doesn't my ASP.net page display until fully finished? I'm using.net 2.0. This is a project that I have taken over for another developer. I have a aspx page that can take a long time to display under certain condition due to loading items from the database. What I want to do is to show a loading animation or somethi...
TITLE: Why doesn't my ASP.net page display until fully finished? QUESTION: I'm using.net 2.0. This is a project that I have taken over for another developer. I have a aspx page that can take a long time to display under certain condition due to loading items from the database. What I want to do is to show a loading an...
[ "asp.net", "c#-2.0" ]
0
2
1,185
3
0
2011-06-08T14:14:43.770000
2011-06-08T14:21:39.847000
6,280,147
6,280,249
Rails 3 - find_all_by_car_id and nil object
I am getting this error: [code] You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each [/code] In controller: @optionals = Car.find_all_by_car_id(1) In view: <% @optionals.each do |c| %> <%= c.type %> <% end %> In the table Car is one ...
Try adding a line in the template like so: <%= @optionals.inspect %> and make sure it's not nil. If it is, check the log to make sure the action that you're calling matches the template you're looking at
Rails 3 - find_all_by_car_id and nil object I am getting this error: [code] You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each [/code] In controller: @optionals = Car.find_all_by_car_id(1) In view: <% @optionals.each do |c| %> <%= ...
TITLE: Rails 3 - find_all_by_car_id and nil object QUESTION: I am getting this error: [code] You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each [/code] In controller: @optionals = Car.find_all_by_car_id(1) In view: <% @optionals.e...
[ "mysql", "ruby-on-rails-3", "find" ]
0
1
72
1
0
2011-06-08T14:15:07.430000
2011-06-08T14:20:22.227000
6,280,150
6,280,251
Lazarus - parse function based on delimiter
I am building a small app in Lazarus and need a parse function based on the underscore. For example: array:= Split(string, delimiter); So string = "this_is_the_first_post" and delimiter is the underscore resulting in the array being returned as: array[0] = this array[1] = is array[2] = the array[3] = first array[4] = p...
You can use the following code: var List1: TStringList; begin List1:= TStringList.Create; try List1.Delimiter:= '_'; List1.DelimitedText:= 'this_is_the_first_post'; ShowMessage(List1[0]); ShowMessage(List1[1]); ShowMessage(List1[2]); ShowMessage(List1[3]); ShowMessage(List1[4]); finally List1.Free; end; end; In this e...
Lazarus - parse function based on delimiter I am building a small app in Lazarus and need a parse function based on the underscore. For example: array:= Split(string, delimiter); So string = "this_is_the_first_post" and delimiter is the underscore resulting in the array being returned as: array[0] = this array[1] = is ...
TITLE: Lazarus - parse function based on delimiter QUESTION: I am building a small app in Lazarus and need a parse function based on the underscore. For example: array:= Split(string, delimiter); So string = "this_is_the_first_post" and delimiter is the underscore resulting in the array being returned as: array[0] = t...
[ "lazarus" ]
0
9
8,607
1
0
2011-06-08T14:15:13.723000
2011-06-08T14:20:34.470000
6,280,178
6,280,228
vibration and sound won't be played
I have the following code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); CharSequence tickerText = "HI!"; long when = System.currentTimeMillis(); Notification notification = new Notification(R.drawable.droid, tickerText, when); notifi...
Try: notification.defaults |= Notification.DEFAULT_SOUND; notification.defaults |= Notification.DEFAULT_LIGHTS; notification.defaults |= Notification.DEFAULT_VIBRATE;
vibration and sound won't be played I have the following code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); CharSequence tickerText = "HI!"; long when = System.currentTimeMillis(); Notification notification = new Notification(R.drawab...
TITLE: vibration and sound won't be played QUESTION: I have the following code: String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns); CharSequence tickerText = "HI!"; long when = System.currentTimeMillis(); Notification notification = new Not...
[ "android" ]
0
1
279
1
0
2011-06-08T14:16:48.283000
2011-06-08T14:19:27.717000
6,280,182
6,280,311
Creating a stepped seek bar
How can I create a stepped seek bar for an android interface, one that functions like the seek bar in the menu below.
I think you could use the RatingBar widget with some clever graphics. The other option is to Make your own widget, maybe starting with a subclass of SeekBar and implementing some sort of snapping to integer values (in the change listener).
Creating a stepped seek bar How can I create a stepped seek bar for an android interface, one that functions like the seek bar in the menu below.
TITLE: Creating a stepped seek bar QUESTION: How can I create a stepped seek bar for an android interface, one that functions like the seek bar in the menu below. ANSWER: I think you could use the RatingBar widget with some clever graphics. The other option is to Make your own widget, maybe starting with a subclass o...
[ "android", "user-interface" ]
1
0
1,304
2
0
2011-06-08T14:17:02.210000
2011-06-08T14:24:13.307000
6,280,194
6,280,352
Using values from AppConfig file in C#
selenium = new DefaultSelenium( ConfigurationManager.AppSettings["TestMachine"].ToString(), 4444, ConfigurationManager.AppSettings["Browser"].ToString(), ConfigurationManager.AppSettings["URL"].ToString() ); Is there an efficient way to do this, instead of repeating: ConfigurationManager.AppSettings[""].ToString()
I think a better idea is to write a wrapper class to everything that deals with configuration, especially if you write tests. A simple example might be: public interface IConfigurationService { string GetValue(string key); } This approach will allow you to mock your configuration when you need it and reduce complexity ...
Using values from AppConfig file in C# selenium = new DefaultSelenium( ConfigurationManager.AppSettings["TestMachine"].ToString(), 4444, ConfigurationManager.AppSettings["Browser"].ToString(), ConfigurationManager.AppSettings["URL"].ToString() ); Is there an efficient way to do this, instead of repeating: Configuration...
TITLE: Using values from AppConfig file in C# QUESTION: selenium = new DefaultSelenium( ConfigurationManager.AppSettings["TestMachine"].ToString(), 4444, ConfigurationManager.AppSettings["Browser"].ToString(), ConfigurationManager.AppSettings["URL"].ToString() ); Is there an efficient way to do this, instead of repeat...
[ "c#", "visual-studio", "selenium", "app-config" ]
5
4
7,122
8
0
2011-06-08T14:17:40.337000
2011-06-08T14:26:48.817000
6,280,202
6,280,256
Javascript alert when user closes the tab ot the window
I want when a user closes the tab or window or when he tries to move to another location different from my site to pops a confirm box, and if he confirm to execute an ajax script and then to close or change the window. I don't know how to do that. PS: I'm using jQuery.
$(window).unload(function() { var answer=confirm("Are you sure you want to leave?"); if(answer){ //ajax call here } }); Just add your own alert/dialogue code to the function.
Javascript alert when user closes the tab ot the window I want when a user closes the tab or window or when he tries to move to another location different from my site to pops a confirm box, and if he confirm to execute an ajax script and then to close or change the window. I don't know how to do that. PS: I'm using jQ...
TITLE: Javascript alert when user closes the tab ot the window QUESTION: I want when a user closes the tab or window or when he tries to move to another location different from my site to pops a confirm box, and if he confirm to execute an ajax script and then to close or change the window. I don't know how to do that...
[ "javascript", "jquery" ]
2
5
8,679
2
0
2011-06-08T14:18:10.727000
2011-06-08T14:20:52.417000
6,280,214
6,280,316
Domain driven design and domain events
I'm new to DDD and I'm reading articles now to get more information. One of the articles focuses on domain events (DE). For example sending email is a domain event raised after some criteria is met while executing piece of code. Code example shows one way of handling domain events and is followed by this paragraph Plea...
It's a general problem period never mind DDD In general, in any system which is required to respond in a performant manner (e.g. a Web Server, any long running activities should be handled asynchronously to the triggering process. This means queue. Rolling back your transaction should remove item from the queue. Of cou...
Domain driven design and domain events I'm new to DDD and I'm reading articles now to get more information. One of the articles focuses on domain events (DE). For example sending email is a domain event raised after some criteria is met while executing piece of code. Code example shows one way of handling domain events...
TITLE: Domain driven design and domain events QUESTION: I'm new to DDD and I'm reading articles now to get more information. One of the articles focuses on domain events (DE). For example sending email is a domain event raised after some criteria is met while executing piece of code. Code example shows one way of hand...
[ "domain-driven-design", "domain-events" ]
7
8
2,915
1
0
2011-06-08T14:18:39.893000
2011-06-08T14:24:31.430000
6,280,215
6,282,210
Where to put Padrino controller files in standalone Sinatra application?
I'm attempting to use Padrino's routing as a standalone addition to a basic Sinatra application. http://www.padrinorb.com/guides/standalone-usage-in-sinatra The main reason I need/want the additional Padrino functionality is the ability to separate my routes into multiple controller files. Is this something I can do wi...
You don't quite need to use the padrino routing to achieve the idea of controllers in Sinatra. In your main.rb file for your Sinatra app you can do: Dir.glob("controllers/*.rb").each { |r| require_relative r } Place your "controllers" into a controllers directory and the above will require_relative all of them for you....
Where to put Padrino controller files in standalone Sinatra application? I'm attempting to use Padrino's routing as a standalone addition to a basic Sinatra application. http://www.padrinorb.com/guides/standalone-usage-in-sinatra The main reason I need/want the additional Padrino functionality is the ability to separat...
TITLE: Where to put Padrino controller files in standalone Sinatra application? QUESTION: I'm attempting to use Padrino's routing as a standalone addition to a basic Sinatra application. http://www.padrinorb.com/guides/standalone-usage-in-sinatra The main reason I need/want the additional Padrino functionality is the ...
[ "ruby", "sinatra", "padrino" ]
1
3
363
1
0
2011-06-08T14:18:46.980000
2011-06-08T16:38:18.523000
6,280,218
6,280,295
MySQL date formatting
I have the following MySQL. SELECT `outputtable`.`date`, count(*) as `count` FROM ( SELECT CONCAT(DATE(`mytable`.`starttime`),' ',HOUR(`mytable`.`starttime`),':',LPAD(10*(MINUTE(`mytable`.`starttime`) DIV 10),2,'0')) as `date`, `mytable`.`clientid` FROM `mytable` WHERE `mytable`.`clientid`='1' GROUP BY `mytable`.`clien...
Cast it to date, like this: cast(CONCAT(DATE(`mytable`.`starttime`),' ',HOUR(`mytable`.`starttime`),':',LPAD(10*(MINUTE(`mytable`.`starttime`) DIV 10),2,'0')) as DATE) as date or more readably: SELECT cast(`outputtable`.`date` as date), count(*) as `count` -- the rest of the query the same
MySQL date formatting I have the following MySQL. SELECT `outputtable`.`date`, count(*) as `count` FROM ( SELECT CONCAT(DATE(`mytable`.`starttime`),' ',HOUR(`mytable`.`starttime`),':',LPAD(10*(MINUTE(`mytable`.`starttime`) DIV 10),2,'0')) as `date`, `mytable`.`clientid` FROM `mytable` WHERE `mytable`.`clientid`='1' GRO...
TITLE: MySQL date formatting QUESTION: I have the following MySQL. SELECT `outputtable`.`date`, count(*) as `count` FROM ( SELECT CONCAT(DATE(`mytable`.`starttime`),' ',HOUR(`mytable`.`starttime`),':',LPAD(10*(MINUTE(`mytable`.`starttime`) DIV 10),2,'0')) as `date`, `mytable`.`clientid` FROM `mytable` WHERE `mytable`....
[ "mysql", "datetime" ]
0
1
89
2
0
2011-06-08T14:18:56.307000
2011-06-08T14:23:22.057000
6,280,239
6,280,303
Understanding the scope of refactoring
I've always thought of code refactoring as only improving implementation details. I want to make sure I have the appropriate understanding of the scope to which refactoring applies (Wikipedia didn't help me much to understand this). For example, I hear people talking about "refactoring their designs", which seems parad...
Refactoring can be applied to a design as well as well as code, when you work with the existing design of the system to make improvements to it, either to improve readability, clarity, or make it easier to add new features in the future. Regardless of if you are applying refactoring to design or code, the idea is the s...
Understanding the scope of refactoring I've always thought of code refactoring as only improving implementation details. I want to make sure I have the appropriate understanding of the scope to which refactoring applies (Wikipedia didn't help me much to understand this). For example, I hear people talking about "refact...
TITLE: Understanding the scope of refactoring QUESTION: I've always thought of code refactoring as only improving implementation details. I want to make sure I have the appropriate understanding of the scope to which refactoring applies (Wikipedia didn't help me much to understand this). For example, I hear people tal...
[ "refactoring" ]
0
3
501
2
0
2011-06-08T14:19:56.937000
2011-06-08T14:23:55.073000
6,280,242
6,280,383
jfilechooser better look?
When I'm using JFileChooser application in my program on Windows 7 it display such window: But when I run the JWS File Chooser Demo it displays much better window: Why?
Because the demo doesn't use JFileChooser; it uses javax.jnlp.FileOpenService, which uses the native OS's file dialog. The source code for that demo is here, check it out.
jfilechooser better look? When I'm using JFileChooser application in my program on Windows 7 it display such window: But when I run the JWS File Chooser Demo it displays much better window: Why?
TITLE: jfilechooser better look? QUESTION: When I'm using JFileChooser application in my program on Windows 7 it display such window: But when I run the JWS File Chooser Demo it displays much better window: Why? ANSWER: Because the demo doesn't use JFileChooser; it uses javax.jnlp.FileOpenService, which uses the nati...
[ "java", "swing", "jfilechooser" ]
3
8
2,979
4
0
2011-06-08T14:20:03.947000
2011-06-08T14:28:15.770000
6,280,246
6,280,410
Section within a section - UITableView -
I just have a question with regards to the tableView. I know we can return the number of sections and rows with. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section Could you tell me how I can have something like: A ...
You will have to make your own implementation in cellForRowAtIndexPath where you return a row that is really made up of multiple rows and maybe a header label. Or maybe better is to make every other row a "header row" and check in cellForRowAtIndexPath whether you are on a "header row" or normal row; something like thi...
Section within a section - UITableView - I just have a question with regards to the tableView. I know we can return the number of sections and rows with. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section Could you ...
TITLE: Section within a section - UITableView - QUESTION: I just have a question with regards to the tableView. I know we can return the number of sections and rows with. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)...
[ "iphone", "objective-c", "xcode", "uitableview" ]
7
9
4,436
1
0
2011-06-08T14:20:18.030000
2011-06-08T14:29:52.927000
6,280,255
6,280,333
Getting the data from a CGRect object
I know that a CGRect consists of 4 floats. How can I get those floats from a given CGRect object? I searched for CGRect's class reference and found nothing.
Like this: (assuming a previously defined CGRect called myRect ) CGFloat x = myRect.origin.x; CGFloat y = myRect.origin.y; CGFloat height = myRect.size.height; CGFloat width = myRect.size.width;
Getting the data from a CGRect object I know that a CGRect consists of 4 floats. How can I get those floats from a given CGRect object? I searched for CGRect's class reference and found nothing.
TITLE: Getting the data from a CGRect object QUESTION: I know that a CGRect consists of 4 floats. How can I get those floats from a given CGRect object? I searched for CGRect's class reference and found nothing. ANSWER: Like this: (assuming a previously defined CGRect called myRect ) CGFloat x = myRect.origin.x; CGFl...
[ "ios", "cgrect" ]
1
3
1,899
2
0
2011-06-08T14:20:52.010000
2011-06-08T14:25:38.950000
6,280,257
6,280,342
How do I use fsockopen() to open a Telnet connection with a password?
I'd like to access a camera through it's Telnet capability. The problem is, it has Password-protection. This is no problem when doing it via Terminal, as I just use telnet 10.30.blah.blah then enter my password when prompted. But in php, I don't see the opportunity to input a password. $con = fsockopen("10.30.blah.blah...
You just output it. Some examples I've seen use fputs. You might have to sleep for a second to make sure the prompt comes up. There's actually an example in the comments on the fsockopen manual page: http://php.net/manual/en/function.fsockopen.php Really though I'd recommend looking for a module that does this. A quick...
How do I use fsockopen() to open a Telnet connection with a password? I'd like to access a camera through it's Telnet capability. The problem is, it has Password-protection. This is no problem when doing it via Terminal, as I just use telnet 10.30.blah.blah then enter my password when prompted. But in php, I don't see ...
TITLE: How do I use fsockopen() to open a Telnet connection with a password? QUESTION: I'd like to access a camera through it's Telnet capability. The problem is, it has Password-protection. This is no problem when doing it via Terminal, as I just use telnet 10.30.blah.blah then enter my password when prompted. But in...
[ "php", "telnet", "fsockopen" ]
2
1
15,697
3
0
2011-06-08T14:20:53.473000
2011-06-08T14:25:55.720000
6,280,262
6,282,400
how to prevent some columns from being highlighted when selecting a row
I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect these columns and have the first couple of columns remain selected. The highlight function...
I don't think you'll get what you want using selectrow. If you don't need multiple selections you could change the background of the current row with an expression in the datawindow. If you want some columns to stay normal you could do that with a rectangle behind the ones you want to highlight instead of changing the ...
how to prevent some columns from being highlighted when selecting a row I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect these columns and ...
TITLE: how to prevent some columns from being highlighted when selecting a row QUESTION: I have a semi-dynamically created window ( and use PowerBuilder 10.5 ). Now there are a couple of columns which can have different colours and I want to see those colours when selecting a row. However I don't know how to deselect ...
[ "highlighting", "powerbuilder", "datawindow" ]
1
0
2,129
2
0
2011-06-08T14:21:21.503000
2011-06-08T16:54:17.983000
6,280,263
6,280,374
How to add Meta Tags dynamically to pages?
I have a website with product pages that are created dynamically depending on the itemws in my database. The site works fine with no errors. I now would like to add Meta Tags to the header. When the pages are created I would like to dynamically/programmically set the meta tags for that page - Keywords, etc. How can I a...
See: http://ryanfarley.com/blog/archive/2006/03/25/18992.aspx I think its exactly what you want ex. // Render: meta = new HtmlMeta(); meta.Name = "date"; meta.Content = DateTime.Now.ToString("yyyy-MM-dd"); meta.Scheme = "YYYY-MM-DD"; this.Header.Controls.Add(meta);
How to add Meta Tags dynamically to pages? I have a website with product pages that are created dynamically depending on the itemws in my database. The site works fine with no errors. I now would like to add Meta Tags to the header. When the pages are created I would like to dynamically/programmically set the meta tags...
TITLE: How to add Meta Tags dynamically to pages? QUESTION: I have a website with product pages that are created dynamically depending on the itemws in my database. The site works fine with no errors. I now would like to add Meta Tags to the header. When the pages are created I would like to dynamically/programmically...
[ "asp.net", "vb.net", "visual-studio-2008", "header", "meta-tags" ]
2
6
8,147
1
0
2011-06-08T14:21:25.500000
2011-06-08T14:27:43.273000
6,280,273
6,280,302
how to display dynamic text in actionscript 3?
Im trying to display text but that isnt working. I create a dynamic text on the stage and assign it an instance '_test'. Then i have the following code _test.text = "hello"; When the code is ran, 'e' is displayed. Why?what am i doing wrong?
By the sound if it you're facing a font embedding issue, try setting the font to _sans and see if that fixes it! If yes, then you just have to make sure that you're embedding all the glyphs you need from your custom font.
how to display dynamic text in actionscript 3? Im trying to display text but that isnt working. I create a dynamic text on the stage and assign it an instance '_test'. Then i have the following code _test.text = "hello"; When the code is ran, 'e' is displayed. Why?what am i doing wrong?
TITLE: how to display dynamic text in actionscript 3? QUESTION: Im trying to display text but that isnt working. I create a dynamic text on the stage and assign it an instance '_test'. Then i have the following code _test.text = "hello"; When the code is ran, 'e' is displayed. Why?what am i doing wrong? ANSWER: By th...
[ "flash", "actionscript-3" ]
0
0
1,987
2
0
2011-06-08T14:21:59.307000
2011-06-08T14:23:53.307000
6,280,288
6,280,446
Getting the exact location of a UITableViewCell
Given a UITableView, how can I find the location of a specific UITableViewCell? In other words, I want to get its frame relative to my iPhone screen, not relative to the UITableView. So if my UITableView is scrolled up, the location of each UITableViewCell should be higher on the screen, etc.
You could also use the rectForRowAtIndexPath method to get the location of a UITableView by sending the indexPath for that. - (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath So use as below: CGRect myRect = [tableView rectForRowAtIndexPath:indexPath];
Getting the exact location of a UITableViewCell Given a UITableView, how can I find the location of a specific UITableViewCell? In other words, I want to get its frame relative to my iPhone screen, not relative to the UITableView. So if my UITableView is scrolled up, the location of each UITableViewCell should be highe...
TITLE: Getting the exact location of a UITableViewCell QUESTION: Given a UITableView, how can I find the location of a specific UITableViewCell? In other words, I want to get its frame relative to my iPhone screen, not relative to the UITableView. So if my UITableView is scrolled up, the location of each UITableViewCe...
[ "iphone", "ios", "uitableview" ]
55
101
59,820
9
0
2011-06-08T14:23:04.007000
2011-06-08T14:31:44.720000
6,280,326
6,280,344
C# Cmd Process Won't Work With Spaces
I am opening cmd.exe from my application and navigating it to a file but the problem is that if the file path has spaces in it, it won't go there. Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\Temp Folder"); Instead for looking of Temp Folder, it will only look for temp I guess. One way is to wrap the p...
The \ in the string needs to be escaped and you need to include folder names with space in double quotes. Try Process.Start("cmd.exe", @"/C choice /C Y /N /D Y /T 3 & cd C:\""Temp Folder"""); or Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\\\"Temp Folder\"");
C# Cmd Process Won't Work With Spaces I am opening cmd.exe from my application and navigating it to a file but the problem is that if the file path has spaces in it, it won't go there. Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\Temp Folder"); Instead for looking of Temp Folder, it will only look for ...
TITLE: C# Cmd Process Won't Work With Spaces QUESTION: I am opening cmd.exe from my application and navigating it to a file but the problem is that if the file path has spaces in it, it won't go there. Process.Start("cmd.exe", "/C choice /C Y /N /D Y /T 3 & cd C:\Temp Folder"); Instead for looking of Temp Folder, it w...
[ "c#", "cmd" ]
0
4
2,477
2
0
2011-06-08T14:25:10.020000
2011-06-08T14:26:04.283000
6,280,335
6,280,417
Useful Source Code Examples of C?
I'm currently delving into learning C and whilst I'm not far into the process, I'd like some examples of fully-functioning windows applications complete with source code that aren't too complicated to study - things like calculator/notepad? Anybody got any links to where I might find a good few examples beyond the 'con...
Did not answer exactly what you asked,but... Tring to solve some Euler problems is a good way to familiar with the language features. http://projecteuler.net/
Useful Source Code Examples of C? I'm currently delving into learning C and whilst I'm not far into the process, I'd like some examples of fully-functioning windows applications complete with source code that aren't too complicated to study - things like calculator/notepad? Anybody got any links to where I might find a...
TITLE: Useful Source Code Examples of C? QUESTION: I'm currently delving into learning C and whilst I'm not far into the process, I'd like some examples of fully-functioning windows applications complete with source code that aren't too complicated to study - things like calculator/notepad? Anybody got any links to wh...
[ "c" ]
0
2
664
3
0
2011-06-08T14:25:40.847000
2011-06-08T14:30:22.017000
6,280,361
6,280,406
this regular expression's meaning
I saw this in httpd.conf (of my mac) # # The following lines prevent.htaccess and.htpasswd files from being # viewed by Web clients. # Order allow,deny Deny from all Satisfy All that expression's former part(before or('|') sign) looks 'starting h or H, followed by T or t. but what does latter part mean? just 'starting ...
it is used to match files like:.htaccess (Apache configuration).DS_Store (Mac OS X Desktop Services Store file)
this regular expression's meaning I saw this in httpd.conf (of my mac) # # The following lines prevent.htaccess and.htpasswd files from being # viewed by Web clients. # Order allow,deny Deny from all Satisfy All that expression's former part(before or('|') sign) looks 'starting h or H, followed by T or t. but what does...
TITLE: this regular expression's meaning QUESTION: I saw this in httpd.conf (of my mac) # # The following lines prevent.htaccess and.htpasswd files from being # viewed by Web clients. # Order allow,deny Deny from all Satisfy All that expression's former part(before or('|') sign) looks 'starting h or H, followed by T o...
[ "regex" ]
0
2
246
3
0
2011-06-08T14:27:14.513000
2011-06-08T14:29:38.360000
6,280,381
6,280,429
android developer console issue
Yesterday my android app's active install was 76% and today it is 80% even though the number of install has not changed at all. Is it possible to go upward without increasing the number of installs? I guess this is a bug in Google's android developer console. Anyone had the same problem?
Perhaps people who had uninstalled the app previously re-installed it. This would increase the number of active installs but not increase the number of unique downloads.
android developer console issue Yesterday my android app's active install was 76% and today it is 80% even though the number of install has not changed at all. Is it possible to go upward without increasing the number of installs? I guess this is a bug in Google's android developer console. Anyone had the same problem?
TITLE: android developer console issue QUESTION: Yesterday my android app's active install was 76% and today it is 80% even though the number of install has not changed at all. Is it possible to go upward without increasing the number of installs? I guess this is a bug in Google's android developer console. Anyone had...
[ "android" ]
0
1
177
1
0
2011-06-08T14:28:09.223000
2011-06-08T14:30:50.883000
6,280,394
6,280,436
How to trigger VS post-build events without rebuilding
I have a bunch of VS 2005 C++ projects, which build a number of dlls and executables, which are a small part of a large interdependent file hierarchy. In order to debug the files, I copy the built execs/dlls to the hierarchy by post-build events. Sometimes I update my hierarchy, but have all my projects up to date - in...
As long as you do not rebuild, the build operation should not do more than execute those events, assuming there are no source code changes.
How to trigger VS post-build events without rebuilding I have a bunch of VS 2005 C++ projects, which build a number of dlls and executables, which are a small part of a large interdependent file hierarchy. In order to debug the files, I copy the built execs/dlls to the hierarchy by post-build events. Sometimes I update...
TITLE: How to trigger VS post-build events without rebuilding QUESTION: I have a bunch of VS 2005 C++ projects, which build a number of dlls and executables, which are a small part of a large interdependent file hierarchy. In order to debug the files, I copy the built execs/dlls to the hierarchy by post-build events. ...
[ "visual-c++", "visual-studio-2005", "rebuild", "post-build-event" ]
7
0
1,051
1
0
2011-06-08T14:29:00.493000
2011-06-08T14:31:02.753000
6,280,403
6,282,590
Android Project - Required Tools
I'm in the process of starting a new Android project that will: Display a Google map Track and record users movements Display the route on the map Show local points on interest on the map My question is what extra tools will I need to accomplish this? I can already get a basic Google Map working with zoom controls and ...
A Caltrans planning grant went towards creating an Android app called CycleTracks that does all of your bulleted items except the last one about points of interest. You can download the source code here: http://www.sfcta.org/downloads/cycletracks/CycleTracks-android.zip I haven't looked at the license to see how free y...
Android Project - Required Tools I'm in the process of starting a new Android project that will: Display a Google map Track and record users movements Display the route on the map Show local points on interest on the map My question is what extra tools will I need to accomplish this? I can already get a basic Google Ma...
TITLE: Android Project - Required Tools QUESTION: I'm in the process of starting a new Android project that will: Display a Google map Track and record users movements Display the route on the map Show local points on interest on the map My question is what extra tools will I need to accomplish this? I can already get...
[ "java", "android", "google-maps", "google-maps-api-3" ]
1
1
308
4
0
2011-06-08T14:29:28.787000
2011-06-08T17:13:26.447000
6,280,404
6,280,451
How can I absolutely position an element via jQuery?
I have a div nested in a td and the div class is set to absolute:.mouseover-tooltip { width:400px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border:1px solid #555; background-color:#FFFFFF; -webkit-box-shadow: #B3B3B3 9px 9px 9px; -moz-box-shadow: #B3B3B3 9px 9px 9px; box-shadow: #B3B3...
But when I give it a top of 0, it aligns itself with the top of it's parent. That's how absolute positioning works: relative to the offset parent. 1 From your statement I can infer that the element's parent is positioned. 2 Use.offset() to set the position of the element relative to the document, or change the HTML str...
How can I absolutely position an element via jQuery? I have a div nested in a td and the div class is set to absolute:.mouseover-tooltip { width:400px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border:1px solid #555; background-color:#FFFFFF; -webkit-box-shadow: #B3B3B3 9px 9px 9px; -m...
TITLE: How can I absolutely position an element via jQuery? QUESTION: I have a div nested in a td and the div class is set to absolute:.mouseover-tooltip { width:400px; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; border:1px solid #555; background-color:#FFFFFF; -webkit-box-shadow: #B3B3...
[ "jquery", "css", "css-position" ]
1
4
85
1
0
2011-06-08T14:29:31.313000
2011-06-08T14:31:54.857000
6,282,198
6,282,236
Reading string from input with space character?
I'm using Ubuntu and I'm also using Geany and CodeBlock as my IDE. What I'm trying to do is reading a string (like "Barack Obama" ) and put it in a variable: #include int main(void) { char name[100]; printf("Enter your name: "); scanf("%s", name); printf("Your Name is: %s", name); return 0; } Output: Enter your name:...
Use: fgets (name, 100, stdin); 100 is the max length of the buffer. You should adjust it as per your need. Use: scanf ("%[^\n]%*c", name); The [] is the scanset character. [^\n] tells that while the input is not a newline ( '\n' ) take input. Then with the %*c it reads the newline character from the input buffer (which...
Reading string from input with space character? I'm using Ubuntu and I'm also using Geany and CodeBlock as my IDE. What I'm trying to do is reading a string (like "Barack Obama" ) and put it in a variable: #include int main(void) { char name[100]; printf("Enter your name: "); scanf("%s", name); printf("Your Name is: %...
TITLE: Reading string from input with space character? QUESTION: I'm using Ubuntu and I'm also using Geany and CodeBlock as my IDE. What I'm trying to do is reading a string (like "Barack Obama" ) and put it in a variable: #include int main(void) { char name[100]; printf("Enter your name: "); scanf("%s", name); print...
[ "c", "string", "input", "scanf", "whitespace" ]
112
200
611,033
13
0
2011-06-08T16:37:35.023000
2011-06-08T16:40:28.157000
6,282,227
6,282,315
Best to build a SQL Query or extrapolate with another program?
I am having trouble developing some queries on the fly for our clients and sometimes find myself asking "Would it be better to start with a subset of the data I know I'm looking for, then just import into a program like Excel and process the data accordingly using similar functions, such as Pivot Tables"?. One instance...
I am a proponent of doing this kind of querying on the server side, at least to get just the data you need. You should create a time-periods table. It can get as complex as you desire, going down to days even. id year month monthstart monthend 1 2011 1 1/1/2011 1/31/2011... This gives you almost limitless ability to gr...
Best to build a SQL Query or extrapolate with another program? I am having trouble developing some queries on the fly for our clients and sometimes find myself asking "Would it be better to start with a subset of the data I know I'm looking for, then just import into a program like Excel and process the data accordingl...
TITLE: Best to build a SQL Query or extrapolate with another program? QUESTION: I am having trouble developing some queries on the fly for our clients and sometimes find myself asking "Would it be better to start with a subset of the data I know I'm looking for, then just import into a program like Excel and process t...
[ "mysql", "excel", "join", "subquery", "pivot-table" ]
2
2
740
2
0
2011-06-08T16:39:35.170000
2011-06-08T16:47:57.767000
6,282,238
6,282,261
How do I display an error message for a GUI app from non-GUI related classes?
I know I can use something like MessageBox.Show("some error") but I'm talking about an error that occurs at some lower level in my code that has no business tossing up a MessageBox or any other GUI elements. I'm building an RSS Client and I have a class which manages the various feeds (lets say FeedManager ) which is j...
Non-GUI code should indeed not show a MessageBox. The standard approach is to throw an Exception. Your GUI should surround the call to SaveFiles() with a try/catch block and take the appropriate action, like showing a Messagebox. Maybe you overlooked the point is that this is exactly what Exceptions are for: to communi...
How do I display an error message for a GUI app from non-GUI related classes? I know I can use something like MessageBox.Show("some error") but I'm talking about an error that occurs at some lower level in my code that has no business tossing up a MessageBox or any other GUI elements. I'm building an RSS Client and I h...
TITLE: How do I display an error message for a GUI app from non-GUI related classes? QUESTION: I know I can use something like MessageBox.Show("some error") but I'm talking about an error that occurs at some lower level in my code that has no business tossing up a MessageBox or any other GUI elements. I'm building an ...
[ "c#", ".net", "error-handling" ]
3
2
1,902
4
0
2011-06-08T16:40:37.317000
2011-06-08T16:42:48.260000
6,282,243
6,282,286
Batch: for /f +xcopy output - Save to .log
I have the next script, and I need it to save all the xcopy files copy outputs to one log file,:tmdeploy title Deploying Edithor - %deployer% set src_folder=S:\ApliTelinver\Compilacion\Edithor 10.5\CompilacionQA set dst_folder=S:\ApliTelinver\Ambientes-Edithor\Sincronizacion\Test\Test-Mantenimiento set filelist=filelis...
You should use the appended redirection operator, >> instead of >. So, your for loop will look like this: REM for /f %%i in (%filelist%) DO xcopy /S/E/U/Y "%src_folder%\%%i" "%dst_folder%" >> "%dd%.log" for /f "delims=" %%i in (%filelist%) do ( xcopy /S/E/U/Y "%src_folder%\%%i" "%dst_folder%" >> "%dd%.log" )
Batch: for /f +xcopy output - Save to .log I have the next script, and I need it to save all the xcopy files copy outputs to one log file,:tmdeploy title Deploying Edithor - %deployer% set src_folder=S:\ApliTelinver\Compilacion\Edithor 10.5\CompilacionQA set dst_folder=S:\ApliTelinver\Ambientes-Edithor\Sincronizacion\T...
TITLE: Batch: for /f +xcopy output - Save to .log QUESTION: I have the next script, and I need it to save all the xcopy files copy outputs to one log file,:tmdeploy title Deploying Edithor - %deployer% set src_folder=S:\ApliTelinver\Compilacion\Edithor 10.5\CompilacionQA set dst_folder=S:\ApliTelinver\Ambientes-Editho...
[ "scripting", "batch-file", "scripting-language" ]
1
4
7,921
1
0
2011-06-08T16:40:46.510000
2011-06-08T16:45:16.403000
6,282,244
6,282,408
Equivalent of #define in Java for macros
My question is close to this one but not quite the same. I have an inherited (as in, I can't/won't change it) array of parameters in my class like so: public double[] params; The class utilises these parameters in complex ways, so I would prefer to have human-readable names for each element in the array. In C, you woul...
If you have an array of doubles and each array element in a specific position has a definite meaning you should create a class instead. public class MyParamBlob extends ParentParamBlob { private double myReadableParameter; private double anotherParameter; private double yetOneMore; // getters and setters as appropriat...
Equivalent of #define in Java for macros My question is close to this one but not quite the same. I have an inherited (as in, I can't/won't change it) array of parameters in my class like so: public double[] params; The class utilises these parameters in complex ways, so I would prefer to have human-readable names for ...
TITLE: Equivalent of #define in Java for macros QUESTION: My question is close to this one but not quite the same. I have an inherited (as in, I can't/won't change it) array of parameters in my class like so: public double[] params; The class utilises these parameters in complex ways, so I would prefer to have human-r...
[ "java", "preprocessor", "c-preprocessor" ]
3
1
8,688
4
0
2011-06-08T16:40:58.967000
2011-06-08T16:54:44.630000
6,282,258
6,282,434
Using boost::asio to perform unicast messaging
What is the simplest way in C++ (an actual code example would be great) to establish/open a UDP unicast connection if I know the IP address and port? The resolver/query/endpoint/iterator stuff seems a bit like overkill and at my level of understanding, so far a bit confusing. First of all I'm new to Boost, but I have d...
There is an example here that uses resolvers etc. http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/tutorial/tutdaytime4.html If you wish to use an ip address that you already have, you can do something like this: boost::asio::ip::address ip_add = boost::asio::ip::address::from_string("192.168.1.1"); tcp::endpoi...
Using boost::asio to perform unicast messaging What is the simplest way in C++ (an actual code example would be great) to establish/open a UDP unicast connection if I know the IP address and port? The resolver/query/endpoint/iterator stuff seems a bit like overkill and at my level of understanding, so far a bit confusi...
TITLE: Using boost::asio to perform unicast messaging QUESTION: What is the simplest way in C++ (an actual code example would be great) to establish/open a UDP unicast connection if I know the IP address and port? The resolver/query/endpoint/iterator stuff seems a bit like overkill and at my level of understanding, so...
[ "c++", "windows" ]
0
1
972
1
0
2011-06-08T16:42:22.540000
2011-06-08T16:57:15.470000
6,282,263
6,282,302
Adding small scroll icon when a new row is been added to table view
Is there any way to show an icon in a table view when a new row is been added?
Keep track of which items are new externally to the table view. Then for each of your table cells, check to see if the item is new. If it is new, then set an image view on your custom table cell to be unhidden, and you should be good. What you will need then: A model for each of your items you are displaying in your ta...
Adding small scroll icon when a new row is been added to table view Is there any way to show an icon in a table view when a new row is been added?
TITLE: Adding small scroll icon when a new row is been added to table view QUESTION: Is there any way to show an icon in a table view when a new row is been added? ANSWER: Keep track of which items are new externally to the table view. Then for each of your table cells, check to see if the item is new. If it is new, ...
[ "objective-c", "cocoa-touch", "ios", "uitableview", "scroll" ]
1
0
445
1
0
2011-06-08T16:42:58.703000
2011-06-08T16:46:56.253000
6,282,266
6,282,350
Need help with odd Access query
I have an existing Access database which contains training records for employees. If an employee has been trained or has been scheduled for training there is a record in the linking table. If not, there is no record. I want to query all employees not trained on a certain thing, but there aren't any records. Database is...
I think this should get it for you... However, since they would not have been trained, we can't make up a Training Date for them, hence I've only included the two columns... select t.Description, emp.FullName, et.ScheduledDate from trainings t join employees emp left join EmployeeTrainings et on emp.EmployeeID = et.Emp...
Need help with odd Access query I have an existing Access database which contains training records for employees. If an employee has been trained or has been scheduled for training there is a record in the linking table. If not, there is no record. I want to query all employees not trained on a certain thing, but there...
TITLE: Need help with odd Access query QUESTION: I have an existing Access database which contains training records for employees. If an employee has been trained or has been scheduled for training there is a record in the linking table. If not, there is no record. I want to query all employees not trained on a certai...
[ "sql", "ms-access" ]
2
2
76
1
0
2011-06-08T16:43:07.547000
2011-06-08T16:50:38.330000
6,282,268
6,282,380
Windows: signaling a Java process to show its window
I have a Java process that runs in the background. How can I quickly signal the process to show its window? I want a really light-weight script that can do this and can be launched from the Start Menu. I think maybe a BAT file that checks if the lock file has been touched in the last few seconds, signal the process, ot...
One option would be to have that process having a listener on a port (as an example 8888), then you could send a message to that port (or do something like telnet localhost 8888). The running processes could have a separate thread listening on that port. Another option would be to use JMX communication with the JVM - s...
Windows: signaling a Java process to show its window I have a Java process that runs in the background. How can I quickly signal the process to show its window? I want a really light-weight script that can do this and can be launched from the Start Menu. I think maybe a BAT file that checks if the lock file has been to...
TITLE: Windows: signaling a Java process to show its window QUESTION: I have a Java process that runs in the background. How can I quickly signal the process to show its window? I want a really light-weight script that can do this and can be launched from the Start Menu. I think maybe a BAT file that checks if the loc...
[ "java", "desktop-application", "background-process", "launcher" ]
0
3
265
2
0
2011-06-08T16:43:27.520000
2011-06-08T16:53:06.270000
6,282,271
6,282,311
Pass values to another page
I have a page where I output some data (page1.php). Also I have another page (page2.php) where I need to pass the values as well. // page1.php $myVals = '""'; foreach($values as $name) { $myVals.= ',"'.( strlen($name)? htmlspecialchars($name): ' ').'"'; } $_SESSION['myVals'] = $myVals; On page2.php I need myVals to ...
Why not store it as an array in page1? Page1: foreach($values as $name) { $_SESSION['myVals'][] = strlen($name)? htmlspecialchars($name): ' '; } Page2: $xls->addRow($_SESSION['myVals']);
Pass values to another page I have a page where I output some data (page1.php). Also I have another page (page2.php) where I need to pass the values as well. // page1.php $myVals = '""'; foreach($values as $name) { $myVals.= ',"'.( strlen($name)? htmlspecialchars($name): ' ').'"'; } $_SESSION['myVals'] = $myVals; On...
TITLE: Pass values to another page QUESTION: I have a page where I output some data (page1.php). Also I have another page (page2.php) where I need to pass the values as well. // page1.php $myVals = '""'; foreach($values as $name) { $myVals.= ',"'.( strlen($name)? htmlspecialchars($name): ' ').'"'; } $_SESSION['myVa...
[ "php" ]
0
1
495
2
0
2011-06-08T16:44:02.633000
2011-06-08T16:47:41.783000
6,282,281
6,282,594
shared method to update Core Data NSManagedObject?
I am looking for a basic pattern where I can move some shared code. I have an NSManagedObject PurchaseOrder which is stored in Core Data. This can be edited and changed in several different views. Most of the time it is always the same type of change, PurchaseOrder is updated with data from another NSManagedObject Clie...
Where is your updatePurchaseOrder method defined? In this situation, I would create a custom PurchaseOrder subclass of the NSManagedObject and implement an updateWithClient method. @interface PurchaseOrder: NSManagedObject { } -(void)updateWithClient:(Client *)client; @end So you can simply call [aPurchaseOrder updat...
shared method to update Core Data NSManagedObject? I am looking for a basic pattern where I can move some shared code. I have an NSManagedObject PurchaseOrder which is stored in Core Data. This can be edited and changed in several different views. Most of the time it is always the same type of change, PurchaseOrder is ...
TITLE: shared method to update Core Data NSManagedObject? QUESTION: I am looking for a basic pattern where I can move some shared code. I have an NSManagedObject PurchaseOrder which is stored in Core Data. This can be edited and changed in several different views. Most of the time it is always the same type of change,...
[ "iphone", "objective-c" ]
0
2
216
1
0
2011-06-08T16:44:58.160000
2011-06-08T17:13:32.437000
6,282,295
6,282,851
Command line serial terminal
I'm using Eclipse to develop application for embedded systems. One of the options of Eclipse configurations are "Program to run after programming/building" Usually, on that textbox it's the path to our.exe generated before, but on this case I want to run a serial port terminal, like this: terminal -COM=9 -baud=9600... ...
You could use the Target Management platform to achieve this result. Sadly, I did not try this, so cannot tell whether it works or not, but should be according to the about page.
Command line serial terminal I'm using Eclipse to develop application for embedded systems. One of the options of Eclipse configurations are "Program to run after programming/building" Usually, on that textbox it's the path to our.exe generated before, but on this case I want to run a serial port terminal, like this: t...
TITLE: Command line serial terminal QUESTION: I'm using Eclipse to develop application for embedded systems. One of the options of Eclipse configurations are "Program to run after programming/building" Usually, on that textbox it's the path to our.exe generated before, but on this case I want to run a serial port term...
[ "eclipse", "embedded", "terminal", "serial-port", "microchip" ]
2
2
1,610
1
0
2011-06-08T16:45:58.677000
2011-06-08T17:33:51.633000
6,282,296
6,282,406
C# Populate drop down based on data from cookie
I will see if I can explain this clearly enough. I have 2 web forms. One is a basic Forms Authentication login page and the other form displays tasks from multiple servers. I am creating a cookie that stores the UserID. Here is the code for my cookie: FormsAuthenticationTicket tkt = new FormsAuthenticationTicket(1, txt...
Looks like you'll need to do a join to your permissions table something like SELECT ServerIP from Servers s, Permissions p where p.serverid = s.serverid and p.userid =:userIdFromCookie Then you'll need to pass in the user id from your cookie into the Populate method and use a DbParameter to pass the value into your Sql...
C# Populate drop down based on data from cookie I will see if I can explain this clearly enough. I have 2 web forms. One is a basic Forms Authentication login page and the other form displays tasks from multiple servers. I am creating a cookie that stores the UserID. Here is the code for my cookie: FormsAuthenticationT...
TITLE: C# Populate drop down based on data from cookie QUESTION: I will see if I can explain this clearly enough. I have 2 web forms. One is a basic Forms Authentication login page and the other form displays tasks from multiple servers. I am creating a cookie that stores the UserID. Here is the code for my cookie: Fo...
[ "c#", "sql", "webforms" ]
0
1
273
1
0
2011-06-08T16:46:10.297000
2011-06-08T16:54:42.683000
6,282,298
6,282,370
Detecting idle users in Winforms
I'd like to pause my program if a user is inactive for 5 minutes. By inactive I mean hasn't pressed their mouse or their keyboard during that time (including outside the program too!). Any starting points?
Within a timer you could p/invoke GetLastInputInfo() which will return the number ms since input was detected from the user, across all processes in the current session.
Detecting idle users in Winforms I'd like to pause my program if a user is inactive for 5 minutes. By inactive I mean hasn't pressed their mouse or their keyboard during that time (including outside the program too!). Any starting points?
TITLE: Detecting idle users in Winforms QUESTION: I'd like to pause my program if a user is inactive for 5 minutes. By inactive I mean hasn't pressed their mouse or their keyboard during that time (including outside the program too!). Any starting points? ANSWER: Within a timer you could p/invoke GetLastInputInfo() w...
[ "c#", "winforms" ]
14
11
9,992
5
0
2011-06-08T16:46:38.217000
2011-06-08T16:52:13.593000
6,282,303
6,282,470
UITableView not pushing the Detail View!
losing sleep over this issue My app hierarchy is ListVC1-->ListVC2-->DetailVC. [Working perfect] and... SearchListVC-->DetailVC (the same DetailVC as above) [Issue is in this model] The code in SearchListVC is almost same as ListVC2, with a difference that it contains a SearchBar, instead of a navigationBar, on top. Al...
I suppose the problem is that, you dont have a navigation controller in the SearchListVC. Like you wrote, it contains a SearchBar, instead of a navigationBar, on top Use a navigation controller with the SearchListVC and I think your problem is solved. Cheers
UITableView not pushing the Detail View! losing sleep over this issue My app hierarchy is ListVC1-->ListVC2-->DetailVC. [Working perfect] and... SearchListVC-->DetailVC (the same DetailVC as above) [Issue is in this model] The code in SearchListVC is almost same as ListVC2, with a difference that it contains a SearchBa...
TITLE: UITableView not pushing the Detail View! QUESTION: losing sleep over this issue My app hierarchy is ListVC1-->ListVC2-->DetailVC. [Working perfect] and... SearchListVC-->DetailVC (the same DetailVC as above) [Issue is in this model] The code in SearchListVC is almost same as ListVC2, with a difference that it c...
[ "iphone", "uitableview", "pushviewcontroller" ]
0
1
771
2
0
2011-06-08T16:47:01.917000
2011-06-08T17:01:29
6,282,305
6,282,755
Why I can't define android attributes in default namespace?
Typically I have to write layout code like this: I want to do something like this: But this code doesn't run properly. Why? And second question: Why element namen are in CamelCase and attributes are in under_score?
XML default namespaces do not apply to attribute names. Hence, you always have to specify the namespace of an attribute, if it has one: Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear. So the real ques...
Why I can't define android attributes in default namespace? Typically I have to write layout code like this: I want to do something like this: But this code doesn't run properly. Why? And second question: Why element namen are in CamelCase and attributes are in under_score?
TITLE: Why I can't define android attributes in default namespace? QUESTION: Typically I have to write layout code like this: I want to do something like this: But this code doesn't run properly. Why? And second question: Why element namen are in CamelCase and attributes are in under_score? ANSWER: XML default namesp...
[ "android", "xml", "namespaces" ]
7
8
1,066
2
0
2011-06-08T16:47:24.990000
2011-06-08T17:26:53.537000
6,282,307
6,283,074
ExecJS and could not find a JavaScript runtime
I'm trying to use the Mongoid / Devise Rails 3.1 template ( Mongoid and Devise ), and I keep getting an error stating ExecJS cannot find a JavaScript runtime. Fair enough when I didn't have any installed, but I've tried installing Node.js, Mustang and the Ruby Racer, but nothing is working. I could not find a JavaScrip...
Ubuntu Users I'm on Ubuntu 11.04 and had similar issues. Installing Node.js fixed it. As of Ubuntu 13.04 x64 you only need to run: sudo apt-get install nodejs This will solve the problem. CentOS/RedHat Users sudo yum install nodejs
ExecJS and could not find a JavaScript runtime I'm trying to use the Mongoid / Devise Rails 3.1 template ( Mongoid and Devise ), and I keep getting an error stating ExecJS cannot find a JavaScript runtime. Fair enough when I didn't have any installed, but I've tried installing Node.js, Mustang and the Ruby Racer, but n...
TITLE: ExecJS and could not find a JavaScript runtime QUESTION: I'm trying to use the Mongoid / Devise Rails 3.1 template ( Mongoid and Devise ), and I keep getting an error stating ExecJS cannot find a JavaScript runtime. Fair enough when I didn't have any installed, but I've tried installing Node.js, Mustang and the...
[ "ruby-on-rails-3.1", "execjs", "javascript" ]
416
453
274,514
19
0
2011-06-08T16:47:34.583000
2011-06-08T17:53:09.423000
6,282,310
6,282,343
Is there a way to tell what version of the .Net Framework is being used by a #define
I have some.cs files that are shared amongst several projects and if possible I would like to be able to #define away things that are part of the 3.5 framework if I am attempting to compile to the 2.0 framework. Is there a #define that is already built in to do this?
You'll need to define constants based on $(TargetFrameworkVersion). Have a look at this question.
Is there a way to tell what version of the .Net Framework is being used by a #define I have some.cs files that are shared amongst several projects and if possible I would like to be able to #define away things that are part of the 3.5 framework if I am attempting to compile to the 2.0 framework. Is there a #define that...
TITLE: Is there a way to tell what version of the .Net Framework is being used by a #define QUESTION: I have some.cs files that are shared amongst several projects and if possible I would like to be able to #define away things that are part of the 3.5 framework if I am attempting to compile to the 2.0 framework. Is th...
[ "c#", "visual-studio-2010" ]
1
2
350
1
0
2011-06-08T16:47:39.920000
2011-06-08T16:50:14.930000
6,282,316
6,283,030
Formatting Specific Parts of a Listview Item
So in my application I am using a ListView to display data from an ArrayList which holds objects. The data is displayed using the same method as the tutorial on the android developer website: // automatically adds a ListView to fill the entire screen of this activity setListAdapter(new ArrayAdapter (this, R.layout.list...
I would recommend using a custom adapter extending BaseAdapter. http://developer.android.com/reference/android/widget/BaseAdapter.html See this link for an example. http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/
Formatting Specific Parts of a Listview Item So in my application I am using a ListView to display data from an ArrayList which holds objects. The data is displayed using the same method as the tutorial on the android developer website: // automatically adds a ListView to fill the entire screen of this activity setList...
TITLE: Formatting Specific Parts of a Listview Item QUESTION: So in my application I am using a ListView to display data from an ArrayList which holds objects. The data is displayed using the same method as the tutorial on the android developer website: // automatically adds a ListView to fill the entire screen of thi...
[ "java", "android", "listview", "formatting", "textview" ]
0
0
1,615
1
0
2011-06-08T16:48:03.370000
2011-06-08T17:47:45.997000
6,282,319
6,282,484
jQuery tabs is loaded but not working in WordPress
I am trying to work with jQuery UI tabs in WordPress but I keep getting the "jQuery("#").tabs is not a function" error. I thought the tabs file might not be loading but looking in firebug it shows it is loading. I am also using modernizr so I thought there might be a conflict with that but using jQuery.noConflict(); di...
I see the following scripts being loaded on your page: modernizr-1.6.min.js l10n.js jquery.js galleria.js and $.tabs is an extension of jQuery UI, and I don't see jQuery UI or the tabs extension loaded on your page. Look at the very bottom of the source at your link and you'll see the following two scripts, which I bel...
jQuery tabs is loaded but not working in WordPress I am trying to work with jQuery UI tabs in WordPress but I keep getting the "jQuery("#").tabs is not a function" error. I thought the tabs file might not be loading but looking in firebug it shows it is loading. I am also using modernizr so I thought there might be a c...
TITLE: jQuery tabs is loaded but not working in WordPress QUESTION: I am trying to work with jQuery UI tabs in WordPress but I keep getting the "jQuery("#").tabs is not a function" error. I thought the tabs file might not be loading but looking in firebug it shows it is loading. I am also using modernizr so I thought ...
[ "javascript", "jquery", "wordpress", "jquery-ui" ]
1
1
1,887
2
0
2011-06-08T16:48:16.023000
2011-06-08T17:02:35.050000
6,282,321
6,282,411
design pattern to handle version specific display to user
I have been looking for this pattern for some time but still did not get very good way of representing this. Consider a GUI design which needs to show attributes of an object based on version, these versions specify which attributes makes sense to a client. (say the client has details of supported versions ) The GUI la...
I would extract shared functionality out into another object and have them composed inside your actual class. For example, if the class is A, you would do CommonA and have A_1 contain an object of CommonA and A_2 contain an object of CommonA as well. Here A_1 and A_2 represent version 1 and version 2. Both A_1 and A_2 ...
design pattern to handle version specific display to user I have been looking for this pattern for some time but still did not get very good way of representing this. Consider a GUI design which needs to show attributes of an object based on version, these versions specify which attributes makes sense to a client. (say...
TITLE: design pattern to handle version specific display to user QUESTION: I have been looking for this pattern for some time but still did not get very good way of representing this. Consider a GUI design which needs to show attributes of an object based on version, these versions specify which attributes makes sense...
[ "java", "user-interface", "design-patterns", "gwt" ]
0
1
734
2
0
2011-06-08T16:48:20.753000
2011-06-08T16:55:05.127000
6,282,326
6,282,377
Selection of Div that contains no class - jQuery
I have been attempting to capture the event when a user clicks on a section of my menu that doesn't contain any other type of contents / class. The menu itself is separated into two portions, both of which are floated (one on the right and another on the left) and I am just trying to grab when the click occurs inside t...
Compare this to e.target. If they are the same, the element where the event is handled will be the same as the one where it originated. $('#test').click(function(e) { if (this === e.target) { alert('#test itself clicked'); } else { alert('some child element was clicked'); } }); jsFiddle.
Selection of Div that contains no class - jQuery I have been attempting to capture the event when a user clicks on a section of my menu that doesn't contain any other type of contents / class. The menu itself is separated into two portions, both of which are floated (one on the right and another on the left) and I am j...
TITLE: Selection of Div that contains no class - jQuery QUESTION: I have been attempting to capture the event when a user clicks on a section of my menu that doesn't contain any other type of contents / class. The menu itself is separated into two portions, both of which are floated (one on the right and another on th...
[ "jquery", "jquery-selectors", "html" ]
2
3
227
2
0
2011-06-08T16:48:32.117000
2011-06-08T16:52:50.653000
6,282,332
6,283,588
Cannot play html5 audio on ipad safari
I am unable to play html5 audio on iPad Safari..i have tried var audio = document.createElement('audio'); audio.type = "audio/mpeg"; audio.src = audioUrl; x.appendChild(audio); audio.load() audio.play(); and x.innerHTML = ' '; I am able to play on desktop Safari, but on the iPad it says, cannot play movie... I am using...
Some video and audio types are served up by certain browsers with no configuration on your part (which is likely why mp3 files are being served), but you will need to add a mapping to.htaccess in order for the MPEG audio to work for you. Just open your.htaccess file for your site and add (something like) the following ...
Cannot play html5 audio on ipad safari I am unable to play html5 audio on iPad Safari..i have tried var audio = document.createElement('audio'); audio.type = "audio/mpeg"; audio.src = audioUrl; x.appendChild(audio); audio.load() audio.play(); and x.innerHTML = ' '; I am able to play on desktop Safari, but on the iPad i...
TITLE: Cannot play html5 audio on ipad safari QUESTION: I am unable to play html5 audio on iPad Safari..i have tried var audio = document.createElement('audio'); audio.type = "audio/mpeg"; audio.src = audioUrl; x.appendChild(audio); audio.load() audio.play(); and x.innerHTML = ' '; I am able to play on desktop Safari,...
[ "ipad", "html", "safari", "html5-audio" ]
4
1
4,249
1
0
2011-06-08T16:49:09.960000
2011-06-08T18:39:47.153000
6,282,333
6,283,472
YAML::Emitter stream size
I have an iterative algorithm, written in C++. I am using yaml-cpp. On each iteration I send send some data to a YAML::Emitter object. When the algorithm terminates I use YAML::Emitter::c_str() to write the underlying buffer to an ofstream. However, I would prefer to write the buffer to the file incrementally every few...
It sounds like you'd like a pluggable "writer" for the YAML::Emitter - if so, please file a feature request at http://code.google.com/p/yaml-cpp/issues/list. (I can't guarantee how quickly I'll get to it, but I'd be happy to accept patches as well.) In the meantime, you can tag-team the emitter's c_str() and size() met...
YAML::Emitter stream size I have an iterative algorithm, written in C++. I am using yaml-cpp. On each iteration I send send some data to a YAML::Emitter object. When the algorithm terminates I use YAML::Emitter::c_str() to write the underlying buffer to an ofstream. However, I would prefer to write the buffer to the fi...
TITLE: YAML::Emitter stream size QUESTION: I have an iterative algorithm, written in C++. I am using yaml-cpp. On each iteration I send send some data to a YAML::Emitter object. When the algorithm terminates I use YAML::Emitter::c_str() to write the underlying buffer to an ofstream. However, I would prefer to write th...
[ "c++", "file-io", "yaml", "ostream", "yaml-cpp" ]
0
0
349
1
0
2011-06-08T16:49:14.273000
2011-06-08T18:29:47.370000
6,282,340
6,282,877
What browsers support XSLT 2.0?
The Safari browser does not support XSLT 2.0 documents. What browsers, if any, support XSLT 2.0?
Browsers do not yet support XSLT 2.0, natively. Saxon 9 CE is a JavaScript-based XSLT 2.0 implementation. Frameless is another, more light-weight XSLT 2.0 implementation in the browser, supporting large parts of the XSLT 2.0 and XPath 2.0 functionality See also: How can I make XSLT work in chrome? https://developer.moz...
What browsers support XSLT 2.0? The Safari browser does not support XSLT 2.0 documents. What browsers, if any, support XSLT 2.0?
TITLE: What browsers support XSLT 2.0? QUESTION: The Safari browser does not support XSLT 2.0 documents. What browsers, if any, support XSLT 2.0? ANSWER: Browsers do not yet support XSLT 2.0, natively. Saxon 9 CE is a JavaScript-based XSLT 2.0 implementation. Frameless is another, more light-weight XSLT 2.0 implement...
[ "xml", "xslt", "browser", "xslt-2.0" ]
31
29
17,682
1
0
2011-06-08T16:50:04.103000
2011-06-08T17:35:30.350000
6,282,346
6,282,369
Jcarousel design problem
Excuse me. I am using jcarousel for nice sliders. so I have got two sliders on my web page. The first slider is greater than second. so i need modify the separation between images in second slider without modify css (The css is for all sliders in webpage). However when I modify margin-right in jcarousel-item: If the jc...
It's a documented issue by the jCarousel developer that wrap:circular is broken and won't be fixed until the next release. https://github.com/jsor/jcarousel/issues/search?q=circular https://github.com/jsor/jcarousel/issues/182
Jcarousel design problem Excuse me. I am using jcarousel for nice sliders. so I have got two sliders on my web page. The first slider is greater than second. so i need modify the separation between images in second slider without modify css (The css is for all sliders in webpage). However when I modify margin-right in ...
TITLE: Jcarousel design problem QUESTION: Excuse me. I am using jcarousel for nice sliders. so I have got two sliders on my web page. The first slider is greater than second. so i need modify the separation between images in second slider without modify css (The css is for all sliders in webpage). However when I modif...
[ "jquery", "jcarousel" ]
1
3
1,209
2
0
2011-06-08T16:50:29.857000
2011-06-08T16:52:03.367000
6,282,349
6,282,505
Design Issue with tab bar, nav bar & segment control
This is more of a requirement than a problem. There is a tab bar controller, in one of the controllers of the tab bar controller there is a nav controller. Below it there is a segment control, I have to display some data(which I'll get thru URL connections) in table view. On changing of segment from the segment control...
I looked into this quite a lot and eventually plumped for changing the data source of a single TableView. I only had two segments, cell types, fetchedResultsControllers etc. and it still made for a pretty heavy custom TableViewController. Lazy loading images, if you need to do that, is also a bit of a pain. I didn't ne...
Design Issue with tab bar, nav bar & segment control This is more of a requirement than a problem. There is a tab bar controller, in one of the controllers of the tab bar controller there is a nav controller. Below it there is a segment control, I have to display some data(which I'll get thru URL connections) in table ...
TITLE: Design Issue with tab bar, nav bar & segment control QUESTION: This is more of a requirement than a problem. There is a tab bar controller, in one of the controllers of the tab bar controller there is a nav controller. Below it there is a segment control, I have to display some data(which I'll get thru URL conn...
[ "iphone", "ios", "uitableview", "uinavigationcontroller", "uitabbarcontroller" ]
0
0
428
1
0
2011-06-08T16:50:37.223000
2011-06-08T17:05:17.607000
6,282,351
6,282,388
In PHP, how I show various images from a BLOB field in the database with the HTML content?
I stored it images in the database using an BLOB field (I'm using SQLite). Now I want to recover this image to a HTML page and show the images there. I can retrieve the binary data from the image from the database, but what I can do to transform this data in an image and show in the page? Currently I want to show the i...
You could abuse the data: protocol, but trust me, you don't want that if you can avoid it. Normally, you create a separate php-script that serves images, so in script 1: In myimagescript.php: //get the data from the database somehow (mysql query et al.) //let's assuma the data is in $data header('Content-Type: image/jp...
In PHP, how I show various images from a BLOB field in the database with the HTML content? I stored it images in the database using an BLOB field (I'm using SQLite). Now I want to recover this image to a HTML page and show the images there. I can retrieve the binary data from the image from the database, but what I can...
TITLE: In PHP, how I show various images from a BLOB field in the database with the HTML content? QUESTION: I stored it images in the database using an BLOB field (I'm using SQLite). Now I want to recover this image to a HTML page and show the images there. I can retrieve the binary data from the image from the databa...
[ "php", "image", "sqlite", "blob", "transform" ]
2
1
2,808
5
0
2011-06-08T16:50:46.567000
2011-06-08T16:53:57.867000
6,282,361
6,282,492
Relative Markersize in Matlab plots
I am trying to plot a matrix where each element is in one out of two states. (ising model..) Now, I would like to have one state colored and the other one white. That works using [i,j] = find(S); figure(gcf); plothandle = scatter(i,j); axis([0 nNodes+1 0 nNodes+1]); when S holds the Spins and one state is equal to 0. (...
For displaying data of this sort I generally prefer IMAGE or IMAGESC to PCOLOR since PCOLOR won't display the last row and column of the matrix when using faceted shading (the default). Also, IMAGE and IMAGESC flip the y axis so the image more intuitively matches what you think of when looking at a matrix (i.e. rows st...
Relative Markersize in Matlab plots I am trying to plot a matrix where each element is in one out of two states. (ising model..) Now, I would like to have one state colored and the other one white. That works using [i,j] = find(S); figure(gcf); plothandle = scatter(i,j); axis([0 nNodes+1 0 nNodes+1]); when S holds the ...
TITLE: Relative Markersize in Matlab plots QUESTION: I am trying to plot a matrix where each element is in one out of two states. (ising model..) Now, I would like to have one state colored and the other one white. That works using [i,j] = find(S); figure(gcf); plothandle = scatter(i,j); axis([0 nNodes+1 0 nNodes+1]);...
[ "matlab", "plot" ]
6
3
1,279
2
0
2011-06-08T16:51:26.877000
2011-06-08T17:03:42.723000
6,282,365
6,283,031
How to get JSF components on previous page to rerender when user clicks on the back button?
I have a search page for an internal webapp that has several JSF components on the page. When the user clicks on the form submit, a number of results are displayed with links to other pages. My problem is that when one of these links is clicked, then the back button is clicked, the previous page appears to be missing t...
See answer here: javax.faces.application.ViewExpiredException: View could not be restored Particularly the part about adding a Filter with: response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1. response.setHeader("Pragma", "no-cache"); // HTTP 1.0. response.setDateHeader("Expires", 0)...
How to get JSF components on previous page to rerender when user clicks on the back button? I have a search page for an internal webapp that has several JSF components on the page. When the user clicks on the form submit, a number of results are displayed with links to other pages. My problem is that when one of these ...
TITLE: How to get JSF components on previous page to rerender when user clicks on the back button? QUESTION: I have a search page for an internal webapp that has several JSF components on the page. When the user clicks on the form submit, a number of results are displayed with links to other pages. My problem is that ...
[ "jsf", "rerender" ]
1
1
1,028
1
0
2011-06-08T16:51:50.640000
2011-06-08T17:47:52.047000
6,282,374
6,282,460
Grails sql queries
Imagine I have something like this: def example = { def temp = ConferenceUser.findAllByUser(User.get(session.user)) [temp: temp] } Explaining my problem: Although dynamic finders are very easy to use and fast to learn, I must replace dynamic finders of my website for sql queries because it is a requirement. As I don't ...
yes, with grails you can do both plain sql and hql queries. HQL is 'hibernate query language' and allows you to write sql-like statements, but use your domain classes and properties instead of the table names and column names. To do an hql query, do something like def UserList = ConferenceUser.executeQuery('from Confer...
Grails sql queries Imagine I have something like this: def example = { def temp = ConferenceUser.findAllByUser(User.get(session.user)) [temp: temp] } Explaining my problem: Although dynamic finders are very easy to use and fast to learn, I must replace dynamic finders of my website for sql queries because it is a requi...
TITLE: Grails sql queries QUESTION: Imagine I have something like this: def example = { def temp = ConferenceUser.findAllByUser(User.get(session.user)) [temp: temp] } Explaining my problem: Although dynamic finders are very easy to use and fast to learn, I must replace dynamic finders of my website for sql queries bec...
[ "sql", "grails" ]
11
12
42,612
3
0
2011-06-08T16:52:39.250000
2011-06-08T17:00:20.697000
6,282,376
6,282,452
How to version Android app in Eclipse?
I would like to know how Android app versioning is done when creating apps with Eclipse. Now I've completed my first working application and would like to develop it further. But I dont want to mess with code of a working application until improved application will be in working condition. Now I can open up new project...
Use version control for this. For your needs I think Git or Subversion would be enough. So take your working app code, check it in the VCS you chose (Git, Subversion etc), tag it for a release and go from there. There are some other aspects here. You need to learn about version control and how to use it. And you need t...
How to version Android app in Eclipse? I would like to know how Android app versioning is done when creating apps with Eclipse. Now I've completed my first working application and would like to develop it further. But I dont want to mess with code of a working application until improved application will be in working c...
TITLE: How to version Android app in Eclipse? QUESTION: I would like to know how Android app versioning is done when creating apps with Eclipse. Now I've completed my first working application and would like to develop it further. But I dont want to mess with code of a working application until improved application wi...
[ "android" ]
3
5
919
4
0
2011-06-08T16:52:49.173000
2011-06-08T16:59:11.717000
6,282,378
6,282,461
Get record set from stored procedure using C++ ADODB CommandPtr::Execute()
I'm trying to get a recordset from a stored procedure using ADODB. Stored procedures get executeed successfully (Doing everything written in the SP), but the recordset count is "-1". Here is what I'm doing (stored procedure has no parameters): hr = ptrCom.CreateInstance(__uuidof(Command)); ptrCom->ActiveConnection = _c...
Have you tried just calling Execute? ptrCom->Execute(NULL, NULL, ADODB::adCmdStoredProc); returns _RecordSetPtr. You might also want to try: after you set the connection. ptrCom->ActiveConnection->PutCursorLocation(ADODB::adUseClient);
Get record set from stored procedure using C++ ADODB CommandPtr::Execute() I'm trying to get a recordset from a stored procedure using ADODB. Stored procedures get executeed successfully (Doing everything written in the SP), but the recordset count is "-1". Here is what I'm doing (stored procedure has no parameters): h...
TITLE: Get record set from stored procedure using C++ ADODB CommandPtr::Execute() QUESTION: I'm trying to get a recordset from a stored procedure using ADODB. Stored procedures get executeed successfully (Doing everything written in the SP), but the recordset count is "-1". Here is what I'm doing (stored procedure has...
[ "c++", "sql", "adodb" ]
1
0
2,673
1
0
2011-06-08T16:52:58.937000
2011-06-08T17:00:28.630000
6,282,386
6,282,526
Java BufferedOutputStream strategy
You can give the BufferedOutputStream constructor a int parameter for the buffer size. I my szenario I have one process writing to the disk and on process reading from the disk. Having a default buffer of 8192 bytes causes high fragmentation of big files. Now I was wondering if I could reduce the fragmentation if I lif...
The BufferedOutputStream does not use any time based algorithm or other statistics to invoke flush internally. It will flush as soon as the buffer is full or you flush it explitily (or before the buffered stream is closed). In other words: a larger buffer size will reduce fragmentation for your use case.
Java BufferedOutputStream strategy You can give the BufferedOutputStream constructor a int parameter for the buffer size. I my szenario I have one process writing to the disk and on process reading from the disk. Having a default buffer of 8192 bytes causes high fragmentation of big files. Now I was wondering if I coul...
TITLE: Java BufferedOutputStream strategy QUESTION: You can give the BufferedOutputStream constructor a int parameter for the buffer size. I my szenario I have one process writing to the disk and on process reading from the disk. Having a default buffer of 8192 bytes causes high fragmentation of big files. Now I was w...
[ "java", "process", "stream", "buffer", "disk" ]
0
5
2,479
2
0
2011-06-08T16:53:29.717000
2011-06-08T17:07:24.090000
6,282,403
6,283,011
How to vertically align a DIV next to an image?
I have the following html code: Name: Date of birth: Employee id: Status: and the following css: #personalInfo { width: 35%; float: left; clear: left; margin-top: 5%; margin-left: 2%; font-size: 1.3em; } #details { margin-left: 5%; }.photo { vertical-align: middle; width: 150px; height: 150px; float: left; margin-left:...
Use display: inline-block. #details { display: inline-block; vertical-align:middle; border:solid black 1px; width: 300px; }.photo { display: inline-block; vertical-align:middle; width: 300px; height: 300px; border: 1px solid #d1c7ac; }
How to vertically align a DIV next to an image? I have the following html code: Name: Date of birth: Employee id: Status: and the following css: #personalInfo { width: 35%; float: left; clear: left; margin-top: 5%; margin-left: 2%; font-size: 1.3em; } #details { margin-left: 5%; }.photo { vertical-align: middle; width:...
TITLE: How to vertically align a DIV next to an image? QUESTION: I have the following html code: Name: Date of birth: Employee id: Status: and the following css: #personalInfo { width: 35%; float: left; clear: left; margin-top: 5%; margin-left: 2%; font-size: 1.3em; } #details { margin-left: 5%; }.photo { vertical-ali...
[ "html", "css" ]
14
29
22,793
3
0
2011-06-08T16:54:36.853000
2011-06-08T17:45:44.180000
6,282,409
6,289,512
PHP image resizing - Opinions wanted
I have been looking around and would like to know what everyone uses to resize images in case I am missing out. I am using php imageGD library imagejpeg() ect. I have continually updated my class to try and "Solve" this one situation: If an image a user uploads is say 469x358 and the display end picture needs to be or ...
If an image a user uploads is say 469x358 and the display end picture needs to be or is designed to fit within a 120x80 box for instance. If i resize based upon width the resulting resized image will be 120x92, i could just then fix the height but that will pixelate or squash the image, i could also crop the end off wi...
PHP image resizing - Opinions wanted I have been looking around and would like to know what everyone uses to resize images in case I am missing out. I am using php imageGD library imagejpeg() ect. I have continually updated my class to try and "Solve" this one situation: If an image a user uploads is say 469x358 and th...
TITLE: PHP image resizing - Opinions wanted QUESTION: I have been looking around and would like to know what everyone uses to resize images in case I am missing out. I am using php imageGD library imagejpeg() ect. I have continually updated my class to try and "Solve" this one situation: If an image a user uploads is ...
[ "php", "image-processing", "resize", "image-resizing" ]
2
2
1,097
2
0
2011-06-08T16:54:44.520000
2011-06-09T07:34:35.960000
6,282,427
6,282,496
Syntax for calling HTTP Servlet from Flex
Just trying to figure out the proper syntax for making a POST to an HTTP Servlet from Flex. A Java developer gave me this URL to call: http://myUrl:myPort/myProject/test/getFile/?fileId=1225 I want to build the the HTTPService url dynamically, meaning I pass the '1225' at the end. My question is regarding how to transl...
If you form your parameters in ActionScript in send() method use the following: And you can use simple object for params: var params:Object = {fileId: 1225}; rawFileServlet.send(params);
Syntax for calling HTTP Servlet from Flex Just trying to figure out the proper syntax for making a POST to an HTTP Servlet from Flex. A Java developer gave me this URL to call: http://myUrl:myPort/myProject/test/getFile/?fileId=1225 I want to build the the HTTPService url dynamically, meaning I pass the '1225' at the e...
TITLE: Syntax for calling HTTP Servlet from Flex QUESTION: Just trying to figure out the proper syntax for making a POST to an HTTP Servlet from Flex. A Java developer gave me this URL to call: http://myUrl:myPort/myProject/test/getFile/?fileId=1225 I want to build the the HTTPService url dynamically, meaning I pass t...
[ "apache-flex", "actionscript-3", "flex4" ]
0
3
3,682
1
0
2011-06-08T16:56:51.253000
2011-06-08T17:04:18.530000
6,282,433
6,282,795
Playing movies with MPMoviePlayer -- controls will not display
I want to play a movie with controls -- Play, Stop, Fast Forward, etc. I use this code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *movieUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"Spot" ofType:@"mp4"]]; MPMoviePlayerController* myMovie=[[MPMoviePlayerController alloc] initWithContentU...
Try if this works... -(void)viewWillAppear:(BOOL)animated { NSString *urlStr = [[NSBundle mainBundle] pathForResource:@"Spot.mp4" ofType:nil]; NSURL *url = [NSURL fileURLWithPath:urlStr]; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [self.view addSubview:moviePlayer.view]; moviePlayer.view.fr...
Playing movies with MPMoviePlayer -- controls will not display I want to play a movie with controls -- Play, Stop, Fast Forward, etc. I use this code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *movieUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"Spot" ofType:@"mp4"]]; MPMoviePlayerContro...
TITLE: Playing movies with MPMoviePlayer -- controls will not display QUESTION: I want to play a movie with controls -- Play, Stop, Fast Forward, etc. I use this code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *movieUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"Spot" ofType:@"mp4"]]; M...
[ "objective-c", "cocoa-touch", "ios", "mpmovieplayercontroller" ]
1
0
1,364
1
0
2011-06-08T16:57:02.553000
2011-06-08T17:29:49.953000
6,282,447
6,283,279
Executing stored procedures from a DbContext
I have two simple stored procedures in SqlServer: SetData(@id int, @data varchar(10)) GetData(@id int). GetData currently returns a single-row, single-column result set, but I could change it to be a proper function if needed. What would be the best way to execute these from a DbContext instance? If possible, I'd like ...
DbContext offers these functions. Use: IEumerable<...> result = myContext.Database.SqlQuery<...>(...) to execute retrieval stored procedure and int result = myContext.Database.ExecuteSqlCommand(...) to execute data modification stored procedure.
Executing stored procedures from a DbContext I have two simple stored procedures in SqlServer: SetData(@id int, @data varchar(10)) GetData(@id int). GetData currently returns a single-row, single-column result set, but I could change it to be a proper function if needed. What would be the best way to execute these from...
TITLE: Executing stored procedures from a DbContext QUESTION: I have two simple stored procedures in SqlServer: SetData(@id int, @data varchar(10)) GetData(@id int). GetData currently returns a single-row, single-column result set, but I could change it to be a proper function if needed. What would be the best way to ...
[ "sql-server", "entity-framework-4.1" ]
8
23
25,583
1
0
2011-06-08T16:58:39.370000
2011-06-08T18:12:43.957000
6,282,449
6,282,572
Get the value of selected option from a dropdown list in the same file in php?
I have 2 drop down list, one is college and other is branch, so what i want to do is that whenever a user selects a college from the first drop down list, the script should automatically check for the branches available in that college and should add them to the second drop down list i.e. of branches, currently I am do...
As a note, this is a better user-experience if done with AJAX. However, you need to set your form to submit onchange of your college select box. Then, in your PHP, you need to do: if( isset( $_POST['coll1'] ) ) { //query your branches and populate select same as you did for colleges. //e.g. "SELECT * FROM Branches WHER...
Get the value of selected option from a dropdown list in the same file in php? I have 2 drop down list, one is college and other is branch, so what i want to do is that whenever a user selects a college from the first drop down list, the script should automatically check for the branches available in that college and s...
TITLE: Get the value of selected option from a dropdown list in the same file in php? QUESTION: I have 2 drop down list, one is college and other is branch, so what i want to do is that whenever a user selects a college from the first drop down list, the script should automatically check for the branches available in ...
[ "php", "html", "html-select" ]
0
0
4,897
5
0
2011-06-08T16:58:53.047000
2011-06-08T17:11:39.643000
6,282,455
6,282,508
Simplifing a group of mouseover functions jquery
Let me start by saying that this is working correctly, but I know it's not the most efficient way of coding it and I'm lacking the knowledge / understanding as to how to do this. For this specific problem, i have 8 different events that are using a mouseover / mouseout function where it is hiding other classes that are...
If you have control of how the page content is rendered, then I would recommend moving the identifying numbers out of the classes and into the id s. e.g. This will allow you to write one block of code for all instances: $('.songresult').mouseover(function(){ var ID=$(this).attr('id').replace(/\D/g,''); $('.barReadout')...
Simplifing a group of mouseover functions jquery Let me start by saying that this is working correctly, but I know it's not the most efficient way of coding it and I'm lacking the knowledge / understanding as to how to do this. For this specific problem, i have 8 different events that are using a mouseover / mouseout f...
TITLE: Simplifing a group of mouseover functions jquery QUESTION: Let me start by saying that this is working correctly, but I know it's not the most efficient way of coding it and I'm lacking the knowledge / understanding as to how to do this. For this specific problem, i have 8 different events that are using a mous...
[ "jquery", "each", "optimization" ]
1
3
401
2
0
2011-06-08T16:59:32.210000
2011-06-08T17:05:44.527000
6,282,466
6,282,509
JSF doesn't support cross-field validation, is there a workaround?
JSF 2.0 only allows you to validate the input on one field, like check to see if it's a certain length. It doesn't allow you to have a form that says, "enter city and state, or enter just a zip code." How have you gotten around this? I'm only interested in answers that involve the validation phase of JSF. I'm not inter...
The easiest custom approach I've seen and used as far is to create a field with a wherein you reference all involved components as. If you declare it before the to-be-validated components, then you can obtain the submitted values inside the validator by UIInput#getSubmittedValue(). E.g. (please note the value="true" on...
JSF doesn't support cross-field validation, is there a workaround? JSF 2.0 only allows you to validate the input on one field, like check to see if it's a certain length. It doesn't allow you to have a form that says, "enter city and state, or enter just a zip code." How have you gotten around this? I'm only interested...
TITLE: JSF doesn't support cross-field validation, is there a workaround? QUESTION: JSF 2.0 only allows you to validate the input on one field, like check to see if it's a certain length. It doesn't allow you to have a form that says, "enter city and state, or enter just a zip code." How have you gotten around this? I...
[ "validation", "jsf", "jsf-2" ]
39
64
21,196
2
0
2011-06-08T17:00:52.960000
2011-06-08T17:05:51.177000
6,282,468
6,282,641
How to combine 2 matrices into a graph
I have 2 symmetric matrices (mathematical meaning of matrices), one with distances between locations (the locations are coded with 4 digit numbers:2030, 2059, 2095...) that looks like this: 2030 2059 2095... 2030 NA 59328 68464 2059 59328 NA 37196 2095 68464 37196 NA... and another with the correlations between locatio...
If you just want to plot correlations as a function of distances, without imposing a particular structure on your plot, you can just extract the lower part of your respective matrices, e.g. x <- matrix(rnorm(1000), nrow=20) d.mat <- as.matrix(dist(x)) c.mat <- cor(t(x)) plot(d.mat[lower.tri(d.mat)], c.mat[lower.tri(c.m...
How to combine 2 matrices into a graph I have 2 symmetric matrices (mathematical meaning of matrices), one with distances between locations (the locations are coded with 4 digit numbers:2030, 2059, 2095...) that looks like this: 2030 2059 2095... 2030 NA 59328 68464 2059 59328 NA 37196 2095 68464 37196 NA... and anothe...
TITLE: How to combine 2 matrices into a graph QUESTION: I have 2 symmetric matrices (mathematical meaning of matrices), one with distances between locations (the locations are coded with 4 digit numbers:2030, 2059, 2095...) that looks like this: 2030 2059 2095... 2030 NA 59328 68464 2059 59328 NA 37196 2095 68464 3719...
[ "r", "matrix", "plot" ]
3
5
3,212
2
0
2011-06-08T17:01:13.613000
2011-06-08T17:16:17.343000
6,282,471
6,282,908
How do I integrate ScalaTest with Spring
I need to populate my ScalaTest tests with @Autowired fields from a Spring context, but most Scalatest tests (eg FeatureSpec s can't be run by the SpringJUnit4ClassRunner.class - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="myPackage.UnitTestSpringConfiguration", loader=AnnotationConfigConte...
Use the TestContextManager, as this caches the contexts so that they aren't rebuilt every test. It is configured from the class annotations. @ContextConfiguration( locations = Array("myPackage.UnitTestSpringConfiguration"), loader = classOf[AnnotationConfigContextLoader]) class AdminLoginFeatureTest extends FeatureSpec...
How do I integrate ScalaTest with Spring I need to populate my ScalaTest tests with @Autowired fields from a Spring context, but most Scalatest tests (eg FeatureSpec s can't be run by the SpringJUnit4ClassRunner.class - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="myPackage.UnitTestSpringCon...
TITLE: How do I integrate ScalaTest with Spring QUESTION: I need to populate my ScalaTest tests with @Autowired fields from a Spring context, but most Scalatest tests (eg FeatureSpec s can't be run by the SpringJUnit4ClassRunner.class - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations="myPackage...
[ "spring", "scala", "scalatest" ]
15
28
9,628
4
0
2011-06-08T17:01:31.563000
2011-06-08T17:38:23.743000
6,282,478
6,282,662
htaccess: specific directory requests to forward to PHP file
So I am writing an on-the-fly thumbnail generator for a CMS and I am trying to find the best way to handle requests. Specifically, I need to come up with the apache code for an htaccess file that will take all requests to a thumbnail folder and send them to a thumbnail.php file instead. Ideally it would only forward yo...
I guess you're looking for a regex: RewriteEngine on RewriteBase /unknown_folder/media/thumbnails/ # optional, depends on your setup #Check for file existence here and forward if exists RewriteCond %{REQUEST_FILENAME}!-f RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^([a-z-]+)-([0-9]+)-([0-9]+)-true\.jpg$ thumbnail.p...
htaccess: specific directory requests to forward to PHP file So I am writing an on-the-fly thumbnail generator for a CMS and I am trying to find the best way to handle requests. Specifically, I need to come up with the apache code for an htaccess file that will take all requests to a thumbnail folder and send them to a...
TITLE: htaccess: specific directory requests to forward to PHP file QUESTION: So I am writing an on-the-fly thumbnail generator for a CMS and I am trying to find the best way to handle requests. Specifically, I need to come up with the apache code for an htaccess file that will take all requests to a thumbnail folder ...
[ "php", "apache", ".htaccess", "redirect", "thumbnails" ]
1
2
935
2
0
2011-06-08T17:02:11.787000
2011-06-08T17:18:55.650000