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
6,160,012
05/28/2011 06:15:12
69,152
02/20/2009 23:20:07
393
9
Rails params encoding with Passenger
I'm running an app (on Dreamhost) that works fine in the development environment, but does not work properly in production. I've tried eliminating every difference I could: using the same mysql instance, for example. The only thing I can see is that my query params seem to be encoded strangely. Here's how they look in the development instance: This search: GET "/individuals?utf8=%E2%9C%93&search%5Bfirstname_like%5D=&search%5Blastname_like%5D=jones&commit=Search" Produces these params: Parameters: {"utf8"=>"✓", "search"=>{"firstname_like"=>"", "lastname_like"=>"jones"}, "commit"=>"Search"} In the production instance: GET "/individuals/?utf8=%25E2%259C%2593&search%255Bfirstname_like%255D=&search%255Blastname_like%255D=jones&commit=Search" Produces these params: Parameters: {"commit"=>"Search", "search%5Bfirstname_like%5D"=>"", "utf8"=>"%E2%9C%93", "search%5Blastname_like%5D"=>"jones"} The query string seems to have an extra "25" in there. Any idea what gives?
ruby-on-rails
passenger
null
null
null
null
open
Rails params encoding with Passenger === I'm running an app (on Dreamhost) that works fine in the development environment, but does not work properly in production. I've tried eliminating every difference I could: using the same mysql instance, for example. The only thing I can see is that my query params seem to be encoded strangely. Here's how they look in the development instance: This search: GET "/individuals?utf8=%E2%9C%93&search%5Bfirstname_like%5D=&search%5Blastname_like%5D=jones&commit=Search" Produces these params: Parameters: {"utf8"=>"✓", "search"=>{"firstname_like"=>"", "lastname_like"=>"jones"}, "commit"=>"Search"} In the production instance: GET "/individuals/?utf8=%25E2%259C%2593&search%255Bfirstname_like%255D=&search%255Blastname_like%255D=jones&commit=Search" Produces these params: Parameters: {"commit"=>"Search", "search%5Bfirstname_like%5D"=>"", "utf8"=>"%E2%9C%93", "search%5Blastname_like%5D"=>"jones"} The query string seems to have an extra "25" in there. Any idea what gives?
0
3,483,044
08/14/2010 11:19:33
102,855
05/07/2009 12:19:36
64
5
is it possiable can defult sort in datagrid with itemRender label ?
We know already Datagrid defult sorting , when we click on header of dategrid then automatically sorting records well . But how can we sort within inline itemreander linkfield label in datagrid . In project defult sorting properly work in datagrid but linked field column only not sorting ? Is it any way to sort functionality? if u know please refer it .
flex
flash
datagrid
itemrenderer
null
null
open
is it possiable can defult sort in datagrid with itemRender label ? === We know already Datagrid defult sorting , when we click on header of dategrid then automatically sorting records well . But how can we sort within inline itemreander linkfield label in datagrid . In project defult sorting properly work in datagrid but linked field column only not sorting ? Is it any way to sort functionality? if u know please refer it .
0
4,955,635
02/10/2011 10:03:26
410,693
08/04/2010 11:16:53
96
1
Adding local jars in maven project
Can i have my Client jars(which can not be found on maven repository) directly in my project's resouces/lib
java
maven
repository
null
null
02/07/2012 19:07:10
not a real question
Adding local jars in maven project === Can i have my Client jars(which can not be found on maven repository) directly in my project's resouces/lib
1
10,814,488
05/30/2012 10:30:01
1,196,338
02/08/2012 04:59:10
86
6
Var_dump to string
i have a var_dump output from a curl post i want to parse this var_dump output to stinrg the var_dump output is like a:3:{s:6:"status";s:1:"1";s:3:"msg";s:32:"Transaction Fetched Successfully";s:19:"transaction_details";a:1:{i:100003105;a:9:{s:8:"mihpayid";s:7:"4169799";s:10:"request_id";N;s:12:"bank_ref_num";N;s:3:"amt";s:6:"349.00";s:4:"disc";s:4:"0.00";s:4:"mode";s:1:"-";s:7:"retries";i:0;s:6:"status";s:7:"pending";s:14:"unmappedstatus";s:9:"initiated";}}}
php
null
null
null
null
05/30/2012 10:53:42
not a real question
Var_dump to string === i have a var_dump output from a curl post i want to parse this var_dump output to stinrg the var_dump output is like a:3:{s:6:"status";s:1:"1";s:3:"msg";s:32:"Transaction Fetched Successfully";s:19:"transaction_details";a:1:{i:100003105;a:9:{s:8:"mihpayid";s:7:"4169799";s:10:"request_id";N;s:12:"bank_ref_num";N;s:3:"amt";s:6:"349.00";s:4:"disc";s:4:"0.00";s:4:"mode";s:1:"-";s:7:"retries";i:0;s:6:"status";s:7:"pending";s:14:"unmappedstatus";s:9:"initiated";}}}
1
9,925,225
03/29/2012 12:23:49
1,058,683
11/21/2011 21:58:55
39
1
how to use Tesco API or generic API for android for search?
I am very new to programming and I am wondering if there is tutorials for using basically an API for product search. I chose Tesco for now but I wonder if I can do the generic API for scanning all the barcodes and do the search? I have done the research and read the documentation but since my java also is not strong, it is hard for me...... Please kindly give me some good tutorials or working codes. Have a lovely day Regards Thet
android
api
amazon
null
null
07/12/2012 01:39:33
not a real question
how to use Tesco API or generic API for android for search? === I am very new to programming and I am wondering if there is tutorials for using basically an API for product search. I chose Tesco for now but I wonder if I can do the generic API for scanning all the barcodes and do the search? I have done the research and read the documentation but since my java also is not strong, it is hard for me...... Please kindly give me some good tutorials or working codes. Have a lovely day Regards Thet
1
10,698,854
05/22/2012 09:01:54
1,409,722
05/22/2012 08:36:46
1
0
Extract and sort numbers from filnames in python
I have a very basic question. I have files named like Dipole_E0=1.2625E-01.dat and I want to extract the 1.2625E-01 part and finally sort them by ascending order. How can this be done ? I tried first to plit the filename with .split() but it does not what I expect. Thanks for your help. Best Roland
python
numbers
extract
null
null
null
open
Extract and sort numbers from filnames in python === I have a very basic question. I have files named like Dipole_E0=1.2625E-01.dat and I want to extract the 1.2625E-01 part and finally sort them by ascending order. How can this be done ? I tried first to plit the filename with .split() but it does not what I expect. Thanks for your help. Best Roland
0
9,135,399
02/03/2012 21:00:16
1,032,707
11/06/2011 20:01:36
15
1
Change Text which contains symbols in a file using batch
Hi i am actually trying to replace a part of the string in a text file. If my old file contains this text 12345qwert91202030000000 i want to change '120203' to '120204' This is my code. setlocal enabledelayedexpansion if exist c:\myfile.txt (set b=c:\myfile.txt) ELSE GOTO LOGO for /f "tokens= 1" %%c in (%b%) do (set line=%%c) Set NEWdate=120204 ECHO %line:~0,11%%NEWDate%%line:~17,7% > %b% This works just fine. Now if my old file contains the following text 12345q&ert91202030000000 Note the symbol '&', my code doesnt work as it takes it as a code. Any suggestions ?
text
null
null
null
null
null
open
Change Text which contains symbols in a file using batch === Hi i am actually trying to replace a part of the string in a text file. If my old file contains this text 12345qwert91202030000000 i want to change '120203' to '120204' This is my code. setlocal enabledelayedexpansion if exist c:\myfile.txt (set b=c:\myfile.txt) ELSE GOTO LOGO for /f "tokens= 1" %%c in (%b%) do (set line=%%c) Set NEWdate=120204 ECHO %line:~0,11%%NEWDate%%line:~17,7% > %b% This works just fine. Now if my old file contains the following text 12345q&ert91202030000000 Note the symbol '&', my code doesnt work as it takes it as a code. Any suggestions ?
0
7,903,295
10/26/2011 13:29:01
389,823
07/12/2010 20:02:54
543
25
Urlencode large amount of text in .net 4 client C#
What's the best way to urlencode (escape) a large string (50k - 200k characters) in the .net 4 client profile? System.Net.Uri.EscapeDataString() is [limited to 32766 characters][1]. HttpUtility.UrlEncode is not available in .net 4 client. The encoded string is to be passed as the value of a parameter in an httprequest. (Also, is there a .net-4-client profile tag on SO?) [1]: http://msdn.microsoft.com/en-us/library/system.uri.escapedatastring.aspx
c#
.net-4.0
urlencode
null
null
null
open
Urlencode large amount of text in .net 4 client C# === What's the best way to urlencode (escape) a large string (50k - 200k characters) in the .net 4 client profile? System.Net.Uri.EscapeDataString() is [limited to 32766 characters][1]. HttpUtility.UrlEncode is not available in .net 4 client. The encoded string is to be passed as the value of a parameter in an httprequest. (Also, is there a .net-4-client profile tag on SO?) [1]: http://msdn.microsoft.com/en-us/library/system.uri.escapedatastring.aspx
0
9,941,225
03/30/2012 10:26:49
1,295,495
03/27/2012 12:25:22
1
0
JQuery QuickSand with Wordpress
I have a wordpress theme that i am loading posts and filtering it with Jquery Quicksand, so it loads 'all the posts' at first, and then you can click on the different categories and it fades into the filtered posts... HOWEVER.. I am stuck trying to figure out how to automatically have one of the filtered categories come up when you first go to the page, instead of the default 'all' posts. heres the page http://sedesignshosting.com/michael/ i got the active link i want to activate, but its still loading all the posts when you first get there, i have to click 'featured' to enable the filter
jquery
wordpress
quicksand
null
null
04/01/2012 04:39:59
too localized
JQuery QuickSand with Wordpress === I have a wordpress theme that i am loading posts and filtering it with Jquery Quicksand, so it loads 'all the posts' at first, and then you can click on the different categories and it fades into the filtered posts... HOWEVER.. I am stuck trying to figure out how to automatically have one of the filtered categories come up when you first go to the page, instead of the default 'all' posts. heres the page http://sedesignshosting.com/michael/ i got the active link i want to activate, but its still loading all the posts when you first get there, i have to click 'featured' to enable the filter
3
1,214,831
07/31/2009 20:49:50
57,148
01/20/2009 15:35:44
81
7
Even more lost than before - stumped with a PHP loop
Okay, so I followed the advice on this question- http://stackoverflow.com/questions/1214176/stumped-in-the-middle-of-a-php-loop But now, I'm having even more problems than before. Here's what I have so far- $sql = "SELECT section_name, category_name, result_level, url, winner FROM 2009_RKR_bestof INNER JOIN categories ON 2009_RKR_bestof.category = categories.category_id INNER JOIN sections ON 2009_RKR_bestof.section = sections.section_id ORDER BY section_name,category_name ASC"; $query = mysql_query($sql); $current_section = ""; while ($stuff = mysql_fetch_array($query)) { if ($current_section == "") { $current_section = $stuff["section_name"]; echo "<h3>$current_section</h3>"; echo "<h4>$stuff[category_name]</h4>"; } if ($current_section == $stuff["section_name"]) { //what the heck do i do here? } elseif ($current_section != $stuff["section_name"]) { $current_section = $stuff["section_name"]; echo "<h3>$current_section</h3>"; } } And my output is here- http://www.theroanoker.com/bestof/index1.php By my old code, I had gotten this far- http://www.theroanoker.com/bestof/index2.php I'm beating my head against the wall. Can someone guide me a bit more?
while-loops
arrays
php
null
null
01/26/2012 22:39:01
not a real question
Even more lost than before - stumped with a PHP loop === Okay, so I followed the advice on this question- http://stackoverflow.com/questions/1214176/stumped-in-the-middle-of-a-php-loop But now, I'm having even more problems than before. Here's what I have so far- $sql = "SELECT section_name, category_name, result_level, url, winner FROM 2009_RKR_bestof INNER JOIN categories ON 2009_RKR_bestof.category = categories.category_id INNER JOIN sections ON 2009_RKR_bestof.section = sections.section_id ORDER BY section_name,category_name ASC"; $query = mysql_query($sql); $current_section = ""; while ($stuff = mysql_fetch_array($query)) { if ($current_section == "") { $current_section = $stuff["section_name"]; echo "<h3>$current_section</h3>"; echo "<h4>$stuff[category_name]</h4>"; } if ($current_section == $stuff["section_name"]) { //what the heck do i do here? } elseif ($current_section != $stuff["section_name"]) { $current_section = $stuff["section_name"]; echo "<h3>$current_section</h3>"; } } And my output is here- http://www.theroanoker.com/bestof/index1.php By my old code, I had gotten this far- http://www.theroanoker.com/bestof/index2.php I'm beating my head against the wall. Can someone guide me a bit more?
1
11,388,770
07/09/2012 03:28:10
829,771
07/01/2011 22:54:28
62
3
A server response written in node/express/mongodb: does this look right?
This is my very very very first attempt to write anything meaningful in node. The client side is a simple form that has login, workspace, and simply saves them onto the database. It would have been a 5-liner in PHP! My question really is: does this code look sane/good? I am trying to avoid using async.js for now, just because I want to get my hands dirty a little to start with. A few notes: * I want to check if workspace and user names are taken first, but I want to check for BOTH in case they are taken * There is still a slight race condition here: what two users submit different usernames and same workspace names at the same time? OK it's unlikely, but one of them will end up failing (one of them will be workspace-less). How would you address it? Simply deleting the user just created? Or...? * There is a lot of indentation here. I know that it's a known issue with node... I cannot really use "return" as a trick to interrupt execution, because it's often used in an anonymous function context. So... * I sometimes go next("Bad error here"). I plan on writing an error handler in Connect to handle these (I will probably log things onto the database). Here we go... // Helper function. The javascript on the other side calls this with Ajax, and expects // a hash with "response" (can be OK or ERRORS) and a "errors" vector var serverResponse = function(res, errors){ if(errors.length){ res.json( { response: 'ERRORS', errors: errors } , 200) console.log("Sent ERROR"); } else { res.json( { response: 'OK' } , 200) console.log("Sent OK"); } } // The actual call exports.nonApiRegister = function(req, res, next){ // ***** UNINDENTED ON PURPOSE: artificial delay setTimeout(function(){ // ***** var errors = []; var Workspace = mongoose.model("Workspace"); var User = mongoose.model("User"); User.findOne( { login: req.body.login}, function(err, docs){ // Log database error if it's there if(err){ next("Database error fetching user"); // TODO: add error handler } else { // If the user exists, add it to the error vector BUT keep going if(docs){ errors.push({ field:'login', message: 'Login name taken, sorry!' } ); } Workspace.findOne({ name: req.body.workspace }, function(err, docs){ if(err){ next("Database error fetching workspace"); } else { if(docs){ errors.push( {field: "workspace", message: "Workspace taken, sorry!"} ); } if(errors.length != 0){ serverResponse(res, errors); } else { // // AT THIS POINT, UNLESS SOMETHING JUMPS ON US, both user and workspace are available // // User doesn't exist: create it var u = new User(); u.login = req.body.login; u.password = req.body.password[0]; u.workspaceIds = []; u.save( function(err) { if(err){ next("Database error saving user"); } else { var w = new Workspace(); w.name = req.body.workspace; w.activeFlag = true; w.ownerUserId = u._id; w.countryId = null; w.save( function(err){ if(err){ next("Database error saving workspace. WATCH OUT: user " + u.login + " doesn't have a workspace!"); } else{ serverResponse(res, errors); } }) } }) } } }) } }); // } , 500); // Artificial timeout // }
javascript
node.js
mongodb
asynchronous
express
07/09/2012 18:14:25
off topic
A server response written in node/express/mongodb: does this look right? === This is my very very very first attempt to write anything meaningful in node. The client side is a simple form that has login, workspace, and simply saves them onto the database. It would have been a 5-liner in PHP! My question really is: does this code look sane/good? I am trying to avoid using async.js for now, just because I want to get my hands dirty a little to start with. A few notes: * I want to check if workspace and user names are taken first, but I want to check for BOTH in case they are taken * There is still a slight race condition here: what two users submit different usernames and same workspace names at the same time? OK it's unlikely, but one of them will end up failing (one of them will be workspace-less). How would you address it? Simply deleting the user just created? Or...? * There is a lot of indentation here. I know that it's a known issue with node... I cannot really use "return" as a trick to interrupt execution, because it's often used in an anonymous function context. So... * I sometimes go next("Bad error here"). I plan on writing an error handler in Connect to handle these (I will probably log things onto the database). Here we go... // Helper function. The javascript on the other side calls this with Ajax, and expects // a hash with "response" (can be OK or ERRORS) and a "errors" vector var serverResponse = function(res, errors){ if(errors.length){ res.json( { response: 'ERRORS', errors: errors } , 200) console.log("Sent ERROR"); } else { res.json( { response: 'OK' } , 200) console.log("Sent OK"); } } // The actual call exports.nonApiRegister = function(req, res, next){ // ***** UNINDENTED ON PURPOSE: artificial delay setTimeout(function(){ // ***** var errors = []; var Workspace = mongoose.model("Workspace"); var User = mongoose.model("User"); User.findOne( { login: req.body.login}, function(err, docs){ // Log database error if it's there if(err){ next("Database error fetching user"); // TODO: add error handler } else { // If the user exists, add it to the error vector BUT keep going if(docs){ errors.push({ field:'login', message: 'Login name taken, sorry!' } ); } Workspace.findOne({ name: req.body.workspace }, function(err, docs){ if(err){ next("Database error fetching workspace"); } else { if(docs){ errors.push( {field: "workspace", message: "Workspace taken, sorry!"} ); } if(errors.length != 0){ serverResponse(res, errors); } else { // // AT THIS POINT, UNLESS SOMETHING JUMPS ON US, both user and workspace are available // // User doesn't exist: create it var u = new User(); u.login = req.body.login; u.password = req.body.password[0]; u.workspaceIds = []; u.save( function(err) { if(err){ next("Database error saving user"); } else { var w = new Workspace(); w.name = req.body.workspace; w.activeFlag = true; w.ownerUserId = u._id; w.countryId = null; w.save( function(err){ if(err){ next("Database error saving workspace. WATCH OUT: user " + u.login + " doesn't have a workspace!"); } else{ serverResponse(res, errors); } }) } }) } } }) } }); // } , 500); // Artificial timeout // }
2
10,672,766
05/20/2012 10:49:31
1,405,062
05/19/2012 12:19:54
3
0
Mysql row always = 1
Hello i am trying to check to see if there is a row in the db but for some resson it keeps saying there is but is not. I have loads of if staments in side one so i think that is the problem. <?php if (isset($_POST['A'])) { $item2= mysql_real_escape_string($_POST['A']); $item = strip_tags($item2); $pokemonchoice= mysql_real_escape_string($_POST['B']); $pokemonchoicee = strip_tags($pokemonchoice); ?><?php if ( $pokemonchoicee == "Add to pokemon 1" ) { $pokemonchoicee = '1'; } if ( $pokemonchoicee == "Add to pokemon 2" ) { $pokemonchoicee = '2'; } if ( $pokemonchoicee == "Add to pokemon 3" ) { $pokemonchoicee = '3'; } if ( $pokemonchoicee == "Add to pokemon 4" ) { $pokemonchoicee = '4'; } if ( $pokemonchoicee == "Add to pokemon 5" ) { $pokemonchoicee = '5'; } if ( $pokemonchoicee == "Add to pokemon 6" ) { $pokemonchoicee = '6'; } ?> <?php $query = "SELECT * FROM items WHERE item='".$item."' AND belongsto='".$_SESSION['username']."'"; if(mysql_num_rows($query)!=0) { echo "You do not have this item"; } else { echo "You have this item"; } ?> <?php echo $pokemonchoicee ; echo $item ; } ?> The bit which keeps printing true is <?php $query = "SELECT * FROM items WHERE item='".$item."' AND belongsto='".$_SESSION['username']."'"; if(mysql_num_rows($query)!=0) { echo "You do not have this item"; } else { echo "You have this item"; } ?> I remove all rows but still says You have this item
php
mysql
sql
php5
null
05/21/2012 19:40:36
too localized
Mysql row always = 1 === Hello i am trying to check to see if there is a row in the db but for some resson it keeps saying there is but is not. I have loads of if staments in side one so i think that is the problem. <?php if (isset($_POST['A'])) { $item2= mysql_real_escape_string($_POST['A']); $item = strip_tags($item2); $pokemonchoice= mysql_real_escape_string($_POST['B']); $pokemonchoicee = strip_tags($pokemonchoice); ?><?php if ( $pokemonchoicee == "Add to pokemon 1" ) { $pokemonchoicee = '1'; } if ( $pokemonchoicee == "Add to pokemon 2" ) { $pokemonchoicee = '2'; } if ( $pokemonchoicee == "Add to pokemon 3" ) { $pokemonchoicee = '3'; } if ( $pokemonchoicee == "Add to pokemon 4" ) { $pokemonchoicee = '4'; } if ( $pokemonchoicee == "Add to pokemon 5" ) { $pokemonchoicee = '5'; } if ( $pokemonchoicee == "Add to pokemon 6" ) { $pokemonchoicee = '6'; } ?> <?php $query = "SELECT * FROM items WHERE item='".$item."' AND belongsto='".$_SESSION['username']."'"; if(mysql_num_rows($query)!=0) { echo "You do not have this item"; } else { echo "You have this item"; } ?> <?php echo $pokemonchoicee ; echo $item ; } ?> The bit which keeps printing true is <?php $query = "SELECT * FROM items WHERE item='".$item."' AND belongsto='".$_SESSION['username']."'"; if(mysql_num_rows($query)!=0) { echo "You do not have this item"; } else { echo "You have this item"; } ?> I remove all rows but still says You have this item
3
8,737,567
01/05/2012 04:16:25
959,654
09/22/2011 17:11:04
127
6
Why a https URL isn't blocked
I happened to notice this a lot and now I'm at the brink of my curiousity. If domains are blocked, how is that one can access say for example `https://facebook.com` while it's not possible to access `http://facebook.com` ? Thanks in advance.
http
url
https
null
null
01/05/2012 14:52:53
off topic
Why a https URL isn't blocked === I happened to notice this a lot and now I'm at the brink of my curiousity. If domains are blocked, how is that one can access say for example `https://facebook.com` while it's not possible to access `http://facebook.com` ? Thanks in advance.
2
8,198,768
11/20/2011 01:31:25
284,628
03/02/2010 17:46:54
1,261
15
Are there any modern Windows PCs that don't have at least one DirectShow capture device in them?
I am considering doing something that might seem strange to get a *reliable time clock*. I have to push buffers to a WiFi connected audio output device that does not do buffering or audio timestamp arbitration on its own. If I don't send the buffers at regular periodic intervals that would match reasonably the timing of a hardware sampler device, the playback becomes corrupted and starts to stutter. I looked at the usual suspects for doing high resolution timing first before considering the "hack" I describe below. QueryPerformanceCounter looked good until I read about buggy hardware implementations in the Harddware Abstraction Layer and the complexities of variable CPU speed stepping ruining the QPC calculations. Also, the Windows multimedia timer is only accurate to 1 millisecond making its use at high sampling rates like 44.1 kHz dubious. That's why I am considering the following: http://stackoverflow.com/questions/644510/cpu-clock-frequency-and-thus-queryperformancecounter-wrong As far as I know every Windows PC currently made has at least hardware support for a microphone. What I am considering doing is "piggybacking" on an existing capture device's clock. I have a DirectShow push source filter that is the true source of the audio to be sent to the WiFi audio output device. I will force the Capture Filter's sample rate to match the push source filter. Then, I will use a semaphore to lock the push source filter's FillBuffer() call until the Capture Filter's FillBuffer() call produces a buffer, thereby *riding* the Capture Filter's buffer timing. Can I count on a user's PC having at least one Capture Device? Also, any comments about the overall strategy are appreciated.
directshow
capture
performancecounter
sampling
null
11/22/2011 06:41:07
not constructive
Are there any modern Windows PCs that don't have at least one DirectShow capture device in them? === I am considering doing something that might seem strange to get a *reliable time clock*. I have to push buffers to a WiFi connected audio output device that does not do buffering or audio timestamp arbitration on its own. If I don't send the buffers at regular periodic intervals that would match reasonably the timing of a hardware sampler device, the playback becomes corrupted and starts to stutter. I looked at the usual suspects for doing high resolution timing first before considering the "hack" I describe below. QueryPerformanceCounter looked good until I read about buggy hardware implementations in the Harddware Abstraction Layer and the complexities of variable CPU speed stepping ruining the QPC calculations. Also, the Windows multimedia timer is only accurate to 1 millisecond making its use at high sampling rates like 44.1 kHz dubious. That's why I am considering the following: http://stackoverflow.com/questions/644510/cpu-clock-frequency-and-thus-queryperformancecounter-wrong As far as I know every Windows PC currently made has at least hardware support for a microphone. What I am considering doing is "piggybacking" on an existing capture device's clock. I have a DirectShow push source filter that is the true source of the audio to be sent to the WiFi audio output device. I will force the Capture Filter's sample rate to match the push source filter. Then, I will use a semaphore to lock the push source filter's FillBuffer() call until the Capture Filter's FillBuffer() call produces a buffer, thereby *riding* the Capture Filter's buffer timing. Can I count on a user's PC having at least one Capture Device? Also, any comments about the overall strategy are appreciated.
4
3,961,075
10/18/2010 16:15:53
479,510
10/18/2010 16:15:53
1
0
Creating a subscription based business model
are there any programs that allow you to determeine the amount of subscriptons needed to show a profitable business model? (The question is asked because I am trying to create a business that will be based on subscrptions.)
data
base
subscription
null
null
10/18/2010 21:29:49
off topic
Creating a subscription based business model === are there any programs that allow you to determeine the amount of subscriptons needed to show a profitable business model? (The question is asked because I am trying to create a business that will be based on subscrptions.)
2
5,958,194
05/11/2011 01:19:17
538,610
08/12/2010 18:04:03
81
0
Difference between 12Log2 and Log[2,12]?
My math is pretty weak, and I'm having confusion over the differences. I'm trying to find out the midi formula, to output frequency when I have midi value MidiNumber = 69+12* Log2(440/Frequency) So I derived Frequency = (-69 + 5280 Log2 + MidiNumber)/(12 Log2) If I plugin things this works correctly 440 = (-69 + 5280 Log2 + 69)/(12 Log2) If I do this though things do not work correctly (-69 + Log[2, 5280.] + 69)/Log[2, 12.] This is the output I get in my programming, I don't know exactly the difference between the two equations. Maybe it's 12*Log2, but is that 12*Log2[1] or, ...? No idea.
mathematica
null
null
null
null
null
open
Difference between 12Log2 and Log[2,12]? === My math is pretty weak, and I'm having confusion over the differences. I'm trying to find out the midi formula, to output frequency when I have midi value MidiNumber = 69+12* Log2(440/Frequency) So I derived Frequency = (-69 + 5280 Log2 + MidiNumber)/(12 Log2) If I plugin things this works correctly 440 = (-69 + 5280 Log2 + 69)/(12 Log2) If I do this though things do not work correctly (-69 + Log[2, 5280.] + 69)/Log[2, 12.] This is the output I get in my programming, I don't know exactly the difference between the two equations. Maybe it's 12*Log2, but is that 12*Log2[1] or, ...? No idea.
0
3,087,863
06/21/2010 19:33:40
87,302
04/05/2009 15:18:29
257
17
Webservice to apply XSLT to response before sending?
I have a basic asp.net webservice that returns a simple response. To make it [ucore][1] compliant I need to apply an XSLT. Is there a way to apply an XSLT to my response? I'm aware the receiver can apply it on their end, but in this scenario I need to apply it on my end. Thanks! [1]: https://ucore.gov/ucore/node/11
web-services
xslt
null
null
null
null
open
Webservice to apply XSLT to response before sending? === I have a basic asp.net webservice that returns a simple response. To make it [ucore][1] compliant I need to apply an XSLT. Is there a way to apply an XSLT to my response? I'm aware the receiver can apply it on their end, but in this scenario I need to apply it on my end. Thanks! [1]: https://ucore.gov/ucore/node/11
0
4,309,670
11/30/2010 01:08:33
496,949
11/04/2010 08:45:00
1,212
1
how to debug the code which is hang
I have a multithreaded code which is hang in some case. I want to know what's the recommended way to debug?
c#
.net
null
null
null
12/02/2010 01:20:24
not a real question
how to debug the code which is hang === I have a multithreaded code which is hang in some case. I want to know what's the recommended way to debug?
1
7,462,551
09/18/2011 15:45:18
951,297
09/18/2011 14:27:33
1
0
How can I make the tree in Java?
I have been trying to draw this simple tree with Java. I want it to be = == === ==== ===== ====== ======= ======== ========== I tried but it causes problems with different type of data public class tree { public static void main(String[] args) { int i = 10; String base = "" ; while (i > 0) { i= i-1; base = base + "="; System.out.println( base ); } } } I saw a code that used combined of strings function and arrays. Any idea about how to do data trees in Java ? If the output should be like this .. how to do it ? = = = = = = = = = = Thank you
java
treeview
virtualtreeview
null
null
09/21/2011 01:41:39
not a real question
How can I make the tree in Java? === I have been trying to draw this simple tree with Java. I want it to be = == === ==== ===== ====== ======= ======== ========== I tried but it causes problems with different type of data public class tree { public static void main(String[] args) { int i = 10; String base = "" ; while (i > 0) { i= i-1; base = base + "="; System.out.println( base ); } } } I saw a code that used combined of strings function and arrays. Any idea about how to do data trees in Java ? If the output should be like this .. how to do it ? = = = = = = = = = = Thank you
1
8,533,004
12/16/2011 10:42:49
570,861
01/11/2011 06:12:41
1
0
JMeter HTTPProxy Setting change help needed
AS I'm working in Corporate Network we have proxy settings in order to access internet say <abcProxy> and <somePort>. If we change this Proxy name or Port number in Broswer then i can't communicate with internet. But jmeter expects me to put localhost in browser proxy. But it wont work for me. Does any one knows how to change Jmeter HTTP Proxy from localhost to <abcproxy>. I have already followed this [link][1] [1]: http://jmeter.apache.org/usermanual/get-started.html#proxy_server
jmeter
null
null
null
null
null
open
JMeter HTTPProxy Setting change help needed === AS I'm working in Corporate Network we have proxy settings in order to access internet say <abcProxy> and <somePort>. If we change this Proxy name or Port number in Broswer then i can't communicate with internet. But jmeter expects me to put localhost in browser proxy. But it wont work for me. Does any one knows how to change Jmeter HTTP Proxy from localhost to <abcproxy>. I have already followed this [link][1] [1]: http://jmeter.apache.org/usermanual/get-started.html#proxy_server
0
5,393,462
03/22/2011 15:18:32
330,733
05/02/2010 09:08:42
381
9
Qt text with shadow
I see this in other applications, even though the appearance is ever so slightly, the effect is a much high contrast -> better readability. The tabs on the left in Qt Designer for example, or the tabs at the top in Adobe Photoshop: the text has some sort of shadow, only ever 1 pixel surrounding the text with a contrasting colour. Is there a simple way to do this with Qt? Or a more complex one? Thank you.
qt
text
shadow
qt-designer
contrast
null
open
Qt text with shadow === I see this in other applications, even though the appearance is ever so slightly, the effect is a much high contrast -> better readability. The tabs on the left in Qt Designer for example, or the tabs at the top in Adobe Photoshop: the text has some sort of shadow, only ever 1 pixel surrounding the text with a contrasting colour. Is there a simple way to do this with Qt? Or a more complex one? Thank you.
0
9,869,228
03/26/2012 08:59:22
1,035,140
11/08/2011 07:27:40
46
0
How line break content become one line paragraph?
what i want to do is from my breakline content to one line paragraph example my I var_dump result: string(212) "(73857,"2012-02-02 03:18:44","TXT",60143836234);" string(122) "(73858,"2012-02-02 03:20:08","WAP",60143836234);" string(211) "(73859,"2012-02-02 08:21:47","TXT",60163348563,);" What i want to become: string(555) "(73857,"2012-02-02 03:18:44","TXT",60143836234);(73858,"2012-02-02 03:20:08","WAP",60143836234);(73859,"2012-02-02 08:21:47","TXT",60163348563,);" any idea? Thank and highly appreciated your answer
php
null
null
null
null
null
open
How line break content become one line paragraph? === what i want to do is from my breakline content to one line paragraph example my I var_dump result: string(212) "(73857,"2012-02-02 03:18:44","TXT",60143836234);" string(122) "(73858,"2012-02-02 03:20:08","WAP",60143836234);" string(211) "(73859,"2012-02-02 08:21:47","TXT",60163348563,);" What i want to become: string(555) "(73857,"2012-02-02 03:18:44","TXT",60143836234);(73858,"2012-02-02 03:20:08","WAP",60143836234);(73859,"2012-02-02 08:21:47","TXT",60163348563,);" any idea? Thank and highly appreciated your answer
0
11,285,026
07/01/2012 19:34:58
1,429,129
05/31/2012 18:03:47
1
1
How can i read the results from KEEL after generate Output zip file?
KEEL (Knowledge Extraction based on Evolutionary Learning) How can i read the results from KEEL after generate Output zip file ? I download KEEL and import my Data then add the algorithm . the execute for this application generate the zip file. How can i read the results from KEEL after generate Output zip file ?
data-mining
null
null
null
null
null
open
How can i read the results from KEEL after generate Output zip file? === KEEL (Knowledge Extraction based on Evolutionary Learning) How can i read the results from KEEL after generate Output zip file ? I download KEEL and import my Data then add the algorithm . the execute for this application generate the zip file. How can i read the results from KEEL after generate Output zip file ?
0
7,581,679
09/28/2011 10:18:10
137,473
07/13/2009 14:41:04
120
4
Multiple iOS developer licenses for a company
My company has an iOS developer license, and like many others we have reached the 100 UDID limitation. Since I have about 10 more months until the next time I can delete unused UDIDs I tried purchasing another IOS developer license for my company but got rejected from Apple since my company already holds a program enrollment. How can I bypass this issue? I really need more UDIDs so I can send my applications to testers. Do I need to open an individual iOS programing license or is there another way to enroll a company to another iOS license. Thanks Roi
ios
licensing
udid
null
null
09/28/2011 20:39:01
off topic
Multiple iOS developer licenses for a company === My company has an iOS developer license, and like many others we have reached the 100 UDID limitation. Since I have about 10 more months until the next time I can delete unused UDIDs I tried purchasing another IOS developer license for my company but got rejected from Apple since my company already holds a program enrollment. How can I bypass this issue? I really need more UDIDs so I can send my applications to testers. Do I need to open an individual iOS programing license or is there another way to enroll a company to another iOS license. Thanks Roi
2
9,016,620
01/26/2012 10:17:19
1,171,010
01/26/2012 10:07:58
1
0
jQuery highlight and hover function
I have 6 images in a row, the first one I want scaling and a shadow on, then if any of the other images are hovered over they scale up and apply a shadow (through a class) and the most important thing is I want the orinal image to scale back down and remove shadow if another image is hovered over. I have this so far, although its probably written completley wrong you will say! Can anyone help please. <script type="text/javascript"> (document).ready(function() { $("#gallerySlideshow li img:first").css('-moz-transform', 'scale(1.1)').addClass('test'); $("#gallerySlideshow li img").hover(function(){ $(this).css('-moz-transform', 'scale(1.1)').addClass('test'); }, function () { $("#gallerySlideshow li img:first").css('-moz-transform', 'scale(0.9)').removeClass('test'); }, function () { $(this).css('-moz-transform', 'scale(0.9)').removeClass('test'); }); }); </script> Thanks in advance anyone.
jquery
null
null
null
null
null
open
jQuery highlight and hover function === I have 6 images in a row, the first one I want scaling and a shadow on, then if any of the other images are hovered over they scale up and apply a shadow (through a class) and the most important thing is I want the orinal image to scale back down and remove shadow if another image is hovered over. I have this so far, although its probably written completley wrong you will say! Can anyone help please. <script type="text/javascript"> (document).ready(function() { $("#gallerySlideshow li img:first").css('-moz-transform', 'scale(1.1)').addClass('test'); $("#gallerySlideshow li img").hover(function(){ $(this).css('-moz-transform', 'scale(1.1)').addClass('test'); }, function () { $("#gallerySlideshow li img:first").css('-moz-transform', 'scale(0.9)').removeClass('test'); }, function () { $(this).css('-moz-transform', 'scale(0.9)').removeClass('test'); }); }); </script> Thanks in advance anyone.
0
5,802,882
04/27/2011 10:52:35
415,353
08/09/2010 17:25:52
39
0
fb:multi-friend-selector and Secure browsing (https) enabled
I have the following Multi Friend Selector to invite freinds to my page: <div id="fb-layer-wrapper"> <fb:serverFbml width="630px"> <script type="text/fbml"> <fb:fbml> <fb:request-form action = "http://<?=$_SERVER['HTTP_HOST']?>/invite/<?=$hash?>" target = "_top" method = "post" invite = "true" type = "myInvite" content = "<fb:name uid='<?=$facebookId?>' firstnameonly='true' />: My invitation <fb:req-choice url='http://<?=$_SERVER['HTTP_HOST']?>/invited/<?=$hash?>' label='<?__('Join!')?>' />" > <fb:multi-friend-selector showborder = "false" actiontext = "Invite all friends" rows = "3" cols = "4" exclude_ids = "<?=$fbFriends['excludeFriends']?>" /> </fb:request-form> </fb:fbml> </script> </fb:serverFbml> </div> This is all working perfectly as long as your "Secure browsing (https)"-settings in Facebook are disabled. If the checkbox in the users personal settings is checked and the embedding page (on my server) is called through http I get the loading animation of the Facebook widget only. If I call my page over https it works again. Is there a workaround to get the widget working no matter if the user has "Secure browsing" enabled or not?
facebook
facebook-widgets
multi-friend-selector
null
null
06/09/2012 15:28:45
too localized
fb:multi-friend-selector and Secure browsing (https) enabled === I have the following Multi Friend Selector to invite freinds to my page: <div id="fb-layer-wrapper"> <fb:serverFbml width="630px"> <script type="text/fbml"> <fb:fbml> <fb:request-form action = "http://<?=$_SERVER['HTTP_HOST']?>/invite/<?=$hash?>" target = "_top" method = "post" invite = "true" type = "myInvite" content = "<fb:name uid='<?=$facebookId?>' firstnameonly='true' />: My invitation <fb:req-choice url='http://<?=$_SERVER['HTTP_HOST']?>/invited/<?=$hash?>' label='<?__('Join!')?>' />" > <fb:multi-friend-selector showborder = "false" actiontext = "Invite all friends" rows = "3" cols = "4" exclude_ids = "<?=$fbFriends['excludeFriends']?>" /> </fb:request-form> </fb:fbml> </script> </fb:serverFbml> </div> This is all working perfectly as long as your "Secure browsing (https)"-settings in Facebook are disabled. If the checkbox in the users personal settings is checked and the embedding page (on my server) is called through http I get the loading animation of the Facebook widget only. If I call my page over https it works again. Is there a workaround to get the widget working no matter if the user has "Secure browsing" enabled or not?
3
9,450,235
02/26/2012 03:19:25
1,228,907
02/23/2012 16:54:36
12
0
JavaScript if statement changing raw HTML
I'm trying to change HTML if a statement is true upon execution of a function: function checkvals() { if (num > 0) { [HTML becomes]: <form> } else { [HTML becomes]: <form action='submitREQ.php' method="GET"> } On this small bit of code below which will be in the HTML: <form>
html
outerhtml
null
null
null
04/17/2012 09:47:25
not a real question
JavaScript if statement changing raw HTML === I'm trying to change HTML if a statement is true upon execution of a function: function checkvals() { if (num > 0) { [HTML becomes]: <form> } else { [HTML becomes]: <form action='submitREQ.php' method="GET"> } On this small bit of code below which will be in the HTML: <form>
1
11,219,599
06/27/2012 04:49:48
1,369,214
05/02/2012 05:27:47
6
0
Camera preview Zoom in/out not working on click
In my code camera preview zoom in/out controls not working on click when click on zoomed controls it gives null pointer exception so please help me any one i have put all code here with xml. public class CameraActivity extends Activity { private static final String TAG = "CameraDemo"; String currentImage; Preview preview; Button buttonClick; SurfaceHolder holder; Camera mcamera; Bitmap bm; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera); preview = new Preview(this, mcamera); ((FrameLayout) findViewById(R.id.preview)).addView(preview); buttonClick = (Button) findViewById(R.id.buttonClick); buttonClick.setOnClickListener(new OnClickListener() { public void onClick(View v) { preview.camera.takePicture(null, null, jpegCallback); } }); } PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(final byte[] data, Camera camera) { camera.startPreview(); FileOutputStream outStream = null; try { File myDir = new File("/sdcard/demodirc"); if (!myDir.exists()) { myDir.mkdirs(); } String name = "/sdcard/demodirc/Img_" + System.currentTimeMillis() + ".jpg"; File img = new File(name); outStream = new FileOutputStream(img); outStream.write(data); outStream.close(); Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length); } catch (Exception e) { Toast.makeText(getApplicationContext(), "Excep" + e.getMessage(), Toast.LENGTH_SHORT); } } }; } Here is my preview activity public class Preview extends SurfaceView implements SurfaceHolder.Callback { private static final String APP_CLASS = null; SurfaceHolder mHolder; public Camera camera; Bitmap bitmap; int cameraId; Context context; SurfaceHolder holder; Preview(Context mcontext, Camera mcamera) { super(mcontext); context=mcontext; camera = mcamera; mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { camera = Camera.open(); try { camera.setPreviewDisplay(holder); } catch (Exception e) { Log.d(APP_CLASS, "Cannot start preview", e); } } public void surfaceDestroyed(SurfaceHolder holder) { if (camera != null) camera.stopPreview(); camera.setPreviewCallback(null); camera.release(); camera = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Camera.Parameters parameters = camera.getParameters(); ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomControls1); if(params.isZoomSupported()){ maxZoomLevel = params.getMaxZoom(); zoomControls.setIsZoomInEnabled(true); zoomControls.setIsZoomOutEnabled(true); zoomControls.setOnZoomInClickListener(new OnClickListener(){ public void onClick(View v){ if(currentZoomLevel < MAX_ZOOM){ currentZoomLevel++; camera.startSmoothZoom(currentZoomLevel); } } }); zoomControls.setOnZoomOutClickListener(new OnClickListener(){ public void onClick(View v){ if(currentZoomLevel > 0){ currentZoomLevel--; camera.startSmoothZoom(currentZoomLevel); } } }); camera.setParameters(parameters); camera.startPreview(); } } And my camera.xml file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="420dp" android:orientation="horizontal" > <FrameLayout android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height="fill_parent" > </FrameLayout> <Gallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="wrap_content" android:spacing="1pt" /> <Button android:id="@+id/save" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginBottom="-18dp" android:layout_marginLeft="34dp" android:text="Save" android:visibility="invisible" /> <Button android:id="@+id/discard" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginBottom="-18dp" android:layout_marginRight="33dp" android:text="Discard" android:visibility="invisible" /> <Button android:id="@+id/buttonClick" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="-15dp" android:text="Capture" /> <ZoomControls android:id="@+id/zoomControls1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> </RelativeLayout> </RelativeLayout>
android
android-camera
null
null
null
06/27/2012 12:58:35
not a real question
Camera preview Zoom in/out not working on click === In my code camera preview zoom in/out controls not working on click when click on zoomed controls it gives null pointer exception so please help me any one i have put all code here with xml. public class CameraActivity extends Activity { private static final String TAG = "CameraDemo"; String currentImage; Preview preview; Button buttonClick; SurfaceHolder holder; Camera mcamera; Bitmap bm; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera); preview = new Preview(this, mcamera); ((FrameLayout) findViewById(R.id.preview)).addView(preview); buttonClick = (Button) findViewById(R.id.buttonClick); buttonClick.setOnClickListener(new OnClickListener() { public void onClick(View v) { preview.camera.takePicture(null, null, jpegCallback); } }); } PictureCallback jpegCallback = new PictureCallback() { public void onPictureTaken(final byte[] data, Camera camera) { camera.startPreview(); FileOutputStream outStream = null; try { File myDir = new File("/sdcard/demodirc"); if (!myDir.exists()) { myDir.mkdirs(); } String name = "/sdcard/demodirc/Img_" + System.currentTimeMillis() + ".jpg"; File img = new File(name); outStream = new FileOutputStream(img); outStream.write(data); outStream.close(); Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length); } catch (Exception e) { Toast.makeText(getApplicationContext(), "Excep" + e.getMessage(), Toast.LENGTH_SHORT); } } }; } Here is my preview activity public class Preview extends SurfaceView implements SurfaceHolder.Callback { private static final String APP_CLASS = null; SurfaceHolder mHolder; public Camera camera; Bitmap bitmap; int cameraId; Context context; SurfaceHolder holder; Preview(Context mcontext, Camera mcamera) { super(mcontext); context=mcontext; camera = mcamera; mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { camera = Camera.open(); try { camera.setPreviewDisplay(holder); } catch (Exception e) { Log.d(APP_CLASS, "Cannot start preview", e); } } public void surfaceDestroyed(SurfaceHolder holder) { if (camera != null) camera.stopPreview(); camera.setPreviewCallback(null); camera.release(); camera = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { Camera.Parameters parameters = camera.getParameters(); ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomControls1); if(params.isZoomSupported()){ maxZoomLevel = params.getMaxZoom(); zoomControls.setIsZoomInEnabled(true); zoomControls.setIsZoomOutEnabled(true); zoomControls.setOnZoomInClickListener(new OnClickListener(){ public void onClick(View v){ if(currentZoomLevel < MAX_ZOOM){ currentZoomLevel++; camera.startSmoothZoom(currentZoomLevel); } } }); zoomControls.setOnZoomOutClickListener(new OnClickListener(){ public void onClick(View v){ if(currentZoomLevel > 0){ currentZoomLevel--; camera.startSmoothZoom(currentZoomLevel); } } }); camera.setParameters(parameters); camera.startPreview(); } } And my camera.xml file <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="420dp" android:orientation="horizontal" > <FrameLayout android:id="@+id/preview" android:layout_width="fill_parent" android:layout_height="fill_parent" > </FrameLayout> <Gallery android:id="@+id/gallery" android:layout_width="fill_parent" android:layout_height="wrap_content" android:spacing="1pt" /> <Button android:id="@+id/save" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_marginBottom="-18dp" android:layout_marginLeft="34dp" android:text="Save" android:visibility="invisible" /> <Button android:id="@+id/discard" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginBottom="-18dp" android:layout_marginRight="33dp" android:text="Discard" android:visibility="invisible" /> <Button android:id="@+id/buttonClick" android:layout_width="90dp" android:layout_height="50dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="-15dp" android:text="Capture" /> <ZoomControls android:id="@+id/zoomControls1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> </RelativeLayout> </RelativeLayout>
1
6,298,060
06/09/2011 19:18:55
791,593
06/09/2011 19:18:55
1
0
Identify a computer
I am creating a web site to sell digital articles which are in PDF format and are encrypted. The solution I am thinking is to let buyer download encrypted PDF file from my web site and then I email him/her a password for him/her to open and read. I have two concerns here: 1) How can I identify each buyer's computer after they download the article? The purpose is not to allow the same buyer to download from computer B after download from computer A and try to open the file from computer B with the same password as computer A. The goal is to limit buyers to share password with friends. Even his/her friends can download the encryped PDF file, they can not open it with the password. 2) How can I limit a buyer to copy/paste out the content of my PDF file? That is how to disable the 'select' and 'copy' menu of the PDF file? My original file is a MS Word file. When I convert Word to PDF, is there any setting to change to disable 'select' and 'copy'? Or is there better solutions? Thank you for your wisdom on this. -Leo
java
php
javascript
.net
null
06/09/2011 19:42:51
off topic
Identify a computer === I am creating a web site to sell digital articles which are in PDF format and are encrypted. The solution I am thinking is to let buyer download encrypted PDF file from my web site and then I email him/her a password for him/her to open and read. I have two concerns here: 1) How can I identify each buyer's computer after they download the article? The purpose is not to allow the same buyer to download from computer B after download from computer A and try to open the file from computer B with the same password as computer A. The goal is to limit buyers to share password with friends. Even his/her friends can download the encryped PDF file, they can not open it with the password. 2) How can I limit a buyer to copy/paste out the content of my PDF file? That is how to disable the 'select' and 'copy' menu of the PDF file? My original file is a MS Word file. When I convert Word to PDF, is there any setting to change to disable 'select' and 'copy'? Or is there better solutions? Thank you for your wisdom on this. -Leo
2
7,496,326
09/21/2011 07:49:34
496,864
11/04/2010 06:40:40
596
10
SSH fork and children
I have a program where i ssh into a server and gets data. Here is the code... I fork it and the child executes the query and the parent waits for the child for a predetermined amount of time (in function timeout) and then kills the child. I did that part because sometimes, i am not exactly sure why, but the ssh connection stops and doesnot exit. That is there is a "ssh -oConnectTimeout=60 blah blah" in the processes list for a long and the timeout function doesnt seem to work. What am i doing wrong here? The last time this problem occured, there was an ssh in process list for 5 days and still it didnot timeout and the program had stopped because it was waiting for the child. There are those extra wait() functions because previously i was getting a lot of defunct processes a.k.a zombies. So i took the easy way out.. c = fork(); if(c==0) { close(fd[READ]); if (dup2(fd[WRITE],STDOUT_FILENO) != -1) execlp("ssh", "ssh -oConnectTimeout=60", serverDetails.c_str(), NULL); _exit(1); }else{ if(timeout(c) == 1){ kill(c,SIGTERM); waitpid(c, &exitStatus, WNOHANG); wait(&exitStatus); return 0; } wait(&exitStatus); } This is the timeout function. int timeout(int childPID) { int times = 0, max_times = 10, status, rc; while (times < max_times){ sleep(5); rc = waitpid(childPID, &status, WNOHANG); if(rc < 0){ perror("waitpid"); exit(1); } if(WIFEXITED(status) || WIFSIGNALED(status)){ /* child exits */ break; } times++; } if (times >= max_times){ return 1; } else return 0; }
ssh
timeout
fork
null
null
null
open
SSH fork and children === I have a program where i ssh into a server and gets data. Here is the code... I fork it and the child executes the query and the parent waits for the child for a predetermined amount of time (in function timeout) and then kills the child. I did that part because sometimes, i am not exactly sure why, but the ssh connection stops and doesnot exit. That is there is a "ssh -oConnectTimeout=60 blah blah" in the processes list for a long and the timeout function doesnt seem to work. What am i doing wrong here? The last time this problem occured, there was an ssh in process list for 5 days and still it didnot timeout and the program had stopped because it was waiting for the child. There are those extra wait() functions because previously i was getting a lot of defunct processes a.k.a zombies. So i took the easy way out.. c = fork(); if(c==0) { close(fd[READ]); if (dup2(fd[WRITE],STDOUT_FILENO) != -1) execlp("ssh", "ssh -oConnectTimeout=60", serverDetails.c_str(), NULL); _exit(1); }else{ if(timeout(c) == 1){ kill(c,SIGTERM); waitpid(c, &exitStatus, WNOHANG); wait(&exitStatus); return 0; } wait(&exitStatus); } This is the timeout function. int timeout(int childPID) { int times = 0, max_times = 10, status, rc; while (times < max_times){ sleep(5); rc = waitpid(childPID, &status, WNOHANG); if(rc < 0){ perror("waitpid"); exit(1); } if(WIFEXITED(status) || WIFSIGNALED(status)){ /* child exits */ break; } times++; } if (times >= max_times){ return 1; } else return 0; }
0
11,348,463
07/05/2012 16:16:48
252,000
01/16/2010 02:41:04
43,671
728
Duplicated code above and inside while loop
Consider the following code: std::string::size_type von = find_first_not_of(str, splitter); std::string::size_type bis = find_first_of(str, splitter, von); while (von != bis) { result.push_back(str.substr(von, bis - von)); von = find_first_not_of(str, splitter, bis); bis = find_first_of(str, splitter, von); } There are duplicated calls to `find_first_not_of` and `find_first_of` which could be eliminated by various techniques. For example, I could place the function calls inside the loop condition: std::string::size_type von, bis = 0; while (von = find_first_not_of(str, splitter, bis), bis = find_first_of(str, splitter, von), von != bis) { result.push_back(str.substr(von, bis - von)); } Or I could use an endless loop from which I manually break in the middle: std::string::size_type von, bis = 0; for (; ;) { von = find_first_not_of(str, splitter, bis); bis = find_first_of(str, splitter, von); if (von == bis) break; result.push_back(str.substr(von, bis - von)); } Both ways remove the code duplication, but do they actually improve the overall quality of the code?
c++
refactoring
code-duplication
code-quality
code-readability
07/05/2012 17:52:59
too localized
Duplicated code above and inside while loop === Consider the following code: std::string::size_type von = find_first_not_of(str, splitter); std::string::size_type bis = find_first_of(str, splitter, von); while (von != bis) { result.push_back(str.substr(von, bis - von)); von = find_first_not_of(str, splitter, bis); bis = find_first_of(str, splitter, von); } There are duplicated calls to `find_first_not_of` and `find_first_of` which could be eliminated by various techniques. For example, I could place the function calls inside the loop condition: std::string::size_type von, bis = 0; while (von = find_first_not_of(str, splitter, bis), bis = find_first_of(str, splitter, von), von != bis) { result.push_back(str.substr(von, bis - von)); } Or I could use an endless loop from which I manually break in the middle: std::string::size_type von, bis = 0; for (; ;) { von = find_first_not_of(str, splitter, bis); bis = find_first_of(str, splitter, von); if (von == bis) break; result.push_back(str.substr(von, bis - von)); } Both ways remove the code duplication, but do they actually improve the overall quality of the code?
3
10,976,013
06/11/2012 07:30:59
1,442,029
06/07/2012 11:08:58
1
0
Cannot open Microsoft Word Starter 2010
I have just tried opening Microsoft Word Starter 2010 but it [run][1] away, I get an error message saying: Microsoft Word Starter 2010 cannot be opened. Try again or repair the product in Control Panel. I cannot find how to do this. Does anyone know how to fix this? [1]: http://www.lstrends.com
ms-word
null
null
null
null
06/12/2012 09:52:14
off topic
Cannot open Microsoft Word Starter 2010 === I have just tried opening Microsoft Word Starter 2010 but it [run][1] away, I get an error message saying: Microsoft Word Starter 2010 cannot be opened. Try again or repair the product in Control Panel. I cannot find how to do this. Does anyone know how to fix this? [1]: http://www.lstrends.com
2
11,462,037
07/12/2012 23:09:20
305,669
03/31/2010 03:45:46
333
6
Template Metaprogramming vs functional programming
I just started read about some C++ Template Metaprogramming and found some similarities with functional programming. like the typelist example in *modern c++ programming design* book or the factorial example in [this question][1]. My question is what is the relationship between C++ Template Metaprogramming and functional programming? How is the factorial example different from an implementation in a functional language? do some pitfalls like stackoverflow for non-tail recursion relevant for c++ Template Metaprogramming? [1]: http://stackoverflow.com/questions/112277/best-introduction-to-c-template-metaprogramming
c++
templates
haskell
f#
functional-programming
07/13/2012 09:14:11
not a real question
Template Metaprogramming vs functional programming === I just started read about some C++ Template Metaprogramming and found some similarities with functional programming. like the typelist example in *modern c++ programming design* book or the factorial example in [this question][1]. My question is what is the relationship between C++ Template Metaprogramming and functional programming? How is the factorial example different from an implementation in a functional language? do some pitfalls like stackoverflow for non-tail recursion relevant for c++ Template Metaprogramming? [1]: http://stackoverflow.com/questions/112277/best-introduction-to-c-template-metaprogramming
1
9,001,026
01/25/2012 10:22:28
614,807
08/16/2010 14:06:36
4,295
163
How can I format date?
How can I format below date format : "`Wed Jan 18 08:50:04 Asia/Calcutta 2012`" date to depict just "`18.01.2012`"?
android
date
null
null
null
null
open
How can I format date? === How can I format below date format : "`Wed Jan 18 08:50:04 Asia/Calcutta 2012`" date to depict just "`18.01.2012`"?
0
2,872,014
05/20/2010 08:15:02
70,329
02/24/2009 12:15:05
397
28
Custom Tabcontrol in silverlight 4
I'm trying to design a tab control which will have a tabs on left hane hand side, and will have a text displayed vertically besides it. And will have the Page displayed in the main tab control. For reference you can visit : http://www.nseindia.com/ and click on any tab in the main menu. How can it be designed? I have created a style in App.xaml since it would be applicable to all tabs. But I'm not sure how to get the control's name in the page I would be using. Thanks.
tabcontrol
silverlight-4.0
coding-style
null
null
null
open
Custom Tabcontrol in silverlight 4 === I'm trying to design a tab control which will have a tabs on left hane hand side, and will have a text displayed vertically besides it. And will have the Page displayed in the main tab control. For reference you can visit : http://www.nseindia.com/ and click on any tab in the main menu. How can it be designed? I have created a style in App.xaml since it would be applicable to all tabs. But I'm not sure how to get the control's name in the page I would be using. Thanks.
0
10,474,667
05/06/2012 22:01:25
1,229,490
02/23/2012 22:13:39
16
0
Debian boot and wireless card
My computer gets stuck when booting debian very often. I'm wondering if there's any way to fix it. I'm using debian stable version, but I doubt if it is really stable. Btw, I can't use my wireless card or ethernet card when using debian. I've downloaded the firware for my Realtek card but I cannot install it in debian. It says I need root privilege, but my account is administrator. And I cannot login with root in GUI. What should I do then?
linux
debian
null
null
null
05/06/2012 22:34:12
off topic
Debian boot and wireless card === My computer gets stuck when booting debian very often. I'm wondering if there's any way to fix it. I'm using debian stable version, but I doubt if it is really stable. Btw, I can't use my wireless card or ethernet card when using debian. I've downloaded the firware for my Realtek card but I cannot install it in debian. It says I need root privilege, but my account is administrator. And I cannot login with root in GUI. What should I do then?
2
10,170,754
04/16/2012 08:20:50
1,299,846
03/29/2012 04:54:52
12
0
iframe transparent on ie9 under windows 7
I put on one website iframe. Iframe code: <div id="page-content" class="whatsOnContent" style="height:1700px"> <iframe src="/blog-articles/" width="980" height="100%" allowtransparency="true" frameborder="0"></iframe> </div> CSs realted to iframe: #page-content { width: 960px; margin: 107px auto 0 auto; overflow: hidden; height: 400px; line-height: 1.2em; position: relative; } body of iframe: <body class="page page-id-673 page-template-default logged-in" style="background-color:transparent;" > And I dont know why but under ie9 under windows 7 it is whoel transparent (so you cant see anything from iframe). Could content somehow inherit the transparent color? Is it just caused by different settings? or is ti coding problem? Note: It really works on firefox, chrome, safari and ie7 and ie8 but ie9 on windows 7 has got problems
html
css
internet-explorer
iframe
internet-explorer-9
null
open
iframe transparent on ie9 under windows 7 === I put on one website iframe. Iframe code: <div id="page-content" class="whatsOnContent" style="height:1700px"> <iframe src="/blog-articles/" width="980" height="100%" allowtransparency="true" frameborder="0"></iframe> </div> CSs realted to iframe: #page-content { width: 960px; margin: 107px auto 0 auto; overflow: hidden; height: 400px; line-height: 1.2em; position: relative; } body of iframe: <body class="page page-id-673 page-template-default logged-in" style="background-color:transparent;" > And I dont know why but under ie9 under windows 7 it is whoel transparent (so you cant see anything from iframe). Could content somehow inherit the transparent color? Is it just caused by different settings? or is ti coding problem? Note: It really works on firefox, chrome, safari and ie7 and ie8 but ie9 on windows 7 has got problems
0
1,244,203
08/07/2009 11:14:25
126,483
06/21/2009 13:47:02
72
0
Moving webservices to point to on virtual directory.
Currently we have 5 web services each one configured in IIS with their own virtual directory. We have now moved all the webservices into the same virtual directory folder. Will this have any impact on performance or any other problems? JD.
web-services
null
null
null
null
null
open
Moving webservices to point to on virtual directory. === Currently we have 5 web services each one configured in IIS with their own virtual directory. We have now moved all the webservices into the same virtual directory folder. Will this have any impact on performance or any other problems? JD.
0
2,537,349
03/29/2010 11:02:14
187,130
10/09/2009 12:03:26
86
19
Model prefix when using typed HTML helpers
I want to render input for model field with prefix, like so: `..name="Field.FormId"..`. How can I do this using typed helpers? When I use > Html.HiddenFor(m => m.FormId), I get 'FormId' as field name..
asp.net-mvc
null
null
null
null
null
open
Model prefix when using typed HTML helpers === I want to render input for model field with prefix, like so: `..name="Field.FormId"..`. How can I do this using typed helpers? When I use > Html.HiddenFor(m => m.FormId), I get 'FormId' as field name..
0
1,323,704
08/24/2009 17:31:12
108,958
05/18/2009 18:51:21
31
6
What Computer Science Concept Do you Apply the Most?
For some reason, I notice that I end up using a lot of finite state machines at work. In particular, when I'm implementing a custom TCP/serial protocol, they are very helpful and produce a very robust output (in my opinion). My days in CS classes are long behind me. As such my recollection of the stuff I learned there is fuzzy. I was curious if there are other concepts people are leveraging that I've forgotten about. There is no "right" answer. Vote up the answers containing the concept you use this most. We'll simply end up with the most used concepts on top. For me, it'll be a list of stuff to study up on. -Robert
computer-science
null
null
null
null
null
open
What Computer Science Concept Do you Apply the Most? === For some reason, I notice that I end up using a lot of finite state machines at work. In particular, when I'm implementing a custom TCP/serial protocol, they are very helpful and produce a very robust output (in my opinion). My days in CS classes are long behind me. As such my recollection of the stuff I learned there is fuzzy. I was curious if there are other concepts people are leveraging that I've forgotten about. There is no "right" answer. Vote up the answers containing the concept you use this most. We'll simply end up with the most used concepts on top. For me, it'll be a list of stuff to study up on. -Robert
0
6,565,070
07/03/2011 19:30:19
817,497
06/27/2011 13:51:34
10
1
Java Timeline of Events
I am making an `Animation Studio` with JAVA. I want a timeline of events to know which event happens when, a bit like `Windows Movie Maker`: Anyone know of any `JAVA` program which can do so? I don't want to go through _all_ the work of drawing a box for the event, adding a `MouseListener`... Answers are **greatly** appreciated!!!
java
events
optimization
time
null
07/04/2011 14:04:36
off topic
Java Timeline of Events === I am making an `Animation Studio` with JAVA. I want a timeline of events to know which event happens when, a bit like `Windows Movie Maker`: Anyone know of any `JAVA` program which can do so? I don't want to go through _all_ the work of drawing a box for the event, adding a `MouseListener`... Answers are **greatly** appreciated!!!
2
10,030,058
04/05/2012 13:59:50
1,096,036
12/13/2011 15:16:37
24
1
My mobile website is getting vertical scroll
Im makin' a mobile website for a friend - and im using media queries to adjust her website for a more mobile feeling when watching it on any smartphone. Feels like im done with the webpage - but when i view it on my phones iphone 3gs and htc incredbile S its like that you can scroll 2-3 pixels vertically. Some element is messing with this and im growing gray hair since i can't really find out which it is. how do i solve this? webpage link http://www.linaahlen.se/
css
media-queries
responsive-design
null
null
null
open
My mobile website is getting vertical scroll === Im makin' a mobile website for a friend - and im using media queries to adjust her website for a more mobile feeling when watching it on any smartphone. Feels like im done with the webpage - but when i view it on my phones iphone 3gs and htc incredbile S its like that you can scroll 2-3 pixels vertically. Some element is messing with this and im growing gray hair since i can't really find out which it is. how do i solve this? webpage link http://www.linaahlen.se/
0
4,057,554
10/30/2010 06:31:26
119,973
06/09/2009 16:41:23
355
0
make a file directory in php & mySQL
I am currently making a file manager system i store all the folders names and files in the database (MySQL) i am trying to add folders in the database and then add sub folders to them, I wanted it to show all the folders to show in there correct position, Here is a eg: Folder1 Folder1-Sub1 Folder1-Sub1-Sub1 Folder1-Sub1-Sub2 Folder1-Sub1-ect... Folder1-Sub2 Folder1-Sub3 Folder1-ect... Folder2 Folder2-Sub1 Folder2-sub2 ect... I currently have the mysql table layed out like this id folder_name sub_folder_id file_name file_folder_id 1 Folder1 -1 -1 -1 2 Folder1-Sub1 1 -1 -1 3 Folder1-Sub1-Sub1 2 -1 -1 4 Folder1-Sub1-Sub2 2 -1 -1 5 Folder1-Sub2 1 -1 -1 6 Folder1-Sub3 1 -1 -1 7 Folder2 -1 -1 -1 8 Folder2-Sub1 7 -1 -1 9 Folder2-Sub2 7 -1 -1 Here is the following code that i have so far $GetFolders = mysql_query("SELECT * FROM user_filesfolders"); $file_tree = ""; while($ShowFolders = mysql_fetch_array($GetFolders)) { if($ShowFolders['folder_name']==-1){ //Dont Add Becuse it not a folder }else{ $file_tree .= ' <tr> <td height="30" colspan="4"><strong> <input type="checkbox" name="checkbox[]" class="folder_checkbox" id="-1" /> <span class="tree_drop" id="-1"> <img src="images/Folder.png" width="15" height="21" /> <span id="status">+</span> '.$ShowFolders['folder_name'].'</strong> </span> </td> </tr> '; $sub_folders = explode(",", $ShowFolders['sub_folder_id']); for ($i=0;$i<count($sub_folders);$i++) { //echo $sub_folders[$i]; $file_tree .= ' <tr> <td height="30" colspan="4"><strong> <input type="checkbox" name="checkbox[]" class="folder_checkbox" id="-1" /> <span class="tree_drop" id="-1"> <img src="images/Folder.png" width="15" height="21" /> <span id="status">+</span> '.$ShowFolders['folder_name'].'</strong> </span> </td> </tr> '; } } } Can someone help me out please or lead me down the right path
php
mysql
null
null
null
null
open
make a file directory in php & mySQL === I am currently making a file manager system i store all the folders names and files in the database (MySQL) i am trying to add folders in the database and then add sub folders to them, I wanted it to show all the folders to show in there correct position, Here is a eg: Folder1 Folder1-Sub1 Folder1-Sub1-Sub1 Folder1-Sub1-Sub2 Folder1-Sub1-ect... Folder1-Sub2 Folder1-Sub3 Folder1-ect... Folder2 Folder2-Sub1 Folder2-sub2 ect... I currently have the mysql table layed out like this id folder_name sub_folder_id file_name file_folder_id 1 Folder1 -1 -1 -1 2 Folder1-Sub1 1 -1 -1 3 Folder1-Sub1-Sub1 2 -1 -1 4 Folder1-Sub1-Sub2 2 -1 -1 5 Folder1-Sub2 1 -1 -1 6 Folder1-Sub3 1 -1 -1 7 Folder2 -1 -1 -1 8 Folder2-Sub1 7 -1 -1 9 Folder2-Sub2 7 -1 -1 Here is the following code that i have so far $GetFolders = mysql_query("SELECT * FROM user_filesfolders"); $file_tree = ""; while($ShowFolders = mysql_fetch_array($GetFolders)) { if($ShowFolders['folder_name']==-1){ //Dont Add Becuse it not a folder }else{ $file_tree .= ' <tr> <td height="30" colspan="4"><strong> <input type="checkbox" name="checkbox[]" class="folder_checkbox" id="-1" /> <span class="tree_drop" id="-1"> <img src="images/Folder.png" width="15" height="21" /> <span id="status">+</span> '.$ShowFolders['folder_name'].'</strong> </span> </td> </tr> '; $sub_folders = explode(",", $ShowFolders['sub_folder_id']); for ($i=0;$i<count($sub_folders);$i++) { //echo $sub_folders[$i]; $file_tree .= ' <tr> <td height="30" colspan="4"><strong> <input type="checkbox" name="checkbox[]" class="folder_checkbox" id="-1" /> <span class="tree_drop" id="-1"> <img src="images/Folder.png" width="15" height="21" /> <span id="status">+</span> '.$ShowFolders['folder_name'].'</strong> </span> </td> </tr> '; } } } Can someone help me out please or lead me down the right path
0
8,148,346
11/16/2011 07:56:41
533,079
12/07/2010 01:42:20
200
12
Canvas animation is leaving trail/fragments as it moves
First of all, I'm using a page turn animation based on this: http://www.netmagazine.com/tutorials/create-page-flip-effect-html5-canvas I've changed it somewhat, to fit my application. There is no clicking on the page to turn it - you press a button outside the canvas to make it animate. The example they provided animates smoothly, but my version leaves a trail as the page turning animation moves across the canvas. Here's an example of one of the buttons: function page2Down(event) { if(page != 1) { var canvas = document.getElementById( "pageflip-canvas" ); canvas.style.zIndex = 100; var a = function(){ var canvas = document.getElementById( "pageflip-canvas" ); canvas.width = canvas.width; canvas.style.zIndex = 0; }; var b = setTimeout(a, 1100); if(page < 1) flips[page].dragging = true; else flips[page-1].dragging = true; } } function page2Up( event ) { var page_num = 1; while(page > page_num) { for( var i = total_pages; i > -1; i-- ) { if( flips[i].dragging ) { flips[i].target = 1; if(i>page_num) flips[i-1].dragging = true; page--; } console.log(page); flips[i].dragging = false; } } while(page < page_num) { for( var i = 0; i < flips.length; i++ ) { if(page == page_num) return false; if( flips[i].dragging ) { flips[i].target = -1; if(i<page_num) flips[i+1].dragging = true; page++; } console.log(page); flips[i].dragging = false; } } } The render and drawfip functions are the same as in the example. All I changed besides what I specified already were some variables: var BOOK_WIDTH = 2264; var BOOK_HEIGHT = 431; var PAGE_WIDTH = 1132; var PAGE_HEIGHT = 426; The trail looks pretty bad, and I need to remove it. I believe it may be related to the size of the page, but I'm not entirely sure.
html5
animation
canvas
null
null
02/21/2012 11:10:55
too localized
Canvas animation is leaving trail/fragments as it moves === First of all, I'm using a page turn animation based on this: http://www.netmagazine.com/tutorials/create-page-flip-effect-html5-canvas I've changed it somewhat, to fit my application. There is no clicking on the page to turn it - you press a button outside the canvas to make it animate. The example they provided animates smoothly, but my version leaves a trail as the page turning animation moves across the canvas. Here's an example of one of the buttons: function page2Down(event) { if(page != 1) { var canvas = document.getElementById( "pageflip-canvas" ); canvas.style.zIndex = 100; var a = function(){ var canvas = document.getElementById( "pageflip-canvas" ); canvas.width = canvas.width; canvas.style.zIndex = 0; }; var b = setTimeout(a, 1100); if(page < 1) flips[page].dragging = true; else flips[page-1].dragging = true; } } function page2Up( event ) { var page_num = 1; while(page > page_num) { for( var i = total_pages; i > -1; i-- ) { if( flips[i].dragging ) { flips[i].target = 1; if(i>page_num) flips[i-1].dragging = true; page--; } console.log(page); flips[i].dragging = false; } } while(page < page_num) { for( var i = 0; i < flips.length; i++ ) { if(page == page_num) return false; if( flips[i].dragging ) { flips[i].target = -1; if(i<page_num) flips[i+1].dragging = true; page++; } console.log(page); flips[i].dragging = false; } } } The render and drawfip functions are the same as in the example. All I changed besides what I specified already were some variables: var BOOK_WIDTH = 2264; var BOOK_HEIGHT = 431; var PAGE_WIDTH = 1132; var PAGE_HEIGHT = 426; The trail looks pretty bad, and I need to remove it. I believe it may be related to the size of the page, but I'm not entirely sure.
3
5,258,315
03/10/2011 10:24:57
653,281
03/10/2011 09:50:38
1
0
Unexpected error when trying to connect to database in Visual Studio 2010
**The problem:** In Visual Studio 2010 Professional I choose Server Explorer and right-click on Data Connections to choose "Add Connection". Then I get this error: > An unexpected error occurred in the > .NET Framework Data Provider for > Microsoft SQL Server Compact 3.5. > Please contact the provider vendor to > resolve this problem. **My enviroment:** - Windows 7 SP1 - Visual Studio 2010 Professional (trial version) - SQL Server 2008 R2 Express **I've tried** - Installing Visual Web Developer Express (gives the same problem) - Reinstall of VS 2010 Professional - Reinstall of Sql Server 2008 R2 Express - Tools => Import and Export Setting => Reset all Settings - Run: Devenv.exe /ResetSkipPkgs **Comments** Maybe the registry is fucked up in som e way. One post: http://social.msdn.microsoft.com/Forums/en/vstsstart/thread/b6f7fc36-5a34-4166-9e75-7ac39993182b says that I should modify the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders But I don't even have a folder namned DataProviders in the 9.0 (or 10.0) folder. So maybe that's a problem. Thanx for any help!
visual-studio-2010
database-connection
null
null
null
null
open
Unexpected error when trying to connect to database in Visual Studio 2010 === **The problem:** In Visual Studio 2010 Professional I choose Server Explorer and right-click on Data Connections to choose "Add Connection". Then I get this error: > An unexpected error occurred in the > .NET Framework Data Provider for > Microsoft SQL Server Compact 3.5. > Please contact the provider vendor to > resolve this problem. **My enviroment:** - Windows 7 SP1 - Visual Studio 2010 Professional (trial version) - SQL Server 2008 R2 Express **I've tried** - Installing Visual Web Developer Express (gives the same problem) - Reinstall of VS 2010 Professional - Reinstall of Sql Server 2008 R2 Express - Tools => Import and Export Setting => Reset all Settings - Run: Devenv.exe /ResetSkipPkgs **Comments** Maybe the registry is fucked up in som e way. One post: http://social.msdn.microsoft.com/Forums/en/vstsstart/thread/b6f7fc36-5a34-4166-9e75-7ac39993182b says that I should modify the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\DataProviders But I don't even have a folder namned DataProviders in the 9.0 (or 10.0) folder. So maybe that's a problem. Thanx for any help!
0
9,251,804
02/12/2012 19:13:03
1,181,517
01/31/2012 22:29:32
3
0
Using SQL function with datatable results
I have a database table with a DATETIME column. What I want to do is to identify whether the date part of a record is the same of with the date part of today. However, I have a datatable object and I cannot use daUsage.Select with the SQL function DATEPART. So what I'm asking is whether there is a way to filter results from a datatable without using the select function. If this is possible how is it done? I could use LINQ but I'm pretty new to it and I feel that there must be a better way to do that. Thanks
c#
datatable
null
null
null
null
open
Using SQL function with datatable results === I have a database table with a DATETIME column. What I want to do is to identify whether the date part of a record is the same of with the date part of today. However, I have a datatable object and I cannot use daUsage.Select with the SQL function DATEPART. So what I'm asking is whether there is a way to filter results from a datatable without using the select function. If this is possible how is it done? I could use LINQ but I'm pretty new to it and I feel that there must be a better way to do that. Thanks
0
11,002,749
06/12/2012 18:38:22
841,654
07/12/2011 22:06:47
95
1
Testing a TCP/IP connection locally
Currently I have an application that connects to a Terminal Server over TCP/IP using a ip address and a port. Is it possible for me to create a mock tcp/ip connection locally on my laptop so I can make the application to connect to a specific ip and port on my laptop?? I am a noob at networking, so please execuse if the question isn't clear. The reason I am trying to do this is, the application is listening to a specific port on a tcp/ip connection on the terminal server and I remotely send some data using VB macros to the same port. I would like to test the same locally in absence of a terminal server (just using my laptop) but when I run the application it can only connect using a tcp/ip connection. The application is written in java and can be run locally by providing an ip address and port to connect to, so I would like to see if I can make the application connect to my laptop as a tcp/ip connection. Any inputs are appreciated. Thanks!!
java
tcp-ip
null
null
null
null
open
Testing a TCP/IP connection locally === Currently I have an application that connects to a Terminal Server over TCP/IP using a ip address and a port. Is it possible for me to create a mock tcp/ip connection locally on my laptop so I can make the application to connect to a specific ip and port on my laptop?? I am a noob at networking, so please execuse if the question isn't clear. The reason I am trying to do this is, the application is listening to a specific port on a tcp/ip connection on the terminal server and I remotely send some data using VB macros to the same port. I would like to test the same locally in absence of a terminal server (just using my laptop) but when I run the application it can only connect using a tcp/ip connection. The application is written in java and can be run locally by providing an ip address and port to connect to, so I would like to see if I can make the application connect to my laptop as a tcp/ip connection. Any inputs are appreciated. Thanks!!
0
11,693,251
07/27/2012 18:04:19
1,558,391
07/27/2012 17:44:57
1
0
upload and display excel sheet using asp.net with same format
i have got an assignment to upload and read the excel file using asp.net keeping all the format same as it is in excel.(colour,font,size, indentation,padding etc) expecting a favourable reply
asp.net
.net
sql
xml
excel
07/28/2012 01:23:02
not constructive
upload and display excel sheet using asp.net with same format === i have got an assignment to upload and read the excel file using asp.net keeping all the format same as it is in excel.(colour,font,size, indentation,padding etc) expecting a favourable reply
4
11,369,043
07/06/2012 20:11:18
1,507,724
07/06/2012 19:56:17
1
0
Requesting advice on symmetric encryption implementation in .net
I am writing a c# class to encrypt and decrypt strings. The encrypted string, which are simply short pieces of information, will be stored in a database. Is the following approach to implementing this class considered up-to-date and secure? (1) Using AES (Rijndael) algorithm, operating in CBC mode. (2) Specifically using the AesCryptoServiceProvider class from .net. I choose this over AesManaged because some alleged speed benefits. (3) Randomly generating IVs for each piece of information. Prepending these IVs to the encrypted information to allow for decryption (4) I am not using any form of SALT. (5) I am going to use a HMAC (SHA256) to verify that information has not been tampered with. (6) I am going to use a single Key for all encryptions. I will store this key in an encrypted file Once again, is this a secure and viable approach to symmetric encryption? I would really appreciate sources for either affirmative or negative responses. I also hope this helps gather answers to all these questions in one place. Thanks
c#
encryption
aes
symmetric
null
07/23/2012 05:51:08
off topic
Requesting advice on symmetric encryption implementation in .net === I am writing a c# class to encrypt and decrypt strings. The encrypted string, which are simply short pieces of information, will be stored in a database. Is the following approach to implementing this class considered up-to-date and secure? (1) Using AES (Rijndael) algorithm, operating in CBC mode. (2) Specifically using the AesCryptoServiceProvider class from .net. I choose this over AesManaged because some alleged speed benefits. (3) Randomly generating IVs for each piece of information. Prepending these IVs to the encrypted information to allow for decryption (4) I am not using any form of SALT. (5) I am going to use a HMAC (SHA256) to verify that information has not been tampered with. (6) I am going to use a single Key for all encryptions. I will store this key in an encrypted file Once again, is this a secure and viable approach to symmetric encryption? I would really appreciate sources for either affirmative or negative responses. I also hope this helps gather answers to all these questions in one place. Thanks
2
10,163,571
04/15/2012 15:54:16
1,313,129
04/04/2012 14:41:27
4
0
C# - BinTree Node assignemt
This friday I'm going to have a huge test on C#, and i really need your help! I have an assignment to calculate and print the section of the tree with the highest value. Example: ------5------\n ---6-----8---\n --7-9--10-22-\n The section with the highest amount will be 5>8>22 = 35 Thanks, Ophir
c#
null
null
null
null
04/17/2012 09:48:39
not a real question
C# - BinTree Node assignemt === This friday I'm going to have a huge test on C#, and i really need your help! I have an assignment to calculate and print the section of the tree with the highest value. Example: ------5------\n ---6-----8---\n --7-9--10-22-\n The section with the highest amount will be 5>8>22 = 35 Thanks, Ophir
1
6,139,395
05/26/2011 13:37:23
97,526
04/29/2009 05:48:00
925
19
Any idea how to find trend in what is going on in technology?
Any idea, how to find technology trend on twitter? I would like to find, what people tweets about software development in various technologies, which technology is trending etc... Thanks and regards
javascript
python
twitter
twitter-api
trends
05/26/2011 13:41:35
not a real question
Any idea how to find trend in what is going on in technology? === Any idea, how to find technology trend on twitter? I would like to find, what people tweets about software development in various technologies, which technology is trending etc... Thanks and regards
1
7,371,123
09/10/2011 10:35:08
849,900
07/18/2011 11:13:06
4
0
PHP pages inclusion
i want to redirect a PHP page . like this . ` > " include 'info.php#info' `.."but ,this gives error.can some one help me :: thanks
php5
null
null
null
null
09/11/2011 12:08:39
not a real question
PHP pages inclusion === i want to redirect a PHP page . like this . ` > " include 'info.php#info' `.."but ,this gives error.can some one help me :: thanks
1
7,301,888
09/04/2011 20:23:21
524,670
11/30/2010 04:16:39
104
8
Error that can't be fixed?
im getting an error in my vb.net application that connects to my SQL database.It connects fine but for some reason i can't fix this error. When i try to fix it, it moves from one part of my script to another part of my script (both of which were working yesterday). The Error Details are below: ![Error][1] [1]: http://i.stack.imgur.com/7Tljr.png Unfortunately it's difficult for me to describe how i produced this result because it has happened in multiple parts of my code, and the only thing that these parts have in common is their interaction with Listbox1. the first part of code to get this error was: Dim sqlpage As MySqlCommand = New MySqlCommand("SELECT * FROM [" & frmMain.ListBox1.SelectedItem.value & "]", con) then i got the same exact error for: Private Sub ListBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedValueChanged Try Form1.Label1.Text = ListBox1.SelectedItem Form1.Show() Catch myerror As MySqlException MessageBox.Show("Error Setting Up Project Page: " & myerror.Message) End Try End Sub more specifically: Form1.Label1.Text = ListBox1.SelectedItem and then i got it a few more times but i think the examples above will suffice. Since there is no "With Block Variables" in the examples above then the only other option is that its object related. Ive tried different methods of defining and redefining the object variables related to the error however the results are the same. i've asked several questions on this site hoping that i would finally find a solution and i'm willing to offer 50 reputation points to anyone that can successfully solve this problem without creating more errors. If more information is needed to do so, just ask.
vb.net
debugging
error-handling
unhandled-exception
null
null
open
Error that can't be fixed? === im getting an error in my vb.net application that connects to my SQL database.It connects fine but for some reason i can't fix this error. When i try to fix it, it moves from one part of my script to another part of my script (both of which were working yesterday). The Error Details are below: ![Error][1] [1]: http://i.stack.imgur.com/7Tljr.png Unfortunately it's difficult for me to describe how i produced this result because it has happened in multiple parts of my code, and the only thing that these parts have in common is their interaction with Listbox1. the first part of code to get this error was: Dim sqlpage As MySqlCommand = New MySqlCommand("SELECT * FROM [" & frmMain.ListBox1.SelectedItem.value & "]", con) then i got the same exact error for: Private Sub ListBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedValueChanged Try Form1.Label1.Text = ListBox1.SelectedItem Form1.Show() Catch myerror As MySqlException MessageBox.Show("Error Setting Up Project Page: " & myerror.Message) End Try End Sub more specifically: Form1.Label1.Text = ListBox1.SelectedItem and then i got it a few more times but i think the examples above will suffice. Since there is no "With Block Variables" in the examples above then the only other option is that its object related. Ive tried different methods of defining and redefining the object variables related to the error however the results are the same. i've asked several questions on this site hoping that i would finally find a solution and i'm willing to offer 50 reputation points to anyone that can successfully solve this problem without creating more errors. If more information is needed to do so, just ask.
0
9,882,448
03/27/2012 02:08:19
1,224,740
02/22/2012 02:04:33
1
0
Does anyone know if it's possible to create a static build of R?
I have a requirement to run R WITHOUT R environment on CentOS.
r
static
compilation
null
null
03/27/2012 08:40:17
not a real question
Does anyone know if it's possible to create a static build of R? === I have a requirement to run R WITHOUT R environment on CentOS.
1
525,162
02/08/2009 04:36:33
691
08/07/2008 21:53:57
175
8
Does PartialView do what I think it should (but doesn't)?
I have a div on an ASP.NET MVC page that I would like to populate dynamically (at user request) using jQuery. I currently have jQuery placing a JSON call to my controller, which returns a JSON object, and then I use Javascript to build the HTML manually, which is then placed in the div. Hang on a minute. Wouldn't it be much easier to get the controller to produce the HTML on its own (using a custom control (.ascx file)), and then just return the string to be placed in the div? Easier, schmeasier! My current attempt involves the following javascript: $('#MyDiv').load("/MyController/GetList"); calling the following controller method: public PartialViewResult GetList() { ... create model ... var result = PartialView("CategoryList", model); return result; } Problem is, I get absolutely no response from the controller. It is called correctly (as proven by a breakpoint), but Firebug doesn't even register a call to the controller in Net view (although the call does show up the Firebug Console window, with a blank response). What is PartialView (and PartialViewResult) used for, and what should I be doing instead of this? Thanks in advance.
ajax
jquery
asp.net-mvc
null
null
null
open
Does PartialView do what I think it should (but doesn't)? === I have a div on an ASP.NET MVC page that I would like to populate dynamically (at user request) using jQuery. I currently have jQuery placing a JSON call to my controller, which returns a JSON object, and then I use Javascript to build the HTML manually, which is then placed in the div. Hang on a minute. Wouldn't it be much easier to get the controller to produce the HTML on its own (using a custom control (.ascx file)), and then just return the string to be placed in the div? Easier, schmeasier! My current attempt involves the following javascript: $('#MyDiv').load("/MyController/GetList"); calling the following controller method: public PartialViewResult GetList() { ... create model ... var result = PartialView("CategoryList", model); return result; } Problem is, I get absolutely no response from the controller. It is called correctly (as proven by a breakpoint), but Firebug doesn't even register a call to the controller in Net view (although the call does show up the Firebug Console window, with a blank response). What is PartialView (and PartialViewResult) used for, and what should I be doing instead of this? Thanks in advance.
0
7,903,547
10/26/2011 13:47:49
228,755
12/10/2009 11:56:45
2,166
111
iphone : How to create account on itunesconnect.apple.com?
I want to publish my iphone app on App Store. I have **Team Agents** rights on my apple account and have created distribution profile successfully. But when I enter my **Apple ID** and **Password** of my [https://developer.apple.com/][1] account to [https://itunesconnect.apple.com/][2] to publish my app on app store is gives error message. ***Apple ID does not have permission to access iTunes Connect.*** I read that if you have Team agents rights than you can login to itunesconnect.apple.com. Please help me that if there is any problem or I am going to the wrong side. ![enter image description here][3] [1]: https://developer.apple.com/ [2]: https://itunesconnect.apple.com/ [3]: http://i.stack.imgur.com/u3JH8.png
iphone
ios
xcode
app-store
itunesconnect
10/26/2011 15:20:10
off topic
iphone : How to create account on itunesconnect.apple.com? === I want to publish my iphone app on App Store. I have **Team Agents** rights on my apple account and have created distribution profile successfully. But when I enter my **Apple ID** and **Password** of my [https://developer.apple.com/][1] account to [https://itunesconnect.apple.com/][2] to publish my app on app store is gives error message. ***Apple ID does not have permission to access iTunes Connect.*** I read that if you have Team agents rights than you can login to itunesconnect.apple.com. Please help me that if there is any problem or I am going to the wrong side. ![enter image description here][3] [1]: https://developer.apple.com/ [2]: https://itunesconnect.apple.com/ [3]: http://i.stack.imgur.com/u3JH8.png
2
4,566,526
12/30/2010 21:47:47
558,755
12/30/2010 21:47:47
1
0
cant figure out pointer assignment in c
int add(char *var1, char *var2, char **var3) { int num1, num2, length1 = strlen(var1), length2 = strlen(var2), length = max(length1, length2) + 1; char *result = (char*) calloc(length, sizeof(char)); ... free(*var3); *var3 = result; return 0; } out side of the function i get its still nothing(var3); more detail: int addSubCommand(char **vars, int isAdd) { ... return add(vars[index1], var2, &(vars[index3])); } thats where i call add. the char** vars goes from every function to the other.
c
null
null
null
null
01/02/2011 01:28:24
not a real question
cant figure out pointer assignment in c === int add(char *var1, char *var2, char **var3) { int num1, num2, length1 = strlen(var1), length2 = strlen(var2), length = max(length1, length2) + 1; char *result = (char*) calloc(length, sizeof(char)); ... free(*var3); *var3 = result; return 0; } out side of the function i get its still nothing(var3); more detail: int addSubCommand(char **vars, int isAdd) { ... return add(vars[index1], var2, &(vars[index3])); } thats where i call add. the char** vars goes from every function to the other.
1
7,142,673
08/22/2011 02:41:13
904,236
08/21/2011 01:39:50
23
0
What do people in the computer graphics industry use for ray tracing?
I took a **computer graphics course** (graduate level) this past year. We spent the semester **building a ray tracer** and adding features to it. We built **everything from scratch** in C++, presumably for the purpose of gaining a better understanding of the underlying data structures and algorithms. Here's my question: If I were to get a job in industry with computer graphics, **would people think I was crazy if I started building everything from the ground up** for ray tracing like this? Are there graphics **libraries** and **frameworks** similar to OpenGL which support ray tracing? Does OpenGL itself support ray tracing? My professor for the course is an expert in the fundamentals of computer graphics theory and the relevant mathematics, but doesn't have any understanding of modern frameworks and libraries which are used by professionals for computer graphics. She's more of a scientist than a practitioner. If I were to use a library to help me out with ray tracing, it would probably be good if it supported distributing the computations to a cluster of computers. I could also use a **book recommendation**, if you know of one which would help **bridge this gap in my understanding**. Thanks!
opengl
graphics
frameworks
raytracing
null
08/22/2011 03:09:22
off topic
What do people in the computer graphics industry use for ray tracing? === I took a **computer graphics course** (graduate level) this past year. We spent the semester **building a ray tracer** and adding features to it. We built **everything from scratch** in C++, presumably for the purpose of gaining a better understanding of the underlying data structures and algorithms. Here's my question: If I were to get a job in industry with computer graphics, **would people think I was crazy if I started building everything from the ground up** for ray tracing like this? Are there graphics **libraries** and **frameworks** similar to OpenGL which support ray tracing? Does OpenGL itself support ray tracing? My professor for the course is an expert in the fundamentals of computer graphics theory and the relevant mathematics, but doesn't have any understanding of modern frameworks and libraries which are used by professionals for computer graphics. She's more of a scientist than a practitioner. If I were to use a library to help me out with ray tracing, it would probably be good if it supported distributing the computations to a cluster of computers. I could also use a **book recommendation**, if you know of one which would help **bridge this gap in my understanding**. Thanks!
2
5,792,507
04/26/2011 15:17:54
57,986
01/22/2009 17:23:25
12,265
384
How can I determine the parameters required by an arbitrary piece of T-SQL?
Basically, I'm looking for an equivalent to `SqlCommandBuilder.DeriveParameters` that will work for arbitrary T-SQL. For example, this query requires one parameter: SELECT 'a' + @Foo + '@Bar' I basically need to extract: new[] { "Foo" } From above. I could build a SQL parser, but I have an open connection to SQL server, so I'd prefer to use an existing option if possible.
c#
.net
tsql
reflection
null
null
open
How can I determine the parameters required by an arbitrary piece of T-SQL? === Basically, I'm looking for an equivalent to `SqlCommandBuilder.DeriveParameters` that will work for arbitrary T-SQL. For example, this query requires one parameter: SELECT 'a' + @Foo + '@Bar' I basically need to extract: new[] { "Foo" } From above. I could build a SQL parser, but I have an open connection to SQL server, so I'd prefer to use an existing option if possible.
0
7,840,989
10/20/2011 19:11:35
892,029
08/12/2011 15:08:13
765
11
Groovy Migration for Java Developer
I've been a Java developer for several years now. Lately there's been quite the buzz over **Groovy**. I checked it out and it looks interesting and all, but I'm not seeing any inherent "wow factor" to it; meaning, I'm not seeing any intrinsic value to begin developing in it. Now, I'm *positive* that I'm just not seeing the forest through the trees here. So, I ask the SO community at large: how would learning Groovy behoove any Java developer? What features/capabilities/etc. does it do (or do better) than plain ole' Java? Things in the software world don't take off like wildfire without a reason. I'm sure Groovy has all sorts of nifty little (and big) capabilities that make it a must-know; I'm just not "getting" it. Thanks in advance.
java
groovy
null
null
null
10/21/2011 04:34:06
not constructive
Groovy Migration for Java Developer === I've been a Java developer for several years now. Lately there's been quite the buzz over **Groovy**. I checked it out and it looks interesting and all, but I'm not seeing any inherent "wow factor" to it; meaning, I'm not seeing any intrinsic value to begin developing in it. Now, I'm *positive* that I'm just not seeing the forest through the trees here. So, I ask the SO community at large: how would learning Groovy behoove any Java developer? What features/capabilities/etc. does it do (or do better) than plain ole' Java? Things in the software world don't take off like wildfire without a reason. I'm sure Groovy has all sorts of nifty little (and big) capabilities that make it a must-know; I'm just not "getting" it. Thanks in advance.
4
474,901
01/23/2009 22:37:58
50,272
12/30/2008 19:04:16
21
0
Vertical Wrapping in HTML
I'm looking for a good way to do a vertical wrap. My goal is to fit a list of checkboxes into a div. I have the checkboxes sorted alphabetically, and I want the list to flow from the top of the div to the bottom and then begin again in a new column when they reach the bottom. Right now, I can do this by breaking the list into chunks of a predefined size on the server-side before feeding it into my html template. But things get messy when the list gets so long that you have to scroll. I'm hoping to force it to scroll horizontally only. This is not so easy, since I'm holding each chunk in a floating div, so white-space:nowrap doesn't seem to cut it. Currently, I'm using javascript count the number of list chunks and extend the width of an intermediary container (inside the div that serves as the viewport but containing the divs that contain the data). I want something that looks roughly like this: __________________________ | []..... []..... []..... | | []..... []..... []..... | | []..... []..... | | []..... []..... | |__________________________| |<|_____________|___||___|>| So I guess I have two questions: 1. Is there a good way to vertically wrap a list? 2. Is there a good way to force horizontal scrolling when the data gets too large for the viewport?
html
javascript
css
null
null
null
open
Vertical Wrapping in HTML === I'm looking for a good way to do a vertical wrap. My goal is to fit a list of checkboxes into a div. I have the checkboxes sorted alphabetically, and I want the list to flow from the top of the div to the bottom and then begin again in a new column when they reach the bottom. Right now, I can do this by breaking the list into chunks of a predefined size on the server-side before feeding it into my html template. But things get messy when the list gets so long that you have to scroll. I'm hoping to force it to scroll horizontally only. This is not so easy, since I'm holding each chunk in a floating div, so white-space:nowrap doesn't seem to cut it. Currently, I'm using javascript count the number of list chunks and extend the width of an intermediary container (inside the div that serves as the viewport but containing the divs that contain the data). I want something that looks roughly like this: __________________________ | []..... []..... []..... | | []..... []..... []..... | | []..... []..... | | []..... []..... | |__________________________| |<|_____________|___||___|>| So I guess I have two questions: 1. Is there a good way to vertically wrap a list? 2. Is there a good way to force horizontal scrolling when the data gets too large for the viewport?
0
6,656,417
07/11/2011 20:53:22
372,592
06/21/2010 21:17:30
1
0
Drupal hosting support
I work for a government organization and we are looking to see if there are any hosting/support services that will take care of keeping a Drupal install up to date and help ensure the security of the site. The site would be an intranet site so security is of high importance. We are able to do the vast majority of the Drupal development in-house but don't want to deal with the IT maintenance issues.
security
drupal
support
updates
it
07/12/2011 14:43:56
off topic
Drupal hosting support === I work for a government organization and we are looking to see if there are any hosting/support services that will take care of keeping a Drupal install up to date and help ensure the security of the site. The site would be an intranet site so security is of high importance. We are able to do the vast majority of the Drupal development in-house but don't want to deal with the IT maintenance issues.
2
7,065,467
08/15/2011 13:25:39
894,588
08/15/2011 07:00:32
6
0
How to learn debugging in c#?
How to learn debugging in c#? I have never used debugging tools like Step Into. Seems quite nice to be able to go step by step through the code. So far my debugging is just printing a lot all over the place which seems like a waste of time. I must learn debugging tools. Would be nice also if there are books that talk about debugging in language independent manner? Thank you for any advices
c#
debugging
null
null
null
08/15/2011 13:28:41
not a real question
How to learn debugging in c#? === How to learn debugging in c#? I have never used debugging tools like Step Into. Seems quite nice to be able to go step by step through the code. So far my debugging is just printing a lot all over the place which seems like a waste of time. I must learn debugging tools. Would be nice also if there are books that talk about debugging in language independent manner? Thank you for any advices
1
7,114,935
08/18/2011 22:30:21
798,717
06/15/2011 00:44:09
20
2
DDMS is not showing expected output when dumping HPROF file
I am trying to use the DDMS in android to see how much memory my app is using but I can't seem to get it to show anything readable. I press dump the HPROF file and all I get is gibberish: ![](http://i1091.photobucket.com/albums/i382/ebbybeh/error-1.png) This used to work, but stopped ever since I switched workspaces(old one was corrupt) in eclipse. I also get an error in logCat :08-18 14:26:54.420: ERROR/ActivityThread(330): Failed to find provider info for htc_data_call_log but I'm not sure if that's relavent
android
eclipse
ddms
null
null
08/22/2011 23:46:31
too localized
DDMS is not showing expected output when dumping HPROF file === I am trying to use the DDMS in android to see how much memory my app is using but I can't seem to get it to show anything readable. I press dump the HPROF file and all I get is gibberish: ![](http://i1091.photobucket.com/albums/i382/ebbybeh/error-1.png) This used to work, but stopped ever since I switched workspaces(old one was corrupt) in eclipse. I also get an error in logCat :08-18 14:26:54.420: ERROR/ActivityThread(330): Failed to find provider info for htc_data_call_log but I'm not sure if that's relavent
3
2,907,945
05/25/2010 19:43:29
350,272
05/25/2010 19:43:29
1
0
Focus Window by CGWindowID
Is it possible to focus a NSWindow by its CGWindowID? And yes, how? I need to focus a Window of another application, but I have only its CGWindowID and I can only find sample code about retrieving the ID, but not how to focus a Window by its ID.
objective-c
cocoa
osx
null
null
null
open
Focus Window by CGWindowID === Is it possible to focus a NSWindow by its CGWindowID? And yes, how? I need to focus a Window of another application, but I have only its CGWindowID and I can only find sample code about retrieving the ID, but not how to focus a Window by its ID.
0
8,785,451
01/09/2012 08:09:25
792,248
06/10/2011 06:41:13
91
1
How to change the bar background of column series in DVC:Chart to red?
Hi i'm plotting **columnseries** graph using chart controls by downloading Microsoft wpftoolkit. I can able to draw the graph using my data but the background color of the bar was not changing.How to change the bar color to red instead of default ***LightSteelBlue*** color. Here is my code <Window x:Class="net.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" Title="Window1" Height="800" Width="800" xmlns:my="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"> <Grid> <DVC:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart" Width="800" Height="450" FontSize="12" Background="DarkGray" Foreground="DarkRed"> <DVC:Chart.Series> <DVC:ColumnSeries x:Name="Barchart" Title="Students" ItemsSource="{Binding list}" IndependentValueBinding="{Binding Path=Name}" DependentValueBinding="{Binding Path=students}" > </DVC:ColumnSeries> </DVC:Chart.Series> </DVC:Chart> </Grid> </Window> can any one help me to resolve this?. Thanks in advance. Please answer this.
c#
visual-studio
charts
wpf-controls
wpftoolkit
null
open
How to change the bar background of column series in DVC:Chart to red? === Hi i'm plotting **columnseries** graph using chart controls by downloading Microsoft wpftoolkit. I can able to draw the graph using my data but the background color of the bar was not changing.How to change the bar color to red instead of default ***LightSteelBlue*** color. Here is my code <Window x:Class="net.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" xmlns:DV="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" Title="Window1" Height="800" Width="800" xmlns:my="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"> <Grid> <DVC:Chart Canvas.Top="80" Canvas.Left="10" Name="mcChart" Width="800" Height="450" FontSize="12" Background="DarkGray" Foreground="DarkRed"> <DVC:Chart.Series> <DVC:ColumnSeries x:Name="Barchart" Title="Students" ItemsSource="{Binding list}" IndependentValueBinding="{Binding Path=Name}" DependentValueBinding="{Binding Path=students}" > </DVC:ColumnSeries> </DVC:Chart.Series> </DVC:Chart> </Grid> </Window> can any one help me to resolve this?. Thanks in advance. Please answer this.
0
11,578,954
07/20/2012 12:00:56
983,827
10/07/2011 10:39:43
36
4
Using subquery in Doctrine 1.2
I'm having alot of trouble using a subquery in an update statement in doctrine 1.2 I want to set a field to the result of a subquery, but it seems impossible. This is what i tried sofar. $query = Doctrine_Query::create()->from('Users_Model_Book b'); $subSelect = $query->createSubquery()->select('ROUND(SUM(br.rating) / COUNT(br.id))')->from('b.BookRating')->where('b.BookRating.book_id = b.id'); $query->update()->set('bookrating', '('.$subSelect->getDql().')')->where('b.id = ?', $this->id)->getRawSql(); **Will give 'Unknown component alias br'** $q = new Doctrine_RawSql(); $q ->addComponent('b', 'Users_Model_Book') ->addComponent('br', 'Users_Model_BookRating') ->update('b') ->set('b.bookrating', 'ROUND(SUM(br.rating) / COUNT(br.id)') ->where('b.id = ' . (bool) $this->id); echo $q->getSqlQuery(); Will return **SELECT b.id AS b__id, br.id AS br__id FROM b WHERE b.id = 1** Anybody that can help me?
doctrine
subquery
doctrine-1.2
null
null
null
open
Using subquery in Doctrine 1.2 === I'm having alot of trouble using a subquery in an update statement in doctrine 1.2 I want to set a field to the result of a subquery, but it seems impossible. This is what i tried sofar. $query = Doctrine_Query::create()->from('Users_Model_Book b'); $subSelect = $query->createSubquery()->select('ROUND(SUM(br.rating) / COUNT(br.id))')->from('b.BookRating')->where('b.BookRating.book_id = b.id'); $query->update()->set('bookrating', '('.$subSelect->getDql().')')->where('b.id = ?', $this->id)->getRawSql(); **Will give 'Unknown component alias br'** $q = new Doctrine_RawSql(); $q ->addComponent('b', 'Users_Model_Book') ->addComponent('br', 'Users_Model_BookRating') ->update('b') ->set('b.bookrating', 'ROUND(SUM(br.rating) / COUNT(br.id)') ->where('b.id = ' . (bool) $this->id); echo $q->getSqlQuery(); Will return **SELECT b.id AS b__id, br.id AS br__id FROM b WHERE b.id = 1** Anybody that can help me?
0
3,275,639
07/18/2010 13:16:04
395,153
07/09/2009 13:02:08
3
0
Perfect for my career?
I am writing this to u all hoping a good answer for my question.Actually i am a dot net developer since last 5 years. I am using visual studio since there product framework version 1.0 - 3.5. I am very much OK with development technically. But only issue is i don't have any paper qualification or certification yet. Now i am planning to change my place and i feel like i am not competitive with others since i don't have any paper qualification. So please be advice me on this and tell me the best choice that can i asap to make my qualifications. I have choice MSTS and now 4.o has been released so tell me how can i manage these certification with time manner and world demands, i feel like i don't need to go backward with doing 70-536 - 2.0 exams now and should be updated latest. So please provide me the guidelines ,. i would appreciate your comments. Thanks in advance~!
career-development
mstsc
null
null
null
07/18/2010 15:59:52
off topic
Perfect for my career? === I am writing this to u all hoping a good answer for my question.Actually i am a dot net developer since last 5 years. I am using visual studio since there product framework version 1.0 - 3.5. I am very much OK with development technically. But only issue is i don't have any paper qualification or certification yet. Now i am planning to change my place and i feel like i am not competitive with others since i don't have any paper qualification. So please be advice me on this and tell me the best choice that can i asap to make my qualifications. I have choice MSTS and now 4.o has been released so tell me how can i manage these certification with time manner and world demands, i feel like i don't need to go backward with doing 70-536 - 2.0 exams now and should be updated latest. So please provide me the guidelines ,. i would appreciate your comments. Thanks in advance~!
2
11,028,169
06/14/2012 06:59:48
1,063,310
11/24/2011 06:08:19
68
7
iphone photo crop
i am implementing photoalbum and i want to select image from album and then go to edit image page and crop image like iphone do like make rectangle and show matrix same like in iphone 4s and i can resize that but i only see a big rectangle i use this code if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { UIImagePickerController *picker=[[UIImagePickerController alloc]init]; picker.delegate=(id)self; picker.allowsEditing=YES; picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; and this delegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { }
iphone
ios
xcode
uiimage
uiimagepickercontroller
null
open
iphone photo crop === i am implementing photoalbum and i want to select image from album and then go to edit image page and crop image like iphone do like make rectangle and show matrix same like in iphone 4s and i can resize that but i only see a big rectangle i use this code if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { UIImagePickerController *picker=[[UIImagePickerController alloc]init]; picker.delegate=(id)self; picker.allowsEditing=YES; picker.sourceType=UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; and this delegate - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { }
0
8,147,488
11/16/2011 06:11:30
1,032,724
11/06/2011 20:12:59
6
0
Apend xml content to another xml (but without the header part) on Android
I have an app for Android that downloads a xml from the web. I managed to update that xml by appending another xml to it. But I don't want my xml to contain the second xml's header. I want it to be continuous (not like it was composed by several files). How can I append the second xml to the first without the firsts 4 - 5 lines (the header that I'm not interested about)? I want that because I get an error when parsing the concateneted xml with sax. (my guess is that the second one's header is the reason). Thanks.
java
android
xml
append
concat
null
open
Apend xml content to another xml (but without the header part) on Android === I have an app for Android that downloads a xml from the web. I managed to update that xml by appending another xml to it. But I don't want my xml to contain the second xml's header. I want it to be continuous (not like it was composed by several files). How can I append the second xml to the first without the firsts 4 - 5 lines (the header that I'm not interested about)? I want that because I get an error when parsing the concateneted xml with sax. (my guess is that the second one's header is the reason). Thanks.
0
6,491,828
06/27/2011 10:59:32
817,189
06/27/2011 10:47:27
1
0
SOAPpy installation unable to find fpconst eventhough its installed
I am a complete novice to the python world and have recently been asked to migrate a legacy application that runs on Python 2.4.15, SOAPpy Module & fpconst. While installing SOAPpy 0.12.4 on the machine, I get an error saying that its unable to locate fpconst eventhough it has been installed on the server. PFB the steps followed 1. Installed Python 2.4.15 2. Installed setuptools-0.6c11.win32-py2.4.exe 3. Installed wstools-0.3 4. installed fpconst-0.7.2 >>> import fpconst >>> fpconst.__version__ '0.7.2' 5. Tried to install SOAPpy 0.12.4 but receiving an error saying Installed d:\python2.4\lib\site-packages\soappy-0.12.4-py2.4.egg Processing dependencies for SOAPpy==0.12.4 Searching for fpconst Reading _http://pypi.python.org/simple/fpconst/ Download error: (11001, 'getaddrinfo failed') -- Some packages may not be found! Couldn't find index page for 'fpconst' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading _http://pypi.python.org/simple/ Download error: (11001, 'getaddrinfo failed') -- Some packages may not be found! PFB the complete installation log : > D:\Temp\SOAPpy > trial\SOAPpy-0.12.4>python setup.py > build running build running build_py > creating build creating build\lib > creating build\lib\SOAPpy copying > src\SOAPpy\Client.py -> > build\lib\SOAPpy copying > src\SOAPpy\Config.py -> > build\lib\SOAPpy copying > src\SOAPpy\Errors.py -> > build\lib\SOAPpy copying > src\SOAPpy\GSIServer.py -> > build\lib\SOAPpy copying > src\SOAPpy\NS.py -> build\lib\SOAPpy > copying src\SOAPpy\Parser.py -> > build\lib\SOAPpy copying > src\SOAPpy\Server.py -> > build\lib\SOAPpy copying > src\SOAPpy\SOAP.py -> build\lib\SOAPpy > copying src\SOAPpy\SOAPBuilder.py -> > build\lib\SOAPpy copying > src\SOAPpy\Types.py -> > build\lib\SOAPpy copying > src\SOAPpy\URLopener.py -> > build\lib\SOAPpy copying > src\SOAPpy\Utilities.py -> > build\lib\SOAPpy copying > src\SOAPpy\version.py -> > build\lib\SOAPpy copying > src\SOAPpy\WSDL.py -> build\lib\SOAPpy > copying src\SOAPpy\__init__.py -> > build\lib\SOAPpy running egg_info > writing requirements to > src\SOAPpy.egg-info\requires.txt > writing src\SOAPpy.egg-info\PKG-INFO > writing top-level names to > src\SOAPpy.egg-info\top_level.txt > writing dependency_links to > src\SOAPpy.egg-info\dependency_links.txt > reading manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > writing manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > > > D:\Temp\SOAPpy > trial\SOAPpy-0.12.4>python setup.py > install running install running > bdist_egg running egg_info writing > requirements to > src\SOAPpy.egg-info\requires.txt > writing src\SOAPpy.egg-info\PKG-INFO > writing top-level names to > src\SOAPpy.egg-info\top_level.txt > writing dependency_links to > src\SOAPpy.egg-info\dependency_links.txt > reading manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > writing manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > installing library code to > build\bdist.win32\egg running > install_lib running build_py creating > build\bdist.win32 creating > build\bdist.win32\egg creating > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Client.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Config.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Errors.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\GSIServer.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\NS.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Parser.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Server.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\SOAP.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\SOAPBuilder.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Types.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\URLopener.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Utilities.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\version.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\WSDL.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\__init__.py -> > build\bdist.win32\egg\SOAPpy > byte-compiling > build\bdist.win32\egg\SOAPpy\Client.py > to Client.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Config.py > to Config.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Errors.py > to Errors.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\GSIServer.py > to GSIServer.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\NS.py to > NS.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Parser.py > to Parser.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Server.py > to Server.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\SOAP.py > to SOAP.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\SOAPBuilder.py > to SOAPBuilder.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Types.py > to Types.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\URLopener.py > to URLopener.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Utilities.py > to Utilities.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\version.py > to version.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\WSDL.py > to WSDL.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\__init__.py > to __init__.pyc creating > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\PKG-INFO -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\SOURCES.txt -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\dependency_links.txt > -> build\bdist.win32\egg\EGG-IN FO copying > src\SOAPpy.egg-info\requires.txt -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\top_level.txt -> > build\bdist.win32\egg\EGG-INFO > zip_safe flag not set; analyzing > archive contents... creating dist > creating > 'dist\SOAPpy-0.12.4-py2.4.egg' and > adding 'build\bdist.win32\egg' to it > > removing 'build\bdist.win32\egg' (and > everything under it) Processing > SOAPpy-0.12.4-py2.4.egg Copying > SOAPpy-0.12.4-py2.4.egg to > d:\python2.4\lib\site-packages Adding > SOAPpy 0.12.4 to easy-install.pth file > > Installed > d:\python2.4\lib\site-packages\soappy-0.12.4-py2.4.egg > Processing dependencies for > SOAPpy==0.12.4 Searching for fpconst > Reading > http://pypi.python.org/simple/fpconst/ > Download error: (11001, 'getaddrinfo > failed') -- Some packages may not be > found! > > Couldn't find index page for 'fpconst' > (maybe misspelled?) Scanning index of > all packages (this may take a while) > Reading http://pypi.python.org/simple/ > Download error: (11001, 'getaddrinfo > failed') -- Some packages may not be > found! > > No local packages or download links > found for fpconst Best match: None > Traceback (most recent call last): > File "setup.py", line 68, in ? > install_requires=[ File "D:\Python2.4\lib\distutils\core.py", > line 149, in setup > dist.run_commands() File "D:\Python2.4\lib\distutils\dist.py", > line 946, in run_commands > self.run_command(cmd) File "D:\Python2.4\lib\distutils\dist.py", > line 966, in run_command > cmd_obj.run() File "D:\Python2.4\Lib\site-packages\setuptools\command\install.py", > line 76, in run > self.do_egg_install() File "D:\Python2.4\Lib\site-packages\setuptools\command\install.py", > line 104, in do_egg_install > cmd.run() File "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 211, in run > self.easy_install(spec, not self.no_deps) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 427, in easy_install > return self.install_item(None, spec, tmpdir, deps, True) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 478, in install_item > self.process_distribution(spec, dist, deps) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 518, in process_distribution > distros = WorkingSet([]).resolve( File > "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 563, in resolve > dist = best[req.key] = env.best_match(req, self, installer) > File > "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 799, in best_matc h > return self.obtain(req, installer) # try and download/install File "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 811, in obtain > return installer(requirement) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 434, in easy_install > self.local_index File "D:\Python2.4\Lib\site-packages\setuptools\package_index.py", > line 475, i n fetch_distribution > return dist.clone(location=self.download(dist.location, > tmpdir)) AttributeError: 'NoneType' > object has no attribute 'clone'
soappy
null
null
null
null
null
open
SOAPpy installation unable to find fpconst eventhough its installed === I am a complete novice to the python world and have recently been asked to migrate a legacy application that runs on Python 2.4.15, SOAPpy Module & fpconst. While installing SOAPpy 0.12.4 on the machine, I get an error saying that its unable to locate fpconst eventhough it has been installed on the server. PFB the steps followed 1. Installed Python 2.4.15 2. Installed setuptools-0.6c11.win32-py2.4.exe 3. Installed wstools-0.3 4. installed fpconst-0.7.2 >>> import fpconst >>> fpconst.__version__ '0.7.2' 5. Tried to install SOAPpy 0.12.4 but receiving an error saying Installed d:\python2.4\lib\site-packages\soappy-0.12.4-py2.4.egg Processing dependencies for SOAPpy==0.12.4 Searching for fpconst Reading _http://pypi.python.org/simple/fpconst/ Download error: (11001, 'getaddrinfo failed') -- Some packages may not be found! Couldn't find index page for 'fpconst' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading _http://pypi.python.org/simple/ Download error: (11001, 'getaddrinfo failed') -- Some packages may not be found! PFB the complete installation log : > D:\Temp\SOAPpy > trial\SOAPpy-0.12.4>python setup.py > build running build running build_py > creating build creating build\lib > creating build\lib\SOAPpy copying > src\SOAPpy\Client.py -> > build\lib\SOAPpy copying > src\SOAPpy\Config.py -> > build\lib\SOAPpy copying > src\SOAPpy\Errors.py -> > build\lib\SOAPpy copying > src\SOAPpy\GSIServer.py -> > build\lib\SOAPpy copying > src\SOAPpy\NS.py -> build\lib\SOAPpy > copying src\SOAPpy\Parser.py -> > build\lib\SOAPpy copying > src\SOAPpy\Server.py -> > build\lib\SOAPpy copying > src\SOAPpy\SOAP.py -> build\lib\SOAPpy > copying src\SOAPpy\SOAPBuilder.py -> > build\lib\SOAPpy copying > src\SOAPpy\Types.py -> > build\lib\SOAPpy copying > src\SOAPpy\URLopener.py -> > build\lib\SOAPpy copying > src\SOAPpy\Utilities.py -> > build\lib\SOAPpy copying > src\SOAPpy\version.py -> > build\lib\SOAPpy copying > src\SOAPpy\WSDL.py -> build\lib\SOAPpy > copying src\SOAPpy\__init__.py -> > build\lib\SOAPpy running egg_info > writing requirements to > src\SOAPpy.egg-info\requires.txt > writing src\SOAPpy.egg-info\PKG-INFO > writing top-level names to > src\SOAPpy.egg-info\top_level.txt > writing dependency_links to > src\SOAPpy.egg-info\dependency_links.txt > reading manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > writing manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > > > D:\Temp\SOAPpy > trial\SOAPpy-0.12.4>python setup.py > install running install running > bdist_egg running egg_info writing > requirements to > src\SOAPpy.egg-info\requires.txt > writing src\SOAPpy.egg-info\PKG-INFO > writing top-level names to > src\SOAPpy.egg-info\top_level.txt > writing dependency_links to > src\SOAPpy.egg-info\dependency_links.txt > reading manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > writing manifest file > 'src\SOAPpy.egg-info\SOURCES.txt' > installing library code to > build\bdist.win32\egg running > install_lib running build_py creating > build\bdist.win32 creating > build\bdist.win32\egg creating > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Client.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Config.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Errors.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\GSIServer.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\NS.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Parser.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Server.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\SOAP.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\SOAPBuilder.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Types.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\URLopener.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\Utilities.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\version.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\WSDL.py -> > build\bdist.win32\egg\SOAPpy copying > build\lib\SOAPpy\__init__.py -> > build\bdist.win32\egg\SOAPpy > byte-compiling > build\bdist.win32\egg\SOAPpy\Client.py > to Client.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Config.py > to Config.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Errors.py > to Errors.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\GSIServer.py > to GSIServer.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\NS.py to > NS.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Parser.py > to Parser.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Server.py > to Server.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\SOAP.py > to SOAP.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\SOAPBuilder.py > to SOAPBuilder.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Types.py > to Types.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\URLopener.py > to URLopener.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\Utilities.py > to Utilities.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\version.py > to version.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\WSDL.py > to WSDL.pyc byte-compiling > build\bdist.win32\egg\SOAPpy\__init__.py > to __init__.pyc creating > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\PKG-INFO -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\SOURCES.txt -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\dependency_links.txt > -> build\bdist.win32\egg\EGG-IN FO copying > src\SOAPpy.egg-info\requires.txt -> > build\bdist.win32\egg\EGG-INFO copying > src\SOAPpy.egg-info\top_level.txt -> > build\bdist.win32\egg\EGG-INFO > zip_safe flag not set; analyzing > archive contents... creating dist > creating > 'dist\SOAPpy-0.12.4-py2.4.egg' and > adding 'build\bdist.win32\egg' to it > > removing 'build\bdist.win32\egg' (and > everything under it) Processing > SOAPpy-0.12.4-py2.4.egg Copying > SOAPpy-0.12.4-py2.4.egg to > d:\python2.4\lib\site-packages Adding > SOAPpy 0.12.4 to easy-install.pth file > > Installed > d:\python2.4\lib\site-packages\soappy-0.12.4-py2.4.egg > Processing dependencies for > SOAPpy==0.12.4 Searching for fpconst > Reading > http://pypi.python.org/simple/fpconst/ > Download error: (11001, 'getaddrinfo > failed') -- Some packages may not be > found! > > Couldn't find index page for 'fpconst' > (maybe misspelled?) Scanning index of > all packages (this may take a while) > Reading http://pypi.python.org/simple/ > Download error: (11001, 'getaddrinfo > failed') -- Some packages may not be > found! > > No local packages or download links > found for fpconst Best match: None > Traceback (most recent call last): > File "setup.py", line 68, in ? > install_requires=[ File "D:\Python2.4\lib\distutils\core.py", > line 149, in setup > dist.run_commands() File "D:\Python2.4\lib\distutils\dist.py", > line 946, in run_commands > self.run_command(cmd) File "D:\Python2.4\lib\distutils\dist.py", > line 966, in run_command > cmd_obj.run() File "D:\Python2.4\Lib\site-packages\setuptools\command\install.py", > line 76, in run > self.do_egg_install() File "D:\Python2.4\Lib\site-packages\setuptools\command\install.py", > line 104, in do_egg_install > cmd.run() File "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 211, in run > self.easy_install(spec, not self.no_deps) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 427, in easy_install > return self.install_item(None, spec, tmpdir, deps, True) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 478, in install_item > self.process_distribution(spec, dist, deps) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 518, in process_distribution > distros = WorkingSet([]).resolve( File > "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 563, in resolve > dist = best[req.key] = env.best_match(req, self, installer) > File > "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 799, in best_matc h > return self.obtain(req, installer) # try and download/install File "D:\Python2.4\Lib\site-packages\pkg_resources.py", > line 811, in obtain > return installer(requirement) File > "D:\Python2.4\Lib\site-packages\setuptools\command\easy_install.py", > line 434, in easy_install > self.local_index File "D:\Python2.4\Lib\site-packages\setuptools\package_index.py", > line 475, i n fetch_distribution > return dist.clone(location=self.download(dist.location, > tmpdir)) AttributeError: 'NoneType' > object has no attribute 'clone'
0
4,797,461
01/25/2011 18:35:40
485,513
10/24/2010 09:51:56
3
1
Constant pointer array or pointer to an array ? What is faster in C ?
Hello I'm in an intermediary C class right now and this thought just came to my mind: int multi[3][4]; // const multidimensional array int* ptr = *multi; // ptr is a pointer variable that hold the address of multi const array So, what is faster/smaller/optimized for access a multidimensional array position? This: multi[3][1]; // index the value position or *(*(multi+2)+1); // pointer to the position on the array or *ptr+9; // pointer arithmetic using auxiliary pointer Since "multi" is an const array the compiler should "know" already the localization of the element position, in case of using an variable pointer pointing to that array that could take more processing time, on the other hand could be faster when searching for the item that I want to display. What is the faster/smaller/optimized approach? Thank you in advance.
c
arrays
pointers
pointer-arithmetic
null
null
open
Constant pointer array or pointer to an array ? What is faster in C ? === Hello I'm in an intermediary C class right now and this thought just came to my mind: int multi[3][4]; // const multidimensional array int* ptr = *multi; // ptr is a pointer variable that hold the address of multi const array So, what is faster/smaller/optimized for access a multidimensional array position? This: multi[3][1]; // index the value position or *(*(multi+2)+1); // pointer to the position on the array or *ptr+9; // pointer arithmetic using auxiliary pointer Since "multi" is an const array the compiler should "know" already the localization of the element position, in case of using an variable pointer pointing to that array that could take more processing time, on the other hand could be faster when searching for the item that I want to display. What is the faster/smaller/optimized approach? Thank you in advance.
0
2,664,499
04/19/2010 00:00:14
214,225
08/16/2009 18:49:42
284
13
Most valued skill set in web development industry/what should I be doing now? (Kinda random "career" question)
I want to be a web programmer [when I grow up?] because it's what I like doing, and I really do thoroughly enjoy it (web development in general, actually). I have about 2 years experience with PHP, CSS, and HTML and a few months experiance with JS and jQuery. I've been wondering this for a while -- what languages should I be most familiar with if I want to try and make a career out of web development? I'm only 17, so I've got plenty of time, and I think I've got a decent headstart on things, but it doesn't hurt to ask. If I'm thinking in terms of being able to get hired as a web programmer, what is (or what are...?) the most useful thing I can do now to be able to have an upper hand when it comes to looking for a job. What languages, as a young programmer, should I really focus on? If you were looking to hire a developer, what would you be looking for?
career-development
null
null
null
null
02/01/2012 20:25:41
not constructive
Most valued skill set in web development industry/what should I be doing now? (Kinda random "career" question) === I want to be a web programmer [when I grow up?] because it's what I like doing, and I really do thoroughly enjoy it (web development in general, actually). I have about 2 years experience with PHP, CSS, and HTML and a few months experiance with JS and jQuery. I've been wondering this for a while -- what languages should I be most familiar with if I want to try and make a career out of web development? I'm only 17, so I've got plenty of time, and I think I've got a decent headstart on things, but it doesn't hurt to ask. If I'm thinking in terms of being able to get hired as a web programmer, what is (or what are...?) the most useful thing I can do now to be able to have an upper hand when it comes to looking for a job. What languages, as a young programmer, should I really focus on? If you were looking to hire a developer, what would you be looking for?
4
11,380,868
07/08/2012 05:24:24
259,912
01/27/2010 09:28:41
594
5
960 grid elements not displaying like I think they should
I'm using the 960 grid system to layout a website. I'm having trouble getting the nivo-slider and an h1 tag to display side by side with a gutter in the middle. The two elements in question are both contained in one div, the slider has a class of grid_7 and the h1 has a class of `grid_5` These add up to 12 for the 12 column grid I'm using. I don't see why they are overlapping![enter image description here][1] [1]: http://i.stack.imgur.com/08GBm.png Here is my scss @import "compass/reset"; body { background: url(../img/background.png); } #header { background: green; margin-bottom: 25px; } .slider-wrapper { margin-bottom: 10px; } #navigation { clear: both; ul { li{ list-style: none; float: left; margin: 2px; a { text-decoration: none; } } } } #content-wrapper { clear: both; }
css
scss
null
null
null
null
open
960 grid elements not displaying like I think they should === I'm using the 960 grid system to layout a website. I'm having trouble getting the nivo-slider and an h1 tag to display side by side with a gutter in the middle. The two elements in question are both contained in one div, the slider has a class of grid_7 and the h1 has a class of `grid_5` These add up to 12 for the 12 column grid I'm using. I don't see why they are overlapping![enter image description here][1] [1]: http://i.stack.imgur.com/08GBm.png Here is my scss @import "compass/reset"; body { background: url(../img/background.png); } #header { background: green; margin-bottom: 25px; } .slider-wrapper { margin-bottom: 10px; } #navigation { clear: both; ul { li{ list-style: none; float: left; margin: 2px; a { text-decoration: none; } } } } #content-wrapper { clear: both; }
0
5,284,855
03/12/2011 19:23:43
656,883
03/12/2011 19:23:43
1
0
comparison of Embedded servers whit c/c++
who know the advantage and disadvantage of Embedded web servers that's written in c/c++ and comparison of them in ram that they use and how much they are fast, thanks in advance
c++
web-applications
embedded
null
null
03/12/2011 20:36:34
not a real question
comparison of Embedded servers whit c/c++ === who know the advantage and disadvantage of Embedded web servers that's written in c/c++ and comparison of them in ram that they use and how much they are fast, thanks in advance
1
11,345,712
07/05/2012 13:48:02
1,496,973
07/02/2012 19:15:01
1
0
Why can't I add two cpp files to a blank project?
I downloaded a filed called "Blank Project" (from a Stanford online class) which has the following files: <ul> <li>BlankProject</li> <li>BlankProject.cpp</li> <li>BlankProject.xcodeproj</li> <li>build (which has multiple files inside)</li> <li>info.plist</li> <li>StanfordCPPLib</li> </ul> However, when I added another cpp file called (factorial.cpp) and run, it didn't compile and say "build failed." When I copy the code in the factorial.cpp file, delete that file, and paste the code into the BlankProject.cpp file, it ran successfully. Why is that? How can I added 2 or more cpp files and run all of them without the "Build failed" error? Thanks
c++
null
null
null
null
07/05/2012 14:00:16
too localized
Why can't I add two cpp files to a blank project? === I downloaded a filed called "Blank Project" (from a Stanford online class) which has the following files: <ul> <li>BlankProject</li> <li>BlankProject.cpp</li> <li>BlankProject.xcodeproj</li> <li>build (which has multiple files inside)</li> <li>info.plist</li> <li>StanfordCPPLib</li> </ul> However, when I added another cpp file called (factorial.cpp) and run, it didn't compile and say "build failed." When I copy the code in the factorial.cpp file, delete that file, and paste the code into the BlankProject.cpp file, it ran successfully. Why is that? How can I added 2 or more cpp files and run all of them without the "Build failed" error? Thanks
3
1,928,122
12/18/2009 13:11:35
234,531
12/18/2009 13:06:36
1
0
c# .net - authentication expiring prematurely
I am setting up the authentication cookie in c# as persistent and with an end date of one year from now, but it expires not too long after being set. The code is below... DateTime endDate = new DateTime(); endDate = DateTime.Now.AddYears(1); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, endDate, true, userId.ToString(), FormsAuthentication.FormsCookiePath); string encryptedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie authCookie = new HttpCookie( FormsAuthentication.FormsCookieName, encryptedTicket); authCookie.Expires = endDate; Response.Cookies.Add(authCookie); Any ideas?
c#
.net
forms
authentication
null
null
open
c# .net - authentication expiring prematurely === I am setting up the authentication cookie in c# as persistent and with an end date of one year from now, but it expires not too long after being set. The code is below... DateTime endDate = new DateTime(); endDate = DateTime.Now.AddYears(1); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, username, DateTime.Now, endDate, true, userId.ToString(), FormsAuthentication.FormsCookiePath); string encryptedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie authCookie = new HttpCookie( FormsAuthentication.FormsCookieName, encryptedTicket); authCookie.Expires = endDate; Response.Cookies.Add(authCookie); Any ideas?
0
5,428,769
03/25/2011 05:11:16
561,731
01/03/2011 20:37:07
2,198
159
trying to move box with keys and it is not working
I have a fiddle here: http://jsfiddle.net/maniator/SZpkF/1/ The green box is supposed to move with the arrowkeys. can some one explain why it wont work? js: var game = { playArea: null, player: null, init: function() { this.playArea = $('<div>', { style: 'background-color: #AAF;' }); this.player = $('<span>'); this.player.css({ width: 20, height: 20, 'background-color': '#AFA', display: 'block', position: 'absolute', top: 0, left: 0 }) $(window).resize(game.resize); $('body').append(this.playArea); this.resize(); this.playArea.append(this.player); $(document).keydown(function(event) { game.keydown(event) }) return this; }, resize: function() { //console.log('resize', game); game.playArea.css({ width: $(window).width() - 50, height: $(window).height() - 50, }); return this; }, keydown: function(event) { var direction; switch (event.keyCode) { case 38: direction = { 'top': '-= 15' }; break; case 40: direction = { 'top': '+= 15' }; break; case 37: direction = { 'left': '+= 15' }; break; case 39: direction = { 'left': '-= 15' }; break; } console.log(direction, event, game.player); game.player.animate(direction, 'slow'); } }; $(function() { game.init(); })
javascript
jquery
animate
keys
null
null
open
trying to move box with keys and it is not working === I have a fiddle here: http://jsfiddle.net/maniator/SZpkF/1/ The green box is supposed to move with the arrowkeys. can some one explain why it wont work? js: var game = { playArea: null, player: null, init: function() { this.playArea = $('<div>', { style: 'background-color: #AAF;' }); this.player = $('<span>'); this.player.css({ width: 20, height: 20, 'background-color': '#AFA', display: 'block', position: 'absolute', top: 0, left: 0 }) $(window).resize(game.resize); $('body').append(this.playArea); this.resize(); this.playArea.append(this.player); $(document).keydown(function(event) { game.keydown(event) }) return this; }, resize: function() { //console.log('resize', game); game.playArea.css({ width: $(window).width() - 50, height: $(window).height() - 50, }); return this; }, keydown: function(event) { var direction; switch (event.keyCode) { case 38: direction = { 'top': '-= 15' }; break; case 40: direction = { 'top': '+= 15' }; break; case 37: direction = { 'left': '+= 15' }; break; case 39: direction = { 'left': '-= 15' }; break; } console.log(direction, event, game.player); game.player.animate(direction, 'slow'); } }; $(function() { game.init(); })
0
3,559,253
08/24/2010 17:32:26
198,358
10/28/2009 18:38:00
13
0
How to Encrypt Clipboard?
Can the contents of the clipboard be encrypted? For example, say that to circumvent keyloggers, users copy and paste passwords from an encrypted file, but now the password lives unencrypted in the clipboard. Is there a way to prevent this behavior without breaking copy/paste, or running some script function that scrambles the clipboard information.
security
clipboard
null
null
null
08/26/2010 02:29:44
off topic
How to Encrypt Clipboard? === Can the contents of the clipboard be encrypted? For example, say that to circumvent keyloggers, users copy and paste passwords from an encrypted file, but now the password lives unencrypted in the clipboard. Is there a way to prevent this behavior without breaking copy/paste, or running some script function that scrambles the clipboard information.
2
10,461,438
05/05/2012 11:33:24
1,376,692
05/05/2012 11:23:45
1
0
iphone application server maintenance
This is probably a dumb question but here goes... I'm planning on writing an iphone app that connects to a server to download information. My question is, if the app is only bought by e.g. 10 people do I have to be continue to support it via the server, updating the information, etc. ? In other words, if the app fails, will I be burdened with supporting the app for X amount of years, or can I just write it off and pretend it never happened? Thanks for your advice!
iphone
application
maintenance
null
null
05/06/2012 17:58:11
off topic
iphone application server maintenance === This is probably a dumb question but here goes... I'm planning on writing an iphone app that connects to a server to download information. My question is, if the app is only bought by e.g. 10 people do I have to be continue to support it via the server, updating the information, etc. ? In other words, if the app fails, will I be burdened with supporting the app for X amount of years, or can I just write it off and pretend it never happened? Thanks for your advice!
2
6,972,109
08/07/2011 10:11:51
336,359
05/07/2010 19:45:06
85
0
Red Black Tree in C++, deletion algorithm
From "Introduction to alghorithms, 2nd edition": Implementation of deletion algorithm in C++ looks like this: template<class Tree_T, class Node_T> void rb_delete(Tree_T* t,Node_T* z) { Node_T* y = nullptr; Node_T* x = nullptr; if (!get_left(z) || !get_right(z)) { y = z; } else { //y = rb_successor(z); y = rb_predecessor(z); } if (get_left(y)) { x = get_left(y); } else { x = get_right(y); } set_parent(x,get_parent(y)); if (!get_parent(y)) { set_root(t,x); } else { if (y == get_left(get_parent(y))) { set_left(get_parent(y),x); } else { set_right(get_parent(y),x); } } if (y != z) { set_key(z,get_key(y)); set_value(z,get_value(y)); } if(get_color>(y) == Black) { rb_delete_fixup(t,x); } } template<class Tree_T, class Node_T> void rb_delete_fixup(Tree_T* t, Node_T* x) { while (x != get_root(t) && get_color(x) == Black) { //more code here but it never gets executed! } set_color(x,Black); } The problem is that when I create tree in order 1,2,3,4,5,6,7,8 the tree looks like this![enter image description here][1] If I were to delete root from this tree I'm getting: void rb_delete(Tree_T* t,Node_T* z)//t is the tree, z is a node with key 4 { Node_T* y = nullptr; Node_T* x = nullptr; if (!get_left(z) || !get_right(z))//z has left && right so this will get skipped { y = z; } else { //y = rb_successor(z); y = rb_predecessor(z);//to here where y will be set to 3 } if (get_left(y))//this is false { x = get_left(y); } else//so we skipping to this place { x = get_right(y);//and here x goes set to nullptr! } set_parent(x,get_parent(y));//cannot set, x == nullptr if (!get_parent(y))//this is false { set_root(t,x); } else { if (y == get_left(get_parent(y)))//this is false { set_left(get_parent(y),x); } else { set_right(get_parent(y),x);//so here we set right of parent y to nullptr } } if (y != z)//this is true { set_key(z,get_key(y)); set_value(z,get_value(y)); } if(get_color>(y) == Black)//this is true aswell { rb_delete_fixup(t,x);//here we attempting to do fixup but x == nullptr! } } //So we are going into rb_delete_fixup template<class Tree_T, class Node_T> void rb_delete_fixup(Tree_T* t, Node_T* x)//x == nullptr { while (x != get_root(t) && get_color(x) == Black)//this will get skipped because x == nullptr so no code will be executed within while loop! { //more code here but it never gets executed! } set_color(x,Black);//here x which is nullptr will get colored to Black } This code obviously doesn't work, bear in mind it is implemented line by line from book mentioned at the beginning of this question. Could anyone help me and explain to me how shall I fix it? [1]: http://i.stack.imgur.com/NVXqd.png
c++
null
null
null
null
08/09/2011 07:34:06
not constructive
Red Black Tree in C++, deletion algorithm === From "Introduction to alghorithms, 2nd edition": Implementation of deletion algorithm in C++ looks like this: template<class Tree_T, class Node_T> void rb_delete(Tree_T* t,Node_T* z) { Node_T* y = nullptr; Node_T* x = nullptr; if (!get_left(z) || !get_right(z)) { y = z; } else { //y = rb_successor(z); y = rb_predecessor(z); } if (get_left(y)) { x = get_left(y); } else { x = get_right(y); } set_parent(x,get_parent(y)); if (!get_parent(y)) { set_root(t,x); } else { if (y == get_left(get_parent(y))) { set_left(get_parent(y),x); } else { set_right(get_parent(y),x); } } if (y != z) { set_key(z,get_key(y)); set_value(z,get_value(y)); } if(get_color>(y) == Black) { rb_delete_fixup(t,x); } } template<class Tree_T, class Node_T> void rb_delete_fixup(Tree_T* t, Node_T* x) { while (x != get_root(t) && get_color(x) == Black) { //more code here but it never gets executed! } set_color(x,Black); } The problem is that when I create tree in order 1,2,3,4,5,6,7,8 the tree looks like this![enter image description here][1] If I were to delete root from this tree I'm getting: void rb_delete(Tree_T* t,Node_T* z)//t is the tree, z is a node with key 4 { Node_T* y = nullptr; Node_T* x = nullptr; if (!get_left(z) || !get_right(z))//z has left && right so this will get skipped { y = z; } else { //y = rb_successor(z); y = rb_predecessor(z);//to here where y will be set to 3 } if (get_left(y))//this is false { x = get_left(y); } else//so we skipping to this place { x = get_right(y);//and here x goes set to nullptr! } set_parent(x,get_parent(y));//cannot set, x == nullptr if (!get_parent(y))//this is false { set_root(t,x); } else { if (y == get_left(get_parent(y)))//this is false { set_left(get_parent(y),x); } else { set_right(get_parent(y),x);//so here we set right of parent y to nullptr } } if (y != z)//this is true { set_key(z,get_key(y)); set_value(z,get_value(y)); } if(get_color>(y) == Black)//this is true aswell { rb_delete_fixup(t,x);//here we attempting to do fixup but x == nullptr! } } //So we are going into rb_delete_fixup template<class Tree_T, class Node_T> void rb_delete_fixup(Tree_T* t, Node_T* x)//x == nullptr { while (x != get_root(t) && get_color(x) == Black)//this will get skipped because x == nullptr so no code will be executed within while loop! { //more code here but it never gets executed! } set_color(x,Black);//here x which is nullptr will get colored to Black } This code obviously doesn't work, bear in mind it is implemented line by line from book mentioned at the beginning of this question. Could anyone help me and explain to me how shall I fix it? [1]: http://i.stack.imgur.com/NVXqd.png
4
10,743,595
05/24/2012 18:52:37
544,847
12/16/2010 13:55:22
49
1
Send Variable from JQuery Ajax to ASP and Back
I have a list which contains various docIds. When the information is to be submited, a JQuery function is called which then collects all of the list values. I then need these list values to be sent via Ajax to a classic ASP page where the values will be formatted and then sent back to the original page to then populate a textarea. Here is my JQuery code: $("#create").click(function() { var strDocIDs = $.map($('.doc_list:visible').find('li[value]'), function(li) { return $(li).attr("value") }).join(","); alert(strDocIDs); $.ajax({ type: "GET", url: "newslettercreate_action.asp", data: { strDocIDS: strDocIDs }, success: function(result) { var newsletter_string = $(result); $("#scratch").val(newsletter_string); } }); }); And my ASP code: result = Request("strDocIDs") The information that I get returned into my textarea is: [object Object] My form method is currently set to POST. And would it matter between my using a submit button vs a traditional button to trigger the function?
jquery
ajax
asp-classic
null
null
null
open
Send Variable from JQuery Ajax to ASP and Back === I have a list which contains various docIds. When the information is to be submited, a JQuery function is called which then collects all of the list values. I then need these list values to be sent via Ajax to a classic ASP page where the values will be formatted and then sent back to the original page to then populate a textarea. Here is my JQuery code: $("#create").click(function() { var strDocIDs = $.map($('.doc_list:visible').find('li[value]'), function(li) { return $(li).attr("value") }).join(","); alert(strDocIDs); $.ajax({ type: "GET", url: "newslettercreate_action.asp", data: { strDocIDS: strDocIDs }, success: function(result) { var newsletter_string = $(result); $("#scratch").val(newsletter_string); } }); }); And my ASP code: result = Request("strDocIDs") The information that I get returned into my textarea is: [object Object] My form method is currently set to POST. And would it matter between my using a submit button vs a traditional button to trigger the function?
0
5,049,562
02/19/2011 07:42:17
393,879
07/16/2010 12:59:18
68
4
How to calculate financial year start and end dates from financial year's month end value?
I have a financial year's month end value `2`. How would i calculate the financial year `DateTime startDate` and `DateTime endDate` from that value?
c#
datetime
null
null
null
null
open
How to calculate financial year start and end dates from financial year's month end value? === I have a financial year's month end value `2`. How would i calculate the financial year `DateTime startDate` and `DateTime endDate` from that value?
0
11,715,237
07/30/2012 03:57:55
1,553,137
07/26/2012 00:12:26
8
0
PHP - how to prevent .php files from direct access
i have following folders: mywebsite/en/index.php mywebsite/en/product/info.php mywebsite/en/tags/tags.php mywebsite/en/games/list.php my site is running on friendly url, top mentioned files accessable from following friendly urls mywebsite/en/ mywebsite/en/product/Nike-glove mywebsite/en/tags/Nike mywebsite/en/games/ice-sports i have some examples, but nothing work for me like...i want to prevent direct access to .php files..i want to do that with htaccess...can i? thanks and kind regards
php
.htaccess
null
null
null
null
open
PHP - how to prevent .php files from direct access === i have following folders: mywebsite/en/index.php mywebsite/en/product/info.php mywebsite/en/tags/tags.php mywebsite/en/games/list.php my site is running on friendly url, top mentioned files accessable from following friendly urls mywebsite/en/ mywebsite/en/product/Nike-glove mywebsite/en/tags/Nike mywebsite/en/games/ice-sports i have some examples, but nothing work for me like...i want to prevent direct access to .php files..i want to do that with htaccess...can i? thanks and kind regards
0
10,354,905
04/27/2012 17:04:55
364,056
06/10/2010 23:04:34
823
9
How to sending data to a specific activity that is already started?
Suppose we have two simple applications, so we have two different packages. Each of these packages has an `Activity` that can be launched by clicking the application icon. Suppose that the two activities are as follows: - `MyFirstActivity`, which is into the package `org.firstexample.firstactivity` - `MySecondActivity`, which is into the package `org.secondexample.secondactivity` Suppose we have launched the `MyFirstActivity` activity, so it is running. Could the `MySecondActivity` activity send data directly to the `MyFirstActivity` activity? I would like the two activities (which are in different packages) can communicate with each other by exchanging data.
android
android-activity
null
null
null
null
open
How to sending data to a specific activity that is already started? === Suppose we have two simple applications, so we have two different packages. Each of these packages has an `Activity` that can be launched by clicking the application icon. Suppose that the two activities are as follows: - `MyFirstActivity`, which is into the package `org.firstexample.firstactivity` - `MySecondActivity`, which is into the package `org.secondexample.secondactivity` Suppose we have launched the `MyFirstActivity` activity, so it is running. Could the `MySecondActivity` activity send data directly to the `MyFirstActivity` activity? I would like the two activities (which are in different packages) can communicate with each other by exchanging data.
0
10,011,964
04/04/2012 13:19:33
1,228,381
02/23/2012 12:53:52
101
1
Cannot edit main window jEdit
I can no longer edit the main window of jEdit 4.5.1 on OS X 10. java 1.6.0_29 The last file I was editing appears but I can't click it. I'm using the XML plugin. I've tried uninstalling and reinstalling and rebooting, no results. I've also tried to find the settings remove those and re-install but I'm no mac expert and am not sure how to find ~/.jedit
xml
edit
jedit
null
null
null
open
Cannot edit main window jEdit === I can no longer edit the main window of jEdit 4.5.1 on OS X 10. java 1.6.0_29 The last file I was editing appears but I can't click it. I'm using the XML plugin. I've tried uninstalling and reinstalling and rebooting, no results. I've also tried to find the settings remove those and re-install but I'm no mac expert and am not sure how to find ~/.jedit
0
3,244,690
07/14/2010 09:02:53
391,153
07/14/2010 03:38:35
21
0
Compile Fastboot on windows
Specify me the steps to compile fastboot under cygwin to generate fastboot.exe for windows
android
null
null
null
null
07/16/2010 05:22:32
off topic
Compile Fastboot on windows === Specify me the steps to compile fastboot under cygwin to generate fastboot.exe for windows
2
8,843,673
01/12/2012 23:06:52
1,114,031
12/23/2011 21:54:16
8
0
Weird behavior of indexPath.section in "cellForRowAtIndexPath:"
I have a weird problem with the indexPath.section from the "cellForRowAtIndexPath:" method. <br/> I have a grouped tableview with 4 sections and I'm trying to apply a custom UITableViewCell for section 3, but it's not working. <br/> When I try if(indexPath.section==0){...} it works (and for section==1 and section==2 as well) but it fails for section==3. (?) <br/> I don't know why, that makes no sense.. Did someone already had this (strange) problem? <br/> Thanks for your help ! EDIT : When I try if(indexPath.row==0){...} it works for all a the 4 sections.. so..?!
iphone
objective-c
cocoa
null
null
null
open
Weird behavior of indexPath.section in "cellForRowAtIndexPath:" === I have a weird problem with the indexPath.section from the "cellForRowAtIndexPath:" method. <br/> I have a grouped tableview with 4 sections and I'm trying to apply a custom UITableViewCell for section 3, but it's not working. <br/> When I try if(indexPath.section==0){...} it works (and for section==1 and section==2 as well) but it fails for section==3. (?) <br/> I don't know why, that makes no sense.. Did someone already had this (strange) problem? <br/> Thanks for your help ! EDIT : When I try if(indexPath.row==0){...} it works for all a the 4 sections.. so..?!
0
10,416,072
05/02/2012 14:42:26
287,436
03/05/2010 20:47:08
1,316
32
Developing an application that spreads across multiple monitors
I apologize if this is not the proper forum for this question - but I'm looking to develop an application that will spread itself across multiple monitors (not the same image duplicated on multiple monitors, but 1 image filling the 4 monitors). I'd prefer to write it in as3 / php / javascript, but will consider something like C# if necessary. Does anyone have any tips for getting started on this? The platform can be PC or MAC, but it'd be nice to have some out of the box software that would facilitate the projection of the software onto the multiple monitors.
javascript
actionscript-3
display
multiple-monitors
null
05/03/2012 18:50:02
not a real question
Developing an application that spreads across multiple monitors === I apologize if this is not the proper forum for this question - but I'm looking to develop an application that will spread itself across multiple monitors (not the same image duplicated on multiple monitors, but 1 image filling the 4 monitors). I'd prefer to write it in as3 / php / javascript, but will consider something like C# if necessary. Does anyone have any tips for getting started on this? The platform can be PC or MAC, but it'd be nice to have some out of the box software that would facilitate the projection of the software onto the multiple monitors.
1
4,303,622
11/29/2010 12:19:59
447,023
09/14/2010 05:49:14
34
2
Zend Famework how to set action for a form (to validate on the same page) that appears in all pages
I have a form (login form) that appears in all pages (if the user is not logged in). ![alt text][1] The form is created from view helper and then directly called in layout.phtml class Zend_View_Helper_LoginForm extends Zend_View_Helper_Abstract { public function loginForm() { $login = new Application_Form_Login(); return $login; } } <?php if(!$this->isLoggedIn()): ?> <div id="login"> New User? <a href="#">Register Here</a> <?php echo $this->loginForm(); ?> <a href="#">Forgot Password!</a> </div> <?php endif; ?> Now how to set the action of this form such that i could validate the fields in the same page? [1]: http://i.stack.imgur.com/QtX94.png
zend-framework
null
null
null
null
null
open
Zend Famework how to set action for a form (to validate on the same page) that appears in all pages === I have a form (login form) that appears in all pages (if the user is not logged in). ![alt text][1] The form is created from view helper and then directly called in layout.phtml class Zend_View_Helper_LoginForm extends Zend_View_Helper_Abstract { public function loginForm() { $login = new Application_Form_Login(); return $login; } } <?php if(!$this->isLoggedIn()): ?> <div id="login"> New User? <a href="#">Register Here</a> <?php echo $this->loginForm(); ?> <a href="#">Forgot Password!</a> </div> <?php endif; ?> Now how to set the action of this form such that i could validate the fields in the same page? [1]: http://i.stack.imgur.com/QtX94.png
0
2,367,477
03/02/2010 22:49:23
197,229
08/06/2009 19:20:13
1,652
84
Can you 'checkout' from SVN without getting all the .svn stuff?
Maybe there is a proper term for this, but what if you want to simply download a specific revision of a file/directory to disk and never want to commit any changes - say as part of a build/release process - and you don't want the SVN meta information. Is there an easy command for this? Is this what export does? Or is that for dealing with "un-SVNing" an existing checkout?
svn
null
null
null
null
null
open
Can you 'checkout' from SVN without getting all the .svn stuff? === Maybe there is a proper term for this, but what if you want to simply download a specific revision of a file/directory to disk and never want to commit any changes - say as part of a build/release process - and you don't want the SVN meta information. Is there an easy command for this? Is this what export does? Or is that for dealing with "un-SVNing" an existing checkout?
0
7,260,731
08/31/2011 17:06:49
922,098
08/31/2011 17:06:49
1
0
Is YAGNI always valid?
I recently read about the You Ain't Gonna Need It principle, and it seems pretty logical to me. Now that I think about it, I remember lots of occasions where applying it could have saved me some trouble in my team's larger projects. (We wrote a large base of code on which we wanted to build the projects on top and in the end this lead to a lot of neccessary refactoring, code rewriting, yes even completely deleting many unneeded things again) So, I'm totally unfamiliar as to how "accepted" this practice is in software development: - Is YAGNI something you can apply everywhere, and that will always work? - Can the use of the YAGNI principle bring any particular trouble in the late phases of a project? - Do you recommend me introducing and enforcing it in our future projects?
design
planning
extreme-programming
yagni
null
08/31/2011 17:20:46
off topic
Is YAGNI always valid? === I recently read about the You Ain't Gonna Need It principle, and it seems pretty logical to me. Now that I think about it, I remember lots of occasions where applying it could have saved me some trouble in my team's larger projects. (We wrote a large base of code on which we wanted to build the projects on top and in the end this lead to a lot of neccessary refactoring, code rewriting, yes even completely deleting many unneeded things again) So, I'm totally unfamiliar as to how "accepted" this practice is in software development: - Is YAGNI something you can apply everywhere, and that will always work? - Can the use of the YAGNI principle bring any particular trouble in the late phases of a project? - Do you recommend me introducing and enforcing it in our future projects?
2
10,842,028
05/31/2012 22:14:06
649,275
03/08/2011 05:16:20
1
0
How to autostart this slide
Hello there: first of all i have no idea on coding or anything related, simple question: is there any simple way to tell this code to autostart the slide? at the current moment the images change on click. currently the index page only have one image, what i want is to add a few but without the need to click to see the next one here is the code from my index: //<![CDATA[ /* the images preload plugin */ (function($) { $.fn.preload = function(options) { var opts = $.extend({}, $.fn.preload.defaults, options); o = $.meta ? $.extend({}, opts, this.data()) : opts; var c = this.length, l = 0; return this.each(function() { var $i = $(this); $('<img/>').load(function(i){ ++l; if(l == c) o.onComplete(); }).attr('src',$i.attr('src')); }); }; $.fn.preload.defaults = { onComplete : function(){return false;} }; })(jQuery); //]]> </script><script type="text/javascript"> //<![CDATA[ $(function() { var $tf_bg = $('#tf_bg'), $tf_bg_images = $tf_bg.find('img'), $tf_bg_img = $tf_bg_images.eq(0), $tf_thumbs = $('#tf_thumbs'), total = $tf_bg_images.length, current = 0, $tf_content_wrapper = $('#tf_content_wrapper'), $tf_next = $('#tf_next'), $tf_prev = $('#tf_prev'), $tf_loading = $('#tf_loading'); //preload the images $tf_bg_images.preload({ onComplete : function(){ $tf_loading.hide(); init(); } }); //shows the first image and initializes events function init(){ //get dimentions for the image, based on the windows size var dim = getImageDim($tf_bg_img); //set the returned values and show the image $tf_bg_img.css({ width : dim.width, height : dim.height, left : dim.left, top : dim.top }).fadeIn(); //resizing the window resizes the $tf_bg_img $(window).bind('resize',function(){ var dim = getImageDim($tf_bg_img); $tf_bg_img.css({ width : dim.width, height : dim.height, left : dim.left, top : dim.top }); }); //expand and fit the image to the screen $('#tf_zoom').live('click', function(){ if($tf_bg_img.is(':animated')) return false; var $this = $(this); if($this.hasClass('tf_zoom')){ resize($tf_bg_img); $this.addClass('tf_fullscreen') .removeClass('tf_zoom'); } else{ var dim = getImageDim($tf_bg_img); $tf_bg_img.animate({ width : dim.width, height : dim.height, top : dim.top, left : dim.left },350); $this.addClass('tf_zoom') .removeClass('tf_fullscreen'); } } ); //click the arrow down, scrolls down $tf_next.bind('click',function(){ if($tf_bg_img.is(':animated')) return false; scroll('tb'); }); //click the arrow up, scrolls up $tf_prev.bind('click',function(){ if($tf_bg_img.is(':animated')) return false; scroll('bt'); }); //mousewheel events - down / up button trigger the scroll down / up $(document).mousewheel(function(e, delta) { if($tf_bg_img.is(':animated')) return false; if(delta > 0) scroll('bt'); else scroll('tb'); return false; }); //key events - down / up button trigger the scroll down / up $(document).keydown(function(e){ if($tf_bg_img.is(':animated')) return false; switch(e.which){ case 38: scroll('bt'); break; case 40: scroll('tb'); break; } }); } //show next / prev image function scroll(dir){ //if dir is "tb" (top -> bottom) increment current, //else if "bt" decrement it current = (dir == 'tb')?current + 1:current - 1; //we want a circular slideshow, //so we need to check the limits of current if(current == total) current = 0; else if(current < 0) current = total - 1; //flip the thumb $tf_thumbs.flip({ direction : dir, speed : 400, onBefore : function(){ //the new thumb is set here var content = '<span id="tf_zoom" class="tf_zoom"><\/span>'; content +='<img src="' + $tf_bg_images.eq(current).attr('longdesc') + '" alt="Thumb' + (current+1) + '"/>'; $tf_thumbs.html(content); } }); //we get the next image var $tf_bg_img_next = $tf_bg_images.eq(current), //its dimentions dim = getImageDim($tf_bg_img_next), //the top should be one that makes the image out of the viewport //the image should be positioned up or down depending on the direction top = (dir == 'tb')?$(window).height() + 'px':-parseFloat(dim.height,10) + 'px'; //set the returned values and show the next image $tf_bg_img_next.css({ width : dim.width, height : dim.height, left : dim.left, top : top }).show(); //now slide it to the viewport $tf_bg_img_next.stop().animate({ top : dim.top },700); //we want the old image to slide in the same direction, out of the viewport var slideTo = (dir == 'tb')?-$tf_bg_img.height() + 'px':$(window).height() + 'px'; $tf_bg_img.stop().animate({ top : slideTo },700,function(){ //hide it $(this).hide(); //the $tf_bg_img is now the shown image $tf_bg_img = $tf_bg_img_next; //show the description for the new image $tf_content_wrapper.children() .eq(current) .show(); }); //hide the current description $tf_content_wrapper.children(':visible') .hide() } //animate the image to fit in the viewport function resize($img){ var w_w = $(window).width(), w_h = $(window).height(), i_w = $img.width(), i_h = $img.height(), r_i = i_h / i_w, new_w,new_h; if(i_w > i_h){ new_w = w_w; new_h = w_w * r_i; if(new_h > w_h){ new_h = w_h; new_w = w_h / r_i; } } else{ new_h = w_w * r_i; new_w = w_w; } $img.animate({ width : new_w + 'px', height : new_h + 'px', top : '0px', left : '0px' },350); } //get dimentions of the image, //in order to make it full size and centered function getImageDim($img){ var w_w = $(window).width(), w_h = $(window).height(), r_w = w_h / w_w, i_w = $img.width(), i_h = $img.height(), r_i = i_h / i_w, new_w,new_h, new_left,new_top; if(r_w > r_i){ new_h = w_h; new_w = w_h / r_i; } else{ new_h = w_w * r_i; new_w = w_w; } return { width : new_w + 'px', height : new_h + 'px', left : (w_w - new_w) / 2 + 'px', top : (w_h - new_h) / 2 + 'px' }; } }); //]]> </script>
jquery
slideshow
autostart
null
null
06/01/2012 01:37:18
not a real question
How to autostart this slide === Hello there: first of all i have no idea on coding or anything related, simple question: is there any simple way to tell this code to autostart the slide? at the current moment the images change on click. currently the index page only have one image, what i want is to add a few but without the need to click to see the next one here is the code from my index: //<![CDATA[ /* the images preload plugin */ (function($) { $.fn.preload = function(options) { var opts = $.extend({}, $.fn.preload.defaults, options); o = $.meta ? $.extend({}, opts, this.data()) : opts; var c = this.length, l = 0; return this.each(function() { var $i = $(this); $('<img/>').load(function(i){ ++l; if(l == c) o.onComplete(); }).attr('src',$i.attr('src')); }); }; $.fn.preload.defaults = { onComplete : function(){return false;} }; })(jQuery); //]]> </script><script type="text/javascript"> //<![CDATA[ $(function() { var $tf_bg = $('#tf_bg'), $tf_bg_images = $tf_bg.find('img'), $tf_bg_img = $tf_bg_images.eq(0), $tf_thumbs = $('#tf_thumbs'), total = $tf_bg_images.length, current = 0, $tf_content_wrapper = $('#tf_content_wrapper'), $tf_next = $('#tf_next'), $tf_prev = $('#tf_prev'), $tf_loading = $('#tf_loading'); //preload the images $tf_bg_images.preload({ onComplete : function(){ $tf_loading.hide(); init(); } }); //shows the first image and initializes events function init(){ //get dimentions for the image, based on the windows size var dim = getImageDim($tf_bg_img); //set the returned values and show the image $tf_bg_img.css({ width : dim.width, height : dim.height, left : dim.left, top : dim.top }).fadeIn(); //resizing the window resizes the $tf_bg_img $(window).bind('resize',function(){ var dim = getImageDim($tf_bg_img); $tf_bg_img.css({ width : dim.width, height : dim.height, left : dim.left, top : dim.top }); }); //expand and fit the image to the screen $('#tf_zoom').live('click', function(){ if($tf_bg_img.is(':animated')) return false; var $this = $(this); if($this.hasClass('tf_zoom')){ resize($tf_bg_img); $this.addClass('tf_fullscreen') .removeClass('tf_zoom'); } else{ var dim = getImageDim($tf_bg_img); $tf_bg_img.animate({ width : dim.width, height : dim.height, top : dim.top, left : dim.left },350); $this.addClass('tf_zoom') .removeClass('tf_fullscreen'); } } ); //click the arrow down, scrolls down $tf_next.bind('click',function(){ if($tf_bg_img.is(':animated')) return false; scroll('tb'); }); //click the arrow up, scrolls up $tf_prev.bind('click',function(){ if($tf_bg_img.is(':animated')) return false; scroll('bt'); }); //mousewheel events - down / up button trigger the scroll down / up $(document).mousewheel(function(e, delta) { if($tf_bg_img.is(':animated')) return false; if(delta > 0) scroll('bt'); else scroll('tb'); return false; }); //key events - down / up button trigger the scroll down / up $(document).keydown(function(e){ if($tf_bg_img.is(':animated')) return false; switch(e.which){ case 38: scroll('bt'); break; case 40: scroll('tb'); break; } }); } //show next / prev image function scroll(dir){ //if dir is "tb" (top -> bottom) increment current, //else if "bt" decrement it current = (dir == 'tb')?current + 1:current - 1; //we want a circular slideshow, //so we need to check the limits of current if(current == total) current = 0; else if(current < 0) current = total - 1; //flip the thumb $tf_thumbs.flip({ direction : dir, speed : 400, onBefore : function(){ //the new thumb is set here var content = '<span id="tf_zoom" class="tf_zoom"><\/span>'; content +='<img src="' + $tf_bg_images.eq(current).attr('longdesc') + '" alt="Thumb' + (current+1) + '"/>'; $tf_thumbs.html(content); } }); //we get the next image var $tf_bg_img_next = $tf_bg_images.eq(current), //its dimentions dim = getImageDim($tf_bg_img_next), //the top should be one that makes the image out of the viewport //the image should be positioned up or down depending on the direction top = (dir == 'tb')?$(window).height() + 'px':-parseFloat(dim.height,10) + 'px'; //set the returned values and show the next image $tf_bg_img_next.css({ width : dim.width, height : dim.height, left : dim.left, top : top }).show(); //now slide it to the viewport $tf_bg_img_next.stop().animate({ top : dim.top },700); //we want the old image to slide in the same direction, out of the viewport var slideTo = (dir == 'tb')?-$tf_bg_img.height() + 'px':$(window).height() + 'px'; $tf_bg_img.stop().animate({ top : slideTo },700,function(){ //hide it $(this).hide(); //the $tf_bg_img is now the shown image $tf_bg_img = $tf_bg_img_next; //show the description for the new image $tf_content_wrapper.children() .eq(current) .show(); }); //hide the current description $tf_content_wrapper.children(':visible') .hide() } //animate the image to fit in the viewport function resize($img){ var w_w = $(window).width(), w_h = $(window).height(), i_w = $img.width(), i_h = $img.height(), r_i = i_h / i_w, new_w,new_h; if(i_w > i_h){ new_w = w_w; new_h = w_w * r_i; if(new_h > w_h){ new_h = w_h; new_w = w_h / r_i; } } else{ new_h = w_w * r_i; new_w = w_w; } $img.animate({ width : new_w + 'px', height : new_h + 'px', top : '0px', left : '0px' },350); } //get dimentions of the image, //in order to make it full size and centered function getImageDim($img){ var w_w = $(window).width(), w_h = $(window).height(), r_w = w_h / w_w, i_w = $img.width(), i_h = $img.height(), r_i = i_h / i_w, new_w,new_h, new_left,new_top; if(r_w > r_i){ new_h = w_h; new_w = w_h / r_i; } else{ new_h = w_w * r_i; new_w = w_w; } return { width : new_w + 'px', height : new_h + 'px', left : (w_w - new_w) / 2 + 'px', top : (w_h - new_h) / 2 + 'px' }; } }); //]]> </script>
1
7,913,127
10/27/2011 08:01:09
887,651
08/10/2011 10:03:05
278
0
is SSL really secure?
I have a question about SSL, I need to use a SSL certificate for my website because i need to manage private informations. I know that SSL uses a public-key, so the question (maybe stupid) is, if the client and the server exchange the key someone could read the key and convert the stream to the original message, maybe it secure the connection AFTER, but if someone get the decrypt key is pointless. No? I was reading something regarding man in the middle attacks, so if someone listen AFTER the exchange of the key, ok...the connection is secure, but what about if someone could listen it from the beginning? Thanks for the info
ssl
null
null
null
null
11/11/2011 10:01:34
off topic
is SSL really secure? === I have a question about SSL, I need to use a SSL certificate for my website because i need to manage private informations. I know that SSL uses a public-key, so the question (maybe stupid) is, if the client and the server exchange the key someone could read the key and convert the stream to the original message, maybe it secure the connection AFTER, but if someone get the decrypt key is pointless. No? I was reading something regarding man in the middle attacks, so if someone listen AFTER the exchange of the key, ok...the connection is secure, but what about if someone could listen it from the beginning? Thanks for the info
2
4,986,923
02/13/2011 21:17:04
200,145
10/31/2009 13:19:36
1,973
18
Using $CamelCase for object instances and $lower_case for everything else
Here's a simple convention for naming variables: > Use $CamelCase for object instances > and "$lower_case" for everything else. Can you think of a reason not to use it? I came up with this convention a few months and I've been using it in a few small projects since then. So far I've been happy with. I'm about to start using it in a big project so I want to be sure I'm not missing something.
php
variables
naming-conventions
null
null
02/13/2011 21:55:37
not constructive
Using $CamelCase for object instances and $lower_case for everything else === Here's a simple convention for naming variables: > Use $CamelCase for object instances > and "$lower_case" for everything else. Can you think of a reason not to use it? I came up with this convention a few months and I've been using it in a few small projects since then. So far I've been happy with. I'm about to start using it in a big project so I want to be sure I'm not missing something.
4
9,126,971
02/03/2012 10:16:31
731,262
04/29/2011 14:39:09
1,132
65
Automatically install software updates at night on RHEL
This is RHEL 6.2. Any good way to automatically install software updates while I am NOT using the machine? Something like the 3AM automatic updates on Windows -- just without the restart? I cannot be bothered with updates on an hourly/daily basis -- that big red exclamation mark appears on my task bar like my computer has just been infected by a virus. The less obtrusive the better.
rhel
null
null
null
null
02/10/2012 12:54:37
off topic
Automatically install software updates at night on RHEL === This is RHEL 6.2. Any good way to automatically install software updates while I am NOT using the machine? Something like the 3AM automatic updates on Windows -- just without the restart? I cannot be bothered with updates on an hourly/daily basis -- that big red exclamation mark appears on my task bar like my computer has just been infected by a virus. The less obtrusive the better.
2
7,837,577
10/20/2011 14:35:56
961,018
09/23/2011 11:19:37
1
1
RSA encryption. Breaking 2048 keys with index
I have some thoughts on this. First, I want to say I am no expert on cryptography, I just know some stuff, and I took a cryptography class in University. I am very interested in this topic. I understand that many security experts out there might get angry just by the discussion of these things, but I hope you can spare me :) My Questions: Would it be possible to break an RSA key, in for example 1 week of time, if the cracker have already spent **X number of years** building an **index of primes** by performing every permutation of existing prime keys up to 2^2048 ? I understand this would take an immense amount of time to do, but it would only be done once. Given the public key, you would be able to look up what the two primes are, and hence retrieve the private key instantly. When I consider who might break such a code, I am primarily thinking about NSA and other Governments that might have spent years in research and have the resources and interest in doing so. Breaking an 256 AES would then be easier, as AES keys are often generated using the RSA private key. Would it be possible to build such an index ? How long would that take in **permutations**, and perhaps with the **fastest computer** in the world ? I hope we can have a nice chat about this. We are just discussion theory here. I hope you can offer me some insight on this topic. Thanks!
security
encryption
rsa
aes
null
10/20/2011 15:39:08
off topic
RSA encryption. Breaking 2048 keys with index === I have some thoughts on this. First, I want to say I am no expert on cryptography, I just know some stuff, and I took a cryptography class in University. I am very interested in this topic. I understand that many security experts out there might get angry just by the discussion of these things, but I hope you can spare me :) My Questions: Would it be possible to break an RSA key, in for example 1 week of time, if the cracker have already spent **X number of years** building an **index of primes** by performing every permutation of existing prime keys up to 2^2048 ? I understand this would take an immense amount of time to do, but it would only be done once. Given the public key, you would be able to look up what the two primes are, and hence retrieve the private key instantly. When I consider who might break such a code, I am primarily thinking about NSA and other Governments that might have spent years in research and have the resources and interest in doing so. Breaking an 256 AES would then be easier, as AES keys are often generated using the RSA private key. Would it be possible to build such an index ? How long would that take in **permutations**, and perhaps with the **fastest computer** in the world ? I hope we can have a nice chat about this. We are just discussion theory here. I hope you can offer me some insight on this topic. Thanks!
2
11,174,799
06/24/2012 03:45:41
1,066,894
11/26/2011 12:56:43
93
9
Reading <p> tag's text in a managed bean
Wel i guess the header sums it up, i have a managed bean linked to a `Facelets` page, i want to read text from normal `html <p>` element into the managed bean or send it to it. I have this <p> tag dynamicly created with a JavaScript, so thats why I can't use JSF elements. example <p> text text text</p> Is it possible ? I need it because ia have alot of normal `Html` elements that I want to use the text in (normal means not a facelets or any java tag).
java
html
jsf
facelets
managed-bean
null
open
Reading <p> tag's text in a managed bean === Wel i guess the header sums it up, i have a managed bean linked to a `Facelets` page, i want to read text from normal `html <p>` element into the managed bean or send it to it. I have this <p> tag dynamicly created with a JavaScript, so thats why I can't use JSF elements. example <p> text text text</p> Is it possible ? I need it because ia have alot of normal `Html` elements that I want to use the text in (normal means not a facelets or any java tag).
0
9,193,418
02/08/2012 12:35:45
1,172,117
01/26/2012 20:01:14
5
0
Suggestion for SQL query books
I want to learn more in Teradata SQL. Can any one suggest me a good book to learn Teradata SQl or as a matter of fact any good SQL book through which I can learn SQL Queries.
sql
books
teradata
null
null
02/08/2012 12:59:16
not constructive
Suggestion for SQL query books === I want to learn more in Teradata SQL. Can any one suggest me a good book to learn Teradata SQl or as a matter of fact any good SQL book through which I can learn SQL Queries.
4
9,978,880
04/02/2012 15:09:42
734,463
05/02/2011 13:03:23
508
9
Python argument parser list of list or tuple of tuples
I'm trying to use argument parser to parse a 3D coordinate so I can use --cord 1,2,3 2,4,6 3,6,9 and get ((1,2,3),(2,4,6),(3,6,9)) My attempt is import argparse parser = argparse.ArgumentParser() parser.add_argument('--cord', help="Coordinate", dest="cord", type=tuple, nargs=3) args = parser.parse_args(["--cord","1,2,3","2,4,6","3,6,9"]) vars(args) {'cord': [('1', ',', '2', ',', '3'), ('2', ',', '4', ',', '6'), ('3', ',', '6', ',', '9')]} What would the replacement of the comma be?
python
argparse
null
null
null
null
open
Python argument parser list of list or tuple of tuples === I'm trying to use argument parser to parse a 3D coordinate so I can use --cord 1,2,3 2,4,6 3,6,9 and get ((1,2,3),(2,4,6),(3,6,9)) My attempt is import argparse parser = argparse.ArgumentParser() parser.add_argument('--cord', help="Coordinate", dest="cord", type=tuple, nargs=3) args = parser.parse_args(["--cord","1,2,3","2,4,6","3,6,9"]) vars(args) {'cord': [('1', ',', '2', ',', '3'), ('2', ',', '4', ',', '6'), ('3', ',', '6', ',', '9')]} What would the replacement of the comma be?
0