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,225,856
6,225,977
AsyncTask does not stop if a long running loop is working in it?
friends, i am using following code inside asyncTask public class AsycLoaderFromDbAndMapInjector extends AsyncTask { @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected Boolean doInBackground(Void... arg0) { Log.d("Asynctask", ""+arg0); boolean show = false; if(db == null) db = new d...
Try this, private ATM results = null; @Override protected Boolean doInBackground(Void... arg0) { Log.d("Asynctask", ""+arg0); boolean show = false; if(db == null) db = new dbHelper(me); ATM results = null; try { results = db.getAtmsBySelectedBanks(atm.getSelectedBankList(), selectedCity); if (results!= null) { publis...
AsyncTask does not stop if a long running loop is working in it? friends, i am using following code inside asyncTask public class AsycLoaderFromDbAndMapInjector extends AsyncTask { @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected Boolean doInBackground(Void... arg0) { Log.d("Async...
TITLE: AsyncTask does not stop if a long running loop is working in it? QUESTION: friends, i am using following code inside asyncTask public class AsycLoaderFromDbAndMapInjector extends AsyncTask { @Override protected void onPreExecute() { super.onPreExecute(); } @Override protected Boolean doInBackground(Void... ar...
[ "android", "runnable" ]
0
0
631
2
0
2011-06-03T10:24:30.530000
2011-06-03T10:36:27.417000
6,225,858
6,225,933
Performance of sort command in unix
I am writing a custom apache log parser for my company and I noticed a performance issue that I can't explain. I have a text file log.txt with size 1.2GB. The command: sort log.txt is up to 3 sec slower than the command: cat log.txt | sort Does anybody know why this is happening?
cat file | sort is a Useless Use of Cat. The purpose of cat is to concatenate (or "catenate") files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process. It shouldn't take longer. Are you sure your timings are right? Please post the output of: time sort file and time ...
Performance of sort command in unix I am writing a custom apache log parser for my company and I noticed a performance issue that I can't explain. I have a text file log.txt with size 1.2GB. The command: sort log.txt is up to 3 sec slower than the command: cat log.txt | sort Does anybody know why this is happening?
TITLE: Performance of sort command in unix QUESTION: I am writing a custom apache log parser for my company and I noticed a performance issue that I can't explain. I have a text file log.txt with size 1.2GB. The command: sort log.txt is up to 3 sec slower than the command: cat log.txt | sort Does anybody know why this...
[ "linux", "unix", "sorting", "pipe" ]
3
4
1,611
2
0
2011-06-03T10:24:44.360000
2011-06-03T10:32:03.920000
6,225,877
6,225,985
object literal undefined
Q.js file Q = {}; Q.stringFile = []; Q.file = "CSS.txt"; Q.getData = function(Q.file){ $.get(Q.file, function(data){ var str = data; Q.stringFile = str.split("\n"); return Q.stringFile; }); } a.html file alert doesn't output! Errors: Q is not defined; unexpected token. How do i fix this??
As I said in my comment, you cannot return data from an Ajax call, as the Ajax call is asynchronous. You have to make your function accept a callback, like: Q.getData = function(file, callback){ $.get(file, function(data){ var stringFile = data.split("\n"); callback(stringFile); }); }; and then call it with: Q.getData(...
object literal undefined Q.js file Q = {}; Q.stringFile = []; Q.file = "CSS.txt"; Q.getData = function(Q.file){ $.get(Q.file, function(data){ var str = data; Q.stringFile = str.split("\n"); return Q.stringFile; }); } a.html file alert doesn't output! Errors: Q is not defined; unexpected token. How do i fix this??
TITLE: object literal undefined QUESTION: Q.js file Q = {}; Q.stringFile = []; Q.file = "CSS.txt"; Q.getData = function(Q.file){ $.get(Q.file, function(data){ var str = data; Q.stringFile = str.split("\n"); return Q.stringFile; }); } a.html file alert doesn't output! Errors: Q is not defined; unexpected token. How ...
[ "javascript" ]
0
2
1,402
5
0
2011-06-03T10:26:32.080000
2011-06-03T10:36:42.903000
6,225,879
6,251,104
Unable to host WCF REST Service 40(CS) on IIS 7
I have created WCF REST service in vs2010(4.0) with WCF REST Service Template 40(CS). It works fine on localhost and local IIS (7.5), without giving me any errors. But while I am trying to deploy it on server, it gives me 500 Internal server error. I have deployed same way I did on locl IIS. It is not giving me more de...
finally I found the thing that causes error in my service. I have used MySQL database and for that reference to MySql.Data.dll file of older version, and when I upgraded that dll with newer version, my entire project was not responding. It was replaced my newer version and when I tested with older version, service is r...
Unable to host WCF REST Service 40(CS) on IIS 7 I have created WCF REST service in vs2010(4.0) with WCF REST Service Template 40(CS). It works fine on localhost and local IIS (7.5), without giving me any errors. But while I am trying to deploy it on server, it gives me 500 Internal server error. I have deployed same wa...
TITLE: Unable to host WCF REST Service 40(CS) on IIS 7 QUESTION: I have created WCF REST service in vs2010(4.0) with WCF REST Service Template 40(CS). It works fine on localhost and local IIS (7.5), without giving me any errors. But while I am trying to deploy it on server, it gives me 500 Internal server error. I hav...
[ "wcf", "web-services", "rest", "iis-7", "service" ]
0
0
1,372
1
0
2011-06-03T10:26:36.710000
2011-06-06T11:06:54.813000
6,225,888
6,225,941
countdown clock in rails 3
I am developing a test engine web application. Users will be give some amount of time to answer questions. I want to create a countdown clock after which the test is finished. I'm using javascript right now but facing problems of refresh and back button in the browser. Following is the javascript: How can i disable the...
You cannot enforce such things using JavaScript. One way would be to have records in the database which hold the test start date time in it, once a user starts a test the start time is set, upon loading the initial timer value is calculated using it, so you can have back and refresh working fine and the countdown timer...
countdown clock in rails 3 I am developing a test engine web application. Users will be give some amount of time to answer questions. I want to create a countdown clock after which the test is finished. I'm using javascript right now but facing problems of refresh and back button in the browser. Following is the javasc...
TITLE: countdown clock in rails 3 QUESTION: I am developing a test engine web application. Users will be give some amount of time to answer questions. I want to create a countdown clock after which the test is finished. I'm using javascript right now but facing problems of refresh and back button in the browser. Follo...
[ "javascript", "ruby-on-rails", "ruby-on-rails-3" ]
0
2
1,170
1
0
2011-06-03T10:27:16.617000
2011-06-03T10:32:36.497000
6,225,901
6,226,444
Lazy loading of columns in sqlalchemy
Is it possible in sqlalchemy to lazy load a column? I have large BLOB column that I'm usually using but in some cases I don't want to load this specific column (while I'd like to have ORM object). Is it possible without adding separate table?
class Book(Base): __tablename__ = 'books' book_id = Column(Integer, primary_key=True) title = Column(String(200), nullable=False) summary = Column(String(2000)) excerpt = deferred(Column(Text)) photo = deferred(Column(Binary)) Deferred Column Loading
Lazy loading of columns in sqlalchemy Is it possible in sqlalchemy to lazy load a column? I have large BLOB column that I'm usually using but in some cases I don't want to load this specific column (while I'd like to have ORM object). Is it possible without adding separate table?
TITLE: Lazy loading of columns in sqlalchemy QUESTION: Is it possible in sqlalchemy to lazy load a column? I have large BLOB column that I'm usually using but in some cases I don't want to load this specific column (while I'd like to have ORM object). Is it possible without adding separate table? ANSWER: class Book(B...
[ "python", "orm", "sqlalchemy", "lazy-loading", "lazy-evaluation" ]
18
21
6,079
1
0
2011-06-03T10:29:18.130000
2011-06-03T11:19:45.097000
6,225,902
6,226,589
Where can I find high resolution financial data
I'm writing some Machine Learning software for equity and would like to find some tick data or at least 3 or 5 minute data. I would like to have a year or two for testing. I don't really care about what exchange the data is from, as long as its from a major exchange somewhere. Also is there anywhere where one can get c...
http://finance.yahoo.com you can download the stock market data for any company in csv format. for example, if you want to download the data for microsoft, the csv is located at - http://download.finance.yahoo.com/d/quotes.csv?s=MSFT&f=sl1d1t1c1ohgv&e=.csv Similarly, you can download the data for any company, just repl...
Where can I find high resolution financial data I'm writing some Machine Learning software for equity and would like to find some tick data or at least 3 or 5 minute data. I would like to have a year or two for testing. I don't really care about what exchange the data is from, as long as its from a major exchange somew...
TITLE: Where can I find high resolution financial data QUESTION: I'm writing some Machine Learning software for equity and would like to find some tick data or at least 3 or 5 minute data. I would like to have a year or two for testing. I don't really care about what exchange the data is from, as long as its from a ma...
[ "finance", "networkstream", "quantitative-finance" ]
10
7
7,327
5
0
2011-06-03T10:29:18.790000
2011-06-03T11:34:17.377000
6,225,903
6,307,883
Thoughtbot Clearance -> Why do I always get signed_out?
I am using Clearance gem. It's "half" working. I can do all basic actions (sign up, sign in,:authorize). But, when I do a POST action to a controller, it just signs me out... Here what's in the log: Started POST "/monkeys" for 127.0.0.1 at Fri Jun 03 06:22:00 -0400 2011 Processing by MonkeysController#create as HTML Pa...
It was actually because of my cookie domain, for some reason, localhost is not right. So i added a simple dns called "monkey.local" on my machine, and now I access the application with it and all works fine. I also believe I can use 127.0.0.0 and it would work. I'll try it at home.
Thoughtbot Clearance -> Why do I always get signed_out? I am using Clearance gem. It's "half" working. I can do all basic actions (sign up, sign in,:authorize). But, when I do a POST action to a controller, it just signs me out... Here what's in the log: Started POST "/monkeys" for 127.0.0.1 at Fri Jun 03 06:22:00 -040...
TITLE: Thoughtbot Clearance -> Why do I always get signed_out? QUESTION: I am using Clearance gem. It's "half" working. I can do all basic actions (sign up, sign in,:authorize). But, when I do a POST action to a controller, it just signs me out... Here what's in the log: Started POST "/monkeys" for 127.0.0.1 at Fri Ju...
[ "ruby-on-rails", "clearance" ]
1
1
229
1
0
2011-06-03T10:29:33.687000
2011-06-10T14:37:59.490000
6,225,907
6,226,304
OpenLDAP user record insertion for authentication
I installed Open Ldap for windows in windows XP i want to Insert user information in Open Ldap. I don't now how to insert user information(like uid,mail,sn,password..etc). I tried with LDAP Admin Tool but it's not working. Is that i need to change something in Slapd.conf file as well as LDIF file... can any one suggest...
You will need some tooling like Apache Directory Studio to edit contents on your ldap server in a GUI environment. OpenLDAP is really good with textfiles too. You can checkout the quickstart guide for more links to information.
OpenLDAP user record insertion for authentication I installed Open Ldap for windows in windows XP i want to Insert user information in Open Ldap. I don't now how to insert user information(like uid,mail,sn,password..etc). I tried with LDAP Admin Tool but it's not working. Is that i need to change something in Slapd.con...
TITLE: OpenLDAP user record insertion for authentication QUESTION: I installed Open Ldap for windows in windows XP i want to Insert user information in Open Ldap. I don't now how to insert user information(like uid,mail,sn,password..etc). I tried with LDAP Admin Tool but it's not working. Is that i need to change some...
[ "openldap" ]
1
1
157
1
0
2011-06-03T10:29:58.723000
2011-06-03T11:06:44.557000
6,225,909
6,226,418
How to debug what PHP PDO prepared statement does not insert data
I have $salt = md5(mt_rand()); $hashed = hash_hmac('SHA256', $password, $salt); $stmt = self::$_dbh->prepare('INSERT INTO users (username, password, salt, display, email) VALUES (:username,:password,:salt,:display,:email)'); $stmt->bindParam('username', $username); $stmt->bindParam('password', $hashed); $stmt->bindPara...
Try: $firephp->log( $stmt->debugDumpParams(). "\n". var_export($stmt->errorInfo());
How to debug what PHP PDO prepared statement does not insert data I have $salt = md5(mt_rand()); $hashed = hash_hmac('SHA256', $password, $salt); $stmt = self::$_dbh->prepare('INSERT INTO users (username, password, salt, display, email) VALUES (:username,:password,:salt,:display,:email)'); $stmt->bindParam('username', ...
TITLE: How to debug what PHP PDO prepared statement does not insert data QUESTION: I have $salt = md5(mt_rand()); $hashed = hash_hmac('SHA256', $password, $salt); $stmt = self::$_dbh->prepare('INSERT INTO users (username, password, salt, display, email) VALUES (:username,:password,:salt,:display,:email)'); $stmt->bind...
[ "php", "pdo" ]
0
3
3,212
3
0
2011-06-03T10:30:05.927000
2011-06-03T11:17:41.040000
6,225,913
6,226,303
How to wrap text using simple_list_item_multiple_choice?
I'm using a SimpleCursorAdapter to display a single CheckedTextView. I know this is done best using simple_list_item_multiple_choice and android.R.id.text1. adapter = new SimpleCursorAdapter(getApplicationContext(), android.R.layout.simple_list_item_multiple_choice, rules, new String[]{Constants.KEY_RULE}, new int[]{an...
There are several options. You can define your custom layout for item in the list. This allows you to fully customize your item UI. More details can be found in List View tutorial. The other approach can be used if you still want to use standard item layout but only fix one small thing in it. You can extend Adapter and...
How to wrap text using simple_list_item_multiple_choice? I'm using a SimpleCursorAdapter to display a single CheckedTextView. I know this is done best using simple_list_item_multiple_choice and android.R.id.text1. adapter = new SimpleCursorAdapter(getApplicationContext(), android.R.layout.simple_list_item_multiple_choi...
TITLE: How to wrap text using simple_list_item_multiple_choice? QUESTION: I'm using a SimpleCursorAdapter to display a single CheckedTextView. I know this is done best using simple_list_item_multiple_choice and android.R.id.text1. adapter = new SimpleCursorAdapter(getApplicationContext(), android.R.layout.simple_list_...
[ "android", "textview", "listactivity", "word-wrap", "android-wrap-content" ]
4
2
4,135
2
0
2011-06-03T10:30:29.047000
2011-06-03T11:06:40.190000
6,225,918
6,227,111
Change the Background of MS Excel 2003
I'm a c# coder and so far this is the best way I know to express what I wanted. I am thinking of doing this code below on a microsoft excel 2003 worksheet. Could this be possible? 1st step if(CellA1 == "Sunday" || CellA1== "Saturday"){ // code to set background color of // CellB1 to CellF1 to background color red } 2nd...
Sub backcolor() Range("a1:a10").Interior.ColorIndex = xlNone For Each cell In Range("a1:a10") If cell.Value = "Sunday" Or cell.Value = "Saturday" Then cell.Interior.ColorIndex = 3 End If Next cell End Sub You can find the list of colors here http://dmcritchie.mvps.org/excel/colors.htm
Change the Background of MS Excel 2003 I'm a c# coder and so far this is the best way I know to express what I wanted. I am thinking of doing this code below on a microsoft excel 2003 worksheet. Could this be possible? 1st step if(CellA1 == "Sunday" || CellA1== "Saturday"){ // code to set background color of // CellB1 ...
TITLE: Change the Background of MS Excel 2003 QUESTION: I'm a c# coder and so far this is the best way I know to express what I wanted. I am thinking of doing this code below on a microsoft excel 2003 worksheet. Could this be possible? 1st step if(CellA1 == "Sunday" || CellA1== "Saturday"){ // code to set background c...
[ "c#", "excel", "excel-2003", "vba" ]
1
2
378
2
0
2011-06-03T10:30:35
2011-06-03T12:30:06.760000
6,225,922
6,225,994
Search directory and sub-directories for pattern in a file
In linux, I want to search the given directoy and its sub-folders/files for certain include and exclude pattern. find /apps -exec grep "performance" -v "warn" {} /dev/null \; This echoes loads of lines from which search goes trough. I don't want that, I'd like to find files containing performance which do not contain w...
Very close to what you have already: find /apps -exec grep "performance" {} /dev/null \; | grep -v "warn" Just pipe the output through a second call to grep.
Search directory and sub-directories for pattern in a file In linux, I want to search the given directoy and its sub-folders/files for certain include and exclude pattern. find /apps -exec grep "performance" -v "warn" {} /dev/null \; This echoes loads of lines from which search goes trough. I don't want that, I'd like ...
TITLE: Search directory and sub-directories for pattern in a file QUESTION: In linux, I want to search the given directoy and its sub-folders/files for certain include and exclude pattern. find /apps -exec grep "performance" -v "warn" {} /dev/null \; This echoes loads of lines from which search goes trough. I don't wa...
[ "linux", "unix", "sed", "awk", "grep" ]
2
3
5,160
4
0
2011-06-03T10:31:04.120000
2011-06-03T10:37:32.747000
6,225,927
6,225,979
Find Replace a Function in JQuery
I have a HTML page where there are many and replace it with Note 1) the values 350 is changes to 600 and 250 is changed to 500 2) there are also many similar tags but i want the code to do Exact find and replace of the above tag. IS this possible?
I wouldn't be looking to change the inline onclick Javascript even if I could. A better approach is to late-bind everything in JavaScript: $(document).ready(function(){ $("#MyAnchorID1").click(function(){ OpenNewWindow('/help_options.php?ID=2', 350, 250); }); }); So, when you did want to change the event, you unbind th...
Find Replace a Function in JQuery I have a HTML page where there are many and replace it with Note 1) the values 350 is changes to 600 and 250 is changed to 500 2) there are also many similar tags but i want the code to do Exact find and replace of the above tag. IS this possible?
TITLE: Find Replace a Function in JQuery QUESTION: I have a HTML page where there are many and replace it with Note 1) the values 350 is changes to 600 and 250 is changed to 500 2) there are also many similar tags but i want the code to do Exact find and replace of the above tag. IS this possible? ANSWER: I wouldn't ...
[ "jquery" ]
0
3
188
2
0
2011-06-03T10:31:22.783000
2011-06-03T10:36:34.963000
6,225,945
6,226,033
Flex: how to manage cookies in mx:HTML?
I use AIR HTML component, and I need to delete cookies sometimes. I have to open IE and delete cookies there... Can I do it via AS code?
See the following: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html#manageCookies http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html#useCache Essentially you can tell AIR NOT to save cookies and or consult the local cache on a per-use...
Flex: how to manage cookies in mx:HTML? I use AIR HTML component, and I need to delete cookies sometimes. I have to open IE and delete cookies there... Can I do it via AS code?
TITLE: Flex: how to manage cookies in mx:HTML? QUESTION: I use AIR HTML component, and I need to delete cookies sometimes. I have to open IE and delete cookies there... Can I do it via AS code? ANSWER: See the following: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html#mana...
[ "html", "apache-flex", "actionscript-3", "cookies", "air" ]
1
3
1,394
1
0
2011-06-03T10:32:54.790000
2011-06-03T10:41:11.510000
6,225,959
6,226,000
mouse listener on frame
Hi i am trying to add a mouse listener to my frame to get the position of the mouse clicked and check if it is inside the circle, the problem is that it is not triggering public class CircleDraw extends Frame implements MouseListener { static int circles = 0; private double color; double mousex = 0; double mousey = 0;...
It is deadly to add your mouselistener in the paint() method, since this method is called very very often (with each repaint), and so many listeners are added (with each repaint). You should add the listener to your content-panel and not to the JFrame itself. This will do it. You can do this in the constructor of your ...
mouse listener on frame Hi i am trying to add a mouse listener to my frame to get the position of the mouse clicked and check if it is inside the circle, the problem is that it is not triggering public class CircleDraw extends Frame implements MouseListener { static int circles = 0; private double color; double mousex...
TITLE: mouse listener on frame QUESTION: Hi i am trying to add a mouse listener to my frame to get the position of the mouse clicked and check if it is inside the circle, the problem is that it is not triggering public class CircleDraw extends Frame implements MouseListener { static int circles = 0; private double co...
[ "java", "mouse", "awt", "frame" ]
0
2
2,462
3
0
2011-06-03T10:34:21.903000
2011-06-03T10:38:13.763000
6,225,968
6,226,097
How can I modify this algorithm which reorders a <ul>?
Background: I asked this question yesterday: How to modify the orientation of a spanning multiple columns? asking how to convert a list like this: a b c d e f g h i j k l into a list like this: a e i b f j c g k d h l and I got this awesome response by beeflavor: http://jsfiddle.net/H4FPw/12/ Problem: Unfortunate...
I know it's not as "elegant" as your accepted answer in that question, but the code I linked to in my answer yesterday does work perfectly for you: http://jsfiddle.net/AcdcD/ If you don't need to handle resizing, it can be simplified slightly: http://jsfiddle.net/AcdcD/1/ Maybe you can use this if you run out of time?
How can I modify this algorithm which reorders a <ul>? Background: I asked this question yesterday: How to modify the orientation of a spanning multiple columns? asking how to convert a list like this: a b c d e f g h i j k l into a list like this: a e i b f j c g k d h l and I got this awesome response by beefla...
TITLE: How can I modify this algorithm which reorders a <ul>? QUESTION: Background: I asked this question yesterday: How to modify the orientation of a spanning multiple columns? asking how to convert a list like this: a b c d e f g h i j k l into a list like this: a e i b f j c g k d h l and I got this awesome ...
[ "javascript", "html", "algorithm", "math", "matrix" ]
4
5
705
5
0
2011-06-03T10:35:37.037000
2011-06-03T10:45:38.673000
6,225,969
6,226,075
hover on div does work in Firefox
I have this code: Select With css:.graButtonBackgroundOn { line-height: 45px; background: url('/resources/images/external/button_generic_on_txmart.png'); } and.graButtonBackgroundOn:hover{ background: url('/resources/images/external/button_generic_on_txmart-hover.png'); } I cannot figure out why on Firefox and IE, hove...
Try giving the:hover style rule more specificity over its normal state, so:.graButtonBackgroundOn { line-height: 45px; background: url('/resources/images/external/button_generic_on_txmart.png'); } div.graButtonBackgroundOn:hover{ background: url('/resources/images/external/button_generic_on_txmart-hover.png'); } which ...
hover on div does work in Firefox I have this code: Select With css:.graButtonBackgroundOn { line-height: 45px; background: url('/resources/images/external/button_generic_on_txmart.png'); } and.graButtonBackgroundOn:hover{ background: url('/resources/images/external/button_generic_on_txmart-hover.png'); } I cannot figu...
TITLE: hover on div does work in Firefox QUESTION: I have this code: Select With css:.graButtonBackgroundOn { line-height: 45px; background: url('/resources/images/external/button_generic_on_txmart.png'); } and.graButtonBackgroundOn:hover{ background: url('/resources/images/external/button_generic_on_txmart-hover.png'...
[ "css", "firefox4" ]
1
4
2,262
1
0
2011-06-03T10:35:38.877000
2011-06-03T10:44:11.947000
6,225,991
6,227,019
How to secure the default page of Tomcat?
I want to make the default page of my Tomcat7 server private, i. e. accessible only after.htaccess password has been entered. I mean this page: For that purpose, I added: to tomcat-users.xml. Then I added: Entire Application /references/* admin BASIC Application The role that is required to log in to the Manager Applic...
Look at your, it is pointing to /references/* (which doesn't exist in the ROOT folder) The typical Tomcat setup the welcome page is in the root folder so the should be pointing to /*.
How to secure the default page of Tomcat? I want to make the default page of my Tomcat7 server private, i. e. accessible only after.htaccess password has been entered. I mean this page: For that purpose, I added: to tomcat-users.xml. Then I added: Entire Application /references/* admin BASIC Application The role that i...
TITLE: How to secure the default page of Tomcat? QUESTION: I want to make the default page of my Tomcat7 server private, i. e. accessible only after.htaccess password has been entered. I mean this page: For that purpose, I added: to tomcat-users.xml. Then I added: Entire Application /references/* admin BASIC Applicati...
[ "tomcat", "security-constraint" ]
2
2
3,227
1
0
2011-06-03T10:37:22.200000
2011-06-03T12:20:43.360000
6,225,998
6,229,135
Capturing image of 3d object in Open GLES
I am new in Open GLES. I want to capture the image of only 3d object, i don't want background view along with that image. when i am trying to capture the image of 3d object, it is coming with glview(eaglLayer) background but i don't want it. Please help me regarding it.
I guess you could capture the glview and then mask the background if it is a single color.
Capturing image of 3d object in Open GLES I am new in Open GLES. I want to capture the image of only 3d object, i don't want background view along with that image. when i am trying to capture the image of 3d object, it is coming with glview(eaglLayer) background but i don't want it. Please help me regarding it.
TITLE: Capturing image of 3d object in Open GLES QUESTION: I am new in Open GLES. I want to capture the image of only 3d object, i don't want background view along with that image. when i am trying to capture the image of 3d object, it is coming with glview(eaglLayer) background but i don't want it. Please help me reg...
[ "iphone", "objective-c", "opengl-es" ]
1
1
445
2
0
2011-06-03T10:38:03.140000
2011-06-03T15:28:42.493000
6,226,001
6,226,083
Handling Home button in android?
Possible Duplicate: Can i override HOME Button on my own Home-Screen from my application? How can I handle the Home button click in android?
Home button is reserved for the OS as a "last chance" escape for the user from any app. Developers cannot override it, this way ensuring that the user will always have the possibility to leave the app.
Handling Home button in android? Possible Duplicate: Can i override HOME Button on my own Home-Screen from my application? How can I handle the Home button click in android?
TITLE: Handling Home button in android? QUESTION: Possible Duplicate: Can i override HOME Button on my own Home-Screen from my application? How can I handle the Home button click in android? ANSWER: Home button is reserved for the OS as a "last chance" escape for the user from any app. Developers cannot override it, ...
[ "android", "events", "button" ]
1
1
4,903
1
0
2011-06-03T10:38:18.720000
2011-06-03T10:44:28.950000
6,226,007
6,226,038
How to reverse the SingleLinkedList in the Java?
Hi I want to print the SingleLinkedList in reverse.
static void Collections.reverse(List list): http://download.oracle.com/javase/1.4.2/docs/api/java/util/Collections.html
How to reverse the SingleLinkedList in the Java? Hi I want to print the SingleLinkedList in reverse.
TITLE: How to reverse the SingleLinkedList in the Java? QUESTION: Hi I want to print the SingleLinkedList in reverse. ANSWER: static void Collections.reverse(List list): http://download.oracle.com/javase/1.4.2/docs/api/java/util/Collections.html
[ "java" ]
0
2
105
4
0
2011-06-03T10:38:46.883000
2011-06-03T10:41:24.883000
6,226,011
6,226,102
french letters in android views show question marks
I read data from an utf8 database then display it in a listview. but there are words in the database containing è é à á letters when I get the xml manually in the browser it shows up perfect but in the listview it shows question marks instead how can I set the character set to utf8 for my listview? or is there another ...
You should double check your file encoding on your computer. Does your system use latin-1 (iso-8859-1) or utf-8? Accents can look good in a latin-1 encoded file declaring a xmlns in utf-8 but indeed there not really stored in utf-8. Salutations, Stéphane
french letters in android views show question marks I read data from an utf8 database then display it in a listview. but there are words in the database containing è é à á letters when I get the xml manually in the browser it shows up perfect but in the listview it shows question marks instead how can I set the charact...
TITLE: french letters in android views show question marks QUESTION: I read data from an utf8 database then display it in a listview. but there are words in the database containing è é à á letters when I get the xml manually in the browser it shows up perfect but in the listview it shows question marks instead how can...
[ "android", "character-encoding", "character" ]
4
1
8,435
7
0
2011-06-03T10:39:11.810000
2011-06-03T10:46:14.977000
6,226,018
6,226,157
For loop goes out of range
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyClass myClass = new MyClass(); myClass.StartTasks(); } } class MyClass { int[] arr; public void StartTasks() { arr = new int[2]; arr[0] = ...
You are closing over loop variable. When it's time for WorkerMethod to get called, i can have the value of two, not the value of 0 or 1. When you use closures it's important to understand that you are not using the value that the variable has at the moment, you use the variable itself. So if you create lambdas in loop ...
For loop goes out of range using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyClass myClass = new MyClass(); myClass.StartTasks(); } } class MyClass { int[] arr; public void StartTasks() { ...
TITLE: For loop goes out of range QUESTION: using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { MyClass myClass = new MyClass(); myClass.StartTasks(); } } class MyClass { int[] arr; public vo...
[ "c#", "for-loop" ]
19
20
4,756
2
0
2011-06-03T10:39:53.437000
2011-06-03T10:52:37.543000
6,226,026
6,253,061
How to run all JUnit tests in a category/suite with Ant?
I'm using JUnit Categories and ClassPathSuite in a setup similar to that described in this answer. To recap: public interface FastTests { } @RunWith(Categories.class) @Categories.IncludeCategory(FastTests.class) @Suite.SuiteClasses(AllTests.class) public class FastTestSuite { } @RunWith(ClasspathSuite.class) public c...
Right, I got it working with quite simply: I had tried earlier, but had made the silly mistake of using "**/FastTestSuite.java" instead of "**/FastTestSuite.class" in the element... Sorry about that:-) NB: it's necessary to set fork="yes" (i.e., run the tests in a separate VM); otherwise this will also produce "initial...
How to run all JUnit tests in a category/suite with Ant? I'm using JUnit Categories and ClassPathSuite in a setup similar to that described in this answer. To recap: public interface FastTests { } @RunWith(Categories.class) @Categories.IncludeCategory(FastTests.class) @Suite.SuiteClasses(AllTests.class) public class F...
TITLE: How to run all JUnit tests in a category/suite with Ant? QUESTION: I'm using JUnit Categories and ClassPathSuite in a setup similar to that described in this answer. To recap: public interface FastTests { } @RunWith(Categories.class) @Categories.IncludeCategory(FastTests.class) @Suite.SuiteClasses(AllTests.cla...
[ "java", "ant", "junit", "junit4" ]
22
15
13,643
2
0
2011-06-03T10:40:46.843000
2011-06-06T13:53:18.407000
6,226,027
6,226,091
incrementing an array of pointers in C
this is probably an essentially trivial thing, but it somewhat escapes me, thus far.. char * a3[2]; a3[0] = "abc"; a3[1] = "def"; char ** p; p = a3; this works: printf("%p - \"%s\"\n", p, *(++p)); this does not: printf("%p - \"%s\"\n", a3, *(++a3)); the error i'm getting at compilation is: lvalue required as increment ...
a3 is a constant pointer, you can not increment it. "p" however is a generic pointer to the start of a3 which can be incremented.
incrementing an array of pointers in C this is probably an essentially trivial thing, but it somewhat escapes me, thus far.. char * a3[2]; a3[0] = "abc"; a3[1] = "def"; char ** p; p = a3; this works: printf("%p - \"%s\"\n", p, *(++p)); this does not: printf("%p - \"%s\"\n", a3, *(++a3)); the error i'm getting at compil...
TITLE: incrementing an array of pointers in C QUESTION: this is probably an essentially trivial thing, but it somewhat escapes me, thus far.. char * a3[2]; a3[0] = "abc"; a3[1] = "def"; char ** p; p = a3; this works: printf("%p - \"%s\"\n", p, *(++p)); this does not: printf("%p - \"%s\"\n", a3, *(++a3)); the error i'm...
[ "c", "arrays", "pointers" ]
6
3
1,891
5
0
2011-06-03T10:40:49.547000
2011-06-03T10:44:52.837000
6,226,030
6,226,087
Getting correspoding enum key for the value passed
var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now if i pass 8 i need the value DE to be printed. How can i do this.
A faster and simpler approach is to use an array: var StateValues = ['Unknown', 'AL', 'AK', 'AZ', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE']; alert(StateValues[9]); //'DE' If for some reason, you need to use your existing structure, try this: function find_key_by_value(set, value) { for(var k in set) { if(set.hasOwnProperty(k...
Getting correspoding enum key for the value passed var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now if i pass 8 i need the value DE to be printed. How can i do this.
TITLE: Getting correspoding enum key for the value passed QUESTION: var StateValue = { Unknown: 0, AL: 1, AK: 2, AZ: 3, AR: 4, CA: 5, CO: 6, CT: 7, DE: 8, }, Now if i pass 8 i need the value DE to be printed. How can i do this. ANSWER: A faster and simpler approach is to use an array: var StateValues = ['Unknown', 'A...
[ "javascript" ]
1
9
7,884
1
0
2011-06-03T10:40:59.077000
2011-06-03T10:44:39.373000
6,226,032
6,226,456
openCV: Sobel edge detection gives me assertion error
I am using python-openCV. When using the Sobel edge detection I get the following assertion error: src.size() == dst.size() && src.channels() == dst.channels() && ((src.depth() == CV_8U && (dst.depth() == CV_16S || dst.depth() == CV_32F)) || (src.depth() == CV_32F && dst.depth() == CV_32F)) I create the dest using Crea...
I found the solution a bit tricky for novices to openCV: src = cv.LoadImageM('src.png', cv.CV_LOAD_IMAGE_GRAYSCALE) dest = cv.CreateMat(src.height, src.width, cv.CV_16S) cv.Sobel(src, dest, 1, 1) The important thing to note is that the image formats required for operations are not clearly documented in API references a...
openCV: Sobel edge detection gives me assertion error I am using python-openCV. When using the Sobel edge detection I get the following assertion error: src.size() == dst.size() && src.channels() == dst.channels() && ((src.depth() == CV_8U && (dst.depth() == CV_16S || dst.depth() == CV_32F)) || (src.depth() == CV_32F &...
TITLE: openCV: Sobel edge detection gives me assertion error QUESTION: I am using python-openCV. When using the Sobel edge detection I get the following assertion error: src.size() == dst.size() && src.channels() == dst.channels() && ((src.depth() == CV_8U && (dst.depth() == CV_16S || dst.depth() == CV_32F)) || (src.d...
[ "python", "opencv", "edge-detection" ]
5
5
4,376
1
0
2011-06-03T10:41:01.243000
2011-06-03T11:20:57.573000
6,226,044
6,226,311
queries in entity framework
i have to fetch those records where cityname like'zipcode' where zipcode is variable and apply conditions var zipcd = (from u in db.ZipCodes1 where u.CityName.Contains(zipcode) && u.CityType == "D" select u).ToList().Select(u => new Viewsearch { Zipcode = u.ZIPCode, CityName = u.CityName, stateabbr = u.StateAbbr }).Dis...
Distinct at the end of your query uses IEqualityComparer, and I'm guessing you haven't defined one for Viewsearch. It would look something like this: public class ViewsearchComparer: IEqualityComparer { public bool Equals(Viewsearch vs1, Viewsearch vs2) { // Implementation } public int GetHashCode(Viewsearch vs) { // ...
queries in entity framework i have to fetch those records where cityname like'zipcode' where zipcode is variable and apply conditions var zipcd = (from u in db.ZipCodes1 where u.CityName.Contains(zipcode) && u.CityType == "D" select u).ToList().Select(u => new Viewsearch { Zipcode = u.ZIPCode, CityName = u.CityName, st...
TITLE: queries in entity framework QUESTION: i have to fetch those records where cityname like'zipcode' where zipcode is variable and apply conditions var zipcd = (from u in db.ZipCodes1 where u.CityName.Contains(zipcode) && u.CityType == "D" select u).ToList().Select(u => new Viewsearch { Zipcode = u.ZIPCode, CityNam...
[ "asp.net", "asp.net-mvc" ]
0
0
744
3
0
2011-06-03T10:41:51.717000
2011-06-03T11:07:42.867000
6,226,045
6,226,217
SQL Server 2008 - Select disjunct rows
I have two concurrent processes and I have two queries, eg.: select top 10 * into #tmp_member from member where status = 0 order by member_id and then update member set process_status = 1 from member inner join #tmp_member m on member.member_id=m.member_id I'd like each process to select different rows, so if a row was...
You need hints. See my answer here: SQL Server Process Queue Race Condition However, you can shorten your query above into a single statement with the OUTPUT clause. Otherwise you'll need a transaction too (asuming each process executes the 2 statements above one after the other) update m set process_status = 1 OUTPUT ...
SQL Server 2008 - Select disjunct rows I have two concurrent processes and I have two queries, eg.: select top 10 * into #tmp_member from member where status = 0 order by member_id and then update member set process_status = 1 from member inner join #tmp_member m on member.member_id=m.member_id I'd like each process to...
TITLE: SQL Server 2008 - Select disjunct rows QUESTION: I have two concurrent processes and I have two queries, eg.: select top 10 * into #tmp_member from member where status = 0 order by member_id and then update member set process_status = 1 from member inner join #tmp_member m on member.member_id=m.member_id I'd li...
[ "sql", "sql-server-2008", "locking" ]
1
3
714
3
0
2011-06-03T10:41:57.303000
2011-06-03T10:59:49.910000
6,226,061
6,226,208
GWT JSONObject adding an additional incorrect key when converting overlay type to json string
I'm encountering the following problem - I have simple GWT overlay types, and I'm trying to convert one to a JSON string on the client; I'm simply doing: new JSONObject(this).toString(); The conversion works, but it adds an additional, incorrect key to the json string, such as: {"key1":"value1", "key2":value2, "$H":1} ...
This issue is define in this link The $H property comes from the implementation of JavaScriptObject#hashCode() (in com.google.gwt.cire.client.impl.Impl#getHashCode(Object)). In your case, this is due to AbstractEditableCell maintaining a map of value keys to their "view data", and your use (I guess) of the default Prov...
GWT JSONObject adding an additional incorrect key when converting overlay type to json string I'm encountering the following problem - I have simple GWT overlay types, and I'm trying to convert one to a JSON string on the client; I'm simply doing: new JSONObject(this).toString(); The conversion works, but it adds an ad...
TITLE: GWT JSONObject adding an additional incorrect key when converting overlay type to json string QUESTION: I'm encountering the following problem - I have simple GWT overlay types, and I'm trying to convert one to a JSON string on the client; I'm simply doing: new JSONObject(this).toString(); The conversion works,...
[ "parsing", "gwt", "json" ]
1
1
505
1
0
2011-06-03T10:43:21.860000
2011-06-03T10:58:29.113000
6,226,062
6,226,263
Is this Codeigniter code correct?
I've just started looking at PHP Frameworks after spending loads of wasted time doing everything from scratch. I thought I would give Codeigniter a go after a friend recommended it to me. I worked through the first tutorial and there were no issues but I'm getting stuck with the second one. At first my code was identic...
This will most likely because you're trying to load scaffolding in the latest version of CodeIgniter. Scaffolding has been depreciated since version 1.6. It was removed in 2.0, and the latest version is now 2.0.2 In terms of which of your provided snippets to use, the latter form of declaring a constructor ( __construc...
Is this Codeigniter code correct? I've just started looking at PHP Frameworks after spending loads of wasted time doing everything from scratch. I thought I would give Codeigniter a go after a friend recommended it to me. I worked through the first tutorial and there were no issues but I'm getting stuck with the second...
TITLE: Is this Codeigniter code correct? QUESTION: I've just started looking at PHP Frameworks after spending loads of wasted time doing everything from scratch. I thought I would give Codeigniter a go after a friend recommended it to me. I worked through the first tutorial and there were no issues but I'm getting stu...
[ "php", "codeigniter" ]
0
5
344
2
0
2011-06-03T10:43:24.443000
2011-06-03T11:03:33.790000
6,226,063
6,226,741
Run a simple text file as Java
I have a simple.txt file which has pure Java code inside it like public class C { public static void main(String[] args ) { System.out.println("This is executed"); } } The file is named C.txt. Now I want to write Java code that will read the code in C.txt and will compile and run the read code as a pure Java file. Note...
I think I'd start with BeanShell, which allows you to compile and execute Java source held in a string.
Run a simple text file as Java I have a simple.txt file which has pure Java code inside it like public class C { public static void main(String[] args ) { System.out.println("This is executed"); } } The file is named C.txt. Now I want to write Java code that will read the code in C.txt and will compile and run the read...
TITLE: Run a simple text file as Java QUESTION: I have a simple.txt file which has pure Java code inside it like public class C { public static void main(String[] args ) { System.out.println("This is executed"); } } The file is named C.txt. Now I want to write Java code that will read the code in C.txt and will compil...
[ "java", "text", "compiler-construction" ]
9
0
13,332
3
0
2011-06-03T10:43:29.403000
2011-06-03T11:50:16.623000
6,226,067
6,226,128
Accessing remote mysql database via asp.net
How would I go about connecting asp.net intranet pages with a remote mysql database? I have full access to both servers. Usually, I connect my asp.net intranet pages, with a sql server which is in our own internal company network, I've never needed to connect to a remove mysql server before. However, I create php pages...
You can connect using ADO.NET and the MySQL Connector available here: http://www.mysql.com/products/connector/ There are also other alternatives here: http://dev.mysql.com/tech-resources/articles/dotnet/index.html EDIT: The firewall shouldn't be an issue as you're establishing an outbound connection (from the website t...
Accessing remote mysql database via asp.net How would I go about connecting asp.net intranet pages with a remote mysql database? I have full access to both servers. Usually, I connect my asp.net intranet pages, with a sql server which is in our own internal company network, I've never needed to connect to a remove mysq...
TITLE: Accessing remote mysql database via asp.net QUESTION: How would I go about connecting asp.net intranet pages with a remote mysql database? I have full access to both servers. Usually, I connect my asp.net intranet pages, with a sql server which is in our own internal company network, I've never needed to connec...
[ "asp.net", "mysql" ]
1
2
1,703
1
0
2011-06-03T10:43:44.367000
2011-06-03T10:49:06.627000
6,226,068
6,226,120
how to use libcurl as server?
can i use curl's functions to receive clients https connections? i want to write server using libcurl, should i use naked sockets to accept connections? Oficial documentation provides following example: /* read the response */ for(;;) { char buf[1024]; wait_on_socket(sockfd, 1, 60000L); res = curl_easy_recv(curl, buf,...
From LIBCURL - about libcurl is a free, open source client to get documents/files from servers, using any of the supported protocols. It is a client library not an HTTPS server.
how to use libcurl as server? can i use curl's functions to receive clients https connections? i want to write server using libcurl, should i use naked sockets to accept connections? Oficial documentation provides following example: /* read the response */ for(;;) { char buf[1024]; wait_on_socket(sockfd, 1, 60000L); r...
TITLE: how to use libcurl as server? QUESTION: can i use curl's functions to receive clients https connections? i want to write server using libcurl, should i use naked sockets to accept connections? Oficial documentation provides following example: /* read the response */ for(;;) { char buf[1024]; wait_on_socket(soc...
[ "c", "linux", "curl" ]
1
7
974
1
0
2011-06-03T10:43:45.630000
2011-06-03T10:47:50.900000
6,226,069
6,226,806
How to write a method trailing with a keyword
I have a situation where i need to call something like this: class Office attr_accessor:workers,:id def initialize @workers = [] end def workers<<(worker) type = worker.type resp = Organiation::Worker.post("/office/#{@id}/workers.json",:worker => {:type => type}) end end this is where i need to call office = Office.n...
New answer for this (based on updated question): class WorkersClient attr_accessor:office_id def <<(worker) type = worker.type resp = Organiation::Worker.post("/office/#{@office_id}/workers.json",:worker => {:type => type}) end end class Office attr_accessor:workers,:id def initialize @workers = WorkersClient.new @w...
How to write a method trailing with a keyword I have a situation where i need to call something like this: class Office attr_accessor:workers,:id def initialize @workers = [] end def workers<<(worker) type = worker.type resp = Organiation::Worker.post("/office/#{@id}/workers.json",:worker => {:type => type}) end end ...
TITLE: How to write a method trailing with a keyword QUESTION: I have a situation where i need to call something like this: class Office attr_accessor:workers,:id def initialize @workers = [] end def workers<<(worker) type = worker.type resp = Organiation::Worker.post("/office/#{@id}/workers.json",:worker => {:type ...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "rubygems" ]
9
4
197
4
0
2011-06-03T10:43:48.130000
2011-06-03T11:57:18.200000
6,226,078
6,226,553
Google Maps v3 - Can't get a polygon and/or rectangle to display on map
I've been working on a.NET geocoding application that at the end displays a Google Map (using the v3 API) of an address or place. The map has a marker in the centre representing the point that is geocoded. This all works. I then wanted to display a rectangle/polygon shape overlay on the map that represents the bounds s...
new google.maps.LatLng(51.3493528), You need x,y coords, for example new google.maps.LatLng(32.321384, -64.75737), OR you need two markers, example: var latLngBounds = new google.maps.LatLngBounds( marker1.getPosition(), marker2.getPosition() ); rectangle.setBounds(latLngBounds);
Google Maps v3 - Can't get a polygon and/or rectangle to display on map I've been working on a.NET geocoding application that at the end displays a Google Map (using the v3 API) of an address or place. The map has a marker in the centre representing the point that is geocoded. This all works. I then wanted to display a...
TITLE: Google Maps v3 - Can't get a polygon and/or rectangle to display on map QUESTION: I've been working on a.NET geocoding application that at the end displays a Google Map (using the v3 API) of an address or place. The map has a marker in the centre representing the point that is geocoded. This all works. I then w...
[ "javascript", "google-maps", "google-maps-api-3" ]
0
2
2,333
1
0
2011-06-03T10:44:18.787000
2011-06-03T11:29:47.740000
6,226,079
6,226,805
remove a chart from it's parent
I wanna draw a graph in android and for that I'm using a chart(I import into my app a jar file) to which I pass the valuess need to be shown... The problem with this chart is that it occupies the full screen in the activity that is set. public void onCreate(){ LineView lv; lv=new LineView(this); } The values that I ...
I believe the trouble is here: protected void onProgressUpdate(String...values) { setContentView(lv); //HERE } You only have to call setContentView once, in onCreate. After that, you can instantiate a LineView (I suppose this is the graph) and add it to the main layout. // in onCreate setContentView(R.layout.main); L...
remove a chart from it's parent I wanna draw a graph in android and for that I'm using a chart(I import into my app a jar file) to which I pass the valuess need to be shown... The problem with this chart is that it occupies the full screen in the activity that is set. public void onCreate(){ LineView lv; lv=new LineV...
TITLE: remove a chart from it's parent QUESTION: I wanna draw a graph in android and for that I'm using a chart(I import into my app a jar file) to which I pass the valuess need to be shown... The problem with this chart is that it occupies the full screen in the activity that is set. public void onCreate(){ LineView...
[ "android", "view", "android-layout" ]
0
0
717
1
0
2011-06-03T10:44:20.887000
2011-06-03T11:57:18.183000
6,226,085
6,226,175
cell with textView
hello every one i have table view with one cell,and i make on this cell a UITextView that the user can write what he want,this is the code inside the cellForRow: static NSString *CellIdentifier = @"Cell"; UITextView *text; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell =...
Use UIButton to create the button and set a action (method) for that will be called when you click on button. -(void) buttonPressed:(id) sender { //First get the cell (We know we have the only one cell). // Create an NSIndexPath to access the cell from UITableView. NSIndexPath *myIndexPath = [NSIndexPath indexPathForR...
cell with textView hello every one i have table view with one cell,and i make on this cell a UITextView that the user can write what he want,this is the code inside the cellForRow: static NSString *CellIdentifier = @"Cell"; UITextView *text; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIden...
TITLE: cell with textView QUESTION: hello every one i have table view with one cell,and i make on this cell a UITextView that the user can write what he want,this is the code inside the cellForRow: static NSString *CellIdentifier = @"Cell"; UITextView *text; UITableViewCell *cell = [tableView dequeueReusableCellWithI...
[ "iphone", "objective-c" ]
0
2
413
1
0
2011-06-03T10:44:31.717000
2011-06-03T10:55:15.023000
6,226,086
6,226,167
Sequence number of an enumeration litteral in Java
Given the following definitions: public enum SampleEnum1 { Uno, Dos, Tres } public enum SampleEnum2 { One, Two, Three, Four } I need two methods doing this: Given the integer 2, return Dos if applied to SampleEnum1, Two if applied to SampleEnum2 Given the value One, return 1 In fact I need to translate an enumeration l...
Another approach is to use a helper method like public static > E lookup(Class eClass, int number) { return eClass.getEnumConstants()[number-1]; } SampleEnum1 se1 = lookup(SampleEnum1.class, 2); BTW: You could start with Zero which would simplify your code as well.
Sequence number of an enumeration litteral in Java Given the following definitions: public enum SampleEnum1 { Uno, Dos, Tres } public enum SampleEnum2 { One, Two, Three, Four } I need two methods doing this: Given the integer 2, return Dos if applied to SampleEnum1, Two if applied to SampleEnum2 Given the value One, re...
TITLE: Sequence number of an enumeration litteral in Java QUESTION: Given the following definitions: public enum SampleEnum1 { Uno, Dos, Tres } public enum SampleEnum2 { One, Two, Three, Four } I need two methods doing this: Given the integer 2, return Dos if applied to SampleEnum1, Two if applied to SampleEnum2 Given...
[ "java", "enumeration" ]
0
1
2,441
3
0
2011-06-03T10:44:34.227000
2011-06-03T10:54:02.533000
6,226,092
6,226,293
How to root android device, Emulator?
I'm making an android application in which I want to show Punjabi text in my view. Most people told me we can add different fonts through rooting. After that I'm able to show Punjabi text in device. How can I root my emulator or android device so I can show Punjabi font in my application?
To add a custom font to your application you must create a folder named fonts inside your assets folder. Put your.ttf font file inside this folder. Then use the following code to initialize your font. Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/your_font.ttf"); To apply this typeface to any TextVie...
How to root android device, Emulator? I'm making an android application in which I want to show Punjabi text in my view. Most people told me we can add different fonts through rooting. After that I'm able to show Punjabi text in device. How can I root my emulator or android device so I can show Punjabi font in my appli...
TITLE: How to root android device, Emulator? QUESTION: I'm making an android application in which I want to show Punjabi text in my view. Most people told me we can add different fonts through rooting. After that I'm able to show Punjabi text in device. How can I root my emulator or android device so I can show Punjab...
[ "android" ]
1
2
1,976
2
0
2011-06-03T10:44:52.607000
2011-06-03T11:06:01.030000
6,226,098
6,249,460
Firefox sidebar calling javascript functions in main browser window
I'm trying to put together a quick Firefox sidebar for internal use only. I'm struggling a bit in understanding how sidebar and main browser window communicate. What I want to do exactly is call existing javascript functions that reside in the main browser window only. My code looks like this; ff-sidebar.xul ff-sidebar...
Theoretically, this should work: window.content.NEWSTYLE.buttonHover(); window.content points to the browser content window and the variable NEWSTYLE is defined on this window. In reality things are a bit more messy due to security mechanisms - privileged code cannot access objects of unprivileged code directly. Instea...
Firefox sidebar calling javascript functions in main browser window I'm trying to put together a quick Firefox sidebar for internal use only. I'm struggling a bit in understanding how sidebar and main browser window communicate. What I want to do exactly is call existing javascript functions that reside in the main bro...
TITLE: Firefox sidebar calling javascript functions in main browser window QUESTION: I'm trying to put together a quick Firefox sidebar for internal use only. I'm struggling a bit in understanding how sidebar and main browser window communicate. What I want to do exactly is call existing javascript functions that resi...
[ "javascript", "firefox", "firefox-addon", "xul", "sidebar" ]
1
1
614
1
0
2011-06-03T10:45:44.500000
2011-06-06T08:34:42.967000
6,226,103
6,226,181
select multiple static values
As we can write in SQL to return single static value select "Jan" as StartMonth In the similar way, SQL should allow to write to return multiple values in same column select {"Jan", "Feb", "Mar"} as Qtr1, {"Apr", "May", "Jun"} as Qtr2 When we need data as table to perform join and data is unknown at Sp level, i.e., it ...
Will this give you what you want? SELECT 'Jan' AS Qtr1, 'Apr' AS Qtr2 UNION ALL SELECT 'Feb' AS Qtr1, 'May' AS Qtr2 UNION ALL SELECT 'Mar' AS Qtr1, 'Jun' AS Qtr2
select multiple static values As we can write in SQL to return single static value select "Jan" as StartMonth In the similar way, SQL should allow to write to return multiple values in same column select {"Jan", "Feb", "Mar"} as Qtr1, {"Apr", "May", "Jun"} as Qtr2 When we need data as table to perform join and data is ...
TITLE: select multiple static values QUESTION: As we can write in SQL to return single static value select "Jan" as StartMonth In the similar way, SQL should allow to write to return multiple values in same column select {"Jan", "Feb", "Mar"} as Qtr1, {"Apr", "May", "Jun"} as Qtr2 When we need data as table to perform...
[ "sql-server" ]
19
42
52,845
3
0
2011-06-03T10:46:20.870000
2011-06-03T10:55:40.310000
6,226,104
6,226,306
change look and feel of JFileChooser in swing
My requirement is to add check box with every directory which is shown by JFileChooser. and give multi selection facility. How can I achieve this?
It would probably be easier to implement a custom component than alter a JFileChooser to support this (odd) requirement. You might start with altering the component used in File Manager questions.
change look and feel of JFileChooser in swing My requirement is to add check box with every directory which is shown by JFileChooser. and give multi selection facility. How can I achieve this?
TITLE: change look and feel of JFileChooser in swing QUESTION: My requirement is to add check box with every directory which is shown by JFileChooser. and give multi selection facility. How can I achieve this? ANSWER: It would probably be easier to implement a custom component than alter a JFileChooser to support thi...
[ "java", "swing", "jfilechooser" ]
0
3
1,233
3
0
2011-06-03T10:46:24.210000
2011-06-03T11:06:57.330000
6,226,106
6,226,615
Is it possible to return the ActionLink html from a ViewModel? (MVC3 + Razor)
I have a four viewmodels/views which display similar but different data. Is it possible to have a property on the viewmodel which retuns ActionLinks (or the html for them?) e.g. At the moment on each of my Views I have @Html.ActionLink("My Open Calls", "MyOpenCalls") @Html.ActionLink("All Open Calls", "AllOpenCalls") @...
While it might be possible to store HTML in view models properties I don't think it would be a good idea. If you want to reuse some code why not simply put this table into a partial and then include the partial: @Html.Partial("_Links") Another possibility is to use a custom HTML helper that will generate those links.
Is it possible to return the ActionLink html from a ViewModel? (MVC3 + Razor) I have a four viewmodels/views which display similar but different data. Is it possible to have a property on the viewmodel which retuns ActionLinks (or the html for them?) e.g. At the moment on each of my Views I have @Html.ActionLink("My Op...
TITLE: Is it possible to return the ActionLink html from a ViewModel? (MVC3 + Razor) QUESTION: I have a four viewmodels/views which display similar but different data. Is it possible to have a property on the viewmodel which retuns ActionLinks (or the html for them?) e.g. At the moment on each of my Views I have @Html...
[ "asp.net-mvc-3", "razor", "viewmodel" ]
0
2
347
1
0
2011-06-03T10:46:28.227000
2011-06-03T11:37:04.367000
6,226,109
6,226,138
Calling a different process when method chaining in PHP?
Firstly, sorry for my flawed english and being dumb:O I just want to know any procedure to make this possible in method chaining. As per the DOMDocument class, the sequence of the characters are altered accordingly if we perform method chaining for example: $dom = new DOMDocument(); $applicant = $dom->createElement('a...
appendChild returns the appended child, so your next appendChild acts on that return value. So in your first example you're allways working on $name in the second twice on $name and once on $firstname. See: http://www.php.net/manual/en/domnode.appendchild.php
Calling a different process when method chaining in PHP? Firstly, sorry for my flawed english and being dumb:O I just want to know any procedure to make this possible in method chaining. As per the DOMDocument class, the sequence of the characters are altered accordingly if we perform method chaining for example: $dom ...
TITLE: Calling a different process when method chaining in PHP? QUESTION: Firstly, sorry for my flawed english and being dumb:O I just want to know any procedure to make this possible in method chaining. As per the DOMDocument class, the sequence of the characters are altered accordingly if we perform method chaining ...
[ "php", "methods", "domdocument", "chaining" ]
0
3
103
2
0
2011-06-03T10:46:46.753000
2011-06-03T10:50:22.887000
6,226,110
6,227,248
Error: fluent NHibernate mapping which references mapping in different assembly
My company has multiple sites which reference the same DB and Core library of code. Then we have a CMS which manages the data. In the Core library I have a Site class which holds a bunch of basic info about each site. This is the fluent mapping I have for it. using Core.Model; // Where Site class exists namespace Core...
An 'unmapped class' error usually stems from the Configuration not having that ClassMap recorded. In your FluentConfiguration, you probably have something similar to:.Mappings(m => m.FluentMappings.AddFromAssemblyOf ()) It appears that your two ClassMaps (at least those mentioned in the post) are in different assemblie...
Error: fluent NHibernate mapping which references mapping in different assembly My company has multiple sites which reference the same DB and Core library of code. Then we have a CMS which manages the data. In the Core library I have a Site class which holds a bunch of basic info about each site. This is the fluent map...
TITLE: Error: fluent NHibernate mapping which references mapping in different assembly QUESTION: My company has multiple sites which reference the same DB and Core library of code. Then we have a CMS which manages the data. In the Core library I have a Site class which holds a bunch of basic info about each site. This...
[ "nhibernate", "fluent-nhibernate", "nhibernate-mapping", "fluent-nhibernate-mapping" ]
0
5
2,441
1
0
2011-06-03T10:46:57.737000
2011-06-03T12:45:28.503000
6,226,113
6,227,296
jquery function only looping twice (should be infinite)
Hello Stack i have the below code and it only seems to loop once, i cant seem to work out why it will not loop infinitely. Do you know whats wrong? here is the demo: http://www.prosperitymedia.co.uk/other/ $( function() { function doAnimation() { $('#ochreWrapper img').hide(); $('#ochreTextOne, #ochreTextTwo, #ochreT...
... setInterval(doAnimation, 1000); }); This will set it up so doAnimation runs every 1 second (decrease the 1000 to decrease the length of the interval - 500 would be half a second, 100 would be a tenth of a second, etc.)
jquery function only looping twice (should be infinite) Hello Stack i have the below code and it only seems to loop once, i cant seem to work out why it will not loop infinitely. Do you know whats wrong? here is the demo: http://www.prosperitymedia.co.uk/other/ $( function() { function doAnimation() { $('#ochreWrappe...
TITLE: jquery function only looping twice (should be infinite) QUESTION: Hello Stack i have the below code and it only seems to loop once, i cant seem to work out why it will not loop infinitely. Do you know whats wrong? here is the demo: http://www.prosperitymedia.co.uk/other/ $( function() { function doAnimation() ...
[ "jquery" ]
0
1
255
3
0
2011-06-03T10:47:09.820000
2011-06-03T12:49:44.653000
6,226,117
6,227,393
Show form in Custom Installer in C#.Net
[RunInstaller(true)] public partial class Installer1: Installer { public Installer1() { InitializeComponent(); } public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); } private void Installer1_AfterInstall(object sender, InstallEventArgs e) { Form1 topmostForm = new Form1(...
What worked for me was to call Activate from the Form.Load event. private void Form1_Load(object sender, EventArgs e) { Active(); }
Show form in Custom Installer in C#.Net [RunInstaller(true)] public partial class Installer1: Installer { public Installer1() { InitializeComponent(); } public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); } private void Installer1_AfterInstall(object sender, InstallEvent...
TITLE: Show form in Custom Installer in C#.Net QUESTION: [RunInstaller(true)] public partial class Installer1: Installer { public Installer1() { InitializeComponent(); } public override void Install(System.Collections.IDictionary stateSaver) { base.Install(stateSaver); } private void Installer1_AfterInstall(object se...
[ "c#" ]
1
1
615
1
0
2011-06-03T10:47:32.287000
2011-06-03T12:58:48.810000
6,226,142
6,226,575
jquery plugin problem
i created jquery plugin and error I get is reference error: mySlider is not defined (function($){ $.fn.mySlider = function(){ var timeOut = 4000; var element = this; var fxDuration = timeOut/6; var items = $("#" + element[0].id + " li"); var captions = $("#" + element[0].id + " li div"); var fadeIn = function(no){ $...
It is not defined, since you did not define it. You defined only $.fn.mySlider You may want something like this, to have a separate function: var mySlider = function() { $("#slider").mySlider(); };
jquery plugin problem i created jquery plugin and error I get is reference error: mySlider is not defined (function($){ $.fn.mySlider = function(){ var timeOut = 4000; var element = this; var fxDuration = timeOut/6; var items = $("#" + element[0].id + " li"); var captions = $("#" + element[0].id + " li div"); var fa...
TITLE: jquery plugin problem QUESTION: i created jquery plugin and error I get is reference error: mySlider is not defined (function($){ $.fn.mySlider = function(){ var timeOut = 4000; var element = this; var fxDuration = timeOut/6; var items = $("#" + element[0].id + " li"); var captions = $("#" + element[0].id + "...
[ "jquery-plugins" ]
0
0
419
1
0
2011-06-03T10:50:41.887000
2011-06-03T11:32:51.200000
6,226,166
6,226,448
we have the CSV / SSV. What are the | separated values called?
we have the CSV for comma-separated-values / SSV for semi-colon-seperated-values. So what is the name for a | separated value? Btw what even is the name for thhe | symbol? (i remember its a pipe, but i think that's just an unofficial name or smt)
The general form is known as DSV - see http://www.catb.org/~esr/writings/taoup/html/ch05s02.html.
we have the CSV / SSV. What are the | separated values called? we have the CSV for comma-separated-values / SSV for semi-colon-seperated-values. So what is the name for a | separated value? Btw what even is the name for thhe | symbol? (i remember its a pipe, but i think that's just an unofficial name or smt)
TITLE: we have the CSV / SSV. What are the | separated values called? QUESTION: we have the CSV for comma-separated-values / SSV for semi-colon-seperated-values. So what is the name for a | separated value? Btw what even is the name for thhe | symbol? (i remember its a pipe, but i think that's just an unofficial name ...
[ "validation", "csv", "data-transfer", "data-tracing" ]
1
4
2,278
2
0
2011-06-03T10:53:53.857000
2011-06-03T11:20:02.023000
6,226,177
6,226,557
How to make chainable methods (scopes) with conditions not tied to database
I have a model Item, which has a relation to itself. class Item < ActiveRecord::Base has_many:subitems,:class_name => "Item",:foreign_key => "superitem_id" belongs_to:superitem,:class_name => "Item" end And I want to query all items which have a parent. Firstly I've tried to check if parent_id is present Item.where("su...
I've had a similar issue in the past. It's sometimes difficult to get round it. I found a hack-ish way of doing it for my purposes so hope this will help... ids = [] self.find_each do |i| ids << i.id if i.superitem end Model.where('id in (?)', ids)
How to make chainable methods (scopes) with conditions not tied to database I have a model Item, which has a relation to itself. class Item < ActiveRecord::Base has_many:subitems,:class_name => "Item",:foreign_key => "superitem_id" belongs_to:superitem,:class_name => "Item" end And I want to query all items which have ...
TITLE: How to make chainable methods (scopes) with conditions not tied to database QUESTION: I have a model Item, which has a relation to itself. class Item < ActiveRecord::Base has_many:subitems,:class_name => "Item",:foreign_key => "superitem_id" belongs_to:superitem,:class_name => "Item" end And I want to query all...
[ "ruby-on-rails", "activerecord", "scopes" ]
1
1
306
3
0
2011-06-03T10:55:19.160000
2011-06-03T11:29:58.027000
6,226,180
6,227,280
Detect re (regexp) object in Python
I wonder what is the proper pythonic backward- and forward-compatible method how check if an object is compiled re object. isinstance method cannot be easily used, while the resulting object claims to be _sre.SRE_Pattern object: >>> import re >>> rex = re.compile('') >>> rex <_sre.SRE_Pattern object at 0x7f63db414390> ...
re._pattern_type exists, and appears to do what you want: >>> isinstance(re.compile(''), re._pattern_type) True But this is not a good idea - per Python convention, names starting with _ are not part of the public API of a module and not part of the backward compatibility guarantees. So, using type(re.compile('')) is y...
Detect re (regexp) object in Python I wonder what is the proper pythonic backward- and forward-compatible method how check if an object is compiled re object. isinstance method cannot be easily used, while the resulting object claims to be _sre.SRE_Pattern object: >>> import re >>> rex = re.compile('') >>> rex <_sre.SR...
TITLE: Detect re (regexp) object in Python QUESTION: I wonder what is the proper pythonic backward- and forward-compatible method how check if an object is compiled re object. isinstance method cannot be easily used, while the resulting object claims to be _sre.SRE_Pattern object: >>> import re >>> rex = re.compile(''...
[ "python", "regex", "types" ]
20
27
7,740
4
0
2011-06-03T10:55:35.913000
2011-06-03T12:48:20.723000
6,226,184
6,226,215
substr by using array as condition
I have a file contain text ABBCDE1990-12-10JOBALPHABETabbcde1990-12-10jobalphabet $field = array( "fullname" => array("length"=5,"mandat"=>True), "bithday" => array("length"=>10,"mandat"=>True) "job" => array("length"=>3,"mandat"=>True), "desc" => array("length"=>8,"mandat"=>false) ); How can I get the array some thin...
$field = array( "fullname" => array("length"=>6,"mandat"=>True), "bithday" => array("length"=>10,"mandat"=>True), "job" => array("length"=>3,"mandat"=>True), "desc" => array("length"=>8,"mandat"=>false) ); $string = 'ABBCDE1990-12-10JOBALPHABETabbcde1990-12-10jobalphabet'; $result = array(); $countString = strlen($s...
substr by using array as condition I have a file contain text ABBCDE1990-12-10JOBALPHABETabbcde1990-12-10jobalphabet $field = array( "fullname" => array("length"=5,"mandat"=>True), "bithday" => array("length"=>10,"mandat"=>True) "job" => array("length"=>3,"mandat"=>True), "desc" => array("length"=>8,"mandat"=>false) )...
TITLE: substr by using array as condition QUESTION: I have a file contain text ABBCDE1990-12-10JOBALPHABETabbcde1990-12-10jobalphabet $field = array( "fullname" => array("length"=5,"mandat"=>True), "bithday" => array("length"=>10,"mandat"=>True) "job" => array("length"=>3,"mandat"=>True), "desc" => array("length"=>8,...
[ "php", "arrays" ]
0
1
92
1
0
2011-06-03T10:55:51.987000
2011-06-03T10:59:35.727000
6,226,187
6,226,250
What the view controller structure/hierarchy of the iPhone photos app?
I'm working on an app that requires a pushing a view that is full screen and shows/hides status, navigation and bottom toolbars on tapping of the central image. The app currently has a UITabBarController that has a UINavigationController for each tab. Basically when the full screen view is displayed I want it to to wor...
Have you tried using UIViewController 's hidesBottomBarWhenPushed property?
What the view controller structure/hierarchy of the iPhone photos app? I'm working on an app that requires a pushing a view that is full screen and shows/hides status, navigation and bottom toolbars on tapping of the central image. The app currently has a UITabBarController that has a UINavigationController for each ta...
TITLE: What the view controller structure/hierarchy of the iPhone photos app? QUESTION: I'm working on an app that requires a pushing a view that is full screen and shows/hides status, navigation and bottom toolbars on tapping of the central image. The app currently has a UITabBarController that has a UINavigationCont...
[ "iphone", "uinavigationcontroller", "uitabbarcontroller" ]
0
1
248
1
0
2011-06-03T10:56:18
2011-06-03T11:02:40.373000
6,226,189
6,226,756
How to convert a String to Bytearray
How can I convert a string in bytearray using JavaScript. Output should be equivalent of the below C# code. UnicodeEncoding encoding = new UnicodeEncoding(); byte[] bytes = encoding.GetBytes(AnyString); As UnicodeEncoding is by default of UTF-16 with Little-Endianness. Edit: I have a requirement to match the bytearray ...
In C# running this UnicodeEncoding encoding = new UnicodeEncoding(); byte[] bytes = encoding.GetBytes("Hello"); Will create an array with 72,0,101,0,108,0,108,0,111,0 For a character which the code is greater than 255 it will look like this If you want a very similar behavior in JavaScript you can do this (v2 is a bit ...
How to convert a String to Bytearray How can I convert a string in bytearray using JavaScript. Output should be equivalent of the below C# code. UnicodeEncoding encoding = new UnicodeEncoding(); byte[] bytes = encoding.GetBytes(AnyString); As UnicodeEncoding is by default of UTF-16 with Little-Endianness. Edit: I have ...
TITLE: How to convert a String to Bytearray QUESTION: How can I convert a string in bytearray using JavaScript. Output should be equivalent of the below C# code. UnicodeEncoding encoding = new UnicodeEncoding(); byte[] bytes = encoding.GetBytes(AnyString); As UnicodeEncoding is by default of UTF-16 with Little-Endiann...
[ "javascript" ]
133
32
426,622
12
0
2011-06-03T10:56:25.147000
2011-06-03T11:52:06.267000
6,226,198
6,226,454
One Presenter needing Access to another Presenter's State in GWT MVP
I am making an application where I have three main Presenters. In one say "ListPresenter", I have a Tree with a list of cities. In one say "WritePresenter", I type in some text and hit update. The update is for one of the cities. In one say "ShowPresenter", I show the update if and only if an update is availaible for t...
How about making ListPresenter fire another event that ShowPresenter would be subscribed to. That event would be fired if, and only if, ListPresenter is in such a state that ShowPresenter should be updated.
One Presenter needing Access to another Presenter's State in GWT MVP I am making an application where I have three main Presenters. In one say "ListPresenter", I have a Tree with a list of cities. In one say "WritePresenter", I type in some text and hit update. The update is for one of the cities. In one say "ShowPrese...
TITLE: One Presenter needing Access to another Presenter's State in GWT MVP QUESTION: I am making an application where I have three main Presenters. In one say "ListPresenter", I have a Tree with a list of cities. In one say "WritePresenter", I type in some text and hit update. The update is for one of the cities. In ...
[ "gwt", "mvp", "event-bus" ]
1
1
194
1
0
2011-06-03T10:57:27.300000
2011-06-03T11:20:32.977000
6,226,204
6,226,234
Problem while using Multi - threading in iPad programming (for loading large number of images)
i am supposed to load large number of images on to a scrollview which, i suppose would take some time and memory. So, i used a separate thread to load these images in the background. I have used the following multi threading method [NSThread detachNewThreadSelector:@selector(prepareSliderView) toTarget:self withObject:...
For each main method that you execute in a new thread, either via NSThread or via performsSelectorInBackground:, you have to create an autorelease pool like this: - (void)myBackgroundOperation { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Do some work. // At the very end, release the pool. [pool re...
Problem while using Multi - threading in iPad programming (for loading large number of images) i am supposed to load large number of images on to a scrollview which, i suppose would take some time and memory. So, i used a separate thread to load these images in the background. I have used the following multi threading ...
TITLE: Problem while using Multi - threading in iPad programming (for loading large number of images) QUESTION: i am supposed to load large number of images on to a scrollview which, i suppose would take some time and memory. So, i used a separate thread to load these images in the background. I have used the followin...
[ "iphone", "multithreading", "image", "ipad", "autorelease" ]
1
3
656
2
0
2011-06-03T10:58:03.353000
2011-06-03T11:01:32.900000
6,226,210
6,226,238
Writing a double type value to a text file
The below code is writing unreadable characters to the text file: int main () { ofstream myfile ("example.txt"); if (myfile.is_open()) { double value = 11.23444556; char *conversion = (char *)&value strcat (conversion, "\0"); myfile.write (conversion, strlen (conversion)); myfile.close(); } return 0; } I want to see...
Why don't you simply do this (updated answer after the edit in the question): #include myfile << std::fixed << std::setprecision(8) << value; myfile.close(); Now, you can see the actual number written in the file. See the documentation of std::setprecision. Note: you have to include the header file.
Writing a double type value to a text file The below code is writing unreadable characters to the text file: int main () { ofstream myfile ("example.txt"); if (myfile.is_open()) { double value = 11.23444556; char *conversion = (char *)&value strcat (conversion, "\0"); myfile.write (conversion, strlen (conversion)); m...
TITLE: Writing a double type value to a text file QUESTION: The below code is writing unreadable characters to the text file: int main () { ofstream myfile ("example.txt"); if (myfile.is_open()) { double value = 11.23444556; char *conversion = (char *)&value strcat (conversion, "\0"); myfile.write (conversion, strle...
[ "c++", "pointers", "file-io" ]
12
29
67,603
4
0
2011-06-03T10:58:45.447000
2011-06-03T11:01:48.033000
6,226,212
6,226,516
guid in System.Guid
As per MSDN, they describe System.Guid.NewGuid() as.. The chance that the value of the new Guid will be all zeros or equal to any other Guid is very **low** Will it be a bad idea to set customerID of Customer table to "uniqueidentifier" and generate the unique id using the System.Guid.NewGuid()? How can I assure the me...
Unless you have very good reasons to use Guid as ID, I would recommend against using Guid as key. Guids take a lot of space in a database, and provide no benefit in common scenarios. Plus they do not play well with indexes. Why don't you set the CustomerID as an integer and set it to auto-generate its value when you in...
guid in System.Guid As per MSDN, they describe System.Guid.NewGuid() as.. The chance that the value of the new Guid will be all zeros or equal to any other Guid is very **low** Will it be a bad idea to set customerID of Customer table to "uniqueidentifier" and generate the unique id using the System.Guid.NewGuid()? How...
TITLE: guid in System.Guid QUESTION: As per MSDN, they describe System.Guid.NewGuid() as.. The chance that the value of the new Guid will be all zeros or equal to any other Guid is very **low** Will it be a bad idea to set customerID of Customer table to "uniqueidentifier" and generate the unique id using the System.G...
[ "guid", "uniqueidentifier" ]
0
2
186
1
0
2011-06-03T10:59:10.043000
2011-06-03T11:26:48.013000
6,226,214
6,226,571
Allow Only Selected Domains to Access Certain Pages
I figure this can be accomplished with htaccess but I'm not sure how. Third-party payment processors for our site has a generic response handler that determines the payment method to process. Responses from these payment processor are passed via POST/GET after a redirect from their server. This gives us the burden to e...
If the IP address is constant, you can simply create a section in.htaccess and only allow the given IPs/subnets to access the contents, e.g. Order Deny, Allow Deny from All Allow from 1.2.3.4 Otherwise, you could just check for $_SERVER['REMOTE_ADDR'] variable and compare with the valid address.
Allow Only Selected Domains to Access Certain Pages I figure this can be accomplished with htaccess but I'm not sure how. Third-party payment processors for our site has a generic response handler that determines the payment method to process. Responses from these payment processor are passed via POST/GET after a redir...
TITLE: Allow Only Selected Domains to Access Certain Pages QUESTION: I figure this can be accomplished with htaccess but I'm not sure how. Third-party payment processors for our site has a generic response handler that determines the payment method to process. Responses from these payment processor are passed via POST...
[ "php", "security", "apache", ".htaccess" ]
0
3
1,304
1
0
2011-06-03T10:59:30.687000
2011-06-03T11:32:02.397000
6,226,216
6,226,686
How to remove redundant <br /> tags from HTML code using PHP?
I'm parsing some messy HTML code with PHP in which there are some redundant tags and I would like to clean them up a bit. For instance: How would I replace something like that with this using preg_replace()?: Newlines, spaces, and the differences between,, and would all have to be accounted for. Edit: Basically I'd lik...
Here is something you can use. The first line finds whenever there is 2 or more tags (with whitespace between and different types) and replace them with wellformated. I also included the second line to clean up the rest of the tags if you want that too. function clean($txt) { $txt=preg_replace("{( |\/>)\s*){2,}}i", " "...
How to remove redundant <br /> tags from HTML code using PHP? I'm parsing some messy HTML code with PHP in which there are some redundant tags and I would like to clean them up a bit. For instance: How would I replace something like that with this using preg_replace()?: Newlines, spaces, and the differences between,, a...
TITLE: How to remove redundant <br /> tags from HTML code using PHP? QUESTION: I'm parsing some messy HTML code with PHP in which there are some redundant tags and I would like to clean them up a bit. For instance: How would I replace something like that with this using preg_replace()?: Newlines, spaces, and the diffe...
[ "php", "html", "regex", "preg-replace" ]
4
6
8,010
5
0
2011-06-03T10:59:46.053000
2011-06-03T11:45:03.213000
6,226,229
6,226,600
Copy/extract part of a File path?
How can I copy/extract part of a File path? For example, say if I have this path: D:\Programs\Tools\Bin\Somefile.dat how could I copy/extract it to make it like this: C:\Users\Bin\Somefile.dat or C:\Users\Tools\Bin\Somefile.dat or C:\Users\Programs\Tools\Bin\Somefile.dat Notice that the examples above are taking part o...
Here's a quick implementation that returns the TAIL of a path, including the specified number of elements. There's also a bit of demo of how to use it, and the results are exactly the ones you requested. Unfortunately I don't fully understand what transformations you're after: this might be exactly what you're after, o...
Copy/extract part of a File path? How can I copy/extract part of a File path? For example, say if I have this path: D:\Programs\Tools\Bin\Somefile.dat how could I copy/extract it to make it like this: C:\Users\Bin\Somefile.dat or C:\Users\Tools\Bin\Somefile.dat or C:\Users\Programs\Tools\Bin\Somefile.dat Notice that th...
TITLE: Copy/extract part of a File path? QUESTION: How can I copy/extract part of a File path? For example, say if I have this path: D:\Programs\Tools\Bin\Somefile.dat how could I copy/extract it to make it like this: C:\Users\Bin\Somefile.dat or C:\Users\Tools\Bin\Somefile.dat or C:\Users\Programs\Tools\Bin\Somefile....
[ "delphi", "filenames", "filepath" ]
6
5
1,834
3
0
2011-06-03T11:01:08.593000
2011-06-03T11:35:25.580000
6,226,246
6,226,288
Submit button clicking changing the value of it to another thing
maybe very easy! I'm php coder and I don't have experience in js but I must do this for one of my codes suppose I have sub1 in page after clicking it must be that sub1 but value now is sub2 pharmacy
show as function name does not really make sense here (imo), but you could do: and function show(element) { element.value = 'sub2'; } Important: But that will actually not solve your problem. As soon as you click the button, the form is submitted, meaning the browser initiates a new request and will load a new page. So...
Submit button clicking changing the value of it to another thing maybe very easy! I'm php coder and I don't have experience in js but I must do this for one of my codes suppose I have sub1 in page after clicking it must be that sub1 but value now is sub2 pharmacy
TITLE: Submit button clicking changing the value of it to another thing QUESTION: maybe very easy! I'm php coder and I don't have experience in js but I must do this for one of my codes suppose I have sub1 in page after clicking it must be that sub1 but value now is sub2 pharmacy ANSWER: show as function name does no...
[ "php", "javascript" ]
0
4
18,126
3
0
2011-06-03T11:02:20.127000
2011-06-03T11:05:33.557000
6,226,247
6,226,280
LINQ search query
The below function returns all the rows in Files table even when the where filter if applied, public IList SearchFiles(int? FileID, int? type, int? Status) { var files = from fil in _context.Files select fil; if (FileID!= null) { files.Where(x => x.FileID == FileID); } if (type!= null) { files.Where(x => x.FileTypeI...
You need to assign the Where back to the IQueryable.... (ie: files = files.where(.... public IList SearchFiles(int? FileID, int? type, int? Status) { var files = from fil in _context.Files select fil; if (FileID!= null) { files = files.Where(x => x.FileID == FileID); } if (type!= null) { files = files.Where(x => x.F...
LINQ search query The below function returns all the rows in Files table even when the where filter if applied, public IList SearchFiles(int? FileID, int? type, int? Status) { var files = from fil in _context.Files select fil; if (FileID!= null) { files.Where(x => x.FileID == FileID); } if (type!= null) { files.Wher...
TITLE: LINQ search query QUESTION: The below function returns all the rows in Files table even when the where filter if applied, public IList SearchFiles(int? FileID, int? type, int? Status) { var files = from fil in _context.Files select fil; if (FileID!= null) { files.Where(x => x.FileID == FileID); } if (type!= ...
[ "linq-to-sql" ]
0
2
606
1
0
2011-06-03T11:02:21.373000
2011-06-03T11:04:47.507000
6,226,256
6,226,316
How to create runing text in WinForm Label? (like photoshop loading page)
If you open adobe photo shop, one small window is suddenly open. In that you can saw the running text Initilizing... Reading Fonts.. like that. I like to do this type of running text in my project also.. I try to in for loop. but it not show!. for (int j = 1; j <= 3; j++) { label1.Text = "Please Wait."; label1.Text = "...
you need to add intervals in between, otherwise you won't see the text except the last one. You'll also need to update the GUI as in Barfieldmv's comments below, so something like this: For(int i =0; i<3;i++) { label1.Text = "Please Wait."; label1.Update(); system.Threading.Thread.Sleep(500); label1.Text = "Please Wait...
How to create runing text in WinForm Label? (like photoshop loading page) If you open adobe photo shop, one small window is suddenly open. In that you can saw the running text Initilizing... Reading Fonts.. like that. I like to do this type of running text in my project also.. I try to in for loop. but it not show!. fo...
TITLE: How to create runing text in WinForm Label? (like photoshop loading page) QUESTION: If you open adobe photo shop, one small window is suddenly open. In that you can saw the running text Initilizing... Reading Fonts.. like that. I like to do this type of running text in my project also.. I try to in for loop. bu...
[ "c#", "winforms" ]
0
1
2,320
2
0
2011-06-03T11:03:14.337000
2011-06-03T11:07:52.383000
6,226,260
6,258,867
Iphone Sqlite problem
I have to make a project using sqlite, i would rather use simple plists, xml or even core data as i don't have any experience with sql. However it has to be able to read from sqlite database. I downloaded the FMDB wrapper and set it up quickly however when i try and read from my database it does not display in the tabl...
I have fixed it, It was a problem with my sql file, it now works great! Thanks for all your comments!
Iphone Sqlite problem I have to make a project using sqlite, i would rather use simple plists, xml or even core data as i don't have any experience with sql. However it has to be able to read from sqlite database. I downloaded the FMDB wrapper and set it up quickly however when i try and read from my database it does n...
TITLE: Iphone Sqlite problem QUESTION: I have to make a project using sqlite, i would rather use simple plists, xml or even core data as i don't have any experience with sql. However it has to be able to read from sqlite database. I downloaded the FMDB wrapper and set it up quickly however when i try and read from my ...
[ "iphone", "sqlite" ]
0
0
175
2
0
2011-06-03T11:03:19.717000
2011-06-06T22:44:48.760000
6,226,261
6,226,332
delphi compare text file contents
We need to compare the contents of two (or more) text files to determine if we need to create a backup. If they differ we create a new backup. I currently use the CRC value of each file to check for differences but I was wondering if there is a more efficient or elegant way of detecting differences between to files. //...
CRC is probably more accurate, and pretty efficient. However do you need to check the contents? I'm assuming you're checking the CRC to see if a modification has been made and re-backup the updated file. In which case FileAge() would do just fine.
delphi compare text file contents We need to compare the contents of two (or more) text files to determine if we need to create a backup. If they differ we create a new backup. I currently use the CRC value of each file to check for differences but I was wondering if there is a more efficient or elegant way of detectin...
TITLE: delphi compare text file contents QUESTION: We need to compare the contents of two (or more) text files to determine if we need to create a backup. If they differ we create a new backup. I currently use the CRC value of each file to check for differences but I was wondering if there is a more efficient or elega...
[ "delphi", "file", "compare" ]
4
2
2,893
4
0
2011-06-03T11:03:21.330000
2011-06-03T11:08:59.753000
6,226,265
6,254,265
Resizing view from cvShowImage
I don't want to resize the entire image structure, but the images I am working with are too large to easily view with cvShowImage. Is there a way to resize their view within the window created by cvShowImage?
No there isn't, you will have to create a new image structure and use cvResize.
Resizing view from cvShowImage I don't want to resize the entire image structure, but the images I am working with are too large to easily view with cvShowImage. Is there a way to resize their view within the window created by cvShowImage?
TITLE: Resizing view from cvShowImage QUESTION: I don't want to resize the entire image structure, but the images I am working with are too large to easily view with cvShowImage. Is there a way to resize their view within the window created by cvShowImage? ANSWER: No there isn't, you will have to create a new image s...
[ "c++", "c", "opencv" ]
0
1
817
1
0
2011-06-03T11:03:39.140000
2011-06-06T15:23:27.083000
6,226,272
6,226,781
(iphone) How to play the same sound from multiple views using AudioServicesPlaySystemSound?
I'd like to play button tap sound from various UIButton instances. I'm planning to create a singleton to hold "SystemSoundID" of sound files that will be shared across many buttons. Will this work? (SystemSoundID won't change during app's lifetime?) Is there a other recommended way of doing this? Thank you
I would suggest you to sub-class UIButton and override its any of the touch event (as you want) and play sound.... by this way you don't have to worry about playing sound each time, which will be the case even you put the code in 'appdelegate'
(iphone) How to play the same sound from multiple views using AudioServicesPlaySystemSound? I'd like to play button tap sound from various UIButton instances. I'm planning to create a singleton to hold "SystemSoundID" of sound files that will be shared across many buttons. Will this work? (SystemSoundID won't change du...
TITLE: (iphone) How to play the same sound from multiple views using AudioServicesPlaySystemSound? QUESTION: I'd like to play button tap sound from various UIButton instances. I'm planning to create a singleton to hold "SystemSoundID" of sound files that will be shared across many buttons. Will this work? (SystemSound...
[ "iphone", "audio", "audiotoolbox" ]
0
0
130
1
0
2011-06-03T11:04:12.277000
2011-06-03T11:54:15.973000
6,226,274
6,226,655
Select distinct active record
I have a model called Shops with an attribute called brands, brands is a text field and contains multiple brands. What i would like to do is select all unique brands and display them sorted in alphabetic order @brands = Shop.all(:select => 'distinct(brands)') What to do from here?
If Shop#brands can hold multiple values like for example: "rony, hoke, fike", then I can reluctantly suggest doing something like this: @brands = Shop.all(:select => 'brands').each { |s| s.brands.split(',').map { |b| b.strip.downcase } }.flatten.uniq.sort BUT, you should really think about your data model here to preve...
Select distinct active record I have a model called Shops with an attribute called brands, brands is a text field and contains multiple brands. What i would like to do is select all unique brands and display them sorted in alphabetic order @brands = Shop.all(:select => 'distinct(brands)') What to do from here?
TITLE: Select distinct active record QUESTION: I have a model called Shops with an attribute called brands, brands is a text field and contains multiple brands. What i would like to do is select all unique brands and display them sorted in alphabetic order @brands = Shop.all(:select => 'distinct(brands)') What to do f...
[ "ruby-on-rails-3", "activerecord" ]
2
1
1,359
1
0
2011-06-03T11:04:17.127000
2011-06-03T11:41:44.910000
6,226,290
6,226,326
Default value of 'boolean' and 'Boolean' in Java
What are the default values of boolean (primitive) and Boolean (primitive wrapper) in Java?
The default value for a Boolean (object) is null. The default value for a boolean (primitive) is false.
Default value of 'boolean' and 'Boolean' in Java What are the default values of boolean (primitive) and Boolean (primitive wrapper) in Java?
TITLE: Default value of 'boolean' and 'Boolean' in Java QUESTION: What are the default values of boolean (primitive) and Boolean (primitive wrapper) in Java? ANSWER: The default value for a Boolean (object) is null. The default value for a boolean (primitive) is false.
[ "java", "boolean", "default-value" ]
331
626
544,141
8
0
2011-06-03T11:05:42.577000
2011-06-03T11:08:30.763000
6,226,291
6,226,387
How to send personalized email in phplist
Is there a way that I can send personalized emails to different users on the same list in phplist? for example i composed this message: Dear [name] This is the content If there is a way to modify the [name] to send emails with the actual name of the recipient how can I do it? Thanks
As you store the user list on a MySQL database, so just simply select the users from the database, and then send a mail to every user on each round of the loop, using result from the query. For example, mail($row['email'], $message, $header); // just for example }?> Figure it out yourself, the code might not fit your c...
How to send personalized email in phplist Is there a way that I can send personalized emails to different users on the same list in phplist? for example i composed this message: Dear [name] This is the content If there is a way to modify the [name] to send emails with the actual name of the recipient how can I do it? T...
TITLE: How to send personalized email in phplist QUESTION: Is there a way that I can send personalized emails to different users on the same list in phplist? for example i composed this message: Dear [name] This is the content If there is a way to modify the [name] to send emails with the actual name of the recipient ...
[ "php", "mysql", "phpmailer", "phplist" ]
1
1
2,834
1
0
2011-06-03T11:05:44.867000
2011-06-03T11:14:43.130000
6,226,292
6,226,333
How to use Update Select statement based on more tables in SQL Server?
I have three tables such as TableA, TableB and TableC. I want to update one column in TableA from the column value in TableC. But there is no direct relationship b/w TableA and TableC. But TableB has relationship with both the tables A and C. How can I update? The structure of the tables are given below: TableA: TableB...
Something like: Update a set a.Quantity = c.Quantity from TableA a join TableB b on b.ItemDetailId = a.ItemDetailId join TableC c on c.ID = b.ID
How to use Update Select statement based on more tables in SQL Server? I have three tables such as TableA, TableB and TableC. I want to update one column in TableA from the column value in TableC. But there is no direct relationship b/w TableA and TableC. But TableB has relationship with both the tables A and C. How ca...
TITLE: How to use Update Select statement based on more tables in SQL Server? QUESTION: I have three tables such as TableA, TableB and TableC. I want to update one column in TableA from the column value in TableC. But there is no direct relationship b/w TableA and TableC. But TableB has relationship with both the tabl...
[ "sql-server", "sql-server-2005" ]
0
3
330
2
0
2011-06-03T11:06:00.890000
2011-06-03T11:09:06.547000
6,226,305
6,226,441
Relationship slow system call with signal
I'm learning slow system call and signals. For the normal system, the slow system call (read from terminal device) can block forever. and below example, it is possible to read to time out after some amount of time. But when I excuted it, The time out does nothing. I can't understand why. Could you explain and show me a...
Your handler gets called after a second. If you check you will see it gets called. I don't recommend putting a printf since it's not async-signal-safe, put you can make it set a variable or something. Anyway, back to the question. If you're wondering why the read doesn't fail with EINTR the answer is SA_RESTART. On mos...
Relationship slow system call with signal I'm learning slow system call and signals. For the normal system, the slow system call (read from terminal device) can block forever. and below example, it is possible to read to time out after some amount of time. But when I excuted it, The time out does nothing. I can't under...
TITLE: Relationship slow system call with signal QUESTION: I'm learning slow system call and signals. For the normal system, the slow system call (read from terminal device) can block forever. and below example, it is possible to read to time out after some amount of time. But when I excuted it, The time out does noth...
[ "signals", "system-calls" ]
2
1
695
1
0
2011-06-03T11:06:49.720000
2011-06-03T11:19:10.810000
6,226,312
6,226,410
using configobj to read a complete section one by one
I am using configobj to read a config file as below. [default] PROP1 = "12345" PROP2 = "abcde" [section1] PROP1 = "56789" PROP2 = "" [section2] PROP1 = "" PROP2 = "" I aim to read the list of sections first and then get each section onto a dictionary. I have to replace with default values if no value is present. say se...
When you read your config file, configobj will convert it into a dictionary for you. >>> from configobj import ConfigObj >>> config = ConfigObj('your_config_filename') >>> config.keys() <<< ['default', 'section1', 'section2'] >>> config['default'] <<< {'PROP1': '12345', 'PROP2': 'abcde'}
using configobj to read a complete section one by one I am using configobj to read a config file as below. [default] PROP1 = "12345" PROP2 = "abcde" [section1] PROP1 = "56789" PROP2 = "" [section2] PROP1 = "" PROP2 = "" I aim to read the list of sections first and then get each section onto a dictionary. I have to repl...
TITLE: using configobj to read a complete section one by one QUESTION: I am using configobj to read a config file as below. [default] PROP1 = "12345" PROP2 = "abcde" [section1] PROP1 = "56789" PROP2 = "" [section2] PROP1 = "" PROP2 = "" I aim to read the list of sections first and then get each section onto a dictiona...
[ "python", "configuration-files", "configobj" ]
1
2
2,997
1
0
2011-06-03T11:07:43.070000
2011-06-03T11:16:42.973000
6,226,324
6,226,371
Question about JQuery - Get values of some selected items by class
Hey Guys, I have a form with 4 select tags: Option 1 Option 2 Option 1 Option 2 Option 1 Option 2 Option 3 Option 1 Option 2 Option 3 Option 4 I want to get by jquery all the classes of "section_1" and their selected options value. I got now: $(".section_1")... by how I continue? Thanks!
You can use.each for looping through that $(".section_1").each(function(){ alert(this.value); }); or you can use.map() var selectedValues = $(".section_1").map(function(){ return this.value; }).get().join(','); You can see a working demo
Question about JQuery - Get values of some selected items by class Hey Guys, I have a form with 4 select tags: Option 1 Option 2 Option 1 Option 2 Option 1 Option 2 Option 3 Option 1 Option 2 Option 3 Option 4 I want to get by jquery all the classes of "section_1" and their selected options value. I got now: $(".sectio...
TITLE: Question about JQuery - Get values of some selected items by class QUESTION: Hey Guys, I have a form with 4 select tags: Option 1 Option 2 Option 1 Option 2 Option 1 Option 2 Option 3 Option 1 Option 2 Option 3 Option 4 I want to get by jquery all the classes of "section_1" and their selected options value. I g...
[ "javascript", "jquery" ]
2
4
6,625
6
0
2011-06-03T11:08:27.567000
2011-06-03T11:13:19.767000
6,226,330
6,232,794
Sharparchitecture upgrade from 1.5 to 1.9 error
I have upgraded SharpArchitecture from 1.5 to 1.9. I have followed the guide here http://blog.sharparchitecture.net/post/Sharp-Architecture-19-released.aspx, and ensured that I have set "copy local = true" for the various DLLs, but I still receive the following error when running the site: Exception Details: System.Arr...
I have been looking at the versions of SharpArchitecture in the different project several times, but apparently I had missed one project which didn't have the SharpArch DLL set to Specific Version.
Sharparchitecture upgrade from 1.5 to 1.9 error I have upgraded SharpArchitecture from 1.5 to 1.9. I have followed the guide here http://blog.sharparchitecture.net/post/Sharp-Architecture-19-released.aspx, and ensured that I have set "copy local = true" for the various DLLs, but I still receive the following error when...
TITLE: Sharparchitecture upgrade from 1.5 to 1.9 error QUESTION: I have upgraded SharpArchitecture from 1.5 to 1.9. I have followed the guide here http://blog.sharparchitecture.net/post/Sharp-Architecture-19-released.aspx, and ensured that I have set "copy local = true" for the various DLLs, but I still receive the fo...
[ "sharp-architecture" ]
0
0
272
1
0
2011-06-03T11:08:51.213000
2011-06-03T21:18:57.817000
6,226,337
6,226,402
New Find & Replace Box
I have found myself with a new find and replace facility within visual studio that appears in the top right of my IDE. I think it has come down as part of a nu-get package (probably alongside something else). I much prefer my old find and replace dialog box. Does anyone know how to turn this off and get my old Find & R...
It's probably Quick Find in Productivity Power Tools. Look for Tools Options Support on the page above and turn off Quick Find from there.
New Find & Replace Box I have found myself with a new find and replace facility within visual studio that appears in the top right of my IDE. I think it has come down as part of a nu-get package (probably alongside something else). I much prefer my old find and replace dialog box. Does anyone know how to turn this off ...
TITLE: New Find & Replace Box QUESTION: I have found myself with a new find and replace facility within visual studio that appears in the top right of my IDE. I think it has come down as part of a nu-get package (probably alongside something else). I much prefer my old find and replace dialog box. Does anyone know how...
[ "visual-studio-2010" ]
8
11
1,069
1
0
2011-06-03T11:09:25.287000
2011-06-03T11:15:42.417000
6,226,364
6,226,460
Access & Select specific sub-list elements with a Pure Function
Part I: ACCESS Provided with: list = {{z, x, c, d}, {1, 2, 3, 4}} I would like to do the following: (#3/2 + #1/3) &[list[[1]]] Which sadly result in: While my desired output would be: obtained with: (#3/2 + #1/3) &[z, x, c, d] Part II: CONDITIONAL SELECTION Trying to do this: Select[list[[2]], # > 2 &] How could I spec...
You were almost there: (#[[3]]/2 + #[[1]]/3) &[list[[1]]] #1 is the first argument of a function and #3 is the third. You only provide one argument, namely list[[1]]. Since list[[1]] is a list it is mapped over your function. #[[1]] and #[[3]] specify the first and third part/element of the first argument.
Access & Select specific sub-list elements with a Pure Function Part I: ACCESS Provided with: list = {{z, x, c, d}, {1, 2, 3, 4}} I would like to do the following: (#3/2 + #1/3) &[list[[1]]] Which sadly result in: While my desired output would be: obtained with: (#3/2 + #1/3) &[z, x, c, d] Part II: CONDITIONAL SELECTI...
TITLE: Access & Select specific sub-list elements with a Pure Function QUESTION: Part I: ACCESS Provided with: list = {{z, x, c, d}, {1, 2, 3, 4}} I would like to do the following: (#3/2 + #1/3) &[list[[1]]] Which sadly result in: While my desired output would be: obtained with: (#3/2 + #1/3) &[z, x, c, d] Part II: C...
[ "list", "function", "wolfram-mathematica" ]
3
5
239
4
0
2011-06-03T11:12:22.013000
2011-06-03T11:21:25.113000
6,226,373
6,226,572
How to build LWP::UserAgent form parameters dynamically?
I want to build a set of form parameters for use in an HTTP POST on the fly, but I'm not sure how to access/build the data structure LWP::UserAgent uses dynamically. The typical example code has this structure being passed as a request. my $response = $browser->post( 'http://example.com/postme', [ 'param1' => 'value1',...
The square brackets construct an arrayref, but in this case the post method accepts either an arrayref or a hashref. So you can just do: my %params; $params{param1} = 'value1'; # store parameters into %params here my $response = $browser->post('http://example.com/postme', \%params); Read perlreftut for an introduction ...
How to build LWP::UserAgent form parameters dynamically? I want to build a set of form parameters for use in an HTTP POST on the fly, but I'm not sure how to access/build the data structure LWP::UserAgent uses dynamically. The typical example code has this structure being passed as a request. my $response = $browser->p...
TITLE: How to build LWP::UserAgent form parameters dynamically? QUESTION: I want to build a set of form parameters for use in an HTTP POST on the fly, but I'm not sure how to access/build the data structure LWP::UserAgent uses dynamically. The typical example code has this structure being passed as a request. my $resp...
[ "perl", "lwp-useragent" ]
3
5
1,175
1
0
2011-06-03T11:13:34.540000
2011-06-03T11:32:05.947000
6,226,378
6,226,438
IS to possible to auto call a function as soon as PHP script's execution is started?
Is it possible to trigger a call to a function as soon as any PHP script's execution is started? e.g. So what I want to achieve is as soon as a.php is included a call should be triggered to a function. There should be something like register_shut_down but this function is executed at script shut down time.
Yes this is possible, using a line in your.htaccess file: php_value auto_prepend_file "prepended.php" Or inside you php.ini ofcourse, but I'd not recommend it if you host multiple websites on the same server.
IS to possible to auto call a function as soon as PHP script's execution is started? Is it possible to trigger a call to a function as soon as any PHP script's execution is started? e.g. So what I want to achieve is as soon as a.php is included a call should be triggered to a function. There should be something like re...
TITLE: IS to possible to auto call a function as soon as PHP script's execution is started? QUESTION: Is it possible to trigger a call to a function as soon as any PHP script's execution is started? e.g. So what I want to achieve is as soon as a.php is included a call should be triggered to a function. There should be...
[ "php", "function" ]
1
0
801
2
0
2011-06-03T11:14:10.717000
2011-06-03T11:18:57.097000
6,226,381
6,226,421
Unexpected output of C code
What would be the output of this program? #include #include void main() { clrscr(); int x=20,y=30,z=10; int i=x Actually i=20<30<10, so the condition is false and the value of i should be 0 but i equals 1. Why?
This int i=x doesn't work the way you intended. The effect is int i=(x, where x is evaluated first, and the value true is then compared to z. Pascal points out below that in C the result of the comparison is 1 instead of true. However, the C++ true is implicitly converted to 1 in the next comparison, so the result is t...
Unexpected output of C code What would be the output of this program? #include #include void main() { clrscr(); int x=20,y=30,z=10; int i=x Actually i=20<30<10, so the condition is false and the value of i should be 0 but i equals 1. Why?
TITLE: Unexpected output of C code QUESTION: What would be the output of this program? #include #include void main() { clrscr(); int x=20,y=30,z=10; int i=x Actually i=20<30<10, so the condition is false and the value of i should be 0 but i equals 1. Why? ANSWER: This int i=x doesn't work the way you intended. The ef...
[ "c++", "c" ]
3
7
181
9
0
2011-06-03T11:14:22.417000
2011-06-03T11:17:53.863000
6,226,382
6,226,408
Which is the best way to send email using PHP
Possible Duplicate: What is the best practice to send emails from PHP script? I would like to setup an email application, which is the best method to use in sending emails through PHP and make sure that emails sent through the application is not considered SPAM?
I strongly recommend using some mature PHP class, which solves many problems you would encounter. Such example of a quality PHP mailer library could be PHPMailer
Which is the best way to send email using PHP Possible Duplicate: What is the best practice to send emails from PHP script? I would like to setup an email application, which is the best method to use in sending emails through PHP and make sure that emails sent through the application is not considered SPAM?
TITLE: Which is the best way to send email using PHP QUESTION: Possible Duplicate: What is the best practice to send emails from PHP script? I would like to setup an email application, which is the best method to use in sending emails through PHP and make sure that emails sent through the application is not considered...
[ "php" ]
2
7
14,923
3
0
2011-06-03T11:14:23.790000
2011-06-03T11:16:30.890000
6,226,383
6,226,720
Align TextBlocks by baseline
I have two TextBlocks, each with a different font size, and am trying to align them vertically so that their baselines match up. I know how to do this by creating multiple Run elements within a single TextBlock, but in this case my TextBlocks are not directly adjacent, so that won't work. Here's a simplified example of...
Whilst I agree with Matt's answer, if you actually need to solve the problem without manually setting margins, etc, then you can align them "properly" by setting the LineHeight to the tallest line, and then setting LineStackingStrategy to BlockLineHeight.
Align TextBlocks by baseline I have two TextBlocks, each with a different font size, and am trying to align them vertically so that their baselines match up. I know how to do this by creating multiple Run elements within a single TextBlock, but in this case my TextBlocks are not directly adjacent, so that won't work. H...
TITLE: Align TextBlocks by baseline QUESTION: I have two TextBlocks, each with a different font size, and am trying to align them vertically so that their baselines match up. I know how to do this by creating multiple Run elements within a single TextBlock, but in this case my TextBlocks are not directly adjacent, so ...
[ "windows-phone-7" ]
2
3
1,146
2
0
2011-06-03T11:14:29.907000
2011-06-03T11:48:47.033000
6,226,391
6,229,334
Matlab : 256 binary matrices to one 256 levels grayscale image
a process of mine produces 256 binary (logical) matrices, one for each level of a grayscale source image. Here is the code: so = imread('bio_sd.bmp'); co = rgb2gray(so); for l = 1:256 bw = (co == l); % Binary image from level l of original image be = ordfilt2(bw, 1, ones(3, 3)); % Convolution filter bl(int16(l)) = {bw...
What your code does... I thought it may be best to first go through what the code you posted is actually doing, since there are a couple of inconsistencies. I'll go through each line in your loop: bw = (co == l); This simply creates a binary matrix bw with ones where your grayscale image co has a pixel intensity equal ...
Matlab : 256 binary matrices to one 256 levels grayscale image a process of mine produces 256 binary (logical) matrices, one for each level of a grayscale source image. Here is the code: so = imread('bio_sd.bmp'); co = rgb2gray(so); for l = 1:256 bw = (co == l); % Binary image from level l of original image be = ordfi...
TITLE: Matlab : 256 binary matrices to one 256 levels grayscale image QUESTION: a process of mine produces 256 binary (logical) matrices, one for each level of a grayscale source image. Here is the code: so = imread('bio_sd.bmp'); co = rgb2gray(so); for l = 1:256 bw = (co == l); % Binary image from level l of origina...
[ "matlab", "image-processing", "pixel", "grayscale" ]
0
2
2,711
3
0
2011-06-03T11:15:06.540000
2011-06-03T15:41:45.357000
6,226,399
6,226,786
check query for value exist
how can check if some value is available in a column in the table or not i used this way but the application crash when the value is not in the table Cursor r = db.query(DATABASE_TABLE3, new String[] { "_id", "point_name", "No_of_visits" }, "point_langtitude" + "=" + lang + " and " + "point_latitude" + "=" + lat, null,...
if(r!= null && r.moveToFirst()) { // Update r.close(); } else { // Do not call r.close() here because r is null }
check query for value exist how can check if some value is available in a column in the table or not i used this way but the application crash when the value is not in the table Cursor r = db.query(DATABASE_TABLE3, new String[] { "_id", "point_name", "No_of_visits" }, "point_langtitude" + "=" + lang + " and " + "point_...
TITLE: check query for value exist QUESTION: how can check if some value is available in a column in the table or not i used this way but the application crash when the value is not in the table Cursor r = db.query(DATABASE_TABLE3, new String[] { "_id", "point_name", "No_of_visits" }, "point_langtitude" + "=" + lang +...
[ "android", "sqlite" ]
0
1
537
2
0
2011-06-03T11:15:32.587000
2011-06-03T11:54:47.947000
6,226,400
6,264,649
NullPointerException with Spring Dynamic Modules
I am integrating OSGi Equinox, GWT as bundle and Spring Dynamic Modules. Firstly I check GWT bundle without services and it runs. Now I wish to call a external service with Spring Dynamic Modules. These are my XML files to declare and consume the service: And: service.IZBService In GreetingServiceImpl I have the proper...
Well, I solve the problem. Only I put the attribute as static and it runs!!!
NullPointerException with Spring Dynamic Modules I am integrating OSGi Equinox, GWT as bundle and Spring Dynamic Modules. Firstly I check GWT bundle without services and it runs. Now I wish to call a external service with Spring Dynamic Modules. These are my XML files to declare and consume the service: And: service.IZ...
TITLE: NullPointerException with Spring Dynamic Modules QUESTION: I am integrating OSGi Equinox, GWT as bundle and Spring Dynamic Modules. Firstly I check GWT bundle without services and it runs. Now I wish to call a external service with Spring Dynamic Modules. These are my XML files to declare and consume the servic...
[ "spring", "gwt", "osgi", "equinox" ]
1
0
131
2
0
2011-06-03T11:15:32.880000
2011-06-07T11:41:31.770000
6,226,405
6,226,471
ASP.NET MVC3 and ajax problem
I'm trying to use ajax in my ASP MVC3 application but I have an issue. Here is my view code: @Html.Partial("_Topic", Model) @Ajax.ActionLink("Afficher les commentaires", "ShowLastArticleComments", new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "showComments", InsertionMode = InsertionMode.Replace }) } And h...
Make sure you have included the jquery unobtrusive ajax script to your page as that's what AJAXifies the Ajax.* helpers (obviously jquery itself should be included as well): and that unobtrusive javascript is enabled in web.config:
ASP.NET MVC3 and ajax problem I'm trying to use ajax in my ASP MVC3 application but I have an issue. Here is my view code: @Html.Partial("_Topic", Model) @Ajax.ActionLink("Afficher les commentaires", "ShowLastArticleComments", new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "showComments", InsertionMode = Ins...
TITLE: ASP.NET MVC3 and ajax problem QUESTION: I'm trying to use ajax in my ASP MVC3 application but I have an issue. Here is my view code: @Html.Partial("_Topic", Model) @Ajax.ActionLink("Afficher les commentaires", "ShowLastArticleComments", new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "showComments", I...
[ "asp.net-mvc-3", "view", "controller" ]
2
4
154
2
0
2011-06-03T11:16:10.917000
2011-06-03T11:22:19.483000
6,226,407
6,226,582
Limit memory usage of a java class
I am writing a java class which is to be run with a java MOA framework. The class has functions to cluster a stream of points. This class is called by MOA application. I want to limit the total memory (at least the memory used on heap, can exclude stack memory) usage of this class (excluding the memory used by MOA appl...
You can embed logic in the class to check Runtime.freeMemory() and Runtime.maxMemory() at intervals and take steps (flush caches, etc) when the limit seems to be close. A little "iffy" since different platforms report heap stats differently. You can also use a SoftReference scheme for some of your "optional" storage. T...
Limit memory usage of a java class I am writing a java class which is to be run with a java MOA framework. The class has functions to cluster a stream of points. This class is called by MOA application. I want to limit the total memory (at least the memory used on heap, can exclude stack memory) usage of this class (ex...
TITLE: Limit memory usage of a java class QUESTION: I am writing a java class which is to be run with a java MOA framework. The class has functions to cluster a stream of points. This class is called by MOA application. I want to limit the total memory (at least the memory used on heap, can exclude stack memory) usage...
[ "java", "memory", "jvm", "cluster-analysis", "moa" ]
2
3
1,612
2
0
2011-06-03T11:16:23.770000
2011-06-03T11:33:27.817000
6,226,409
6,226,496
Subtotals in numpy
I have a numpy array: [[1 3 1] [8 9 0] [1 3 1] [8 4 1] [5 1 0]] and I want to produce subtotals (count, sums, averages) for columns 0,1 for each of the 3rd column's values. Can it be done directly in numpy, or do I have to loop the entire array?
You could use numpy.histogram(): counts = numpy.histogram(data[:,2], bins=range(3))[0] sums0 = numpy.histogram(data[:,2], bins=range(3), weights=data[:,0])[0] sums1 = numpy.histogram(data[:,2], bins=range(3), weights=data[:,1])[0] bins must be adapted to reflect the values occuring in the third column.
Subtotals in numpy I have a numpy array: [[1 3 1] [8 9 0] [1 3 1] [8 4 1] [5 1 0]] and I want to produce subtotals (count, sums, averages) for columns 0,1 for each of the 3rd column's values. Can it be done directly in numpy, or do I have to loop the entire array?
TITLE: Subtotals in numpy QUESTION: I have a numpy array: [[1 3 1] [8 9 0] [1 3 1] [8 4 1] [5 1 0]] and I want to produce subtotals (count, sums, averages) for columns 0,1 for each of the 3rd column's values. Can it be done directly in numpy, or do I have to loop the entire array? ANSWER: You could use numpy.histogra...
[ "python", "arrays", "numpy" ]
2
2
964
4
0
2011-06-03T11:16:40.633000
2011-06-03T11:24:16.597000
6,226,416
6,226,488
Decode javascript image URL
While working in Visual studio MVC3 i got a problem with a image url. I am using some jquery and i get the image url like this: var url = $(this).attr("src"); image = decodeURI(url); the url i get back is the UserContent%C3%BErgers%EF%BF%BD102145860-Koala.jpg When i use the javascript alert function it show the url lik...
You are using backslash("\") in the url it should be slash("/"). Ex. "/UserContent/fergers/102145860-Koala.jpg".
Decode javascript image URL While working in Visual studio MVC3 i got a problem with a image url. I am using some jquery and i get the image url like this: var url = $(this).attr("src"); image = decodeURI(url); the url i get back is the UserContent%C3%BErgers%EF%BF%BD102145860-Koala.jpg When i use the javascript alert ...
TITLE: Decode javascript image URL QUESTION: While working in Visual studio MVC3 i got a problem with a image url. I am using some jquery and i get the image url like this: var url = $(this).attr("src"); image = decodeURI(url); the url i get back is the UserContent%C3%BErgers%EF%BF%BD102145860-Koala.jpg When i use the...
[ "javascript", "jquery", "url", "asp.net-mvc-3", "dotnetnuke" ]
0
1
860
1
0
2011-06-03T11:17:23.493000
2011-06-03T11:24:00.657000
6,226,430
6,226,470
onClick function returns undefined
For some reason, the following code does not work properly: It alerts with undefined. I have also tried doing something like this: onclick="$(function(){ var chk=$(this); alert(chk.attr('id')); })"... but ends up with the same result. What am I doing wrong and how can I fix this?
But a better option would be $('#step1_agree').click(function() { alert($(this).attr('checked)); });
onClick function returns undefined For some reason, the following code does not work properly: It alerts with undefined. I have also tried doing something like this: onclick="$(function(){ var chk=$(this); alert(chk.attr('id')); })"... but ends up with the same result. What am I doing wrong and how can I fix this?
TITLE: onClick function returns undefined QUESTION: For some reason, the following code does not work properly: It alerts with undefined. I have also tried doing something like this: onclick="$(function(){ var chk=$(this); alert(chk.attr('id')); })"... but ends up with the same result. What am I doing wrong and how ca...
[ "javascript", "jquery" ]
2
5
13,212
6
0
2011-06-03T11:18:36.093000
2011-06-03T11:22:13.723000
6,226,439
6,237,701
NSURLCredential is permanent?
We have a problem with our iPhone-simulator that was caused by using this line: Foo = [NSURLCredential CredentialWithUser:foo password:bar persistance:NSURLCredentialPersistencePermanent]; The problem was created when the credential was given to the challenge over at -(NSURLConnection *)connection didReceiveAuthenticat...
Have you tried just resetting the simulator? It's in the Simulator menu.
NSURLCredential is permanent? We have a problem with our iPhone-simulator that was caused by using this line: Foo = [NSURLCredential CredentialWithUser:foo password:bar persistance:NSURLCredentialPersistencePermanent]; The problem was created when the credential was given to the challenge over at -(NSURLConnection *)co...
TITLE: NSURLCredential is permanent? QUESTION: We have a problem with our iPhone-simulator that was caused by using this line: Foo = [NSURLCredential CredentialWithUser:foo password:bar persistance:NSURLCredentialPersistencePermanent]; The problem was created when the credential was given to the challenge over at -(NS...
[ "ios", "objective-c", "nsurlconnection", "nsurlcredential" ]
2
4
1,854
2
0
2011-06-03T11:18:58.560000
2011-06-04T15:42:41.167000
6,226,447
6,226,534
passing SQL "IN" parameter list in jasperreport
I am working on Jasper Reports and my query uses SQL 'IN' predicate. SELECT customer_name AS NAME, id_customer AS ID FROM customer WHERE customer_role IN ($P{roles}) Here the role parameter can have 1 or more integer values and will be dynamically decided when generating the jasper report. Can anybody please help me on...
Jasper Report has a special variable $X for that: select * from customer where $X{IN,customer_role,roles} should work. See here and here.
passing SQL "IN" parameter list in jasperreport I am working on Jasper Reports and my query uses SQL 'IN' predicate. SELECT customer_name AS NAME, id_customer AS ID FROM customer WHERE customer_role IN ($P{roles}) Here the role parameter can have 1 or more integer values and will be dynamically decided when generating ...
TITLE: passing SQL "IN" parameter list in jasperreport QUESTION: I am working on Jasper Reports and my query uses SQL 'IN' predicate. SELECT customer_name AS NAME, id_customer AS ID FROM customer WHERE customer_role IN ($P{roles}) Here the role parameter can have 1 or more integer values and will be dynamically decide...
[ "sql", "jasper-reports" ]
13
27
27,151
3
0
2011-06-03T11:20:01.287000
2011-06-03T11:28:21.837000
6,226,481
6,264,768
Save PdfCopy with MemoryStream
So I got a problem with saving my pdf. I want to create an inventory based on a template, a template with no acrofields. The template contains the companies logo and some data like the address. What I am trying to do is copy the page from the template, paste it in a new document and then add a table to it (the table wi...
The problem is solved now. My main problem was my Updatepanel, Because the printbutton wasn't causing a real postback the saving of the file couldn't be completed. That's why I didn't get any result when i pressed the button. Now that i used it as a postback trigger in my updatepanel all is solved. You guys were also r...
Save PdfCopy with MemoryStream So I got a problem with saving my pdf. I want to create an inventory based on a template, a template with no acrofields. The template contains the companies logo and some data like the address. What I am trying to do is copy the page from the template, paste it in a new document and then ...
TITLE: Save PdfCopy with MemoryStream QUESTION: So I got a problem with saving my pdf. I want to create an inventory based on a template, a template with no acrofields. The template contains the companies logo and some data like the address. What I am trying to do is copy the page from the template, paste it in a new ...
[ "c#", "asp.net", "itext" ]
0
0
4,318
2
0
2011-06-03T11:23:23.287000
2011-06-07T11:52:41.550000
6,226,489
6,230,500
Linq to XML reading Extrinsic node
Could anyone please show me how to read the extrinsic node below by using Linq to XML, please; 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1
What exactly do you want to achieve? Each ItemDetail element seems to have two Extrinsic child elements. Do you want to access both? var data = from item in XElement.Load("file.xml").Elements("ItemDetail") select new { stockcode = (int)item.Elements("Extrinsic").First(e => e.Attribute("name").Value == "StockCode"), qua...
Linq to XML reading Extrinsic node Could anyone please show me how to read the extrinsic node below by using Linq to XML, please; 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1
TITLE: Linq to XML reading Extrinsic node QUESTION: Could anyone please show me how to read the extrinsic node below by using Linq to XML, please; 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1 32 abc description CU 12345678 23333 1 ANSWER: What exactly do you want to achieve? Each Item...
[ "linq-to-xml" ]
0
1
528
1
0
2011-06-03T11:24:03.137000
2011-06-03T17:25:48.530000
6,226,490
6,226,509
C++ multi dimensional array
Possible Duplicate: Multi-dimensional array and pointers in C++? Hi, In 1D I can declare an array like, int *image = new int[W*H]; But in 2D how can I declare an array? int *image = new int[W][H]; -- is it wrong??
int *image = new int[W][H]; -- is it wrong?? It will NOT compile. You should compile your code first, to know the answer of your question. I think you want to do this: //memory allocation int **image = new int*[W]; for(size_t i = 0; i < W; i++ ) image[i] = new int[H]; //use it as for(size_t i = 0; i < W; i++ ) for(siz...
C++ multi dimensional array Possible Duplicate: Multi-dimensional array and pointers in C++? Hi, In 1D I can declare an array like, int *image = new int[W*H]; But in 2D how can I declare an array? int *image = new int[W][H]; -- is it wrong??
TITLE: C++ multi dimensional array QUESTION: Possible Duplicate: Multi-dimensional array and pointers in C++? Hi, In 1D I can declare an array like, int *image = new int[W*H]; But in 2D how can I declare an array? int *image = new int[W][H]; -- is it wrong?? ANSWER: int *image = new int[W][H]; -- is it wrong?? It wil...
[ "c++" ]
0
3
451
4
0
2011-06-03T11:24:04.613000
2011-06-03T11:26:04.583000
6,226,493
6,226,527
Webservice for details of the places
I want to working on the project for iphone where i have to find the information of particular place of the city. Example, i had entere a city name california and i got the long lat of one of the hospital of california including address and phone number.But i want some more detail of the perticluar place by using webse...
Use the Wikipedia API, if the place has an entry it will give you a lot more information: http://www.mediawiki.org/wiki/API:Query
Webservice for details of the places I want to working on the project for iphone where i have to find the information of particular place of the city. Example, i had entere a city name california and i got the long lat of one of the hospital of california including address and phone number.But i want some more detail o...
TITLE: Webservice for details of the places QUESTION: I want to working on the project for iphone where i have to find the information of particular place of the city. Example, i had entere a city name california and i got the long lat of one of the hospital of california including address and phone number.But i want ...
[ "web-services", "api" ]
0
2
71
2
0
2011-06-03T11:24:11.600000
2011-06-03T11:27:54.600000
6,226,512
6,226,558
Content provider URI matcher
There is distinct recomendation in documentation for defining all uris while implementing ContentProvider. But I'm confused with URI matcher part: for example, I've got package org.company.example, table named 'items', then I define public static final Uri CONTENT_URI = Uri.parse("content://org.company.example.samplepr...
public static final String PROVIDER_NAME = "org.company.example.sampleprovider"; public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME); private static final UriMatcher uriMatcher; static { uriMatcher = new UriMatcher(UriMatcher.NO_MATCH); uriMatcher.addURI(PROVIDER_NAME, "items", ITEM); uriMatch...
Content provider URI matcher There is distinct recomendation in documentation for defining all uris while implementing ContentProvider. But I'm confused with URI matcher part: for example, I've got package org.company.example, table named 'items', then I define public static final Uri CONTENT_URI = Uri.parse("content:/...
TITLE: Content provider URI matcher QUESTION: There is distinct recomendation in documentation for defining all uris while implementing ContentProvider. But I'm confused with URI matcher part: for example, I've got package org.company.example, table named 'items', then I define public static final Uri CONTENT_URI = Ur...
[ "android", "android-contentprovider" ]
9
14
8,854
1
0
2011-06-03T11:26:12.007000
2011-06-03T11:30:05.930000