PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
7,116,682
08/19/2011 03:37:56
421,109
08/15/2010 17:35:13
1,111
12
CSS issue with 'overflow-y:auto' that creates a problem in Chrome but not in Firefox
In my app, text is inputted by the user and is displayed within a div with a fixed width and height and a `overflow-y:auto` property. The html looks like this: <div class="description_div scroll-pane jspScrollable" style="overflow-x: hidden; overflow-y: hidden; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 290px; " tabindex="0"> <div class="jspContainer" style="width: 290px; height: 160px; "> <div class="jspPane" style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; width: 280px; left: 0px; "> <p>This is an original song written and performed by me, Jessica Speziale. I wrote this in early May 2011 :) Let me know what you think!</p> <p>Studio is 3 DAYS AWAY!!! *dies* I’ll be sending daily studio blogs via my newsletter! Also, if you sign-up for the newsletter before August 31st, you’ll be entered to win a free copy of my EP! Woot!! </p> <p>Sign up here: http://www.reverbnation.com/page_object/join_mailing_list/artist_868563</p> </div> </div> </div> The outer div is the one I specify, and all of the other divs are dynamically generated with the [jscrollpane plugin][1]. Here is the css for the outer div: .description_div{ float:right; width:280px; height:160px; overflow-y:auto; padding:5px; margin-left:5px; } The problem is that this renders correctly in Firefox but not in Chrome. Here is a pic of how it is rendered in Firefox: ![Firefox-1][2] ![Firefox-2][3] and here is how it is rendered in Chrome: ![Chrome-1][4] ![Chrome-2][5] As you can see, in Firefox it cuts up the long url at the bottom of the div so that all the text fits within the width of the div, and a vertical scroll bar is added. In Chrome, it cuts off the last paragraph of text on the bottom and only adds a horizontal scroll bar. Why is this, and is there a solution to remedy this? [1]: http://jscrollpane.kelvinluck.com/ [2]: http://i.stack.imgur.com/nl5O9.png [3]: http://i.stack.imgur.com/n5N0P.png [4]: http://i.stack.imgur.com/7k97v.png [5]: http://i.stack.imgur.com/rbqP8.png
css
firefox
google-chrome
browser
cross-browser
null
open
CSS issue with 'overflow-y:auto' that creates a problem in Chrome but not in Firefox === In my app, text is inputted by the user and is displayed within a div with a fixed width and height and a `overflow-y:auto` property. The html looks like this: <div class="description_div scroll-pane jspScrollable" style="overflow-x: hidden; overflow-y: hidden; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; width: 290px; " tabindex="0"> <div class="jspContainer" style="width: 290px; height: 160px; "> <div class="jspPane" style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; width: 280px; left: 0px; "> <p>This is an original song written and performed by me, Jessica Speziale. I wrote this in early May 2011 :) Let me know what you think!</p> <p>Studio is 3 DAYS AWAY!!! *dies* I’ll be sending daily studio blogs via my newsletter! Also, if you sign-up for the newsletter before August 31st, you’ll be entered to win a free copy of my EP! Woot!! </p> <p>Sign up here: http://www.reverbnation.com/page_object/join_mailing_list/artist_868563</p> </div> </div> </div> The outer div is the one I specify, and all of the other divs are dynamically generated with the [jscrollpane plugin][1]. Here is the css for the outer div: .description_div{ float:right; width:280px; height:160px; overflow-y:auto; padding:5px; margin-left:5px; } The problem is that this renders correctly in Firefox but not in Chrome. Here is a pic of how it is rendered in Firefox: ![Firefox-1][2] ![Firefox-2][3] and here is how it is rendered in Chrome: ![Chrome-1][4] ![Chrome-2][5] As you can see, in Firefox it cuts up the long url at the bottom of the div so that all the text fits within the width of the div, and a vertical scroll bar is added. In Chrome, it cuts off the last paragraph of text on the bottom and only adds a horizontal scroll bar. Why is this, and is there a solution to remedy this? [1]: http://jscrollpane.kelvinluck.com/ [2]: http://i.stack.imgur.com/nl5O9.png [3]: http://i.stack.imgur.com/n5N0P.png [4]: http://i.stack.imgur.com/7k97v.png [5]: http://i.stack.imgur.com/rbqP8.png
0
7,076,680
08/16/2011 10:20:31
896,445
04/21/2011 09:48:13
1
0
error running hadoop project
I'm running hadoop project it showing as follows 11/08/16 12:36:09 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same. 11/08/16 12:36:10 INFO mapred.FileInputFormat: Total input paths to process : 4 11/08/16 12:36:10 INFO mapred.JobClient: Running job: job_201108161203_0001 11/08/16 12:36:11 INFO mapred.JobClient: map 0% reduce 0% 11/08/16 12:36:17 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_0, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:21 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_1, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:25 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_2, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:34 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_0, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:37 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_1, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:42 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_2, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) java.io.IOException: Job failed! at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1232) at TestDriver.main(TestDriver.java:40)
hadoop
null
null
null
null
08/17/2011 01:12:37
not a real question
error running hadoop project === I'm running hadoop project it showing as follows 11/08/16 12:36:09 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same. 11/08/16 12:36:10 INFO mapred.FileInputFormat: Total input paths to process : 4 11/08/16 12:36:10 INFO mapred.JobClient: Running job: job_201108161203_0001 11/08/16 12:36:11 INFO mapred.JobClient: map 0% reduce 0% 11/08/16 12:36:17 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_0, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:21 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_1, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:25 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000006_2, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:34 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_0, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:37 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_1, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) 11/08/16 12:36:42 INFO mapred.JobClient: Task Id : attempt_201108161203_0001_m_000005_2, Status : FAILED java.io.IOException: Task process exit with nonzero status of 1. at org.apache.hadoop.mapred.TaskRunner.run(TaskRunner.java:425) java.io.IOException: Job failed! at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1232) at TestDriver.main(TestDriver.java:40)
1
7,489,201
09/20/2011 17:28:06
937,508
09/09/2011 20:22:06
6
0
how can I run multiple ios simulators to test p2p
I'm trying to develop an app that uses the gamekit to communicate between 2 devices using bluetooth. I was wondering if there is a way to test this using just the ios simulators? Is there a way to use a virtual machine to run multiple instances of the simulator at once?
iphone
ios
bluetooth
ios-simulator
p2p
null
open
how can I run multiple ios simulators to test p2p === I'm trying to develop an app that uses the gamekit to communicate between 2 devices using bluetooth. I was wondering if there is a way to test this using just the ios simulators? Is there a way to use a virtual machine to run multiple instances of the simulator at once?
0
7,570,205
09/27/2011 13:44:59
959,131
09/22/2011 12:45:37
3
0
How to configure an Ultra Sonic Sensor in Matlab?
I would like to Configure an ultrasonic sensor for triggering purpose in matlab. How to configure the ultrasonic sensor for triggering ?
matlab
configuration
hardware
null
null
09/27/2011 17:54:00
not a real question
How to configure an Ultra Sonic Sensor in Matlab? === I would like to Configure an ultrasonic sensor for triggering purpose in matlab. How to configure the ultrasonic sensor for triggering ?
1
4,394,778
12/09/2010 04:14:20
526,008
12/01/2010 03:10:37
1
0
How to implement tag a friend in photo as facebook?
I want to implement tag a friend in photo as facebook.com by javascript Can I give me some solutions or useful links?
javascript
facebook
null
null
null
12/11/2010 09:16:57
not a real question
How to implement tag a friend in photo as facebook? === I want to implement tag a friend in photo as facebook.com by javascript Can I give me some solutions or useful links?
1
5,521,603
04/02/2011 06:29:00
1,283,030
02/16/2011 04:37:42
9
1
is it possible to intigrate google checkout with iphone?
i want to know...is it possible to integrate googlecheckout with iphone?
iphone
null
null
null
null
04/02/2011 12:56:58
not a real question
is it possible to intigrate google checkout with iphone? === i want to know...is it possible to integrate googlecheckout with iphone?
1
1,676,080
11/04/2009 19:34:05
72,514
03/01/2009 19:09:43
31
2
How do I migrate a newer svn repository to an older version
I created a local repository using tortoiseSVN a while back. Now I would like to migrate the repository to my dreamhost account. I moved the files over but it seems that dreamhost is using an older version of svn. when i issue the command svnadmin load 'repository dir' it spits back > svnadmin: Expected FS format '2'; > found format '4' Solution?
svn
migrate
dreamhost
null
null
null
open
How do I migrate a newer svn repository to an older version === I created a local repository using tortoiseSVN a while back. Now I would like to migrate the repository to my dreamhost account. I moved the files over but it seems that dreamhost is using an older version of svn. when i issue the command svnadmin load 'repository dir' it spits back > svnadmin: Expected FS format '2'; > found format '4' Solution?
0
3,620,940
09/01/2010 18:16:49
429,902
08/24/2010 18:24:44
12
0
Deleting a row based on the max value.
How can I structure a mySQL query to delete a row based on the max value. I tried WHERE jobPositonId = max(jobPostionId) but got an error?
mysql
delete
max
null
null
null
open
Deleting a row based on the max value. === How can I structure a mySQL query to delete a row based on the max value. I tried WHERE jobPositonId = max(jobPostionId) but got an error?
0
6,983,164
08/08/2011 13:52:48
883,649
08/08/2011 08:24:45
3
0
How to create ordered list of results in views using drupal 6?
Hi I would like to know how to create an oredered list of results in my block views in Drupal 6. I think this is something basic, but I am unable to resolve this problem. Ok, I have 5 results(article titles; for simplicity I will be using just field Title) something like this: NATO is killing people in Libya Who are the "rebels"? NATO War Against Libya's Khaddafi is meeting resistance People of Libya will not surrender Libya's rebel army chief killed - video And I want it to look like this: 1. NATO is killing people in Libya 2. Who are the "rebels"? 3. NATO War Against Libya's Khaddafi is meeting resistance 4. People of Libya will not surrender 5. Libya's rebel army chief killed - video How to achieve this orederd list? Thanks in advance.
drupal
views
null
null
null
null
open
How to create ordered list of results in views using drupal 6? === Hi I would like to know how to create an oredered list of results in my block views in Drupal 6. I think this is something basic, but I am unable to resolve this problem. Ok, I have 5 results(article titles; for simplicity I will be using just field Title) something like this: NATO is killing people in Libya Who are the "rebels"? NATO War Against Libya's Khaddafi is meeting resistance People of Libya will not surrender Libya's rebel army chief killed - video And I want it to look like this: 1. NATO is killing people in Libya 2. Who are the "rebels"? 3. NATO War Against Libya's Khaddafi is meeting resistance 4. People of Libya will not surrender 5. Libya's rebel army chief killed - video How to achieve this orederd list? Thanks in advance.
0
8,455,776
12/10/2011 10:12:09
292,291
03/12/2010 10:53:07
4,259
39
How to develop by faking login to test ACLs in Symfony 2
I am developing a part of a web app build on Symfony 2. Like in many apps, authentication & authorization is required. How can I continue developing, taking considerations ACL by by passing or faking a login? In the docs, `login_check` does the authentication and sessions part transparently. I think I may either need to implement a version of that or somehow call it to login as different users/roles
authentication
symfony-2.0
null
null
null
null
open
How to develop by faking login to test ACLs in Symfony 2 === I am developing a part of a web app build on Symfony 2. Like in many apps, authentication & authorization is required. How can I continue developing, taking considerations ACL by by passing or faking a login? In the docs, `login_check` does the authentication and sessions part transparently. I think I may either need to implement a version of that or somehow call it to login as different users/roles
0
7,146,674
08/22/2011 11:18:20
905,758
08/22/2011 11:18:20
1
0
Handling multiple tables in SQLite on Android - why so complicated?
I'm desperately trying to set up a database with multiple tables which looks like: nutrition.db: Ingredient(ID, name, kcal); Meal(ID, name, ingredientId1, ingredientId2); MealInstance(ID, mealId, date, amountOfIngr1, amountOfIngr2) ... I stumbled across miscellaneus approaches - for instance expanding a Provider class like the one from the notepad tutorial (**extends** ContentProvider) by using tons of switch-cases or alternatively building up an entire CRUD-interface based on .execSQL yourself. However all of this seems absurdly complex to me for such an easy (and common?) task, which is why I believe I overlooked something. For some odd reason all tutorials that I've checked only use a single DB and a single table. I'd really appreciate a tutorial recommendation or some hint.
android
database
sqlite
table
android-contentprovider
null
open
Handling multiple tables in SQLite on Android - why so complicated? === I'm desperately trying to set up a database with multiple tables which looks like: nutrition.db: Ingredient(ID, name, kcal); Meal(ID, name, ingredientId1, ingredientId2); MealInstance(ID, mealId, date, amountOfIngr1, amountOfIngr2) ... I stumbled across miscellaneus approaches - for instance expanding a Provider class like the one from the notepad tutorial (**extends** ContentProvider) by using tons of switch-cases or alternatively building up an entire CRUD-interface based on .execSQL yourself. However all of this seems absurdly complex to me for such an easy (and common?) task, which is why I believe I overlooked something. For some odd reason all tutorials that I've checked only use a single DB and a single table. I'd really appreciate a tutorial recommendation or some hint.
0
11,687,268
07/27/2012 11:54:26
1,534,027
07/18/2012 07:56:08
3
0
Getting time out error while installing application
hello everyone i have prepared my project using target android 4.0.3 api level 15. but in case of running the project sum times i get time out error i have also increased the time form DDMS to 60000 ms but still getting error myProject.apk not installed :'timeout'
android
null
null
null
null
null
open
Getting time out error while installing application === hello everyone i have prepared my project using target android 4.0.3 api level 15. but in case of running the project sum times i get time out error i have also increased the time form DDMS to 60000 ms but still getting error myProject.apk not installed :'timeout'
0
9,086,136
01/31/2012 20:06:15
443,602
09/09/2010 15:54:43
1,108
36
How to hide public methods from intellisense
I want to hide public methods from the intellisense member list
intellisense
null
null
null
null
02/01/2012 03:37:40
not a real question
How to hide public methods from intellisense === I want to hide public methods from the intellisense member list
1
2,573,992
04/04/2010 09:14:31
288,152
03/07/2010 10:11:05
11
0
New preg-repleace for youtube
Welcome, I notice that Youtube make some changes into their website code. Anyone have idea how make it working today ? That's my script (don't work anymore) preg_match('/"video_id": "(.*?)"/', $page, $match); $var_id = $match[1]; preg_match('/"t": "(.*?)"/', $page, $match); $var_t = $match[1]; Look at source of example Youtube video page: http://www.youtube.com/watch?v=w_J27GxPNM0 (yes i like that song very much) Now the t variable can be found under <script> (function() { var isIE = /*@cc_on!@*/false; I dont paste full because it's very long. Regards
youtube
download
api
php
null
null
open
New preg-repleace for youtube === Welcome, I notice that Youtube make some changes into their website code. Anyone have idea how make it working today ? That's my script (don't work anymore) preg_match('/"video_id": "(.*?)"/', $page, $match); $var_id = $match[1]; preg_match('/"t": "(.*?)"/', $page, $match); $var_t = $match[1]; Look at source of example Youtube video page: http://www.youtube.com/watch?v=w_J27GxPNM0 (yes i like that song very much) Now the t variable can be found under <script> (function() { var isIE = /*@cc_on!@*/false; I dont paste full because it's very long. Regards
0
4,356,824
12/05/2010 01:10:42
263,061
01/31/2010 20:27:44
20
2
How to prevent memory leak by cleaning up <audio> elements
I wrote a bit of JavaScript with jQuery that loads a sound file with the HTML 5 `<audio>` tag and on a mouse click starts playing a new instance of that sound file (so that it can be played multiple times in parallel/overlay). ### HTML: <audio id="audiotemplate" src="audio/myfile.ogg"></audio> ### JavaScript: mybutton.click(function() { $('#audiotemplate').clone()[0].play(); }); This works as intended, but creates a memory leak that causes FF to eat up the system RAM and Chromium to show its "Ah, Snap" page if you click the button too many times. How to clean up the `<audio>` element after the sound file has finished playing? **NOTE:** I do not insert the cloned element into the the page. _(I am happy with a solution, but also appreciate an explanation why the leak happens at all.)_
javascript
jquery
memory-leaks
html5-audio
null
null
open
How to prevent memory leak by cleaning up <audio> elements === I wrote a bit of JavaScript with jQuery that loads a sound file with the HTML 5 `<audio>` tag and on a mouse click starts playing a new instance of that sound file (so that it can be played multiple times in parallel/overlay). ### HTML: <audio id="audiotemplate" src="audio/myfile.ogg"></audio> ### JavaScript: mybutton.click(function() { $('#audiotemplate').clone()[0].play(); }); This works as intended, but creates a memory leak that causes FF to eat up the system RAM and Chromium to show its "Ah, Snap" page if you click the button too many times. How to clean up the `<audio>` element after the sound file has finished playing? **NOTE:** I do not insert the cloned element into the the page. _(I am happy with a solution, but also appreciate an explanation why the leak happens at all.)_
0
7,714,354
10/10/2011 14:35:44
702,977
04/11/2011 21:23:13
482
0
C-c C-r for Ocaml toplevel and setting a region under Emacs
I have seen somewhere the description of `C-c C-r` is "evaluate the whole selected region" or `tuareg-eval-region`. But when I try it under `Emacs`, it seems that after setting a region, and placing the cursor several commands after the end of the region, pressing `C-c C-r` evaluates until the position of the cursor. So could anyone tell me if `C-c C-r` evaluates "until the cursor" or a region that we set before? By the way, I am not sure I have set the region correctly. One way is to use `SHIFT + direction arrow`; another way is to use `CTRL + space`, but i do not know the difference between `Mark set`, `Mark activated` and `Mark cleared`. Could anyone tell me the right way to select a region?
emacs
keyboard-shortcuts
ocaml
null
null
null
open
C-c C-r for Ocaml toplevel and setting a region under Emacs === I have seen somewhere the description of `C-c C-r` is "evaluate the whole selected region" or `tuareg-eval-region`. But when I try it under `Emacs`, it seems that after setting a region, and placing the cursor several commands after the end of the region, pressing `C-c C-r` evaluates until the position of the cursor. So could anyone tell me if `C-c C-r` evaluates "until the cursor" or a region that we set before? By the way, I am not sure I have set the region correctly. One way is to use `SHIFT + direction arrow`; another way is to use `CTRL + space`, but i do not know the difference between `Mark set`, `Mark activated` and `Mark cleared`. Could anyone tell me the right way to select a region?
0
8,860,819
01/14/2012 07:28:18
1,134,534
01/06/2012 14:59:43
1
0
How to connect MapKit iPhone app to a database
I am trying to make an app that you can share sightings by dropping a pin with an annotation and everyone with that app will be able to see all the other dropped pins by other people using the app. I read that you need to have a database connection but I don't know how to even make a database for this specific situation let alone connect it to one. I really need any help I can get. Thanks!
iphone
database
xcode
mapkit
development
01/15/2012 12:40:46
not a real question
How to connect MapKit iPhone app to a database === I am trying to make an app that you can share sightings by dropping a pin with an annotation and everyone with that app will be able to see all the other dropped pins by other people using the app. I read that you need to have a database connection but I don't know how to even make a database for this specific situation let alone connect it to one. I really need any help I can get. Thanks!
1
5,147,103
02/28/2011 20:19:14
355,641
06/01/2010 16:40:12
53
10
Begining with AR development
I am looking for developing an application (iphone) based on Augmented Reality , for that i am asking colleagues of this forum if any of you has references ?books?framworks?tutorials? Thanks!
iphone
frameworks
books
tutorials
augmented-reality
null
open
Begining with AR development === I am looking for developing an application (iphone) based on Augmented Reality , for that i am asking colleagues of this forum if any of you has references ?books?framworks?tutorials? Thanks!
0
7,764,830
10/14/2011 08:12:49
994,999
10/14/2011 08:07:53
1
0
Mail not working properly on server
I am having an issue with my servers mail functionality. First off the the web forms on my site for instance contact form take several minutes to send after clicking send. So, I know the mail is working something is just getting held up. When I try to test to see if I have the slowness on my webserver, none of the mail commands are working. I tried: mail example@example.com and I receive mail: no command found. when I try sendmail example@example.com the terminal doesn't do anything. Anyone have any ideas?
email
sendmail
fedora
null
null
10/14/2011 21:18:46
off topic
Mail not working properly on server === I am having an issue with my servers mail functionality. First off the the web forms on my site for instance contact form take several minutes to send after clicking send. So, I know the mail is working something is just getting held up. When I try to test to see if I have the slowness on my webserver, none of the mail commands are working. I tried: mail example@example.com and I receive mail: no command found. when I try sendmail example@example.com the terminal doesn't do anything. Anyone have any ideas?
2
4,926,214
02/07/2011 20:32:03
18,091
09/18/2008 18:40:50
1,894
57
Is it possible to install an iOS app in the simulator through Xcode without launching it immediately?
I want to verify that the default values in Settings.app are correct before the app updates them when it is launched.
xcode
ios
ios-simulator
null
null
null
open
Is it possible to install an iOS app in the simulator through Xcode without launching it immediately? === I want to verify that the default values in Settings.app are correct before the app updates them when it is launched.
0
5,777,846
04/25/2011 11:24:07
242,305
01/02/2010 13:56:26
44
6
url showing page with and with .htm
stumped with this one. Fond out through Google webmaster tools that a .htm page on my website can be accessed either by {page} or {page}.htm. it is {page}.htm as a static file and i built the server from scratch so i know there is no rewrites or apache configs that are doing AFAIK. Ubuntu 10.04. Any suggestions? A page in question is: http://www.hello-grancanaria.co.uk/accommodation/balito-beach-2387 try adding the .htm on the end. regards.
url
alias
null
null
null
null
open
url showing page with and with .htm === stumped with this one. Fond out through Google webmaster tools that a .htm page on my website can be accessed either by {page} or {page}.htm. it is {page}.htm as a static file and i built the server from scratch so i know there is no rewrites or apache configs that are doing AFAIK. Ubuntu 10.04. Any suggestions? A page in question is: http://www.hello-grancanaria.co.uk/accommodation/balito-beach-2387 try adding the .htm on the end. regards.
0
1,941,192
12/21/2009 16:40:36
24,839
10/03/2008 14:15:04
79
4
asdp.net - deleting cache object at session end
I have a wrapper class for Caching (CachingBL) where I store users that are currently signed in (some of their session info). In CachingBL wrapper there is actually a dictionary of users, and I am putting that dictionary in cache like this: HttpContext.Current.Cache.Insert(...): At the session end I would need to access to the cachelike this: var cacheBL = (CacheBL)HttpContext.Current.Cache.Get("MyCache_CacheSlot"); But the problem is that HttpContext.Current is empty, so I cannot access Cache object. The Cache itself is not empty (tested), but I can't figure out how to access it at Session_End.
asp.net
asp.net-caching
caching
null
null
null
open
asdp.net - deleting cache object at session end === I have a wrapper class for Caching (CachingBL) where I store users that are currently signed in (some of their session info). In CachingBL wrapper there is actually a dictionary of users, and I am putting that dictionary in cache like this: HttpContext.Current.Cache.Insert(...): At the session end I would need to access to the cachelike this: var cacheBL = (CacheBL)HttpContext.Current.Cache.Get("MyCache_CacheSlot"); But the problem is that HttpContext.Current is empty, so I cannot access Cache object. The Cache itself is not empty (tested), but I can't figure out how to access it at Session_End.
0
11,118,052
06/20/2012 10:56:39
1,240,996
02/29/2012 18:57:19
31
4
Linux Event Handling: Mouse Detection
I am trying to write a script that will disable the touchpad when a USB mouse is connected. I am using 'jupiter' to disable the touchpad. (<http://alexsleat.co.uk/2012/03/22/toggle-touchpad-with-keyboard-shortcut-in-ubuntu/>) I am able to detect if a mouse is present at startup (by checking /proc/bus/input/devices). But what would I do if a mouse is connected after startup? Is there some high level mechanism for handling interrupts? I tried reading about interrupts in Linux but most of it was at a low level. If it makes any difference I am using Ubuntu 12.04. Thanks
linux
interrupt
interrupt-handling
interrupts
null
null
open
Linux Event Handling: Mouse Detection === I am trying to write a script that will disable the touchpad when a USB mouse is connected. I am using 'jupiter' to disable the touchpad. (<http://alexsleat.co.uk/2012/03/22/toggle-touchpad-with-keyboard-shortcut-in-ubuntu/>) I am able to detect if a mouse is present at startup (by checking /proc/bus/input/devices). But what would I do if a mouse is connected after startup? Is there some high level mechanism for handling interrupts? I tried reading about interrupts in Linux but most of it was at a low level. If it makes any difference I am using Ubuntu 12.04. Thanks
0
7,797,433
10/17/2011 17:39:30
309,145
04/05/2010 10:25:17
562
7
How to create listbox with image backgrounds
Where can I find a simple example of image list? I want to make a simple singlecolumn, singleselection listbox with items. I have 2 backgrounds, for selected/unselected. By default I want it to be unselected. Can someone give me example for this, please, cause I'm not good with javascript/css.
javascript
jquery
html
css
null
11/14/2011 04:45:41
not a real question
How to create listbox with image backgrounds === Where can I find a simple example of image list? I want to make a simple singlecolumn, singleselection listbox with items. I have 2 backgrounds, for selected/unselected. By default I want it to be unselected. Can someone give me example for this, please, cause I'm not good with javascript/css.
1
8,055,102
11/08/2011 18:09:55
913,595
08/26/2011 07:37:57
18
1
back from UIWebView
programmatically i have create UIWebView. And for coming back i have create an UIImageView and after that i have create a UIButton . Now i want to back to my app page. Please consider this code -(void) aMethod:(id) sender{ //[self dismissModalViewControllerAnimated:YES]; // does not work //[[self.view viewWithTag:55] removeFromSuperview];// does not work } //facebook Like button -(IBAction)faceBookLikeBtn { CGRect webFrameMain = CGRectMake(0.0, 0.0, 320.0, 460.0); UIWebView *webViewMain = [[UIWebView alloc] initWithFrame:webFrameMain]; [webViewMain setBackgroundColor:[UIColor clearColor]]; [self.view addSubview:webViewMain]; [webViewMain release]; // create UIImageView UIImageView *userImageShow = [[[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; [userImageShow setImage:[UIImage imageNamed:@"btn_bg.png"]]; userImageShow.frame = CGRectMake(0.00 , 0.00 , 320, 50); userImageShow.backgroundColor = [UIColor blueColor]; [webViewMain addSubview:userImageShow]; // create button UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Back" forState:UIControlStateNormal]; button.frame = CGRectMake(5.0, 10.0, 100.0, 40.0); [userImageShow addSubview:button]; // Call facebook like page CGRect webFrame = CGRectMake(0.0, 50.0, 320.0, 410.0); UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame]; [webView setBackgroundColor:[UIColor clearColor]]; NSString *urlAddress = @"http://www.facebook.com/...."; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; [webViewMain addSubview:webView]; [webView release]; }
iphone
objective-c
xcode
null
null
11/09/2011 01:21:48
not a real question
back from UIWebView === programmatically i have create UIWebView. And for coming back i have create an UIImageView and after that i have create a UIButton . Now i want to back to my app page. Please consider this code -(void) aMethod:(id) sender{ //[self dismissModalViewControllerAnimated:YES]; // does not work //[[self.view viewWithTag:55] removeFromSuperview];// does not work } //facebook Like button -(IBAction)faceBookLikeBtn { CGRect webFrameMain = CGRectMake(0.0, 0.0, 320.0, 460.0); UIWebView *webViewMain = [[UIWebView alloc] initWithFrame:webFrameMain]; [webViewMain setBackgroundColor:[UIColor clearColor]]; [self.view addSubview:webViewMain]; [webViewMain release]; // create UIImageView UIImageView *userImageShow = [[[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]; [userImageShow setImage:[UIImage imageNamed:@"btn_bg.png"]]; userImageShow.frame = CGRectMake(0.00 , 0.00 , 320, 50); userImageShow.backgroundColor = [UIColor blueColor]; [webViewMain addSubview:userImageShow]; // create button UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchDown]; [button setTitle:@"Back" forState:UIControlStateNormal]; button.frame = CGRectMake(5.0, 10.0, 100.0, 40.0); [userImageShow addSubview:button]; // Call facebook like page CGRect webFrame = CGRectMake(0.0, 50.0, 320.0, 410.0); UIWebView *webView = [[UIWebView alloc] initWithFrame:webFrame]; [webView setBackgroundColor:[UIColor clearColor]]; NSString *urlAddress = @"http://www.facebook.com/...."; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; [webViewMain addSubview:webView]; [webView release]; }
1
11,099,479
06/19/2012 10:53:53
545,490
12/17/2010 00:21:22
434
5
Filtering dates between x & y using ODATA
I'm looking into the new ASP.NET Web API as a reporting tool. In SQL I would do this: WHERE order_date between to_date ('2003/01/01', 'yyyy/mm/dd') AND to_date ('2003/12/31', 'yyyy/mm/dd'); ...how do these type of command translate in the ODATA protocol URL? Thanks Paul
c#
.net
odata
asp.net-web-api
null
null
open
Filtering dates between x & y using ODATA === I'm looking into the new ASP.NET Web API as a reporting tool. In SQL I would do this: WHERE order_date between to_date ('2003/01/01', 'yyyy/mm/dd') AND to_date ('2003/12/31', 'yyyy/mm/dd'); ...how do these type of command translate in the ODATA protocol URL? Thanks Paul
0
10,041,738
04/06/2012 09:41:53
1,296,362
03/27/2012 18:46:37
1
0
Valums file-uploader hangs when filename contains non-latin characters
I've got a problem when I'm trying to upload files with valums' file-uploader (handler class - UploadHandlerForm). It doesn't even call server-size upload script if the file name contains non-latin utf characters. However if the handler class is UploadHandlerXhr it's OK but then I always get empty-size files. On the page with uploader utf8 charset is defined.
javascript
upload
null
null
null
null
open
Valums file-uploader hangs when filename contains non-latin characters === I've got a problem when I'm trying to upload files with valums' file-uploader (handler class - UploadHandlerForm). It doesn't even call server-size upload script if the file name contains non-latin utf characters. However if the handler class is UploadHandlerXhr it's OK but then I always get empty-size files. On the page with uploader utf8 charset is defined.
0
8,483,054
12/13/2011 00:55:14
1,094,721
12/12/2011 23:11:51
1
0
Creata a UIPickerView. Delegate=self
- (void)viewDidLoad {     [super viewDidLoad]; UIView *myView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 250, 100, 100)]; [myView1 setBackgroundColor:[UIColor blueColor]]; [self.view addSubview:myView1]; UIPickerView *pickerView1 = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)]; pickerView1.delegate = self; pickerView1.tag = kVIEW1_PICKERVIEW_TAG; pickerView1.showsSelectionIndicator = YES; [myView1 addSubview:pickerView1]; table =[[NSMutableArray alloc]init]; [table addObject:@"Giraffe"]; [table addObject:@"Water Bottle"]; [table addObject:@"Sprinning Fan"]; [table addObject:@"Mairy Monkey"]; label =[[UILabel alloc] initWithFrame:CGRectMake(100, 120, 130, 130)]; label.backgroundColor=[UIColor clearColor]; label.text =@"Label Page"; label.textAlignment = UITextAlignmentCenter; [self.view addSubview:label]; }
objective-c
null
null
null
null
12/13/2011 04:04:04
not a real question
Creata a UIPickerView. Delegate=self === - (void)viewDidLoad {     [super viewDidLoad]; UIView *myView1 = [[UIView alloc] initWithFrame:CGRectMake(0, 250, 100, 100)]; [myView1 setBackgroundColor:[UIColor blueColor]]; [self.view addSubview:myView1]; UIPickerView *pickerView1 = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)]; pickerView1.delegate = self; pickerView1.tag = kVIEW1_PICKERVIEW_TAG; pickerView1.showsSelectionIndicator = YES; [myView1 addSubview:pickerView1]; table =[[NSMutableArray alloc]init]; [table addObject:@"Giraffe"]; [table addObject:@"Water Bottle"]; [table addObject:@"Sprinning Fan"]; [table addObject:@"Mairy Monkey"]; label =[[UILabel alloc] initWithFrame:CGRectMake(100, 120, 130, 130)]; label.backgroundColor=[UIColor clearColor]; label.text =@"Label Page"; label.textAlignment = UITextAlignmentCenter; [self.view addSubview:label]; }
1
9,533,042
03/02/2012 12:09:11
1,173,588
01/27/2012 13:48:00
44
2
trouble reading css attributes assigned to a html table
i have a html table in which on each row i have assigned some style classes(dynamically through server side code). the html which is rendered looks like <tr id= "2977" class ="x y z a b c" > now to access background color of a row i am using, document.getElementById("2977").style.backgroundColor but i am not able to read any of the style attribute. above line returns null value. what am i missing? please comment.
javascript
html
css
null
null
null
open
trouble reading css attributes assigned to a html table === i have a html table in which on each row i have assigned some style classes(dynamically through server side code). the html which is rendered looks like <tr id= "2977" class ="x y z a b c" > now to access background color of a row i am using, document.getElementById("2977").style.backgroundColor but i am not able to read any of the style attribute. above line returns null value. what am i missing? please comment.
0
7,304,764
09/05/2011 07:02:04
787,058
06/07/2011 08:08:12
24
2
UI Orientation Change-Make it independent for rotation
I have a one condition. There is a SDK in my Project.who change activity orientation when it requires the performing an operation. But after its operation i have to set activity orientation according to the device orientation. I used following method to set screen orientation back to previous orientation. But when i set it. Next time if i rotate my device my activity is not changing orientation according to the device. Can anyone suggest me the proper solution to make my activity flexible again. Or solving this situation. Thanks In advance. if(this.getResources().getConfiguration().orientation !=Configuration.ORIENTATION_PORTRAIT) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
android
android-layout
android-emulator
android-widget
android-ui
null
open
UI Orientation Change-Make it independent for rotation === I have a one condition. There is a SDK in my Project.who change activity orientation when it requires the performing an operation. But after its operation i have to set activity orientation according to the device orientation. I used following method to set screen orientation back to previous orientation. But when i set it. Next time if i rotate my device my activity is not changing orientation according to the device. Can anyone suggest me the proper solution to make my activity flexible again. Or solving this situation. Thanks In advance. if(this.getResources().getConfiguration().orientation !=Configuration.ORIENTATION_PORTRAIT) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
0
2,554,714
03/31/2010 16:36:41
107,567
05/15/2009 08:38:14
25
8
How can I make my table cell UITextField editable when the table has entered 'edit' mode?
I have a simple table view which is editable. All I need the user to be able to do is edit the text field in the cell when they choose to edit the table.
iphone
uitableview
uitableviewcell
uitextfield
null
null
open
How can I make my table cell UITextField editable when the table has entered 'edit' mode? === I have a simple table view which is editable. All I need the user to be able to do is edit the text field in the cell when they choose to edit the table.
0
708,776
04/02/2009 08:16:34
85,837
04/01/2009 19:02:45
1
0
A good Report Design tool/Libarary
I have to produce multiple reports on a regular basis; same reports are produced for the whole customer base. My problem is that designing the layout of the reports is long and tedious job. What I need is a GUI tool for designing the layout of the reports. The output of the tool should be xsl file that will used for creating reports in batch. Additional option is that the toll will provide a library that will allow build a customized batch process for report creation based on GUI layout definitions. Thanks
reporting
report-designer
null
null
null
01/09/2012 17:52:43
not constructive
A good Report Design tool/Libarary === I have to produce multiple reports on a regular basis; same reports are produced for the whole customer base. My problem is that designing the layout of the reports is long and tedious job. What I need is a GUI tool for designing the layout of the reports. The output of the tool should be xsl file that will used for creating reports in batch. Additional option is that the toll will provide a library that will allow build a customized batch process for report creation based on GUI layout definitions. Thanks
4
3,710,017
09/14/2010 14:46:36
66,191
02/13/2009 18:26:03
667
17
How to write your own condition variable using atomic primitives
I need to write my own implementation of a condition variable much like pthread_cond_t. I know I'll need to use the compiler provided primitives like __sync_val_compare_and_swap etc. Does anyone know how I'd go about this please. Thx
c++
null
null
null
null
null
open
How to write your own condition variable using atomic primitives === I need to write my own implementation of a condition variable much like pthread_cond_t. I know I'll need to use the compiler provided primitives like __sync_val_compare_and_swap etc. Does anyone know how I'd go about this please. Thx
0
8,806,651
01/10/2012 16:24:25
1,129,525
01/04/2012 08:51:25
18
1
Embed Silverlight Video Player to Asp.net Web Application
How to embed my Custom Silverlight Video Player Application into Asp.net Web Application ? -
c#
asp.net
silverlight
silverlight-4.0
null
01/10/2012 17:07:14
not a real question
Embed Silverlight Video Player to Asp.net Web Application === How to embed my Custom Silverlight Video Player Application into Asp.net Web Application ? -
1
9,786,375
03/20/2012 12:02:37
1,275,439
03/17/2012 07:11:41
8
0
Collecting different values in a single input field
Guys i will be having only one input field. Where in i wanna ask the user to input either his phone no or his email to display his details from the database. How will i check?
php
mysql
null
null
null
03/21/2012 12:37:18
not a real question
Collecting different values in a single input field === Guys i will be having only one input field. Where in i wanna ask the user to input either his phone no or his email to display his details from the database. How will i check?
1
2,449,077
03/15/2010 17:21:36
272,955
02/14/2010 17:07:38
16
0
duplicate each member in a list - python
I want to write a function that recives a list [1,5,3,6,...] and gives [1,1,5,5,3,3,6,6,...] any idea how to do it? thanks
basic
python
list
null
null
null
open
duplicate each member in a list - python === I want to write a function that recives a list [1,5,3,6,...] and gives [1,1,5,5,3,3,6,6,...] any idea how to do it? thanks
0
9,490,572
02/28/2012 22:11:40
1,043,269
11/12/2011 15:41:03
3
0
Will "Discrete Mathematics for Computing" be appropriate reading to cover the Discrete Maths needed for Introduction to Algorithms (CLRS)
I'm a student on an undergraduate Software Engineering course, and I'm currently on my placement/internship year out before my final year. Whilst working I have realized that my knowledge of Data Structures & Algorithms isn't actually that good (unfortunately only the Computer Science students had the Data Stuctures & Algorithms module at University!), and would like to get it to the standard it should be before I return for my final year. After searching SO I have come to the conclusion that CLRS is the book I am looking for, however I do not feel I have the Maths knowledge needed to read it. I studied Discrete Maths in my first year, however that was two years ago and I can't really remember most of it now. Thus, I am looking for a book to help re-learn Discrete Maths, and the top recommendation appears to be [Discrete Maths and Its Applications][1]. However, after looking into getting this book Amazon appears to have endless poor reviews, with many stating that the companion site for the book is incomplete which has put me off. Instead, I have been considering [Discrete Mathematics for Computing][2]. If you could take a look at the table of contents on the link (you just have to click on the picture of the book), and confirm whether the contents covered include everything needed for CLRS it would be most appreciated. [1]: http://highered.mcgraw-hill.com/classware/infoCenter.do?isbn=0072880082 [2]: http://www.amazon.co.uk/Discrete-Mathematics-Computing-Rod-Haggarty/dp/0201730472/ref=sr_1_1?ie=UTF8&qid=1330464879&sr=8-1
algorithm
math
introduction
clrs
null
02/29/2012 01:43:14
off topic
Will "Discrete Mathematics for Computing" be appropriate reading to cover the Discrete Maths needed for Introduction to Algorithms (CLRS) === I'm a student on an undergraduate Software Engineering course, and I'm currently on my placement/internship year out before my final year. Whilst working I have realized that my knowledge of Data Structures & Algorithms isn't actually that good (unfortunately only the Computer Science students had the Data Stuctures & Algorithms module at University!), and would like to get it to the standard it should be before I return for my final year. After searching SO I have come to the conclusion that CLRS is the book I am looking for, however I do not feel I have the Maths knowledge needed to read it. I studied Discrete Maths in my first year, however that was two years ago and I can't really remember most of it now. Thus, I am looking for a book to help re-learn Discrete Maths, and the top recommendation appears to be [Discrete Maths and Its Applications][1]. However, after looking into getting this book Amazon appears to have endless poor reviews, with many stating that the companion site for the book is incomplete which has put me off. Instead, I have been considering [Discrete Mathematics for Computing][2]. If you could take a look at the table of contents on the link (you just have to click on the picture of the book), and confirm whether the contents covered include everything needed for CLRS it would be most appreciated. [1]: http://highered.mcgraw-hill.com/classware/infoCenter.do?isbn=0072880082 [2]: http://www.amazon.co.uk/Discrete-Mathematics-Computing-Rod-Haggarty/dp/0201730472/ref=sr_1_1?ie=UTF8&qid=1330464879&sr=8-1
2
7,823,966
10/19/2011 15:39:30
16,241
09/17/2008 15:38:49
6,995
156
Milliseconds in my DateTime changes when stored in SQL Server
I have a date time that I generate like this: DateTime myDateTime = DateTime.Now; I then store it in the database (in a `DateTime` typed column) with Entity Framework. I then retrieve it with OData (WCF Data Services). When it goes in the TimeOfDay value is: **09:30:03.0196095** When it comes out the TimeOfDay value is: **09:30:03.0200000** The net effect of this makes it so that the Milliseconds are seen as 19 before it is saved and 20 after it is re-loaded. So when I do a compare later in my code, it fails where it should be equal. Does SQL Server not have as much precision as .NET? Or is it Entity Framework or OData that is messing this up? I will just truncate off the milliseconds (I don't really need them). But I would like to know why this is happening.
c#
.net
sql-server
null
null
null
open
Milliseconds in my DateTime changes when stored in SQL Server === I have a date time that I generate like this: DateTime myDateTime = DateTime.Now; I then store it in the database (in a `DateTime` typed column) with Entity Framework. I then retrieve it with OData (WCF Data Services). When it goes in the TimeOfDay value is: **09:30:03.0196095** When it comes out the TimeOfDay value is: **09:30:03.0200000** The net effect of this makes it so that the Milliseconds are seen as 19 before it is saved and 20 after it is re-loaded. So when I do a compare later in my code, it fails where it should be equal. Does SQL Server not have as much precision as .NET? Or is it Entity Framework or OData that is messing this up? I will just truncate off the milliseconds (I don't really need them). But I would like to know why this is happening.
0
10,563,171
05/12/2012 11:07:49
1,277,407
03/18/2012 20:49:47
101
0
What should I study to do a social website?
I'm trying to do a social website with the gogle maps API and it must have a ranking system. I started thinking what should I know, and I conclude that I need these: > - Search algorithms.(For searching people) - How to do the ranking system. - Voting up and down. The site is going to be like a mix of StackExchange and Google Maps to meet people. Should I study more? Any good manuals to study these?
google-maps
social
null
null
null
05/12/2012 11:44:03
not constructive
What should I study to do a social website? === I'm trying to do a social website with the gogle maps API and it must have a ranking system. I started thinking what should I know, and I conclude that I need these: > - Search algorithms.(For searching people) - How to do the ranking system. - Voting up and down. The site is going to be like a mix of StackExchange and Google Maps to meet people. Should I study more? Any good manuals to study these?
4
9,715,320
03/15/2012 07:10:22
414,773
08/09/2010 06:44:19
140
5
Save an existing file as UTF-8 in Vba
Can I save an already existing file(in unicode) in UTF-8. Please help me
vba
unicode
utf-8
save
null
03/16/2012 00:24:03
not a real question
Save an existing file as UTF-8 in Vba === Can I save an already existing file(in unicode) in UTF-8. Please help me
1
7,722,493
10/11/2011 07:09:02
313,163
04/09/2010 20:31:46
1,135
25
How does one aggregate and summarize data quickly?
I have a dataset whose headers look like so: PID Time Site Rep Count I want sum the `Count` by `Rep` for each `PID x Time x Site combo` on the resulting data.frame, I want to get the mean value of `Count` for `PID x Time x Site` combo. Current function is as follows: dummy <- function (data) { A<-aggregate(Count~PID+Time+Site+Rep,data=data,function(x){sum(na.omit(x))}) B<-aggregate(Count~PID+Time+Site,data=A,mean) return (B) } This is painfully slow (original data.frame is `510000 20)`. Is there a way to speed this up with plyr?
r
plyr
null
null
null
null
open
How does one aggregate and summarize data quickly? === I have a dataset whose headers look like so: PID Time Site Rep Count I want sum the `Count` by `Rep` for each `PID x Time x Site combo` on the resulting data.frame, I want to get the mean value of `Count` for `PID x Time x Site` combo. Current function is as follows: dummy <- function (data) { A<-aggregate(Count~PID+Time+Site+Rep,data=data,function(x){sum(na.omit(x))}) B<-aggregate(Count~PID+Time+Site,data=A,mean) return (B) } This is painfully slow (original data.frame is `510000 20)`. Is there a way to speed this up with plyr?
0
10,943,401
06/08/2012 05:15:19
1,425,606
05/30/2012 09:05:22
17
0
websites made in silverlight
Are there any websites that out there on the internet made in silverlight? If yes, please give me the links. This question I am asking is out of curiosity to know that how popular and frequent is silverlight chosen while designing the website. Thanks in advance.
silverlight
website
null
null
null
06/08/2012 14:53:21
off topic
websites made in silverlight === Are there any websites that out there on the internet made in silverlight? If yes, please give me the links. This question I am asking is out of curiosity to know that how popular and frequent is silverlight chosen while designing the website. Thanks in advance.
2
4,878,674
02/02/2011 19:04:27
203,146
11/05/2009 03:45:29
150
2
Controlling a device that only interacts via Hyperterminal using python
I am trying to write a basic driver to control a device that only interacts with hyperterminal. All the inputs expect HT formated data and all of the returns include copious equal signs, newlines, and spaces in order to get the formatting correct for human visualization. I am pretty sure that the returns are generating trouble, as I am throwing exceptions a lot, but I am not sure how else I can handle it. Does anyone know of a better way to do this? Device manual: http://us.startech.com/media/products/PCM815SHNA/Manuals/PCM815SHNA.pdf import visa import re class iopower8(visa.SerialInstrument): #initialization def __init__(self,loc): visa.SerialInstrument.__init__(self,loc) self.term_chars = '\r' #set terminal characters self.write('\r\r') #start faux 'Hyperterminal' def on(self, bank, out): self.ask("on " + str(bank) + " " + str(out)) for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break return self.status(bank, out) def off(self, bank, out): self.ask("of " + str(bank) + " " + str(out)) for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break return self.status(bank, out) def status(self, bank, port): #enter bank and port # you want to check self.ask("st " + str(bank)) result = 'Error' #send error message regardless for i in range (1,13):#all 12 lines need to be read out of the buffer to prevent issues later try: stuff = self.read()#read the line to a holding srting, and dump in void if wriong line to clear buffer if stuff.strip() == ('='*44): break except(visa_exceptions.VisaIOError): break for i in range(1,9): try: stuff = self.read()#read the line to a holding string, and dump in void if wriong line to clear buffer. if i == port: #this offset will get you to the line with the relevant port's status result = re.match('(.*?)(ON|OFF)', stuff) #regex to the find the on/off status #convert to boolean if result.group(2) == 'ON': result = True elif result.group(2) =='OFF': result = False else: result = 'ERROR' except(visa_exceptions.VisaIOError): self.buffer_clear() break return result def buffer_clear(self): #in case of buffer jamming while True: try: self.read_raw() except(visa_exceptions.VisaIOError): break def all_on(self, bank): self.ask("on " + str(bank) + " 0") for i in range (1,3):#read buffer into void to prevent issues try: hold = self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break def all_off(self, bank): self.ask("of " + str(bank) + " 0") for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break
python
regex
interface
device-driver
hyperterminal
null
open
Controlling a device that only interacts via Hyperterminal using python === I am trying to write a basic driver to control a device that only interacts with hyperterminal. All the inputs expect HT formated data and all of the returns include copious equal signs, newlines, and spaces in order to get the formatting correct for human visualization. I am pretty sure that the returns are generating trouble, as I am throwing exceptions a lot, but I am not sure how else I can handle it. Does anyone know of a better way to do this? Device manual: http://us.startech.com/media/products/PCM815SHNA/Manuals/PCM815SHNA.pdf import visa import re class iopower8(visa.SerialInstrument): #initialization def __init__(self,loc): visa.SerialInstrument.__init__(self,loc) self.term_chars = '\r' #set terminal characters self.write('\r\r') #start faux 'Hyperterminal' def on(self, bank, out): self.ask("on " + str(bank) + " " + str(out)) for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break return self.status(bank, out) def off(self, bank, out): self.ask("of " + str(bank) + " " + str(out)) for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break return self.status(bank, out) def status(self, bank, port): #enter bank and port # you want to check self.ask("st " + str(bank)) result = 'Error' #send error message regardless for i in range (1,13):#all 12 lines need to be read out of the buffer to prevent issues later try: stuff = self.read()#read the line to a holding srting, and dump in void if wriong line to clear buffer if stuff.strip() == ('='*44): break except(visa_exceptions.VisaIOError): break for i in range(1,9): try: stuff = self.read()#read the line to a holding string, and dump in void if wriong line to clear buffer. if i == port: #this offset will get you to the line with the relevant port's status result = re.match('(.*?)(ON|OFF)', stuff) #regex to the find the on/off status #convert to boolean if result.group(2) == 'ON': result = True elif result.group(2) =='OFF': result = False else: result = 'ERROR' except(visa_exceptions.VisaIOError): self.buffer_clear() break return result def buffer_clear(self): #in case of buffer jamming while True: try: self.read_raw() except(visa_exceptions.VisaIOError): break def all_on(self, bank): self.ask("on " + str(bank) + " 0") for i in range (1,3):#read buffer into void to prevent issues try: hold = self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break def all_off(self, bank): self.ask("of " + str(bank) + " 0") for i in range (1,3):#read buffer into void to prevent issues try: self.read_raw() except(visa_exceptions.VisaIOError): self.buffer_clear() break
0
1,890,196
12/11/2009 19:04:01
213,946
11/18/2009 17:20:03
44
0
Records and Generic Containers in Delphi
I'm going slightly mad (singing Queen's song) about records with Generic Containers (TList). First, see this code: TItemRec = record private FSender : TAction; FOwnerPack : HModule; FDockPanel : TdxDockPanel; procedure SetDockPanel(const Value: TdxDockPanel); procedure SetOwnerPack(const Value: HModule); procedure SetSender(const Value: TAction); public property Sender: TAction read FSender write SetSender; property OwnerPack: HModule read FOwnerPack write SetOwnerPack; property DockPanel: TdxDockPanel read FDockPanel write SetDockPanel; end; TPackRec = record private FHandle : HModule; var FCounter : Int16; procedure SetCounter(const Value: Int16); procedure SetHandle(const Value: HModule); public property Handle: HModule read FHandle write SetHandle; property Counter: Int16 read FCounter write SetCounter; procedure ChangeCounter(IncValue: Boolean = True); end; TRecList = class(TList<TItemRec>) public procedure CloseDockPanels; end; TPackList = class(TList<TPackRec>) strict private procedure DoChanges(const APack: HModule; const AAdd: Boolean = True); public procedure CheckForUnusedItems; procedure AppendRef(const APack: HModule); procedure DeleteRef(const APack: HModule); procedure ClosePackages; end; TfrmMain = class(TForm) private FRecList : TRecList; FPackList : TPackList; public end; ........................ procedure TPackList.CheckForUnusedItems; var i : Int16; Flag : Boolean; begin repeat Flag:= False; if Self.Count > 0 then begin for i:= Self.Count - 1 downto 0 do begin Flag:= Self.Items[i].FCounter > 0; if not Flag then begin Self.Delete(i); Flag:= True; Break; end; Flag:= False; end; end; until not Flag; end; procedure TPackRec.ChangeCounter(IncValue: Boolean); var Value : Int16; begin Value:= Counter; if IncValue then Value:= Value + 1 else Value:= Value - 1; Counter:= Value; end; I have a serious problem when trying to change value for **Counter** property, which is the only item with a changing value. ChangeCounter method should change value of Counter, and apparently it is done, but for CheckForUnusedItems method changed nothing, I've tried almost everything but it seems that each of TPackList and TRecList was a constant. I show you some pics: Items added successfully ![Pic01][1] Item of FRecList deleted ![Pic02][2] ChangeCounter method changed value of Counter ![Pic03][3] CheckForUnusedItems method doesnot see any change ![Pic04][4] Counter property keeps its value like a constant ![Pic05][5] What is happening? Is there an explanation for this? How can I resolved it? Thanks in advance. [1]: http://ifynmg.blu.livefilestore.com/y1p6OgI5SSaLdak-EtY4shX76pR1f2ZiIASipNeJ7yRPn0hbOTB7U3CKG_VDkvjaf37RcOzB7jJuJnJDpW6YLjb2UpzUor5eKZc/01.jpg [2]: http://ifynmg.blu.livefilestore.com/y1p6OgI5SSaLdbsOS_KrseMdlSJO2f5N5flC5N0BE9u5DhbFMLKLLS5lhezPHM45pLC_QWb08DJPKhOEnepjY2s8LW8ZguCtYEr/02.jpg [3]: http://ifynmg.blu.livefilestore.com/y1pmccN61pEmDBFrq764d-bed8_yjLagLw_NCm4vAZY0IKYql8HTgIgmF-1-OWVDN9T7BvQI6xTtVhmUzxTD_cUscufQ8R0Fvrm/03.jpg [4]: http://ifynmg.blu.livefilestore.com/y1pYBYDjfimmKvkFMYBwmsUingpRuFOAV6LSZrp26uNKeFOfdgrbHI7gPN8FVYFUEPGM74ki4Xph8aZOSeQqFrHCVN1iDyJwFbh/04.jpg [5]: http://public.blu.livefilestore.com/y1pkKTtcSP2c2gg8DCKjPoeMjrS_cFEIQM9m7Rq7ZsPICHZR8R0QMcG4RVUsdqVlIfUZVidXcCTK2o4fREXVZghYQ/05.jpg
records
generics
containers
delphi
null
null
open
Records and Generic Containers in Delphi === I'm going slightly mad (singing Queen's song) about records with Generic Containers (TList). First, see this code: TItemRec = record private FSender : TAction; FOwnerPack : HModule; FDockPanel : TdxDockPanel; procedure SetDockPanel(const Value: TdxDockPanel); procedure SetOwnerPack(const Value: HModule); procedure SetSender(const Value: TAction); public property Sender: TAction read FSender write SetSender; property OwnerPack: HModule read FOwnerPack write SetOwnerPack; property DockPanel: TdxDockPanel read FDockPanel write SetDockPanel; end; TPackRec = record private FHandle : HModule; var FCounter : Int16; procedure SetCounter(const Value: Int16); procedure SetHandle(const Value: HModule); public property Handle: HModule read FHandle write SetHandle; property Counter: Int16 read FCounter write SetCounter; procedure ChangeCounter(IncValue: Boolean = True); end; TRecList = class(TList<TItemRec>) public procedure CloseDockPanels; end; TPackList = class(TList<TPackRec>) strict private procedure DoChanges(const APack: HModule; const AAdd: Boolean = True); public procedure CheckForUnusedItems; procedure AppendRef(const APack: HModule); procedure DeleteRef(const APack: HModule); procedure ClosePackages; end; TfrmMain = class(TForm) private FRecList : TRecList; FPackList : TPackList; public end; ........................ procedure TPackList.CheckForUnusedItems; var i : Int16; Flag : Boolean; begin repeat Flag:= False; if Self.Count > 0 then begin for i:= Self.Count - 1 downto 0 do begin Flag:= Self.Items[i].FCounter > 0; if not Flag then begin Self.Delete(i); Flag:= True; Break; end; Flag:= False; end; end; until not Flag; end; procedure TPackRec.ChangeCounter(IncValue: Boolean); var Value : Int16; begin Value:= Counter; if IncValue then Value:= Value + 1 else Value:= Value - 1; Counter:= Value; end; I have a serious problem when trying to change value for **Counter** property, which is the only item with a changing value. ChangeCounter method should change value of Counter, and apparently it is done, but for CheckForUnusedItems method changed nothing, I've tried almost everything but it seems that each of TPackList and TRecList was a constant. I show you some pics: Items added successfully ![Pic01][1] Item of FRecList deleted ![Pic02][2] ChangeCounter method changed value of Counter ![Pic03][3] CheckForUnusedItems method doesnot see any change ![Pic04][4] Counter property keeps its value like a constant ![Pic05][5] What is happening? Is there an explanation for this? How can I resolved it? Thanks in advance. [1]: http://ifynmg.blu.livefilestore.com/y1p6OgI5SSaLdak-EtY4shX76pR1f2ZiIASipNeJ7yRPn0hbOTB7U3CKG_VDkvjaf37RcOzB7jJuJnJDpW6YLjb2UpzUor5eKZc/01.jpg [2]: http://ifynmg.blu.livefilestore.com/y1p6OgI5SSaLdbsOS_KrseMdlSJO2f5N5flC5N0BE9u5DhbFMLKLLS5lhezPHM45pLC_QWb08DJPKhOEnepjY2s8LW8ZguCtYEr/02.jpg [3]: http://ifynmg.blu.livefilestore.com/y1pmccN61pEmDBFrq764d-bed8_yjLagLw_NCm4vAZY0IKYql8HTgIgmF-1-OWVDN9T7BvQI6xTtVhmUzxTD_cUscufQ8R0Fvrm/03.jpg [4]: http://ifynmg.blu.livefilestore.com/y1pYBYDjfimmKvkFMYBwmsUingpRuFOAV6LSZrp26uNKeFOfdgrbHI7gPN8FVYFUEPGM74ki4Xph8aZOSeQqFrHCVN1iDyJwFbh/04.jpg [5]: http://public.blu.livefilestore.com/y1pkKTtcSP2c2gg8DCKjPoeMjrS_cFEIQM9m7Rq7ZsPICHZR8R0QMcG4RVUsdqVlIfUZVidXcCTK2o4fREXVZghYQ/05.jpg
0
10,478,528
05/07/2012 07:50:17
1,256,477
03/08/2012 07:41:22
50
2
jtable title is not shown
I want to do a JTable with column names, I read: JTable(Vector rowData, Vector columnNames) Constructs a JTable to display the values in the Vector of Vectors, rowData, with column names, columnNames. So, I did this: final String[] columnNames = {"NOMBRE", "DÍAS DE LA SEMANA", "HORA DE INICIO", "HORA DE FIN", "TIEMPO MÁXIMO DE USO"}; rs.last(); int numRows = rs.getRow(); rs.beforeFirst(); Object[][] columnData = new String[numRows][5]; int i = 0; while(rs.next()){ columnData[i][0] = rs.getString(1); columnData[i][1] = rs.getString(2); columnData[i][2] = rs.getString(3); columnData[i][3] = rs.getString(4); columnData[i][4] = rs.getString(5); } table = new JTable(columnData, columnNames); table.setBounds(300,600,700,150); But I only see the data, why isn't the title shown? Thank in advance
java
null
null
null
null
null
open
jtable title is not shown === I want to do a JTable with column names, I read: JTable(Vector rowData, Vector columnNames) Constructs a JTable to display the values in the Vector of Vectors, rowData, with column names, columnNames. So, I did this: final String[] columnNames = {"NOMBRE", "DÍAS DE LA SEMANA", "HORA DE INICIO", "HORA DE FIN", "TIEMPO MÁXIMO DE USO"}; rs.last(); int numRows = rs.getRow(); rs.beforeFirst(); Object[][] columnData = new String[numRows][5]; int i = 0; while(rs.next()){ columnData[i][0] = rs.getString(1); columnData[i][1] = rs.getString(2); columnData[i][2] = rs.getString(3); columnData[i][3] = rs.getString(4); columnData[i][4] = rs.getString(5); } table = new JTable(columnData, columnNames); table.setBounds(300,600,700,150); But I only see the data, why isn't the title shown? Thank in advance
0
5,857,355
05/02/2011 12:53:09
828,122
11/15/2010 06:56:16
14
0
remove " ' " from given string
I want string that does not contain "'". If my strin is **vaibhav's friend** then i want **vaibhavs friend** Notice **vaibhav's friend** = **vaibhavs friend** Plz reply fast. Thank You.
php
null
null
null
null
05/03/2011 09:56:59
not a real question
remove " ' " from given string === I want string that does not contain "'". If my strin is **vaibhav's friend** then i want **vaibhavs friend** Notice **vaibhav's friend** = **vaibhavs friend** Plz reply fast. Thank You.
1
3,887,492
10/08/2010 03:28:59
469,816
10/08/2010 03:28:59
1
0
ANTLR match to end of input
I'm trying to match my grammar to an entire string, and have it error out if it cannot consume the entire input. Basically, this pseudo regex: \whitespace* [a-zA-Z]+ [-]? [a-zA-Z]+ \whitespace* $ According to <a href="http://stackoverflow.com/questions/2147964/antlr-how-to-detect-rubbish-data-at-end-of-input">this</a>, EOF should work. So, consider this grammar: start : CHARS EOF; CHARS : ('a'..'z')+; If I set input to "hello" in this code: var ss = new Antlr.Runtime.ANTLRStringStream(input); var lex = new autocompleteLexer(ss); var tokens = new CommonTokenStream(lex); var parser = new autocompleteParser(tokens); return (BaseTree)(parser.start().Tree); I get an AST with two children, HELLO and EOF, as expected. But if I set the input to say "hello#", it gives back the same tree, and doesn't complain about the hash at all. I'm not sure what I'm doing wrong.
regex
parsing
input
antlr
null
null
open
ANTLR match to end of input === I'm trying to match my grammar to an entire string, and have it error out if it cannot consume the entire input. Basically, this pseudo regex: \whitespace* [a-zA-Z]+ [-]? [a-zA-Z]+ \whitespace* $ According to <a href="http://stackoverflow.com/questions/2147964/antlr-how-to-detect-rubbish-data-at-end-of-input">this</a>, EOF should work. So, consider this grammar: start : CHARS EOF; CHARS : ('a'..'z')+; If I set input to "hello" in this code: var ss = new Antlr.Runtime.ANTLRStringStream(input); var lex = new autocompleteLexer(ss); var tokens = new CommonTokenStream(lex); var parser = new autocompleteParser(tokens); return (BaseTree)(parser.start().Tree); I get an AST with two children, HELLO and EOF, as expected. But if I set the input to say "hello#", it gives back the same tree, and doesn't complain about the hash at all. I'm not sure what I'm doing wrong.
0
8,978,745
01/23/2012 21:20:03
646,023
03/05/2011 13:14:05
155
4
Can we create popup error alerts in java?
Can we create popup error alerts in POJO class? Thanks
java
error-message
null
null
null
01/23/2012 21:42:30
not a real question
Can we create popup error alerts in java? === Can we create popup error alerts in POJO class? Thanks
1
11,520,968
07/17/2012 10:50:46
284,240
03/02/2010 08:55:40
39,148
1,728
Multi mapping in dapper causes exception
I'm implementing my first [Dapper.Net][1] project. Now i'm wondering what's the easiest way to initialize an object that contains another object(multi mapping). Here's my code: public static IEnumerable<ShopPrefix> GetShopPrefixes(short fiSL) { using (var con = new SqlConnection(Properties.Settings.Default.RM2Con)) { const String sql = "SELECT locShopPrefix.idShopPrefix, locShopPrefix.fiSL, locShopPrefix.fiShop, locShopPrefix.Prefix, locShopPrefix.Active, locShop.idShop, locShop.ShopName, locShop.ContactPerson, locShop.Street, locShop.ZIP, locShop.City, locShop.Telephone, locShop.Telefax, locShop.Email, locShop.ShopKey FROM locShopPrefix INNER JOIN locShop ON locShopPrefix.fiShop = locShop.idShop WHERE (locShopPrefix.fiSL = @fiSL);"; con.Open(); IEnumerable<Tuple<ShopPrefix,Shop>> shops = con.Query<ShopPrefix, Shop, Tuple<ShopPrefix, Shop>>( sql , (shopPrefix, shop) => Tuple.Create(shopPrefix, shop) , new { fiSL = fiSL }, splitOn: "idShop" ); foreach (var shop in shops) shop.Item1.Shop = shop.Item2; return shops.Select(t => t.Item1); } } So every `shopPrefix` belongs to (has) a `Shop`. **Q:** Is this the correct way to map two objects since the `Tuple` approach with the following `foreach` looks a little bit cumbersome? [1]: http://code.google.com/p/dapper-dot-net/
c#
dapper
null
null
null
null
open
Multi mapping in dapper causes exception === I'm implementing my first [Dapper.Net][1] project. Now i'm wondering what's the easiest way to initialize an object that contains another object(multi mapping). Here's my code: public static IEnumerable<ShopPrefix> GetShopPrefixes(short fiSL) { using (var con = new SqlConnection(Properties.Settings.Default.RM2Con)) { const String sql = "SELECT locShopPrefix.idShopPrefix, locShopPrefix.fiSL, locShopPrefix.fiShop, locShopPrefix.Prefix, locShopPrefix.Active, locShop.idShop, locShop.ShopName, locShop.ContactPerson, locShop.Street, locShop.ZIP, locShop.City, locShop.Telephone, locShop.Telefax, locShop.Email, locShop.ShopKey FROM locShopPrefix INNER JOIN locShop ON locShopPrefix.fiShop = locShop.idShop WHERE (locShopPrefix.fiSL = @fiSL);"; con.Open(); IEnumerable<Tuple<ShopPrefix,Shop>> shops = con.Query<ShopPrefix, Shop, Tuple<ShopPrefix, Shop>>( sql , (shopPrefix, shop) => Tuple.Create(shopPrefix, shop) , new { fiSL = fiSL }, splitOn: "idShop" ); foreach (var shop in shops) shop.Item1.Shop = shop.Item2; return shops.Select(t => t.Item1); } } So every `shopPrefix` belongs to (has) a `Shop`. **Q:** Is this the correct way to map two objects since the `Tuple` approach with the following `foreach` looks a little bit cumbersome? [1]: http://code.google.com/p/dapper-dot-net/
0
7,826,521
10/19/2011 18:51:54
166,612
09/01/2009 13:21:28
408
12
Free DevExpress alternative
I'm doing open source software development and I'd like to know if there is some free windows forms controls availaible? (In the same package like DevExpress) Thanks
winforms
controls
devexpress
null
null
10/20/2011 10:55:12
not constructive
Free DevExpress alternative === I'm doing open source software development and I'd like to know if there is some free windows forms controls availaible? (In the same package like DevExpress) Thanks
4
3,697,453
09/13/2010 01:38:13
23,341
09/29/2008 04:41:59
1,985
32
Javascript lightbox component that works with arbitrary HTML
Is there a Javascript component that allows me to simply pass it a string made up of arbitrary HTML (any HTML I wish to use) and will show that HTML in a lightbox? I've been scouring the internet, searching for examples, but it seems like there simply isn't any component capable of doing this. Even LightWindow, which claims to be all-purpose, still requires me to attach it to an <a> tag with the href set to an element ID. This isn't what I want. I want to be able to call a function and **pass in the HTML myself**. (Another issue with LightWindow is that it requires scriptaculous as a dependency. The project already uses jQuery, and I'd rather not include two frameworks at once.) Any ideas?
javascript
lightbox
popupwindow
lightwindow
null
null
open
Javascript lightbox component that works with arbitrary HTML === Is there a Javascript component that allows me to simply pass it a string made up of arbitrary HTML (any HTML I wish to use) and will show that HTML in a lightbox? I've been scouring the internet, searching for examples, but it seems like there simply isn't any component capable of doing this. Even LightWindow, which claims to be all-purpose, still requires me to attach it to an <a> tag with the href set to an element ID. This isn't what I want. I want to be able to call a function and **pass in the HTML myself**. (Another issue with LightWindow is that it requires scriptaculous as a dependency. The project already uses jQuery, and I'd rather not include two frameworks at once.) Any ideas?
0
5,290,927
03/13/2011 17:04:22
657,686
03/13/2011 16:52:12
1
0
Problem with recursive objective-c void-method
thats my first question here and i hope someone can help me. I´m new at the iPhone programming and want to try an easy app... It´s an SudokuSolver which is working with an recursive Method. In JAVA this code is making no problems, but in Objective-C the code isn´t stopping when Sudoku is solved. It´s still trying to solve the Sudoku and stops later. Anyone an idea?! Here´s the code. - (void) solve { [self solveFieldAtRow:0 andCol:0]; } - (void) solveFieldAtRow: (int) row andCol: (int) col { if (row > 8) { return; } else { while (sudokuField[row][col] != 0) { if (++col > 8) { col = 0; row++; if (row > 8) { return; } } } for (int num=1; num<10; num++) { if ([self checkRow:row forNumber:num] && [self checkCol:col forNumber:num] && [self checkFieldAtRow:row andCol:col forNumber:num]) { sudokuField[row][col] = num; [self showFieldInConsole:0]; if (col < 8) { [self solveFieldAtRow:row andCol:col+1]; } else { [self solveFieldAtRow:row+1 andCol:0]; } } } sudokuField[row][col] = 0; } }
objective-c
recursion
return
void
null
null
open
Problem with recursive objective-c void-method === thats my first question here and i hope someone can help me. I´m new at the iPhone programming and want to try an easy app... It´s an SudokuSolver which is working with an recursive Method. In JAVA this code is making no problems, but in Objective-C the code isn´t stopping when Sudoku is solved. It´s still trying to solve the Sudoku and stops later. Anyone an idea?! Here´s the code. - (void) solve { [self solveFieldAtRow:0 andCol:0]; } - (void) solveFieldAtRow: (int) row andCol: (int) col { if (row > 8) { return; } else { while (sudokuField[row][col] != 0) { if (++col > 8) { col = 0; row++; if (row > 8) { return; } } } for (int num=1; num<10; num++) { if ([self checkRow:row forNumber:num] && [self checkCol:col forNumber:num] && [self checkFieldAtRow:row andCol:col forNumber:num]) { sudokuField[row][col] = num; [self showFieldInConsole:0]; if (col < 8) { [self solveFieldAtRow:row andCol:col+1]; } else { [self solveFieldAtRow:row+1 andCol:0]; } } } sudokuField[row][col] = 0; } }
0
6,165,900
05/29/2011 04:10:35
435,645
08/31/2010 07:01:49
1,072
1
How to implement square in C without using arithmetic operator?
How to implement square in C without using arithmetic operator? Since it requires cannot use arithmetic operator. I knind stuck here. cannot find a good way to solve it. Can anybody help me, give me some hints? Thank you!!!
c
null
null
null
null
05/29/2011 04:15:24
not a real question
How to implement square in C without using arithmetic operator? === How to implement square in C without using arithmetic operator? Since it requires cannot use arithmetic operator. I knind stuck here. cannot find a good way to solve it. Can anybody help me, give me some hints? Thank you!!!
1
10,061,226
04/08/2012 07:40:18
518,116
11/23/2010 22:42:29
476
22
Android + saxParser + storing objects into ArrayList
I'm using a simple implementation of saxParser. Within my endElement method, I'm storing vo objects to an ArrayList. Unfortunately when I loop over my List, it only returns the last item from my xml data. Just wondering what I'm doing wrong? Relavent code below: public class MyXMLHandler extends DefaultHandler { private StringBuffer buffer = new StringBuffer(); private Boolean currentElement = false; private StoreDetails storeDetails = new StoreDetails(); //vo object private ArrayList<StoreDetails> dataList = new ArrayList<StoreDetails>(); //list of vo public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; } @Override public void endElement(String uri, String localName, String qName) throws SAXException { currentElement = false; if (localName.equals("StoreID")) { buffer.toString().trim(); storeDetails.setStoreId(buffer.toString()); } else if (localName.equals("StoreName")) { buffer.toString().trim(); storeDetails.setStoreName(buffer.toString()); } else if (localName.equals("StoreCategory")) { buffer.toString().trim(); storeDetails.setStoreCategory(buffer.toString()); //add vo object to ArrayList - dataList dataList.add(storeDetails); } buffer = new StringBuffer(); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { buffer.append(ch, start, length); currentElement = false; } } @Override public void endDocument() throws SAXException { Log.i("TAG", "DONE PARSING XML"); for(StoreDetails details : dataList){ //ISSUE - returning only the last row in my xml data (over and over) Log.i("TAG", "Details ID: " + details.getStoreId()); } } }
android
arraylist
saxparser
null
null
null
open
Android + saxParser + storing objects into ArrayList === I'm using a simple implementation of saxParser. Within my endElement method, I'm storing vo objects to an ArrayList. Unfortunately when I loop over my List, it only returns the last item from my xml data. Just wondering what I'm doing wrong? Relavent code below: public class MyXMLHandler extends DefaultHandler { private StringBuffer buffer = new StringBuffer(); private Boolean currentElement = false; private StoreDetails storeDetails = new StoreDetails(); //vo object private ArrayList<StoreDetails> dataList = new ArrayList<StoreDetails>(); //list of vo public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; } @Override public void endElement(String uri, String localName, String qName) throws SAXException { currentElement = false; if (localName.equals("StoreID")) { buffer.toString().trim(); storeDetails.setStoreId(buffer.toString()); } else if (localName.equals("StoreName")) { buffer.toString().trim(); storeDetails.setStoreName(buffer.toString()); } else if (localName.equals("StoreCategory")) { buffer.toString().trim(); storeDetails.setStoreCategory(buffer.toString()); //add vo object to ArrayList - dataList dataList.add(storeDetails); } buffer = new StringBuffer(); } @Override public void characters(char[] ch, int start, int length) throws SAXException { if (currentElement) { buffer.append(ch, start, length); currentElement = false; } } @Override public void endDocument() throws SAXException { Log.i("TAG", "DONE PARSING XML"); for(StoreDetails details : dataList){ //ISSUE - returning only the last row in my xml data (over and over) Log.i("TAG", "Details ID: " + details.getStoreId()); } } }
0
405,684
01/01/2009 23:35:44
32,775
10/30/2008 14:38:47
502
38
PHP/MySQL with encoding problems
I am having trouble with PHP regarding encoding. I have a JavaScript/jQuery HTML5 page interact with my PHP script using $.post. However, PHP is facing a weird problem, probably related to encoding. When I write htmlentities("í") I expect PHP to output `&iacute;`. However, instead it outputs `&Atilde;&shy;` At the beginning, I thought that I was making some mistake with the encodings, however htmlentities("í")=="&iacute;"?"Good":"Fail"; is outputing "Fail", where htmlentities("í")=="&Atilde;&shy;"?"Good":"Fail"; But `htmlentities($search, null, "utf-8")` works as expected. I want to have PHP communicate with a MySQL server, but it has encoding problems too, even if I use utf8_encode. What should I do?
php
mysql
encoding
utf-8
null
null
open
PHP/MySQL with encoding problems === I am having trouble with PHP regarding encoding. I have a JavaScript/jQuery HTML5 page interact with my PHP script using $.post. However, PHP is facing a weird problem, probably related to encoding. When I write htmlentities("í") I expect PHP to output `&iacute;`. However, instead it outputs `&Atilde;&shy;` At the beginning, I thought that I was making some mistake with the encodings, however htmlentities("í")=="&iacute;"?"Good":"Fail"; is outputing "Fail", where htmlentities("í")=="&Atilde;&shy;"?"Good":"Fail"; But `htmlentities($search, null, "utf-8")` works as expected. I want to have PHP communicate with a MySQL server, but it has encoding problems too, even if I use utf8_encode. What should I do?
0
11,461,778
07/12/2012 22:40:19
490,332
10/28/2010 16:05:19
402
6
Create plain white background in Cinema 4D
I'm looking to create a plain white background in Cinema 4D, currently when I render its onto a black background, I essentially want the same but with white. I would like there to be NO shadows, reflects etc... just a plain white background.
cinema-4d
null
null
null
null
07/13/2012 23:36:47
off topic
Create plain white background in Cinema 4D === I'm looking to create a plain white background in Cinema 4D, currently when I render its onto a black background, I essentially want the same but with white. I would like there to be NO shadows, reflects etc... just a plain white background.
2
4,180,580
11/15/2010 00:30:55
143,373
07/23/2009 03:21:02
631
7
Using Windows Performance Tools for tracing an application running on a remote computer
How can I trace a system responsiveness and application resource usage issue on a remote computer? I deployed my application on my client's computer running Windows XP sp3 pro, but its running very slowly and I want to diagnose it since it runs well on my Windows 7 machine. How can i fo it remotely and if thats too difficult how can i do it onsite?
performance
trace
null
null
null
null
open
Using Windows Performance Tools for tracing an application running on a remote computer === How can I trace a system responsiveness and application resource usage issue on a remote computer? I deployed my application on my client's computer running Windows XP sp3 pro, but its running very slowly and I want to diagnose it since it runs well on my Windows 7 machine. How can i fo it remotely and if thats too difficult how can i do it onsite?
0
7,885,128
10/25/2011 05:41:20
375,510
06/24/2010 17:16:53
477
62
Netbook can be used for PHP and Ruby Development with netbeans
does netbook can be used for php and ruby development with out any jerks. but i have the eager to know the experience and suggestions from the my great team here. my requirement is php and ruby development using netbeans. can you suggest and put reason for netbooks for my requirment. and also the best os, i mean linux or windows for the netbook. thanks in advance
netbook
null
null
null
null
10/25/2011 10:38:56
off topic
Netbook can be used for PHP and Ruby Development with netbeans === does netbook can be used for php and ruby development with out any jerks. but i have the eager to know the experience and suggestions from the my great team here. my requirement is php and ruby development using netbeans. can you suggest and put reason for netbooks for my requirment. and also the best os, i mean linux or windows for the netbook. thanks in advance
2
9,842,060
03/23/2012 15:35:27
1,288,568
03/23/2012 15:25:46
1
0
Socket Access During an NFS Failure in Linux
A colleague and I are in a disagreement and therefore are unsure about this: Suppose on an implementation of Linux running an NFS file system there is a failure on the NFS mount (presumably causing a kernel panic), can a running process still read/write to a socket? One notion is that this is not possible (i.e., the access would block or crash) as Linux maintains all drivers modular in the file system. Another is that since the region of the file system where the drivers are located is a construct of the operating system, individual processes should be capable of executing communications. Any help is greatly appreciated!
linux
sockets
nfs
catastrophic-failure
null
03/25/2012 18:57:07
off topic
Socket Access During an NFS Failure in Linux === A colleague and I are in a disagreement and therefore are unsure about this: Suppose on an implementation of Linux running an NFS file system there is a failure on the NFS mount (presumably causing a kernel panic), can a running process still read/write to a socket? One notion is that this is not possible (i.e., the access would block or crash) as Linux maintains all drivers modular in the file system. Another is that since the region of the file system where the drivers are located is a construct of the operating system, individual processes should be capable of executing communications. Any help is greatly appreciated!
2
6,245,468
06/05/2011 19:55:45
779,444
06/01/2011 13:12:37
5
0
Can't Get A Window's DC In Windows XP Direct X
I've made a program for windows 7 (in short, it uses a game's window DC) and when trying it out in windows XP, the returned DC is null (or 0 since its IntPtr). NOTE : In windows 7, the program disables aero, in windows xp it doesn't so thats not the problem. I've made a new window for application with just the code I need and I keep getting 0's in games : [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] public static extern IntPtr GetWindowDC(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); private void HandleChecker_Tick(object sender, EventArgs e) { IntPtr hdcSrc = GetWindowDC(GetForegroundWindow()); StringBuilder sb = new StringBuilder(500); GetWindowText(GetForegroundWindow(), sb, sb.Capacity); HandleLB.Items.Add(sb + " (" + hdcSrc + ")"); } Anyone has any idea why is this happening?
c#
window-handles
null
null
null
null
open
Can't Get A Window's DC In Windows XP Direct X === I've made a program for windows 7 (in short, it uses a game's window DC) and when trying it out in windows XP, the returned DC is null (or 0 since its IntPtr). NOTE : In windows 7, the program disables aero, in windows xp it doesn't so thats not the problem. I've made a new window for application with just the code I need and I keep getting 0's in games : [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] public static extern IntPtr GetWindowDC(IntPtr hWnd); [DllImport("user32.dll")] static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); private void HandleChecker_Tick(object sender, EventArgs e) { IntPtr hdcSrc = GetWindowDC(GetForegroundWindow()); StringBuilder sb = new StringBuilder(500); GetWindowText(GetForegroundWindow(), sb, sb.Capacity); HandleLB.Items.Add(sb + " (" + hdcSrc + ")"); } Anyone has any idea why is this happening?
0
1,102,734
07/09/2009 09:14:54
65,060
02/11/2009 13:02:57
566
34
How can I make a column in a listbox in WPF the same width for all items?
I have a `ListBox` with an `ItemTemplate` consisting of a `TextBlock` and a `ComboBox`. The problem is that the width of the text inside the `TextBlock` is not the same for each item and the `ComboBox` controls are not aligned. How can I set the `TextBlock` in the template so all items are the same width, that is the one of the widest? Here is my xaml: <ListBox MinHeight="100" ItemsSource="{Binding Trainees}"> <ListBox.ItemTemplate> <DataTemplate> <Grid Margin="1"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock VerticalAlignment="Center" Grid.Column="0"> <TextBlock.Text> <MultiBinding StringFormat="{}{0}, {1}"> <Binding Path="LastName" /> <Binding Path="FirstName" /> </MultiBinding> </TextBlock.Text> </TextBlock> <ComboBox HorizontalAlignment="Left" Grid.Column="1" ItemsSource="{Binding Source={StaticResource Functions}}" SelectedValue="{Binding Path=Function}" MinWidth="100" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
wpf
listbox
itemtemplate
width
null
null
open
How can I make a column in a listbox in WPF the same width for all items? === I have a `ListBox` with an `ItemTemplate` consisting of a `TextBlock` and a `ComboBox`. The problem is that the width of the text inside the `TextBlock` is not the same for each item and the `ComboBox` controls are not aligned. How can I set the `TextBlock` in the template so all items are the same width, that is the one of the widest? Here is my xaml: <ListBox MinHeight="100" ItemsSource="{Binding Trainees}"> <ListBox.ItemTemplate> <DataTemplate> <Grid Margin="1"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock VerticalAlignment="Center" Grid.Column="0"> <TextBlock.Text> <MultiBinding StringFormat="{}{0}, {1}"> <Binding Path="LastName" /> <Binding Path="FirstName" /> </MultiBinding> </TextBlock.Text> </TextBlock> <ComboBox HorizontalAlignment="Left" Grid.Column="1" ItemsSource="{Binding Source={StaticResource Functions}}" SelectedValue="{Binding Path=Function}" MinWidth="100" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox>
0
11,509,409
07/16/2012 17:28:06
1,509,915
07/08/2012 11:13:06
18
3
How to change my box for orangehrm from windows to linux
I need to change my box for orangehrm from windows to linux. Please help.
php
symphony-cms
null
null
null
07/16/2012 17:30:09
not a real question
How to change my box for orangehrm from windows to linux === I need to change my box for orangehrm from windows to linux. Please help.
1
3,116,385
06/25/2010 07:52:51
170,196
09/08/2009 13:29:57
295
28
how to use jpa outside of a web project
I've used eclipselink in a web project in netbeans. Works nice and easy. How can I do the same in a project unrelated to web(console app)?
java
netbeans
jpa
eclipselink
null
null
open
how to use jpa outside of a web project === I've used eclipselink in a web project in netbeans. Works nice and easy. How can I do the same in a project unrelated to web(console app)?
0
282,267
11/11/2008 21:54:39
27,580
10/13/2008 19:05:51
810
45
Good Programming Monitor: Actual Display Dimensions vs Diagonal "Marketing" Size?
I am thinking about adding a third monitor to my coding station. I currently run 1600x1200 on a dell 20.1", which is ok, but I am thinking to move to something that will do 1920x1200. I'm doing the purchase on eBay, so can't really see the monitor beforehand. Last time I bought a "Widescreen" (I read "ShortScreen") monitor, I hated it. In real space, I gained a couple inches width, but I lost a lot off the height. It was like getting my monitor cut in half. I'm looking at the Dell 24" or a SOYO 26". I want to make sure that the height of the screen isn't less than what I have now, in actual inches, so that the 1200 I get will be the same as the 1200 I have now, and it will just be like adding an extra 320px to the side of my existing monitor. Most of the monitors I have looked at include the HxWxD, but it's for the whole thing, including sides, stand, etc. For the life of me, I can't seem to find an actual measure of screen height and width, other than diagonal, which could be anything, depending on the diagonal angle. Does anyone have experience with the Dell 24" 248WFP or the Soyo Pearl 26", or have any idea on a resource that would show how TALL the screen is? At this point, I'd be happy if someone could just measure their screen height with a ruler for me =o)
hardware
monitor
workspace
null
null
04/09/2012 16:21:53
off topic
Good Programming Monitor: Actual Display Dimensions vs Diagonal "Marketing" Size? === I am thinking about adding a third monitor to my coding station. I currently run 1600x1200 on a dell 20.1", which is ok, but I am thinking to move to something that will do 1920x1200. I'm doing the purchase on eBay, so can't really see the monitor beforehand. Last time I bought a "Widescreen" (I read "ShortScreen") monitor, I hated it. In real space, I gained a couple inches width, but I lost a lot off the height. It was like getting my monitor cut in half. I'm looking at the Dell 24" or a SOYO 26". I want to make sure that the height of the screen isn't less than what I have now, in actual inches, so that the 1200 I get will be the same as the 1200 I have now, and it will just be like adding an extra 320px to the side of my existing monitor. Most of the monitors I have looked at include the HxWxD, but it's for the whole thing, including sides, stand, etc. For the life of me, I can't seem to find an actual measure of screen height and width, other than diagonal, which could be anything, depending on the diagonal angle. Does anyone have experience with the Dell 24" 248WFP or the Soyo Pearl 26", or have any idea on a resource that would show how TALL the screen is? At this point, I'd be happy if someone could just measure their screen height with a ruler for me =o)
2
7,195,237
08/25/2011 18:15:44
871,202
07/31/2011 02:04:31
488
1
What desktop software uses C# .NET?
Question is pretty much in the title. I know Paint.NET uses C# but I can't think of any other major pieces of software that uses the language/framework. There are probably dozens of websites which use it, like stackoverflow itself, but are there any desktop applications which use it? I know you can use C#/XNA to make XBox games, but are any notable games actually made that way? A cursory Google search didn't bring up much, and i'm curious to see if there's anything major i should know about.
c#
.net
language
null
null
08/25/2011 18:18:34
not constructive
What desktop software uses C# .NET? === Question is pretty much in the title. I know Paint.NET uses C# but I can't think of any other major pieces of software that uses the language/framework. There are probably dozens of websites which use it, like stackoverflow itself, but are there any desktop applications which use it? I know you can use C#/XNA to make XBox games, but are any notable games actually made that way? A cursory Google search didn't bring up much, and i'm curious to see if there's anything major i should know about.
4
680,315
03/25/2009 05:19:56
82,380
03/25/2009 05:19:56
1
0
How to printing crystal report directly to network printer in Vb.net or C#.net in Windows Applications
I have written the following code as, Dim report As New ReportDocument report.PrintOptions.PrinterName = "\\network\printer" report.Load(CrystalReportName.rpt, OpenReportMethod.OpenReportByDefault) report.PrintToPrinter(1, False, 0, 0) when i am trying to run this code , it shows the error message as "Invalid Printer Specified". If i give the local printer name, it is working fine. But i can't able to print the crystal report directly to the network printer. Kind help needed. Thanks in advance. Sivakumar.P
c#
vb.net
null
null
null
null
open
How to printing crystal report directly to network printer in Vb.net or C#.net in Windows Applications === I have written the following code as, Dim report As New ReportDocument report.PrintOptions.PrinterName = "\\network\printer" report.Load(CrystalReportName.rpt, OpenReportMethod.OpenReportByDefault) report.PrintToPrinter(1, False, 0, 0) when i am trying to run this code , it shows the error message as "Invalid Printer Specified". If i give the local printer name, it is working fine. But i can't able to print the crystal report directly to the network printer. Kind help needed. Thanks in advance. Sivakumar.P
0
11,550,273
07/18/2012 20:59:57
584,141
01/21/2011 07:55:46
263
1
Where did this cool google framework go?
Recently I came across a new google web application development framework that was some kind of "middleman-jekyll-javascript-single-page-app-super-duper-framework". Thought I bookmarked it, but cannot find it anywhere. Not even on google an I do not remember the name anymore. It's been still in beta, not available yet, an the logo was an old fart with a monocular. It's not been angularjs or some gwt stuff. It was all about bootstrapping a js driven single (multipage) app quickly and provided lots of cool stuff like haml, sass, coffeescript, asset compression and so on. Since I am looking for it for hours now, SO is my last bet. Can anyone help please? It was a story on HN I think. Regards Felix
javascript
html5
frameworks
single-page-application
null
07/19/2012 04:32:54
too localized
Where did this cool google framework go? === Recently I came across a new google web application development framework that was some kind of "middleman-jekyll-javascript-single-page-app-super-duper-framework". Thought I bookmarked it, but cannot find it anywhere. Not even on google an I do not remember the name anymore. It's been still in beta, not available yet, an the logo was an old fart with a monocular. It's not been angularjs or some gwt stuff. It was all about bootstrapping a js driven single (multipage) app quickly and provided lots of cool stuff like haml, sass, coffeescript, asset compression and so on. Since I am looking for it for hours now, SO is my last bet. Can anyone help please? It was a story on HN I think. Regards Felix
3
10,959,406
06/09/2012 08:01:58
1,324,781
04/10/2012 18:15:52
12
0
is there any book which guides for developing application using zenstudio and mongodb?
I am searching for book, which guides developing application using **-Zendstudio(Zendframework)** **-Mongodb** Thanks,
mongodb
zend-studio
mongodb-php
null
null
06/10/2012 05:05:32
not constructive
is there any book which guides for developing application using zenstudio and mongodb? === I am searching for book, which guides developing application using **-Zendstudio(Zendframework)** **-Mongodb** Thanks,
4
10,196,047
04/17/2012 17:27:26
965,748
09/26/2011 19:46:40
30
2
PDF to txt conversion using OCR or text selection
I'd like to convert a PDF file into plain text in the same way as if a user would be copy pasting it piece by piece. The PDF file contains 2 columns of tables of fixed width having blue headers. I want to get an output like this for each table in the file: ABC;XYZ;Data1;Data2;Col1;Col2;Col3;Caption1;Val11;Val12;Val13;Caption1....... ![Boxes][1] [1]: http://i.stack.imgur.com/52Gl2.png Is there any software capable of that? Or will I have to write my own script?
pdf
ocr
bayesian
classifier
file-conversion
04/25/2012 11:47:55
not a real question
PDF to txt conversion using OCR or text selection === I'd like to convert a PDF file into plain text in the same way as if a user would be copy pasting it piece by piece. The PDF file contains 2 columns of tables of fixed width having blue headers. I want to get an output like this for each table in the file: ABC;XYZ;Data1;Data2;Col1;Col2;Col3;Caption1;Val11;Val12;Val13;Caption1....... ![Boxes][1] [1]: http://i.stack.imgur.com/52Gl2.png Is there any software capable of that? Or will I have to write my own script?
1
8,137,252
11/15/2011 13:43:34
50,776
01/02/2009 01:10:30
29,471
1,150
Would elasticsearch or RavenDB be better for fueling a statistics engine/random forest?
I've been looking at the following [NoSQL][1] databases for the next phase of my project: - [elasticsearch][2] - [RavenDB][3] elasticsearch positions itself as primarily serving advanced search scenarios while RavenDB positions itself as a document-oriented-database. Primarily, the document will be around videos. Each has a natural id. That will be the key of the document. Around that, I add other content in fields which will not necessarily be scalar or flat, as the information will come from a number of different sources with different structures. For example, there will be content from the video provider's Atom feeds, [blog posts][4] that have the video embedded in it, and other pieces of data from a [data warehouse project][5]. There is no set structure across all of the items (each of them will be very domain-specific, actually), the only thing that will relate them is the natural key of the video mentioned above. That said, once I have this information in one of the above solutions, I'll want to do a number of things with it: - Cull it to help populate variables in a [random forest][6] in order to make classifications about the videos - Provide general search on the videos (general free-text, not based on the results of the random forest) through a web-based front end (ASP.NET MVC if you must know) There are some requirements: - I will more than likely be in a ASP.NET shared web hosting environment. This means I'll have one machine, and won't have access to set up a service. Something embeddable will be *very* helpful. - The ASP.NET environment will be hosted in IIS, so the embeddable aspect will have to survive [app-domain recycling][7]. - I'll want to create new indexes based on the results of the statistical analysis which I can easily fascet which will help with the search on the site. - Support for autocomplete functionality (I know this isn't an "out-of-the box" request, but being able to get to that point is important). - Rich synonym support (there's a number of them in the type of videos I'm indexing content around) I'm also open to services, such as [Truffler][8], although I do have concerns about the cost (and in Truffler's case, a little concerned about latency between the data centers, because the requests will come from the web host on the West coast, or from a back-end process on the East coast). Additionally, I don't feel that *one* solution needs to fit *all* the requirements. I'm more than fine with having one serve one purpose and having another serve another purpose. Granted, [migrations suck][9], but migrating between these two document stores is a little easier (and I don't expect them to use the same document structure, necessarily). [1]: http://en.wikipedia.org/wiki/NoSQL [2]: http://www.elasticsearch.org/ [3]: http://ravendb.net/ [4]: http://dba.stackexchange.com/questions/7810/best-type-to-use-in-a-composite-key-when-one-of-the-values-varies-in-type [5]: http://chat.stackexchange.com/transcript/179?m=2425738#2425738 [6]: http://stats.stackexchange.com/questions/15076/determining-the-variables-when-training-a-classifying-with-a-random-forest [7]: http://stackoverflow.com/questions/37564/what-exactly-is-appdomain-recycling [8]: http://truffler.net/ [9]: http://ayende.com/blog/4468/that-no-sql-thing-document-database-migrations
.net
nosql
ravendb
elasticsearch
truffler
01/31/2012 16:03:34
not constructive
Would elasticsearch or RavenDB be better for fueling a statistics engine/random forest? === I've been looking at the following [NoSQL][1] databases for the next phase of my project: - [elasticsearch][2] - [RavenDB][3] elasticsearch positions itself as primarily serving advanced search scenarios while RavenDB positions itself as a document-oriented-database. Primarily, the document will be around videos. Each has a natural id. That will be the key of the document. Around that, I add other content in fields which will not necessarily be scalar or flat, as the information will come from a number of different sources with different structures. For example, there will be content from the video provider's Atom feeds, [blog posts][4] that have the video embedded in it, and other pieces of data from a [data warehouse project][5]. There is no set structure across all of the items (each of them will be very domain-specific, actually), the only thing that will relate them is the natural key of the video mentioned above. That said, once I have this information in one of the above solutions, I'll want to do a number of things with it: - Cull it to help populate variables in a [random forest][6] in order to make classifications about the videos - Provide general search on the videos (general free-text, not based on the results of the random forest) through a web-based front end (ASP.NET MVC if you must know) There are some requirements: - I will more than likely be in a ASP.NET shared web hosting environment. This means I'll have one machine, and won't have access to set up a service. Something embeddable will be *very* helpful. - The ASP.NET environment will be hosted in IIS, so the embeddable aspect will have to survive [app-domain recycling][7]. - I'll want to create new indexes based on the results of the statistical analysis which I can easily fascet which will help with the search on the site. - Support for autocomplete functionality (I know this isn't an "out-of-the box" request, but being able to get to that point is important). - Rich synonym support (there's a number of them in the type of videos I'm indexing content around) I'm also open to services, such as [Truffler][8], although I do have concerns about the cost (and in Truffler's case, a little concerned about latency between the data centers, because the requests will come from the web host on the West coast, or from a back-end process on the East coast). Additionally, I don't feel that *one* solution needs to fit *all* the requirements. I'm more than fine with having one serve one purpose and having another serve another purpose. Granted, [migrations suck][9], but migrating between these two document stores is a little easier (and I don't expect them to use the same document structure, necessarily). [1]: http://en.wikipedia.org/wiki/NoSQL [2]: http://www.elasticsearch.org/ [3]: http://ravendb.net/ [4]: http://dba.stackexchange.com/questions/7810/best-type-to-use-in-a-composite-key-when-one-of-the-values-varies-in-type [5]: http://chat.stackexchange.com/transcript/179?m=2425738#2425738 [6]: http://stats.stackexchange.com/questions/15076/determining-the-variables-when-training-a-classifying-with-a-random-forest [7]: http://stackoverflow.com/questions/37564/what-exactly-is-appdomain-recycling [8]: http://truffler.net/ [9]: http://ayende.com/blog/4468/that-no-sql-thing-document-database-migrations
4
8,763,661
01/06/2012 19:56:04
214,046
11/18/2009 19:51:57
68
7
Does anyone have an XML namespace for Salesforce's APEX?
I'm trying to use xmllint to reformat our VisualForce code. My command line is "xmllint --format --recover filename.page". Though the formatting (especially script sections) work out well, all the tags with apex inside them are modified to eliminate "apex." For instance, "apex:page" is replaced with "page.". Obviously, this makes the reformatting useless. While processing, xmllint complains about the namespace. In the example below I just use the namespace "ns." Notice how the output removes the "ns." tgagne@ubuntu:~/tmp$ xmllint --format --recover a.xml a.xml:1: namespace error : Namespace prefix ns on a is not defined <ns:a> ^ <?xml version="1.0"?> <a> </a>
xml
salesforce
visualforce
null
null
null
open
Does anyone have an XML namespace for Salesforce's APEX? === I'm trying to use xmllint to reformat our VisualForce code. My command line is "xmllint --format --recover filename.page". Though the formatting (especially script sections) work out well, all the tags with apex inside them are modified to eliminate "apex." For instance, "apex:page" is replaced with "page.". Obviously, this makes the reformatting useless. While processing, xmllint complains about the namespace. In the example below I just use the namespace "ns." Notice how the output removes the "ns." tgagne@ubuntu:~/tmp$ xmllint --format --recover a.xml a.xml:1: namespace error : Namespace prefix ns on a is not defined <ns:a> ^ <?xml version="1.0"?> <a> </a>
0
7,762,943
10/14/2011 04:12:11
50,385
12/31/2008 03:59:09
3,532
45
Why is '.' a hard link in Unix?
I've seen many explanations for why the link count for an empty directory in Unix based OSes is 2 instead of 1. They all say that it's because of the '.' directory, which every directory has pointing back to itself. I understand why having some concept of '.' is useful for specifying relative paths, but what is gained by implementing it at the filesystem level? Why not just have shells or the system calls that take paths know how to interpret it? That '..' is a real link makes much more sense to me -- the filesystem needs to store a pointer back to the parent directory in order to navigate to it. But I don't see why '.' being a real link is necessary. It also seems like it leads to an ugly special case in the implementation -- you would think you could only free the space used by inodes that have a link count less than 1, but if they're directories, you actually need to check for a link count less than 2. Why the inconsistency?
unix
filesystems
directory
relative-path
inode
10/14/2011 20:08:03
off topic
Why is '.' a hard link in Unix? === I've seen many explanations for why the link count for an empty directory in Unix based OSes is 2 instead of 1. They all say that it's because of the '.' directory, which every directory has pointing back to itself. I understand why having some concept of '.' is useful for specifying relative paths, but what is gained by implementing it at the filesystem level? Why not just have shells or the system calls that take paths know how to interpret it? That '..' is a real link makes much more sense to me -- the filesystem needs to store a pointer back to the parent directory in order to navigate to it. But I don't see why '.' being a real link is necessary. It also seems like it leads to an ugly special case in the implementation -- you would think you could only free the space used by inodes that have a link count less than 1, but if they're directories, you actually need to check for a link count less than 2. Why the inconsistency?
2
7,671,395
10/06/2011 07:36:33
861,264
07/25/2011 09:35:05
249
7
Where are some online "logic" games/"puzzles" that are solved with JavaScript, so I can see some examples?
I'd like to learn more about solving problems, like math problems with algorithms and Rubik's cubes and stuff, on the internet?
javascript
algorithm
resources
puzzle
online-resources
10/06/2011 07:44:38
not constructive
Where are some online "logic" games/"puzzles" that are solved with JavaScript, so I can see some examples? === I'd like to learn more about solving problems, like math problems with algorithms and Rubik's cubes and stuff, on the internet?
4
8,371,530
12/03/2011 22:25:50
299,216
03/22/2010 17:11:12
1,472
62
Return items from array sequentially on each function call, false when no more exist
I need to have a function that sort of acts like mysql resources sometimes do, where you have to "fetch" something as part of a loop until it returns false. I have something like: while ($variable = $object->method()) { // Do stuff with variable here } I'm trying to figure out how, on my object, to best keep track of what to send from the method. class object { $values = array(1, 2); public function method() { // First call should return 1, second should return 2, and any subsequent calls should return FALSE // Not sure now what to do // return $values[$i]; } }
php
null
null
null
null
null
open
Return items from array sequentially on each function call, false when no more exist === I need to have a function that sort of acts like mysql resources sometimes do, where you have to "fetch" something as part of a loop until it returns false. I have something like: while ($variable = $object->method()) { // Do stuff with variable here } I'm trying to figure out how, on my object, to best keep track of what to send from the method. class object { $values = array(1, 2); public function method() { // First call should return 1, second should return 2, and any subsequent calls should return FALSE // Not sure now what to do // return $values[$i]; } }
0
4,643,290
01/10/2011 02:44:09
569,305
01/10/2011 02:44:09
1
0
Problems with layout using <uses-sdk android:minSdkVersion - Android
I was publishing my first APP but i have a problem, I have tested my app with a lot of AVD then i tested with my phone(Galaxy S) and with my girlfriend phone (Galaxy 5) before publishing, when i tried to publish i received a msg to specify an API level requirement. then i put this code <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="7" /> then i tested in the AVD and i had no problem, but when i publish and tested in my Galaxy S, i encountered a crazy layout of my app, i do no why, so i go back to the Eclipse and tested direct to my galaxy S and get the same error, so i take this part of the code out and then tried again in my galaxy S and the layout is all OK, so i`m probably doing some thing wrong. Many Thanks Sorry my poor English i`m from Brazil.
android
apk
null
null
null
null
open
Problems with layout using <uses-sdk android:minSdkVersion - Android === I was publishing my first APP but i have a problem, I have tested my app with a lot of AVD then i tested with my phone(Galaxy S) and with my girlfriend phone (Galaxy 5) before publishing, when i tried to publish i received a msg to specify an API level requirement. then i put this code <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="7" /> then i tested in the AVD and i had no problem, but when i publish and tested in my Galaxy S, i encountered a crazy layout of my app, i do no why, so i go back to the Eclipse and tested direct to my galaxy S and get the same error, so i take this part of the code out and then tried again in my galaxy S and the layout is all OK, so i`m probably doing some thing wrong. Many Thanks Sorry my poor English i`m from Brazil.
0
8,790,542
01/09/2012 15:11:25
293,531
03/14/2010 19:30:43
353
15
OpenRasta, MonoRail, FubuMVC, ASP.NET MVC what to choose?
I need to start a new Webproject. Previously i worked with Webforms but i do not like it. I made some research but i am still unsure what to choose from OpenRasta, MonoRail, FubuMVC, ASP.NET MVC. Requierments: 1. Stable and fast 2. Support for Razor View Engine 3. Easy to get started, the Framework should get as little in my way as possible. 4. Avoid magic strings and dynamic objects. I have seen them in ASP.NET MVC.I know T4MVC but i seems a bit clunky and returned some errors after i played around a bit. a T4MVC like way of "strong typed actions/links" without the T4MVC generated code Magix would be awesome. 5. Some kind of easy to use AJAX support would be great but not nessecary. If you just know one of these Frameworks i would still be very happy if you let me know how it fits in my requierments (upvote included).
asp.net
asp.net-mvc
castle-monorail
openrasta
fubumvc
01/09/2012 15:39:40
not constructive
OpenRasta, MonoRail, FubuMVC, ASP.NET MVC what to choose? === I need to start a new Webproject. Previously i worked with Webforms but i do not like it. I made some research but i am still unsure what to choose from OpenRasta, MonoRail, FubuMVC, ASP.NET MVC. Requierments: 1. Stable and fast 2. Support for Razor View Engine 3. Easy to get started, the Framework should get as little in my way as possible. 4. Avoid magic strings and dynamic objects. I have seen them in ASP.NET MVC.I know T4MVC but i seems a bit clunky and returned some errors after i played around a bit. a T4MVC like way of "strong typed actions/links" without the T4MVC generated code Magix would be awesome. 5. Some kind of easy to use AJAX support would be great but not nessecary. If you just know one of these Frameworks i would still be very happy if you let me know how it fits in my requierments (upvote included).
4
922,432
05/28/2009 18:20:10
49,032
12/25/2008 10:13:53
590
36
Automatically switch between SVN branches of the same project
<p>How can developers set up their environment paths when working on different SVN branches of the same project so that they don't need to setup their paths each time they switch from one branch to another? </p> <p>I am a Python developer and I find myself working on different branches of the same project and it's pretty ugly to export each time PYTHONPATH when I am switching from one branch to another.</p> <p>That is if your IDE doesn't do this automatically for you (I am using vim).</p>
linux
svn
environment-variables
null
null
null
open
Automatically switch between SVN branches of the same project === <p>How can developers set up their environment paths when working on different SVN branches of the same project so that they don't need to setup their paths each time they switch from one branch to another? </p> <p>I am a Python developer and I find myself working on different branches of the same project and it's pretty ugly to export each time PYTHONPATH when I am switching from one branch to another.</p> <p>That is if your IDE doesn't do this automatically for you (I am using vim).</p>
0
7,164,554
08/23/2011 16:47:58
889,789
08/11/2011 11:21:23
3
0
Python Interactive Program
I recently came across a code implementing Artificial intelligence in Python. It is called Eliza. http://www-ai.ijs.si/eliza-cgi-bin/eliza_script (this one is not in python- just given the link for a reference without having to install Python ide) I am trying to code a virtual assistant like Eliza for my college website. I plan to also use it as a project in college I found that Eliza is a little dumb when it comes to returning answers. The queries i have are : 1) Can I make the bot slightly more intelligent? (I wish to make the bot answer commonly asked FAQ's as well as some questions which will require slight intelligence.ie when a student asks about the syllabus, it should return a question asking which course or which year he is studying in. 2) Can i make a live assistant who speaks by using python? Would this be a very difficult task(I am only an intermediate programmer) ? (http://sheepridge.pandorabots.com/pandora/talk?botid=dee0624a5e345abd) 3) can you give me details of the wrappers and libraries required and how they work ? Thank you for your help. If you are willing to help me with my project, please mention that too!
python
open-source
artificial-intelligence
project
bots
08/23/2011 20:00:26
not a real question
Python Interactive Program === I recently came across a code implementing Artificial intelligence in Python. It is called Eliza. http://www-ai.ijs.si/eliza-cgi-bin/eliza_script (this one is not in python- just given the link for a reference without having to install Python ide) I am trying to code a virtual assistant like Eliza for my college website. I plan to also use it as a project in college I found that Eliza is a little dumb when it comes to returning answers. The queries i have are : 1) Can I make the bot slightly more intelligent? (I wish to make the bot answer commonly asked FAQ's as well as some questions which will require slight intelligence.ie when a student asks about the syllabus, it should return a question asking which course or which year he is studying in. 2) Can i make a live assistant who speaks by using python? Would this be a very difficult task(I am only an intermediate programmer) ? (http://sheepridge.pandorabots.com/pandora/talk?botid=dee0624a5e345abd) 3) can you give me details of the wrappers and libraries required and how they work ? Thank you for your help. If you are willing to help me with my project, please mention that too!
1
4,909,556
02/05/2011 20:48:28
259,889
01/27/2010 08:55:26
531
38
In depth knowledge of Java
I have been coding in Java for 4 years. I also know HTML, JavaScript and SQL. But I feel I am not a master of Java. I wish to know in-and-out of Java. I wish to become a Java Guru. Please help me with some material or something. Thanks.
java
knowledge
guru
null
null
02/05/2011 20:51:42
off topic
In depth knowledge of Java === I have been coding in Java for 4 years. I also know HTML, JavaScript and SQL. But I feel I am not a master of Java. I wish to know in-and-out of Java. I wish to become a Java Guru. Please help me with some material or something. Thanks.
2
6,985,312
08/08/2011 16:31:14
585,795
01/22/2011 17:52:19
547
8
C# using regexp while working with strings
I have a string in this format "string1;string2;string3;...;stringn"<br> ; as a delimiter<br> I need to delete some string value of which I know, say valueForDelete<br> I use string.Split(';') method to find my value, delete it and then create a new string without deleted value.<br> I'm wondering is it possible to make this process easy with regex?
c#
regex
null
null
null
null
open
C# using regexp while working with strings === I have a string in this format "string1;string2;string3;...;stringn"<br> ; as a delimiter<br> I need to delete some string value of which I know, say valueForDelete<br> I use string.Split(';') method to find my value, delete it and then create a new string without deleted value.<br> I'm wondering is it possible to make this process easy with regex?
0
4,921,453
02/07/2011 12:47:36
525,206
11/30/2010 13:27:06
10
0
How to wrap the data in a label of a cell in iphone?
im passing huge data to a label of a cell.So i need to wrap the line.I tried the below methods ------- cell.textlabel.lineBreakMode = UILineBreakModeWordWrap; cell.textlabel.lineBreakMode =UILineBreakModeTailTruncation;By truncating the label also no use.In this way my problem didnt get solved.I want all the data to be displayed in the same font size also.If the label of a cell containg less data,the font size is different and if the label of a cell containing more data,the font size is small.Please help me out.....thanks in advance
iphone
objective-c
iphone-sdk-4.0
ios-simulator
null
null
open
How to wrap the data in a label of a cell in iphone? === im passing huge data to a label of a cell.So i need to wrap the line.I tried the below methods ------- cell.textlabel.lineBreakMode = UILineBreakModeWordWrap; cell.textlabel.lineBreakMode =UILineBreakModeTailTruncation;By truncating the label also no use.In this way my problem didnt get solved.I want all the data to be displayed in the same font size also.If the label of a cell containg less data,the font size is different and if the label of a cell containing more data,the font size is small.Please help me out.....thanks in advance
0
10,548,476
05/11/2012 09:03:44
979,099
10/04/2011 18:47:18
88
1
MySQL Query with multiple columns but exact matches?
I've got my table called Device_tbl which has the following columns: - Image - Manufacturer - Model An example of some of my Manufacturers are: - Sony Ericsson - HTC - Motorola An example of some of my Models are: - One X - One S - Xperia Arc - Xperia X10 - Xoom The issue I have is that I pass the combination of a Manufacturer and a Model into the query. For example: SELECT Image, Manufacturer, Model FROM Device_tbl WHERE Manufacturer LIKE 'Sony Ericsson Xperia Arc' OR Model LIKE 'Sony Ericsson Xperia Arc' As you can see, this would return nothing. What I am after is an it to return an EXACT match of only that result above, however if I searched for Son it'd return all results where Son exists in either Manufacturer or Model. Possible solution? ------------------ If its any help, I am using the JQuery Autocomplete function to generate the full names. These suggestions are generated from an array which combines the Manufacturer and Model. Not sure if there's a way to split it in the background so the search is more accurate? <?php mysql_select_db($database_database_connection, $database_connection); $query = "SELECT * FROM Device_tbl"; $result=mysql_query($query, $database_connection) or die(mysql_error()); $findrow = array(); while($row = mysql_fetch_assoc($result)){ $manufac = $row['Manufacturer']; $mod = $row['Model']; $string = $manufac.' '.$mod; $findrow[] = $string; } ?> <script type="text/javascript"> $(document).ready(function() { var availableTags = <?php echo json_encode($findrow);?>; $("#search_input").watermark("Begin Typing to Search"); $('#searchresultdata').append(sendSelected); $( "#search_input" ).autocomplete({ source: availableTags, select: function(event, ui) { sendSelected(ui.item.value); } }); function sendSelected(_val){ var search_input = _val; if (search_input =='') search_input ='*'; var dataString = 'keyword='+search_input; if (search_input.length > 2 || search_input=='*') { $.ajax({ type: "GET", url: "core/functions/searchdata.php", data: dataString, success: function(server_response) { $('#searchresultdata').empty(); $('#searchresultdata').append(server_response); $('span#category_title').html(search_input); } }); } } }); </script>
mysql
jquery-ui
null
null
null
null
open
MySQL Query with multiple columns but exact matches? === I've got my table called Device_tbl which has the following columns: - Image - Manufacturer - Model An example of some of my Manufacturers are: - Sony Ericsson - HTC - Motorola An example of some of my Models are: - One X - One S - Xperia Arc - Xperia X10 - Xoom The issue I have is that I pass the combination of a Manufacturer and a Model into the query. For example: SELECT Image, Manufacturer, Model FROM Device_tbl WHERE Manufacturer LIKE 'Sony Ericsson Xperia Arc' OR Model LIKE 'Sony Ericsson Xperia Arc' As you can see, this would return nothing. What I am after is an it to return an EXACT match of only that result above, however if I searched for Son it'd return all results where Son exists in either Manufacturer or Model. Possible solution? ------------------ If its any help, I am using the JQuery Autocomplete function to generate the full names. These suggestions are generated from an array which combines the Manufacturer and Model. Not sure if there's a way to split it in the background so the search is more accurate? <?php mysql_select_db($database_database_connection, $database_connection); $query = "SELECT * FROM Device_tbl"; $result=mysql_query($query, $database_connection) or die(mysql_error()); $findrow = array(); while($row = mysql_fetch_assoc($result)){ $manufac = $row['Manufacturer']; $mod = $row['Model']; $string = $manufac.' '.$mod; $findrow[] = $string; } ?> <script type="text/javascript"> $(document).ready(function() { var availableTags = <?php echo json_encode($findrow);?>; $("#search_input").watermark("Begin Typing to Search"); $('#searchresultdata').append(sendSelected); $( "#search_input" ).autocomplete({ source: availableTags, select: function(event, ui) { sendSelected(ui.item.value); } }); function sendSelected(_val){ var search_input = _val; if (search_input =='') search_input ='*'; var dataString = 'keyword='+search_input; if (search_input.length > 2 || search_input=='*') { $.ajax({ type: "GET", url: "core/functions/searchdata.php", data: dataString, success: function(server_response) { $('#searchresultdata').empty(); $('#searchresultdata').append(server_response); $('span#category_title').html(search_input); } }); } } }); </script>
0
7,696,373
10/08/2011 11:05:43
89,035
04/09/2009 11:46:52
2,752
80
Why is Xcode trying to access 'cs193p.dyndns.org'
Yesterday I installed Xcode 4.2 GM, today connected my iPhone (installed with iOS 5 GM) and clicked the "Use for Development" button in Organiser. I was them confronted with this dialogue. ![Xcode attempting to connect to the host cs193p.dyndns.org][1] The site [http://cs193p.dyndns.org][2] hosts some "Profiles", clicking on then download a profile and attempts to install it: ![Install profile][3] (I clicked cancel) This new System Preference then appears: ![System Preferences: Profiles][4] I have know idea what this is or even if I should trust it. [1]: http://i.stack.imgur.com/rrJHA.png [2]: http://cs193p.dyndns.org [3]: http://i.stack.imgur.com/oC9aK.png [4]: http://i.stack.imgur.com/mmlpM.png
security
xcode4
ios5
null
null
null
open
Why is Xcode trying to access 'cs193p.dyndns.org' === Yesterday I installed Xcode 4.2 GM, today connected my iPhone (installed with iOS 5 GM) and clicked the "Use for Development" button in Organiser. I was them confronted with this dialogue. ![Xcode attempting to connect to the host cs193p.dyndns.org][1] The site [http://cs193p.dyndns.org][2] hosts some "Profiles", clicking on then download a profile and attempts to install it: ![Install profile][3] (I clicked cancel) This new System Preference then appears: ![System Preferences: Profiles][4] I have know idea what this is or even if I should trust it. [1]: http://i.stack.imgur.com/rrJHA.png [2]: http://cs193p.dyndns.org [3]: http://i.stack.imgur.com/oC9aK.png [4]: http://i.stack.imgur.com/mmlpM.png
0
10,233,285
04/19/2012 17:15:13
993,970
10/13/2011 17:01:51
1
0
Sending video frames from OpenCV program to Samsung Andriod
Just wanted to know before I dive into this field. Is it possible to send video frames from an opencv program on windows to a Samsung android tab and visualize it there? Thanks in advance !
android
opencv
null
null
null
null
open
Sending video frames from OpenCV program to Samsung Andriod === Just wanted to know before I dive into this field. Is it possible to send video frames from an opencv program on windows to a Samsung android tab and visualize it there? Thanks in advance !
0
9,042,455
01/28/2012 02:32:03
511,179
11/17/2010 18:38:15
10
0
Should we use SharePoint for public document portal?
We are currently building a new public (extranet) client document portal. This should be system very similar to box.com where we can exchange documents with our clients. We will also allow the client to share documents with other users. Since we are relatively new to the SharePoint technology, we hired a vendor who persuaded us to use SharePoint technology for this product, and we’ve invested significant amount of money so far. System will have a SharePoint site for each client, around 12000 sites. Each site will have 3 document libraries. We will also create site for shared document users and a library in each of these shared user’s sites. In order to avoid item level security, we will have to either add all these users to each of the libraries in their respective client sites, or create site custom groups (we can’t use custom groups since Microsoft recommends only 10000 per site collection). Moreover, we will definitely have to use item level security for one of the libraries in which client users can upload documents and they are allowed to see only their uploaded documents. Considering that our system will be used only to exchange documents in the first phase, and possible collaboration features for the next phase (we haven’t defined collaboration yet), do we really need: -12000+ sites, -36000+ libraries, -complicated security model (more secure though), -extra reading/writing document to database (we are using BLOBs technology) but there is a lot of database reading/writing when you upload/download document -limitation of 250K sites per site collections -increased difficulty of creating web parts, event receivers, workflows, timer jobs, web templates, features and other custom code -more difficult way of updating UI (page layouts, web part zones, publishing templates) If we were going to do this in SP.NET we could have done it using few web forms, single database and file system for document storage. Is SharePoint right technology for this system? Can you please give me some Pros and Cons? Thanks,
asp.net
sharepoint
sharepoint2010
null
null
01/29/2012 06:03:26
off topic
Should we use SharePoint for public document portal? === We are currently building a new public (extranet) client document portal. This should be system very similar to box.com where we can exchange documents with our clients. We will also allow the client to share documents with other users. Since we are relatively new to the SharePoint technology, we hired a vendor who persuaded us to use SharePoint technology for this product, and we’ve invested significant amount of money so far. System will have a SharePoint site for each client, around 12000 sites. Each site will have 3 document libraries. We will also create site for shared document users and a library in each of these shared user’s sites. In order to avoid item level security, we will have to either add all these users to each of the libraries in their respective client sites, or create site custom groups (we can’t use custom groups since Microsoft recommends only 10000 per site collection). Moreover, we will definitely have to use item level security for one of the libraries in which client users can upload documents and they are allowed to see only their uploaded documents. Considering that our system will be used only to exchange documents in the first phase, and possible collaboration features for the next phase (we haven’t defined collaboration yet), do we really need: -12000+ sites, -36000+ libraries, -complicated security model (more secure though), -extra reading/writing document to database (we are using BLOBs technology) but there is a lot of database reading/writing when you upload/download document -limitation of 250K sites per site collections -increased difficulty of creating web parts, event receivers, workflows, timer jobs, web templates, features and other custom code -more difficult way of updating UI (page layouts, web part zones, publishing templates) If we were going to do this in SP.NET we could have done it using few web forms, single database and file system for document storage. Is SharePoint right technology for this system? Can you please give me some Pros and Cons? Thanks,
2
4,983,876
02/13/2011 11:34:03
247,482
01/10/2010 14:20:47
53
8
Why is (Ogg) Vorbis not automatically supported by Windows?
1. Vorbis was never threatened by MPEG LA, so it is undoubtedly completely patent free. (MPEG LA never misses a chance to spread patent FUD) 2. Windows supports mp3, so it isn’t because they want to push their crappy wma. 3. The GPL allows distribution alongside commercial products, and 4. Even if they fear to ship GPL software, they can still load it automatically, like they do with XviD So why can’t a windows customer not simply drop a ogg vorbis file into his/her music library and listen to it via WMP?
windows
ogg
law
patents
vorbis
02/13/2011 11:47:06
off topic
Why is (Ogg) Vorbis not automatically supported by Windows? === 1. Vorbis was never threatened by MPEG LA, so it is undoubtedly completely patent free. (MPEG LA never misses a chance to spread patent FUD) 2. Windows supports mp3, so it isn’t because they want to push their crappy wma. 3. The GPL allows distribution alongside commercial products, and 4. Even if they fear to ship GPL software, they can still load it automatically, like they do with XviD So why can’t a windows customer not simply drop a ogg vorbis file into his/her music library and listen to it via WMP?
2
8,051,260
11/08/2011 13:38:47
598,084
02/01/2011 08:23:38
87
6
what is the use of method overiding in java?
i got the meaning of overriding....but i want to know y we r overriding... what is use of overriding... In a class hierarchy, when a method in a subclass has the same name and type signature as a method in its super class, then the method in the subclass is said to override the method in the super class. When an overridden method is called from within a subclass, it will always refer to the version of that method defined by the subclass. ............................................................................................
java
null
null
null
null
11/08/2011 17:45:20
not constructive
what is the use of method overiding in java? === i got the meaning of overriding....but i want to know y we r overriding... what is use of overriding... In a class hierarchy, when a method in a subclass has the same name and type signature as a method in its super class, then the method in the subclass is said to override the method in the super class. When an overridden method is called from within a subclass, it will always refer to the version of that method defined by the subclass. ............................................................................................
4
11,484,457
07/14/2012 14:15:43
1,171,398
01/26/2012 14:03:46
80
7
TinyMCE posts plain text and not html tags
How can tinyMCE configured to post html with it. I am posting the text from the tinyMCE editor onto another page. The posted data shows plain text and not the html which was with the text message. Is it because some configuration has to be set to allow html tags in TinyMCE?
tinymce
null
null
null
null
null
open
TinyMCE posts plain text and not html tags === How can tinyMCE configured to post html with it. I am posting the text from the tinyMCE editor onto another page. The posted data shows plain text and not the html which was with the text message. Is it because some configuration has to be set to allow html tags in TinyMCE?
0
8,713,009
01/03/2012 13:29:37
1,127,683
01/03/2012 11:08:54
1
0
bathc file to name folder based on filename
I am new to the forum and even newer to bathc scripting! I have managed to copy and manipulate a batch script that does the following: - looks at the last 4 characters of a .csv file - creates a folder with this name - moves the file into the folder @echo off & setlocal EnableDelayedExpansion echo. pushd "%~dp0" for %%j in (*.csv) do ( set file=%%~nj set folder=!file:~-4! if !folder!==FI_2 set folder=!file:~-6! if not exist !folder! md !folder! move "%%~j" "!folder!" echo "%%~j" -^> "!folder!" ) popd echo.& echo.Done :: End_Of_Batch The problem I have is that I need to group the files by month. The file names look like this: BS_IDX_LEVEL_YYYYMMDD_BAFI.csv (obviously the YYYYMMDD will be replaced with the date of the file) So any file with the name BS_IDX_LEVEL_20111231_BAFI.csv would go into a folder named "1112" (date formate of folder is YYMM) A file with the name BS_IDX_LEVEL_20111115_BAFI.csv would go into a folder names "1111" Is there someway I can alter this script so that before organising the files by their filenames it groups them by date first? If I can explain anything further please let me know Thanks Chris
batch-file
null
null
null
null
null
open
bathc file to name folder based on filename === I am new to the forum and even newer to bathc scripting! I have managed to copy and manipulate a batch script that does the following: - looks at the last 4 characters of a .csv file - creates a folder with this name - moves the file into the folder @echo off & setlocal EnableDelayedExpansion echo. pushd "%~dp0" for %%j in (*.csv) do ( set file=%%~nj set folder=!file:~-4! if !folder!==FI_2 set folder=!file:~-6! if not exist !folder! md !folder! move "%%~j" "!folder!" echo "%%~j" -^> "!folder!" ) popd echo.& echo.Done :: End_Of_Batch The problem I have is that I need to group the files by month. The file names look like this: BS_IDX_LEVEL_YYYYMMDD_BAFI.csv (obviously the YYYYMMDD will be replaced with the date of the file) So any file with the name BS_IDX_LEVEL_20111231_BAFI.csv would go into a folder named "1112" (date formate of folder is YYMM) A file with the name BS_IDX_LEVEL_20111115_BAFI.csv would go into a folder names "1111" Is there someway I can alter this script so that before organising the files by their filenames it groups them by date first? If I can explain anything further please let me know Thanks Chris
0
5,490,636
03/30/2011 18:37:21
477,228
10/15/2010 17:23:17
392
9
Im getting no postback on my button? I have it tied to Javascript
Hey guys Im getting no postback on my button? I have it tied to Javascript like so: <script type="text/javascript"> function confirm_delete() { if (confirm("Are you sure you want to delete this comment?")==true) return true; else return false; } </script> <p> <asp:Button ID="btn" OnClientClick="if(confirm_delete()){/* post back*/}else{return false;};" OnClick="btnDelete_Click" runat="server" CssClass="Btn" Text="delete"/> But when I click ok on confirm no postback is initiated, its initiated if I click the button manually?
c#
javascript
jquery
asp.net
html
null
open
Im getting no postback on my button? I have it tied to Javascript === Hey guys Im getting no postback on my button? I have it tied to Javascript like so: <script type="text/javascript"> function confirm_delete() { if (confirm("Are you sure you want to delete this comment?")==true) return true; else return false; } </script> <p> <asp:Button ID="btn" OnClientClick="if(confirm_delete()){/* post back*/}else{return false;};" OnClick="btnDelete_Click" runat="server" CssClass="Btn" Text="delete"/> But when I click ok on confirm no postback is initiated, its initiated if I click the button manually?
0
9,213,623
02/09/2012 15:24:03
1,199,777
02/09/2012 13:40:11
1
0
Conversion from quarters into pennies.
I'm stuck on making a modulist on JS for the conversion from quarters into pennies, here is what I got so far. What am I missing? <html> <head> <title>Bicycle</title> <script type="text/javascript"> //Program: Problem 5 //Purpose: calculate the number of quarters a person will get in return when they enter the number of pennies they have //Author: Zach Salih //Date last modified: 2/9/12 var entrmoney = "" var totnum = "The total number of quarters needed is " var totcents = "left over" entrmoney = prompt("How much money do you want to turn into Quarters,enter in pennies?") document.write(totnum + + totcents) </script> </head> <body> </body> </html>
javascript
null
null
null
null
02/14/2012 04:23:10
not a real question
Conversion from quarters into pennies. === I'm stuck on making a modulist on JS for the conversion from quarters into pennies, here is what I got so far. What am I missing? <html> <head> <title>Bicycle</title> <script type="text/javascript"> //Program: Problem 5 //Purpose: calculate the number of quarters a person will get in return when they enter the number of pennies they have //Author: Zach Salih //Date last modified: 2/9/12 var entrmoney = "" var totnum = "The total number of quarters needed is " var totcents = "left over" entrmoney = prompt("How much money do you want to turn into Quarters,enter in pennies?") document.write(totnum + + totcents) </script> </head> <body> </body> </html>
1
4,848,281
01/31/2011 06:44:29
297,092
03/19/2010 04:56:07
139
6
Silverlight C# - ComponentOne Spellchecker not loading dictionary
This may be a long shot, but I'm using ComponentOne's Spellchecker control for Silverlight. I made a test project, added a plain textbox and a button to it, added the references to the C1.Silverlight and C1.Silverlight.SpellChecker bits, and added the dictionary file to my project. In the code, I called up the spellchecker on button1's click event and it worked SPLENDIDLY. The spellchecker dialog shows up, and works exactly as it should. Since that test was successful, I then tried to implement this into my existing project. I've had no success for absolutely NO reason that I can determine, since I used the EXACT SAME code. Here's the code I use to call the component: using C1.Silverlight; using C1.Silverlight.SpellChecker; using C1.Silverlight.Resources; public partial class MainPage : UserControl { C1SpellChecker spellChecker = new C1SpellChecker(); public MainPage() { InitializeComponent(); spellChecker.MainDictionary.LoadAsync("C1Spell_en-US.dct"); } private void btnSpelling_Click(object sender, RoutedEventArgs e) { var dlg = new C1SpellDialog(); spellChecker.CheckControlAsync(txtArticle, false, dlg); } The references to `C1.Silverlight` and `C1.Silverlight.Spellchecker` are added to this project as well, and the dictionary as been added in the same fashion as well. The issue seems to be that for whatever reason the dictionary is not loading, because the spellChecker.Enabled method returns whether or not the main dictionary has been loaded. If I call `MessageBox.Show("SpellChecker Enabled = " + spellChecker.Enabled.ToString());` it shows false, even though the call to load the dictionary is there (as you can see). **What would cause the dictionary to not load? Have I added it to my project incorrectly somehow?**
c#
silverlight
silverlight-4.0
reference
componentone
null
open
Silverlight C# - ComponentOne Spellchecker not loading dictionary === This may be a long shot, but I'm using ComponentOne's Spellchecker control for Silverlight. I made a test project, added a plain textbox and a button to it, added the references to the C1.Silverlight and C1.Silverlight.SpellChecker bits, and added the dictionary file to my project. In the code, I called up the spellchecker on button1's click event and it worked SPLENDIDLY. The spellchecker dialog shows up, and works exactly as it should. Since that test was successful, I then tried to implement this into my existing project. I've had no success for absolutely NO reason that I can determine, since I used the EXACT SAME code. Here's the code I use to call the component: using C1.Silverlight; using C1.Silverlight.SpellChecker; using C1.Silverlight.Resources; public partial class MainPage : UserControl { C1SpellChecker spellChecker = new C1SpellChecker(); public MainPage() { InitializeComponent(); spellChecker.MainDictionary.LoadAsync("C1Spell_en-US.dct"); } private void btnSpelling_Click(object sender, RoutedEventArgs e) { var dlg = new C1SpellDialog(); spellChecker.CheckControlAsync(txtArticle, false, dlg); } The references to `C1.Silverlight` and `C1.Silverlight.Spellchecker` are added to this project as well, and the dictionary as been added in the same fashion as well. The issue seems to be that for whatever reason the dictionary is not loading, because the spellChecker.Enabled method returns whether or not the main dictionary has been loaded. If I call `MessageBox.Show("SpellChecker Enabled = " + spellChecker.Enabled.ToString());` it shows false, even though the call to load the dictionary is there (as you can see). **What would cause the dictionary to not load? Have I added it to my project incorrectly somehow?**
0
5,611,960
04/10/2011 13:13:18
700,861
04/10/2011 13:13:18
1
0
MySQL Fulltext Search on Multi Tables
I have 2 tables: <pre> "product_info" table: id name price ========================== 1 LG Monitor $250 "product_detail_info" table: id product_info_id detail_title title_position content ======================================================================== 1 1 Features 2 bla bla bla 2 1 Specification 1 bla bla bla </pre> How can I link both 2 tables data together for searching in mysql fulltext search and have the result returned to be the name of the product on "product_info" table? Thanks.
php
mysql
full-text-search
search-engine
null
null
open
MySQL Fulltext Search on Multi Tables === I have 2 tables: <pre> "product_info" table: id name price ========================== 1 LG Monitor $250 "product_detail_info" table: id product_info_id detail_title title_position content ======================================================================== 1 1 Features 2 bla bla bla 2 1 Specification 1 bla bla bla </pre> How can I link both 2 tables data together for searching in mysql fulltext search and have the result returned to be the name of the product on "product_info" table? Thanks.
0
6,142,929
05/26/2011 17:52:18
579,689
01/18/2011 09:35:00
88
4
How to search for line that contain letter "foo" above the line.
In vim how to search for line that contain letter "foo" above the line. To meet the quality standards of the stack overflow i have to type these line otherwise my question is not accepted, probably the program which is validating is considering this is too short.
vim
null
null
null
null
null
open
How to search for line that contain letter "foo" above the line. === In vim how to search for line that contain letter "foo" above the line. To meet the quality standards of the stack overflow i have to type these line otherwise my question is not accepted, probably the program which is validating is considering this is too short.
0
10,375,331
04/29/2012 19:39:42
388,158
07/09/2010 21:56:16
1
0
Microsoft DirectX SDK installation fails with error code S1018
I'm trying to install Microsoft DirectX SDK (June 2010) downloaded from microsoft.com and I keep getting error S1018 all the time. Does anyone knows what it might be? I'm using Windows 7 Professional.
c++
sdk
microsoft
directx
null
04/30/2012 19:57:26
not a real question
Microsoft DirectX SDK installation fails with error code S1018 === I'm trying to install Microsoft DirectX SDK (June 2010) downloaded from microsoft.com and I keep getting error S1018 all the time. Does anyone knows what it might be? I'm using Windows 7 Professional.
1
10,508,762
05/09/2012 01:34:47
167,520
09/02/2009 21:45:49
749
2
vba of EXCEL calling VB.NET class through tlb...
Following code is not working. Dim c As AssemblyTemp.ClassTemp Set c = New AssemblyTemp.ClassTemp I know it's recognizing AssemblyTemp.tlb properly, because first line works. It fails only on second line - **System can't find the file specified.** Actually, it works at first. But of course, if I make a change to the dll and export tlb again to the location, it will stop working. It is not feasible to create new project with new name every time I have to make a small change to my dll.
vb.net
vba
vb
null
null
null
open
vba of EXCEL calling VB.NET class through tlb... === Following code is not working. Dim c As AssemblyTemp.ClassTemp Set c = New AssemblyTemp.ClassTemp I know it's recognizing AssemblyTemp.tlb properly, because first line works. It fails only on second line - **System can't find the file specified.** Actually, it works at first. But of course, if I make a change to the dll and export tlb again to the location, it will stop working. It is not feasible to create new project with new name every time I have to make a small change to my dll.
0
8,723,248
01/04/2012 07:09:51
1,070,892
11/29/2011 08:39:20
16
4
Key board hides textField when Orientation Changes?
I have two textfields in a subview as viewLogin. when try to enter text key board is hiding them. I solved that problem by moving the viewLogin. Code is... - (void)textFieldDidBeginEditing:(UITextField *)textField { UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) { viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/9, viewLogin.frame.size.width, viewLogin.frame.size.height); } else { viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height); } } - (void)textFieldDidEndEditing:(UITextField *)textField { UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) { viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/2.5, viewLogin.frame.size.width, viewLogin.frame.size.height); } else { viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height); } } Problem here i facing is if i first change the orientation to Landscape and click on textField its working fine but if i first click on textField in portrait mode and then changed to Landscape left/right its not working.. can some help me to solve this.... Thanks in advance
iphone
ipad
uitextfield
uiinterfaceorientation
orientation-changes
null
open
Key board hides textField when Orientation Changes? === I have two textfields in a subview as viewLogin. when try to enter text key board is hiding them. I solved that problem by moving the viewLogin. Code is... - (void)textFieldDidBeginEditing:(UITextField *)textField { UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) { viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/9, viewLogin.frame.size.width, viewLogin.frame.size.height); } else { viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height); } } - (void)textFieldDidEndEditing:(UITextField *)textField { UIDeviceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIDeviceOrientationLandscapeLeft || orientation == UIDeviceOrientationLandscapeRight) { viewLogin.frame = CGRectMake((1024-viewLogin.frame.size.width)/2, (768-viewLogin.frame.size.height)/2.5, viewLogin.frame.size.width, viewLogin.frame.size.height); } else { viewLogin.frame = CGRectMake((768-viewLogin.frame.size.width)/2, (1024-viewLogin.frame.size.height)/2, viewLogin.frame.size.width, viewLogin.frame.size.height); } } Problem here i facing is if i first change the orientation to Landscape and click on textField its working fine but if i first click on textField in portrait mode and then changed to Landscape left/right its not working.. can some help me to solve this.... Thanks in advance
0
10,128,461
04/12/2012 17:12:57
1,329,679
04/12/2012 16:39:54
1
0
ruby chess engine
this is my first post here, as i am brand new to stackoverflow. i have joined because these forums are always the most helpful when searching for answers to my ever-prevalent programming questions. now it is now time for me to ask my own question. well, i am requesting more than a simple answer to a simple question. i would like help/advice on my code. here's the backstory. last week, i decided to embark on the wonderful journey of writing a chess engine in ruby. (!) i have had no formal ruby education -- just picked it up over the past few years -- but i am proud of the progress so far. the first step (before any move generation, AI, search trees, etc.) is to get a solid board representation so the computer and i can effectively communicate the game state to one another. the board representation i am using here is of the 64-bitstring variety. (i implemented one using 0x88 board rep'n too, but that isn't here. from what i understand, having a several representations on hand in memory will be most useful to solve various number-crunching issues that will appear along the way. ) i am unsure of the etiquette on this type of thing, but here is my code (244 lines): #!/usr/bin/env ruby ################################################# =begin A game of chess can be played in the terminal! User(s) must know the rules because the program knows none. Moves must be entered as "initial_square-terminal_square", where the squares must be given in algebraic chess notation and any whitespace is ok in that entered string. The program checks if initial square contains a piece of your color and if the termnal square does not. There are no other restrictions on piece movement. No saving, loading, undoing, etc. Game runs in an infinite loop, so quit with Ctrl-C. =end ################################################# class Integer # out: String = standard chessboard coordinates (e.g., "D4") # in: Fixnum = coordinates on the 8x16 board in memory def to_square if (0..63).to_a.include?(self) then square = String.new square << ((self.to_i % 8) + "A".ord).chr square << ((self.to_i/8).floor + 1).to_s end return square end # out: move "1" from init to term position and change init position to "0" # in: two cells def move(initial_cell,terminal_cell) return self - 2**initial_cell + 2**terminal_cell end # out: change "1" from given cell position to "0" # in: cell def remove(cell) return self - 2**cell end # convert 64bitstring to array of cells def to_cells cells_array = Array.new 0.upto(63) do |i| cells_array << i if 2**i & self > 0 end return cells_array end end ################################################# class String # out: String = standard chessboard coordinates (e.g., "A3", "D4") # in: Fixnum = virtual cell location (e.g., 0,19,51,... ) def to_cell # check if in standard form return nil if self.length!= 2 rank = self[0].upcase file = self[1] cell = file.to_i*8 + (rank.ord - 65) - 8 return cell end end ################################################# class Game # setup the game. its attributes are the pieces in game, access white pawns with "<game_name>.whitePawns" attr_accessor :whitePawns, :whiteKnights, :whiteBishops, :whiteRooks, :whiteQueens, :whiteKing, :blackPawns, :blackKnights, :blackBishops, :blackRooks, :blackQueens, :blackKing, :whitePieces, :blackPieces, :whiteCastled, :blackCastled, :whitesMove # initialize game, i.e., define initial piece locations def initialize # assign white pieces' cells @whitePawns = 0b0000000000000000000000000000000000000000000000001111111100000000 @whiteKnights = 0b0000000000000000000000000000000000000000000000000000000001000010 @whiteBishops = 0b0000000000000000000000000000000000000000000000000000000000100100 @whiteRooks = 0b0000000000000000000000000000000000000000000000000000000010000001 @whiteQueens = 0b0000000000000000000000000000000000000000000000000000000000010000 @whiteKing = 0b0000000000000000000000000000000000000000000000000000000000001000 # assign black pieces' cells @blackPawns = 0b0000000011111111000000000000000000000000000000000000000000000000 @blackKnights = 0b0100001000000000000000000000000000000000000000000000000000000000 @blackBishops = 0b0010010000000000000000000000000000000000000000000000000000000000 @blackRooks = 0b1000000100000000000000000000000000000000000000000000000000000000 @blackQueens = 0b0001000000000000000000000000000000000000000000000000000000000000 @blackKing = 0b0000100000000000000000000000000000000000000000000000000000000000 # game control flags @whitesMove = true @whiteCastled = false @blackCastles = false end def board @board = Array.new 0.upto(63) do |i| @board[i] = nil end 0.upto(63) do |i| bit_compare = 2**i @board[i] = "P" if @whitePawns & bit_compare != 0 @board[i] = "N" if @whiteKnights & bit_compare != 0 @board[i] = "B" if @whiteBishops & bit_compare != 0 @board[i] = "R" if @whiteRooks & bit_compare != 0 @board[i] = "Q" if @whiteQueens & bit_compare != 0 @board[i] = "K" if @whiteKing & bit_compare != 0 @board[i] = "p" if @blackPawns & bit_compare != 0 @board[i] = "n" if @blackKnights & bit_compare != 0 @board[i] = "b" if @blackBishops & bit_compare != 0 @board[i] = "r" if @blackRooks & bit_compare != 0 @board[i] = "q" if @blackQueens & bit_compare != 0 @board[i] = "k" if @blackKing & bit_compare != 0 end return @board end # change: piece bitstrings according to move # in: String, String = squares to move from and to def make_move(initial_cell,terminal_cell) # find and alter captured piece's (if any) bitstring instance_variables.select{ |var| var =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |var| if opponentsPieces & 2**terminal_cell > 0 then instance_variables.select{ |var2| var2 =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |opp_var| if 2**terminal_cell & instance_variable_get(opp_var) > 0 instance_variable_set(opp_var,instance_variable_get(opp_var).remove(terminal_cell)) end end end end # find and alter moving piece's bitstring instance_variables.select{ |var| var =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |var| if 2**initial_cell & instance_variable_get(var) > 0 instance_variable_set(var,instance_variable_get(var).move(initial_cell,terminal_cell)) end end end # out; bitstring of white piece locations def whitePieces return @whitePawns | @whiteKnights | @whiteBishops | @whiteRooks | @whiteQueens | @whiteKing end # out; bitstring of black piece locations def blackPieces return @blackPawns | @blackKnights | @blackBishops | @blackRooks | @blackQueens | @blackKing end # out: bitstring of pieces belonging to the moving color def moversPieces case @whitesMove when true then return whitePieces when false then return blackPieces end end # out: bitstring of pieces belonging to not the moving color def opponentsPieces case @whitesMove when true then return blackPieces when false then return whitePieces end end # heyy, can i move a piece to this terminal cell? # out: Boolean = true if mover's play terminates in a cell not containing a friendly piece # in: Fixnum = terminal cell in 0..63 def legal_move?(terminal_cell) return 2**terminal_cell & movers_pieces == 0 end def save_state end # output current state or game board to terminal def display system('clear') puts # show board with pieces print "\t\tA\tB\tC\tD\tE\tF\tG\tH\n\n" print "\t +", " ----- +"*8,"\n\n" 8.downto(1) do |rank| print "\t#{rank} |\t" 'A'.upto('H') do |file| if board["#{file}#{rank}".to_cell] then piece = board["#{file}#{rank}".to_cell] else piece = " " end print "#{piece} |\t" end print "#{rank}\n\n\t +", " ----- +"*8,"\n\n" end print "\t\tA\tB\tC\tD\tE\tF\tG\tH" puts "\n\n" # show occupancy print " White occupancy: " puts whitePieces.to_cells.map{ |cell| cell.to_square}.join(", ") print " Black occupancy: " puts blackPieces.to_cells.map{ |cell| cell.to_square}.join(", ") puts # show whose move it is case @whitesMove when true puts " WHITE to move." when false puts " BLACK to move." end puts end def play until false do # show board display # request move initial_cell, terminal_cell = nil until !initial_cell.nil? & !terminal_cell.nil? do print " enter move : " # get move in D2-D4 format; break apart into array by "-" and remove any whitespace in each piece user_input = gets.strip.upcase.delete(' ') # if string entered is something like "A4-C5" or " a4 -C5 " etc if user_input =~ /[A-H][1-8]-[A-H][1-8]/ user_move = user_input.split("-").map { |cell| cell.strip } # if initial square contains one of your pieces & terminal square does not if ((2**user_move[0].to_cell & moversPieces) > 0) & ((2**user_move[1].to_cell & ~moversPieces) > 0) then initial_cell, terminal_cell = user_move[0].to_cell, user_move[1].to_cell end end end make_move(initial_cell,terminal_cell) @whitesMove = !@whitesMove end end end ################################################# ################################################# ################################################# game = Game.new game.play ################################################# #################### fin ######################## ################################################# all too often, we lose sight of efficiency upfront and it comes back to haunt us in the later stages of a program, causing many headaches. i would like to not have to uproot all my progress two weeks from now because of some foolish implementation i made today. if anyone can offer any advice on the beginnings of this chess engine, it would be so greatly appreciated. thanks and happy to be a member finally, matt
ruby
chess
null
null
null
04/12/2012 22:43:18
not a real question
ruby chess engine === this is my first post here, as i am brand new to stackoverflow. i have joined because these forums are always the most helpful when searching for answers to my ever-prevalent programming questions. now it is now time for me to ask my own question. well, i am requesting more than a simple answer to a simple question. i would like help/advice on my code. here's the backstory. last week, i decided to embark on the wonderful journey of writing a chess engine in ruby. (!) i have had no formal ruby education -- just picked it up over the past few years -- but i am proud of the progress so far. the first step (before any move generation, AI, search trees, etc.) is to get a solid board representation so the computer and i can effectively communicate the game state to one another. the board representation i am using here is of the 64-bitstring variety. (i implemented one using 0x88 board rep'n too, but that isn't here. from what i understand, having a several representations on hand in memory will be most useful to solve various number-crunching issues that will appear along the way. ) i am unsure of the etiquette on this type of thing, but here is my code (244 lines): #!/usr/bin/env ruby ################################################# =begin A game of chess can be played in the terminal! User(s) must know the rules because the program knows none. Moves must be entered as "initial_square-terminal_square", where the squares must be given in algebraic chess notation and any whitespace is ok in that entered string. The program checks if initial square contains a piece of your color and if the termnal square does not. There are no other restrictions on piece movement. No saving, loading, undoing, etc. Game runs in an infinite loop, so quit with Ctrl-C. =end ################################################# class Integer # out: String = standard chessboard coordinates (e.g., "D4") # in: Fixnum = coordinates on the 8x16 board in memory def to_square if (0..63).to_a.include?(self) then square = String.new square << ((self.to_i % 8) + "A".ord).chr square << ((self.to_i/8).floor + 1).to_s end return square end # out: move "1" from init to term position and change init position to "0" # in: two cells def move(initial_cell,terminal_cell) return self - 2**initial_cell + 2**terminal_cell end # out: change "1" from given cell position to "0" # in: cell def remove(cell) return self - 2**cell end # convert 64bitstring to array of cells def to_cells cells_array = Array.new 0.upto(63) do |i| cells_array << i if 2**i & self > 0 end return cells_array end end ################################################# class String # out: String = standard chessboard coordinates (e.g., "A3", "D4") # in: Fixnum = virtual cell location (e.g., 0,19,51,... ) def to_cell # check if in standard form return nil if self.length!= 2 rank = self[0].upcase file = self[1] cell = file.to_i*8 + (rank.ord - 65) - 8 return cell end end ################################################# class Game # setup the game. its attributes are the pieces in game, access white pawns with "<game_name>.whitePawns" attr_accessor :whitePawns, :whiteKnights, :whiteBishops, :whiteRooks, :whiteQueens, :whiteKing, :blackPawns, :blackKnights, :blackBishops, :blackRooks, :blackQueens, :blackKing, :whitePieces, :blackPieces, :whiteCastled, :blackCastled, :whitesMove # initialize game, i.e., define initial piece locations def initialize # assign white pieces' cells @whitePawns = 0b0000000000000000000000000000000000000000000000001111111100000000 @whiteKnights = 0b0000000000000000000000000000000000000000000000000000000001000010 @whiteBishops = 0b0000000000000000000000000000000000000000000000000000000000100100 @whiteRooks = 0b0000000000000000000000000000000000000000000000000000000010000001 @whiteQueens = 0b0000000000000000000000000000000000000000000000000000000000010000 @whiteKing = 0b0000000000000000000000000000000000000000000000000000000000001000 # assign black pieces' cells @blackPawns = 0b0000000011111111000000000000000000000000000000000000000000000000 @blackKnights = 0b0100001000000000000000000000000000000000000000000000000000000000 @blackBishops = 0b0010010000000000000000000000000000000000000000000000000000000000 @blackRooks = 0b1000000100000000000000000000000000000000000000000000000000000000 @blackQueens = 0b0001000000000000000000000000000000000000000000000000000000000000 @blackKing = 0b0000100000000000000000000000000000000000000000000000000000000000 # game control flags @whitesMove = true @whiteCastled = false @blackCastles = false end def board @board = Array.new 0.upto(63) do |i| @board[i] = nil end 0.upto(63) do |i| bit_compare = 2**i @board[i] = "P" if @whitePawns & bit_compare != 0 @board[i] = "N" if @whiteKnights & bit_compare != 0 @board[i] = "B" if @whiteBishops & bit_compare != 0 @board[i] = "R" if @whiteRooks & bit_compare != 0 @board[i] = "Q" if @whiteQueens & bit_compare != 0 @board[i] = "K" if @whiteKing & bit_compare != 0 @board[i] = "p" if @blackPawns & bit_compare != 0 @board[i] = "n" if @blackKnights & bit_compare != 0 @board[i] = "b" if @blackBishops & bit_compare != 0 @board[i] = "r" if @blackRooks & bit_compare != 0 @board[i] = "q" if @blackQueens & bit_compare != 0 @board[i] = "k" if @blackKing & bit_compare != 0 end return @board end # change: piece bitstrings according to move # in: String, String = squares to move from and to def make_move(initial_cell,terminal_cell) # find and alter captured piece's (if any) bitstring instance_variables.select{ |var| var =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |var| if opponentsPieces & 2**terminal_cell > 0 then instance_variables.select{ |var2| var2 =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |opp_var| if 2**terminal_cell & instance_variable_get(opp_var) > 0 instance_variable_set(opp_var,instance_variable_get(opp_var).remove(terminal_cell)) end end end end # find and alter moving piece's bitstring instance_variables.select{ |var| var =~ /Pawns|Knights|Bishops|Rooks|Queens|King/ }.each do |var| if 2**initial_cell & instance_variable_get(var) > 0 instance_variable_set(var,instance_variable_get(var).move(initial_cell,terminal_cell)) end end end # out; bitstring of white piece locations def whitePieces return @whitePawns | @whiteKnights | @whiteBishops | @whiteRooks | @whiteQueens | @whiteKing end # out; bitstring of black piece locations def blackPieces return @blackPawns | @blackKnights | @blackBishops | @blackRooks | @blackQueens | @blackKing end # out: bitstring of pieces belonging to the moving color def moversPieces case @whitesMove when true then return whitePieces when false then return blackPieces end end # out: bitstring of pieces belonging to not the moving color def opponentsPieces case @whitesMove when true then return blackPieces when false then return whitePieces end end # heyy, can i move a piece to this terminal cell? # out: Boolean = true if mover's play terminates in a cell not containing a friendly piece # in: Fixnum = terminal cell in 0..63 def legal_move?(terminal_cell) return 2**terminal_cell & movers_pieces == 0 end def save_state end # output current state or game board to terminal def display system('clear') puts # show board with pieces print "\t\tA\tB\tC\tD\tE\tF\tG\tH\n\n" print "\t +", " ----- +"*8,"\n\n" 8.downto(1) do |rank| print "\t#{rank} |\t" 'A'.upto('H') do |file| if board["#{file}#{rank}".to_cell] then piece = board["#{file}#{rank}".to_cell] else piece = " " end print "#{piece} |\t" end print "#{rank}\n\n\t +", " ----- +"*8,"\n\n" end print "\t\tA\tB\tC\tD\tE\tF\tG\tH" puts "\n\n" # show occupancy print " White occupancy: " puts whitePieces.to_cells.map{ |cell| cell.to_square}.join(", ") print " Black occupancy: " puts blackPieces.to_cells.map{ |cell| cell.to_square}.join(", ") puts # show whose move it is case @whitesMove when true puts " WHITE to move." when false puts " BLACK to move." end puts end def play until false do # show board display # request move initial_cell, terminal_cell = nil until !initial_cell.nil? & !terminal_cell.nil? do print " enter move : " # get move in D2-D4 format; break apart into array by "-" and remove any whitespace in each piece user_input = gets.strip.upcase.delete(' ') # if string entered is something like "A4-C5" or " a4 -C5 " etc if user_input =~ /[A-H][1-8]-[A-H][1-8]/ user_move = user_input.split("-").map { |cell| cell.strip } # if initial square contains one of your pieces & terminal square does not if ((2**user_move[0].to_cell & moversPieces) > 0) & ((2**user_move[1].to_cell & ~moversPieces) > 0) then initial_cell, terminal_cell = user_move[0].to_cell, user_move[1].to_cell end end end make_move(initial_cell,terminal_cell) @whitesMove = !@whitesMove end end end ################################################# ################################################# ################################################# game = Game.new game.play ################################################# #################### fin ######################## ################################################# all too often, we lose sight of efficiency upfront and it comes back to haunt us in the later stages of a program, causing many headaches. i would like to not have to uproot all my progress two weeks from now because of some foolish implementation i made today. if anyone can offer any advice on the beginnings of this chess engine, it would be so greatly appreciated. thanks and happy to be a member finally, matt
1
3,020,623
06/11/2010 06:29:28
303,477
03/28/2010 07:19:01
96
11
JQgrid : specific value from a selected row
how to get a value of a (hidden) column, from the selected row. that is, the cell value needs to be from the cell identied by colName, and the selected row (not using multi select). From the API i see the method getGridParam("selrow") for reading the row, may be able to combine with other methods.. but, any convenient method available? a code snippet would save lot of time... \ thanks.
jqgrid
null
null
null
null
null
open
JQgrid : specific value from a selected row === how to get a value of a (hidden) column, from the selected row. that is, the cell value needs to be from the cell identied by colName, and the selected row (not using multi select). From the API i see the method getGridParam("selrow") for reading the row, may be able to combine with other methods.. but, any convenient method available? a code snippet would save lot of time... \ thanks.
0
8,291,860
11/28/2011 05:29:48
425,964
08/20/2010 03:20:10
488
4
JavaScript QuickSort Objects
Assuming I have the following Javascript structure: [ { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/node-w.tar.gz" }, { "hash": "b1adffc1988b7339c7d4c59310fb3a64ce89e776a4924d492e819a08a7dce3fd", "path": "/Users/justin/test/level-1/level-1-1/music.mp3" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/level-1-1/node-z.tar.gz" }, { "hash": "2e456c8de66a4ab6cf929d52bd6928b2d0096a8116891ade3dde9588c5f6b3c2", "path": "/Users/justin/test/logo_large.psd" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/node-y.tar.gz" }, { "hash": "fce57d4407e847c4c13cb2867d3f00f2aed4b5c569385d04765abe2fcae726bb", "path": "/Users/justin/test/level-1/install.dmg" } ] This is just a basic example, in reality, its going to be thousands, even tens of thousands of objects long. I want to group the duplicates on `hash`, so basically sort by hash the fastest way possible, so quick sort. The result, then should look like: [ { "hash": "2e456c8de66a4ab6cf929d52bd6928b2d0096a8116891ade3dde9588c5f6b3c2", "path": "/Users/justin/test/logo_large.psd" }, { "hash": "b1adffc1988b7339c7d4c59310fb3a64ce89e776a4924d492e819a08a7dce3fd", "path": "/Users/justin/test/level-1/level-1-1/music.mp3" }, { "hash": "fce57d4407e847c4c13cb2867d3f00f2aed4b5c569385d04765abe2fcae726bb", "path": "/Users/justin/test/level-1/install.dmg" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/node-w.tar.gz" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/level-1-1/node-z.tar.gz" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/node-y.tar.gz" } ]
javascript
sorting
object
quicksort
null
null
open
JavaScript QuickSort Objects === Assuming I have the following Javascript structure: [ { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/node-w.tar.gz" }, { "hash": "b1adffc1988b7339c7d4c59310fb3a64ce89e776a4924d492e819a08a7dce3fd", "path": "/Users/justin/test/level-1/level-1-1/music.mp3" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/level-1-1/node-z.tar.gz" }, { "hash": "2e456c8de66a4ab6cf929d52bd6928b2d0096a8116891ade3dde9588c5f6b3c2", "path": "/Users/justin/test/logo_large.psd" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/node-y.tar.gz" }, { "hash": "fce57d4407e847c4c13cb2867d3f00f2aed4b5c569385d04765abe2fcae726bb", "path": "/Users/justin/test/level-1/install.dmg" } ] This is just a basic example, in reality, its going to be thousands, even tens of thousands of objects long. I want to group the duplicates on `hash`, so basically sort by hash the fastest way possible, so quick sort. The result, then should look like: [ { "hash": "2e456c8de66a4ab6cf929d52bd6928b2d0096a8116891ade3dde9588c5f6b3c2", "path": "/Users/justin/test/logo_large.psd" }, { "hash": "b1adffc1988b7339c7d4c59310fb3a64ce89e776a4924d492e819a08a7dce3fd", "path": "/Users/justin/test/level-1/level-1-1/music.mp3" }, { "hash": "fce57d4407e847c4c13cb2867d3f00f2aed4b5c569385d04765abe2fcae726bb", "path": "/Users/justin/test/level-1/install.dmg" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/node-w.tar.gz" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/level-1-1/node-z.tar.gz" }, { "hash": "fe5642d26d04cc7e7d47daa426da2a79e244bdcbae1594a12578f0d6fe03082e", "path": "/Users/justin/test/level-1/node-y.tar.gz" } ]
0